Paul Eggert [Tue, 14 Jun 2016 19:19:36 +0000 (12:19 -0700)]
Port to platforms where char * has top bit set
This fixes a five-year-old FIXME comment. Although I don’t know
of a platform where this is a problem in practice, better safe
than sorry.
* src/doc.c (Fdocumentation): If SUBRP, simply use doc as integer,
as it is now an integer, not char *.
(store_function_docstring): Offset is now EMACS_INT, not ptrdiff_t;
this is a file offset and EMACS_INT is better if --with-wide-int.
If SUBRP, simply store the offset rather than negating it and
converting it to char *.
* src/lisp.h (struct Lisp_Subr.doc): Now EMACS_INT, not char *.
Paul Eggert [Mon, 13 Jun 2016 21:50:08 +0000 (14:50 -0700)]
Call tzset after setting TZ
* src/editfns.c (tzlookup): Call tzset after setting TZ, so that
the setting change propagates into Emacs local time (Bug#23600).
(emacs_setenv_TZ): Clarify comments.
Paul Eggert [Sun, 12 Jun 2016 17:31:25 +0000 (10:31 -0700)]
New macro GNUC_PREREQ for GCC version
* src/conf_post.h (GNUC_PREREQ): New macro.
Change uses of __GNUC_MINOR__ and __GNUC_PATCHLEVEL__ to use this
macro instead, for clarity and consistency.
(PRINTF_ARCHETYPE): New macro. Define it to __gnu_printf__ only
if glibc, since non-GNU platforms don’t necessarily support GNU
printf formats.
(ATTRIBUTE_FORMAT_PRINTF): Use it.
Eli Zaretskii [Sun, 12 Jun 2016 08:30:14 +0000 (11:30 +0300)]
Fix printf-related compilation warnings on MinGW
* src/conf_post.h (ATTRIBUTE_FORMAT_PRINTF) [__MINGW32__]: Use
'__ms_printf__', not '__gnu_printf__', as the latter is not what
MS 'printf' supports, and causes bogus compilation warnings.
* src/lisp.h (pI) [__MINGW32__]: Define to "I64", as MS 'printf'
doesn't support the "ll" modifier.
Paul Eggert [Sun, 12 Jun 2016 06:48:13 +0000 (23:48 -0700)]
emacs_strerror cleanups
* src/buffer.c, src/emacs.c, src/lread.c: Don’t include coding.h;
no longer needed, now that emacs_strerror is declared by lisp.h.
* src/coding.c (emacs_strerror): Remove; moved to emacs.c.
* src/coding.h (emacs_strerror) [emacs]: Remove decl; moved
to lisp.h.
* src/emacs.c (emacs_strerror): Move here from coding.c. Do not
convert result string; this is now the caller’s responsibility,
as some need conversion and others don’t.
* src/fileio.c (report_file_errno, report_file_notify_error):
Use emacs_strerror rather than rolling it ourselves.
* src/lisp.h (emacs_strerror): Move decl here from coding.h.
* src/lread.c (dir_warning): Just call emacs_strerror rather than
both strerror and emacs_strerror. Convert its result from
locale-coding-system, since it no longer does that conversion.
* src/sound.c (sound_perror):
* src/sysdep.c (emacs_perror, str_collate):
Use emacs_strerror, not strerror.
Paul Eggert [Sat, 11 Jun 2016 00:18:24 +0000 (17:18 -0700)]
Catch malloc_get_state, malloc_set_state failure
This should help insulate Emacs better from configuration screwups.
Future versions of the GNU C library are planned to deprecate
these functions, but will continue to support them in
already-built-and-dumped Emacs executables.
* src/alloc.c (malloc_initialize_hook) [DOUG_LEA_MALLOC]:
Abort if malloc_set_state fails.
(alloc_unexec_pre) [DOUG_LEA_MALLOC]:
Report malloc_get_state failure, and exit.
Eli Zaretskii [Fri, 10 Jun 2016 08:57:17 +0000 (11:57 +0300)]
Show returned value after gdb-mi "finish" command
* lisp/progmodes/gdb-mi.el (gdb-stopped): Display the expected
"Value returned" message in response to "finish", when not
produced by GDB/MI. (Bug#23720)
May address an issue where Emacs consumed large amounts of CPU
because of neverending toolbar updating (which was caused
by, but also called this function).
Martin Rudalics [Fri, 10 Jun 2016 06:21:33 +0000 (08:21 +0200)]
Revert "Bind `widget-button-click' to mouse-1/-2 instead of down-mouse-1/-2"
* lisp/wid-edit.el (widget-keymap): Bind `widget-button-click'
to mouse-1/-2 instead of down-mouse-1/-2. Suggested by Stefan
Monnier. (Bug#19185, Bug#20398)
Paul Eggert [Fri, 10 Jun 2016 06:11:40 +0000 (23:11 -0700)]
Prefer getsockopt to getpeername on non-MS-Windows
* admin/CPP-DEFINES: Remove HAVE_GETPEERNAME.
* configure.ac: Don’t check for getpeername.
* src/process.c (wait_reading_process_output) [!WINDOWSNT]:
Use getsockopt even if not GNU/Linux, as the platforms where
getsockopt used to hang are no doubt long dead.
Paul Eggert [Fri, 10 Jun 2016 04:58:16 +0000 (21:58 -0700)]
Fix XFASTINT of non-fixnum in process status
* src/process.c (decode_status): 3rd arg is now Lisp_Object *,
not int *, and is not decoded. All uses changed.
(status_message): Do not assume ‘failed’ code is an integer.
* src/process.h: Document codes better.
Glenn Morris [Fri, 10 Jun 2016 04:55:02 +0000 (00:55 -0400)]
; Refer to version 25.2 rather than 26.1.
; I hope the next release from master is indeed 26.1, but for reasons
; that passeth my understanding we currently call it 25.2 everywhere else,
; so we should at least be consistent.
* lisp/emulation/viper-init.el (viper-heading-end):
* lisp/gnus/mm-url.el (mm-url-html-entities):
* lisp/gnus/nnmaildir.el (nnmaildir-article-file-name):
* lisp/mh-e/mh-e.el (mh-invisible-header-fields-compiled):
* lisp/net/tramp-adb.el (tramp-adb-method): Remove leading * from doc.
* lisp/gnus/messcompat.el: Mark (pointless) file not for compilation.
(message-from-style, message-interactive, message-indentation-spaces)
(message-signature, message-signature-file):
Remove settings that match the defaults.
(message-setup-hook, message-mode-hook, message-default-headers)
(message-send-hook, message-send-mail-function):
Just use setq rather than redefining.
Eli Zaretskii [Thu, 9 Jun 2016 13:52:08 +0000 (16:52 +0300)]
Fix copying text properties by 'format'
* src/editfns.c (styled_format): Fix copying text properties from
the format specification to the produced string representation.
(Bug#23730)
(Fformat) Doc fix.
* doc/lispref/strings.texi (Formatting Strings): Document that
text properties from the format specifiers are also copied to the
produced string.
Alan Mackenzie [Thu, 9 Jun 2016 12:24:27 +0000 (12:24 +0000)]
Handle C++ raw strings.
* lisp/progmodes/cc-engine.el (c-raw-string-pos, c-depropertize-raw-string)
(c-depropertize-raw-strings-in-region,
c-before-change-check-raw-strings)
(c-propertize-raw-string-opener, c-after-change-re-mark-raw-strings): New
functions.
* lisp/progmodes/cc-fonts.el (c-basic-matchers-before): Insert a clause for
c-font-lock-raw-strings.
(c-font-lock-raw-strings): New function.
* lisp/progmodes/cc-langs.el (c-get-state-before-change-functions): Insert
c-before-change-check-raw-strings into the C++ value, and c-depropertize-CPP
into the values for C, C++, and Objective C.
(c-before-font-lock-functions): Insert c-after-change-re-mark-raw-strings into
the C++ value.
* lisp/progmodes/cc-mode.el (c-old-BEG, c-old-END): New variables.
(c-depropertize-CPP): New function, extracted from
c-neutralize-syntax-in-and-mark-CPP.
(c-neutralize-syntax-in-and-mark-CPP): Remove the call to
c-clear-char-property-with-value for 'syntax-table value '(1) at the beginning
of the function.
(c-after-change): Set c-old-BEG and c-old-END to the current values of
c-new-BEG and c-new-END.
Paul Eggert [Wed, 8 Jun 2016 17:33:34 +0000 (10:33 -0700)]
Replace IF_LINT by NONVOLATILE and UNINIT
Inspired by a suggestion from RMS in: http://bugs.gnu.org/23640#58
* .dir-locals.el (c-mode): Adjust to macro changes.
* src/conf_post.h (NONVOLATILE, UNINIT): New macros (Bug#23640).
(IF_LINT): Remove. All uses replaced by the new macros.
Remove ‘ert-with-function-mocked’ macro in favour of ‘cl-letf’ macro
* lisp/emacs-lisp/ert-x.el (ert-with-function-mocked): Remove macro
in favour of ‘cl-letf’ macro which is more generic. All existing
uses are migrated accordingly. The macro has not been included in
an official release yet so it should be fine to delete it.
Glenn Morris [Wed, 8 Jun 2016 03:50:35 +0000 (20:50 -0700)]
Try to avoid hangs and stray procs in network-stream-tests. (Bug#23560)
* test/lisp/net/network-stream-tests.el (connect-to-tls-ipv4-wait)
(connect-to-tls-ipv4-nowait, connect-to-tls-ipv6-nowait):
Ensure gnutls-serv process gets killed.
(echo-server-nowait, connect-to-tls-ipv4-nowait):
Limit the amount of time we might wait.
Glenn Morris [Wed, 8 Jun 2016 01:34:51 +0000 (21:34 -0400)]
Reduce allout.el's pollution of the namespace.
* lisp/allout.el (allout-set-regexp): Rename from set-allout-regexp.
Keep old name as obsolete alias.
(allout-produce-mode-menubar-entries, allout-nullify-prefix-data)
(allout-solicit-char-in-string)
(allout-count-trailing-whitespace-region, allout-regexp-sans-escapes):
Rename to add an "allout-" prefix.
Glenn Morris [Wed, 8 Jun 2016 01:29:30 +0000 (21:29 -0400)]
Misc small webjump updates.
* lisp/net/webjump.el (webjump): Add custom group.
(webjump-sample-sites): Make it a constant.
Remove explicit, old list of GNU ftp mirrors.
(webjump-state-to-postal-alist): Make it a constant.
(webjump-sites): Make it a defcustom.
(webjump-to-iwin): Update for changed remote service.
Glenn Morris [Wed, 8 Jun 2016 01:25:20 +0000 (21:25 -0400)]
Do not hard-code port for package test server. (Bug#23708)
* test/lisp/emacs-lisp/package-resources/package-test-server.py:
Do not hard-code port.
* test/lisp/emacs-lisp/package-tests.el (package-test-update-archives-async):
Update for the above change.
Paul Eggert [Tue, 7 Jun 2016 23:18:02 +0000 (16:18 -0700)]
Port --enable-gcc-warnings to clang 3.7.0
* configure.ac: Add -Wno-tautological-compare to avoid bogus
warnings about 0 <= rlim.rlim_max. Remove flags that no longer
seem to be needed, at least in Fedora 23 x86-64.
Paul Eggert [Tue, 7 Jun 2016 22:41:51 +0000 (15:41 -0700)]
Use __builtin_assume_aligned on untagged Lisp vals
* src/conf_post.h (__has_builtin, __builtin_assume_aligned):
New macros, for compilers not already defining them.
(__has_builtin___builtin_assume_aligned): New macro.
* src/lisp.h (lisp_h_XUNTAG): Use __builtin_assume_aligned.
This shrinks text space by 0.2% on x86-64 with GCC 6.1.
Paul Eggert [Tue, 7 Jun 2016 16:34:27 +0000 (09:34 -0700)]
Merge from origin/emacs-25
6e3adf8 Fix crash in syntax.c after GC 973ce5a Improve squiggly heredoc support in non-SMIE Ruby mode 9d5cceb Fix doc string quoting 0b33a23 Fix mouse dragging of vertical dividers with scroll bars on l... a5d05f4 * etc/PROBLEMS: Mention the link-time problems on FreeBSD 11.
Paul Eggert [Tue, 7 Jun 2016 16:28:49 +0000 (09:28 -0700)]
Fix crash in syntax.c after GC
Problem reported by Vincent Belaïche (Bug#23704).
* src/syntax.c (skip_chars): Recompute pointers into the
buffer after every call to update_syntax_table_forward,
as it can GC.
Michael Albinus [Mon, 6 Jun 2016 16:25:28 +0000 (18:25 +0200)]
Some fixes in filenotify-tests.el for cygwin
* test/lisp/filenotify-tests.el (file-notify--test-timeout):
Reintroduce value for cygwin, it's needed on slow systems.
(file-notify--wait-for-events): Move up definition.
(file-notify--test-no-descriptors): Use `file-notify--wait-for-events'.
(file-notify--test-with-events-check, file-notify--test-with-events)
(file-notify-test08-watched-file-in-watched-dir):
Use :random rather than `random.
(file-notify-test06-many-events): Do not skip for cygwin.
Martin Rudalics [Sun, 5 Jun 2016 09:50:47 +0000 (11:50 +0200)]
Fix mouse dragging of vertical dividers with scroll bars on left (Bug#23690)
* lisp/mouse.el (mouse-drag-line): With scroll bars on the left
adjust trailing edge of window on the left when dragging the
vertical divider of the mode line. (Bug#23690)
Paul Eggert [Thu, 2 Jun 2016 04:00:58 +0000 (21:00 -0700)]
Port angle-bracket TZ settings to MS-Windows
* doc/lispref/os.texi (Time Zone Rules): Document MS-Windows
lack of support for numeric time zone abbreviations.
* src/w32.c (sys_putenv): Convert angle-bracket TZ syntax
to MS-compatible syntax if possible, and to "ZZZ" otherwise.
Problem reported by Kazuhiro Ito (Bug#23600).
Paul Eggert [Wed, 1 Jun 2016 20:25:09 +0000 (13:25 -0700)]
Avoid delving into Git internals for version
* lisp/loadup.el (exec-path): Set it to nil later, so that
emacs-repository-get-version can invoke git commands in the PATH.
* lisp/version.el (emacs-repository--version-git-1): Remove.
(emacs-repository-get-version): Let Git do it rather than
delving into Git internals.
Paul Eggert [Wed, 1 Jun 2016 17:28:43 +0000 (10:28 -0700)]
Fix emacs-repository-get-version with packed .git
* lisp/version.el (emacs-repository-get-version):
Parse .git/packed-refs if it exists.
Problem reported by Martin Rudalics in:
http://lists.gnu.org/archive/html/emacs-devel/2016-05/msg00554.html
K. Handa [Tue, 31 May 2016 22:53:03 +0000 (07:53 +0900)]
Fix incomplete handling of translation table in a coding system.
* coding.c (get_translation): New arg NCHARS. Even if TRANS
is an alist, return a character or a vector of character.
(produce_chars): Adjust for the above change.
(consume_chars): Likewise.
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
Use local `default-directory'. Simplify command to send.
Don't check return code, this was already done in
`tramp-process-actions'.
(tramp-get-inline-coding): Don't set `default-directory'.
* lisp/net/tramp.el (tramp-action-out-of-band):
Throw `out-of-band-failed'.
(tramp-process-actions): Handle `out-of-band-failed'.
(tramp-call-process, tramp-call-process-region):
Use local `default-directory'.
Bill Wohler [Mon, 30 May 2016 23:49:37 +0000 (16:49 -0700)]
Correct cl-flet usage (Bug#22317)
* mh-compat.el: Rename mh-cl-flet to mh-flet and convert alias to
macro using patch from Katsumi Yamaoka <yamaoka@jpl.org>.
* mh-thread.el (mh-thread-set-tables):
* mh-show.el (mh-gnus-article-highlight-citation):
* mh-mime.el (mh-display-with-external-viewer):
(mh-mime-display, mh-press-button, mh-push-button):
(mh-display-emphasis): Call mh-flet instead of mh-cl-flet.
Mike Kupfer [Mon, 30 May 2016 23:13:10 +0000 (16:13 -0700)]
Update MH-E's documentation about HTML renderers
* doc/misc/mh-e.texi (HTML): Remove the footnote with the minimum Gnus
version (we are no longer trying to support multiple Emacs
releases). Sort the table of HTML renderers by name (the previous
ordering was based on a 10-year-old survey). Add shr and gnus-w3m to
the table. Remove the entry for w3 (no longer available). Update
existing entries so that they are more consistent about what features
are discussed, and to reflect recent testing (Debian 8). Small tweaks
to existing text.
Paul Eggert [Mon, 30 May 2016 23:09:25 +0000 (16:09 -0700)]
Omit IF_LINT code that no longer seems needed
Nowadays GCC is smarter, or the Emacs code has mutated, or both,
and now is as good a time as any to remove uses of IF_LINT that
now seem to be unnecessary.
* lib-src/emacsclient.c (set_local_socket):
* lib-src/movemail.c (main) [MAIL_USE_MAILLOCK && HAVE_TOUCHLOCK]:
* src/buffer.c (fix_start_end_in_overlays, fix_overlays_before):
* src/casefiddle.c (casify_region):
* src/charset.c (load_charset_map):
* src/coding.c (decode_coding_object, encode_coding_object):
* src/data.c (Fmake_variable_buffer_local, Fmake_local_variable)
(cons_to_unsigned, cons_to_signed):
* src/frame.c (make_frame, x_set_frame_parameters):
* src/keyboard.c (read_event_from_main_queue):
* src/regex.c (regex_compile):
* src/syntax.c (back_comment):
* src/window.c (Frecenter):
* src/xfaces.c (Fx_list_fonts):
Remove IF_LINT that no longer seems necessary.
* src/image.c (png_load_body, jpeg_load_body): Simplify use of IF_LINT.
* src/keyboard.c (read_char): Use IF_LINT (volatile) rather than
a pragma dance to pacify GCC -Wclobbered.
* src/xdisp.c (x_produce_glyphs): Rewrite to avoid need for IF_LINT.
* src/xterm.c (x_connection_closed): Now _Noreturn, which should
mean we do not need IF_LINT any more.
(x_io_error_quitter): Now _Noreturn. Put an 'assume (false)’
at the end, to forestall warnings from older compilers.
Paul Eggert [Mon, 30 May 2016 23:09:25 +0000 (16:09 -0700)]
Port --enable-gcc-warnings to Cygwin, FreeBSD
These platforms have a bug where _Noreturn is empty when 'lint' is
defined. Problem reported by Ken Brown (Bug#23640).
* configure.ac (GCC_LINT): Rename from 'lint'.
* src/conf_post.h (IF_LINT): Use GCC_LINT, not just 'lint’.
Paul Eggert [Mon, 30 May 2016 23:09:25 +0000 (16:09 -0700)]
Update from gnulib
This incorporates:
2016-05-30 Use GCC_LINT, not lint
2016-05-29 secure_getenv: Port to many more platforms.
* doc/misc/texinfo.tex, lib/secure_getenv.c, lib/verify.h:
* m4/secure_getenv.m4: Copy from gnulib.