Eli Zaretskii [Tue, 4 Dec 2018 18:27:20 +0000 (20:27 +0200)]
Support IBM038 (a.k.a. "EBCDIC-INT") encoding
* lisp/international/mule-conf.el (ibm038): New charset.
(ebcdic-int, cp038): Alias charsets of ibm038.
* lisp/language/english.el (ibm038): New coding-system.
(ebcdic-int, cp038): Alias coding-systems of ibm038.
(Bug#33612)
* etc/NEWS: Announce the new coding system ibm038.
Juri Linkov [Tue, 4 Dec 2018 00:41:54 +0000 (02:41 +0200)]
* lisp/isearch.el (isearch-yank-on-move): New defcustom
with shift-move related options extracted from `search-exit-option'.
(isearch-pre-command-hook): Rename search-exit-option to
isearch-yank-on-move in shift-move related places.
(isearch-post-command-hook): Check for isearch-pre-move-point
instead of search-exit-option. (Bug#15839)
* doc/emacs/search.texi (Not Exiting Isearch): Rename
search-exit-option to isearch-yank-on-move.
* lisp/menu-bar.el (menu-bar-i-search-menu): Add more isearch commands.
Juri Linkov [Tue, 4 Dec 2018 00:24:29 +0000 (02:24 +0200)]
* lisp/isearch.el (isearch-allow-scroll): New option `unlimited'.
(isearch-pre-command-hook): Call isearch-pre-scroll-point unless
isearch-allow-scroll is 'unlimited'.
(isearch-post-command-hook): Use `when' instead of `cond'.
Call isearch-lazy-highlight-new-loop when isearch-allow-scroll is
'unlimited'. (Bug#15839)
Paul Eggert [Mon, 3 Dec 2018 16:06:46 +0000 (08:06 -0800)]
emacsclient: fix typo on recent socket-leak change
This ports to POSIXish platforms like macOS that lack SOCK_CLOEXEC.
Fix suggested by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2018-12/msg00055.html
* lib-src/emacsclient.c (set_local_socket):
Don’t use SOCK_CLOEXEC; that’s cloexec_socket’s job.
Eli Zaretskii [Mon, 3 Dec 2018 10:29:34 +0000 (12:29 +0200)]
Fix WINDOWSNT/DOS_NT build
Recent changes in sysdep.c and emacsclient unnecessarily
removed useful code from DOS_NT builds. This changeset
reinstates that code.
* nt/inc/ms-w32.h (tcdrain): Redirect to _commit.
(fdatasync): No need to redirect anymore.
* lib-src/emacsclient.c (flush_stdout): Don't avoid calling
tcdrain on DOS_NT platforms.
* src/sysdep.c (reset_sys_modes): Don't ifdef away the call to
tcdrain on DOS_NT platforms.
Paul Eggert [Mon, 3 Dec 2018 07:11:09 +0000 (23:11 -0800)]
Use tcdrain, not fdatasync, to drain ttys
fdatasync is for storage devices, not ttys.
* admin/merge-gnulib (GNULIB_MODULES): Remove fdatasync.
* lib/fdatasync.c, m4/fdatasync.m4: Remove.
* lib-src/Makefile.in (LIB_FDATASYNC):
* src/Makefile.in (LIB_FDATASYNC):
Remove. All uses removed.
* lib-src/emacsclient.c [!DOS_NT]:
Include <termios.h>, for tcdrain.
* lib-src/emacsclient.c (flush_stdout):
* src/sysdep.c (reset_sys_modes): On ttys, use tcdrain instead
of fdatasync (except don’t use either function if DOS_NT).
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Paul Eggert [Mon, 3 Dec 2018 06:32:28 +0000 (22:32 -0800)]
emacsclient: fix symlink/socket race
* lib-src/emacsclient.c (socket_status): New arg UID.
All uses changed.
(set_local_socket): Don’t create the unbound socket unless the
initial sanity checks on the socket file succeed; this
simplifies cleaning it up. Check socket ownership again
after connecting, to fix a race (Bug#33366).
Eli Zaretskii [Sun, 2 Dec 2018 18:04:05 +0000 (20:04 +0200)]
Revert "Revert "Fix infloop in GC mark_kboards""
This reverts commit c418c85617babbe7b63730fefb71e2c87a0141af.
This reinstates the original fix, as it had nothing to do
with the behavior reported in bug#33571, which seems to be
the expected behavior.
Paul Eggert [Sun, 2 Dec 2018 07:06:06 +0000 (23:06 -0800)]
emacsclient: prefer XDG_RUNTIME_DIR (Bug#33367)
* lib-src/emacsclient.c: Disable -Wformat-truncation=2,
to avoid false alarms about the new snprintf calls.
(local_sockname): New function.
(set_local_socket): Use it. Prefer XDG_RUNTIME_DIR (if set)
for location of socket directory. Avoid unnecessary memory
allocation by using snprintf to destination.
* lisp/server.el (server-socket-dir): Prefer XDG_RUNTIME_DIR if set.
Paul Eggert [Fri, 30 Nov 2018 22:22:54 +0000 (14:22 -0800)]
Fix infloop in GC mark_kboards
* src/keyboard.c (KBD_BUFFER_SIZE): Now a constant, not a macro.
(kbd_fetch_ptr, kbd_store_ptr): These now always point somewhere
into kbd_buffer, instead of sometimes pointing just past the
end which led to serious bugs (Bug#33547). All uses changed.
(kbd_store_ptr): No longer volatile. This variable has not been
accessed by a signal handler for some time, it seems.
(next_kbd_event, prev_kbd_event): New functions.
(kbd_buffer_nr_stored, process_special_events): Simplify.
Michael Albinus [Fri, 30 Nov 2018 11:04:57 +0000 (12:04 +0100)]
Fix Bug#33556
* lisp/autorevert.el (auto-revert-notify-add-watch):
Assert that a key in `auto-revert-notify-watch-descriptor-hash-list'
is a valid file notification descriptor. (Bug#33556)
Robert Pluim [Thu, 29 Nov 2018 14:26:44 +0000 (15:26 +0100)]
Convert NS face colors to RGBA when comparing with frame values
The NS port uses indexes into a color table to specify the colors of
faces, whereas frames use RGBA pixel values. In
extend_face_to_end_of_line the two needed to be compared to ensure
that the backgrounds of certain faces are not extended to the edge of
the window, which was failing because of this difference, thus causing
a visual difference with other platforms. Convert from index to RGBA
when doing such comparisons.
* src/dispextern.h (FACE_COLOR_TO_PIXEL) [HAVE_NS]: New macro. Call
ns_color_index_to_rgba under NS only.
* src/nsgui.h: Add prototype for ns_color_index_to_rgba.
* src/nsterm.m (ns_color_index_to_rgba): New function. Converts a
color_table entry to corresponding RGBA pixel value.
* src/xdisp.c (extend_face_to_end_of_line): Call FACE_COLOR_TO_PIXEL
on face background color when comparing with frame color.
Eric Abrahamsen [Wed, 28 Nov 2018 17:31:40 +0000 (09:31 -0800)]
Further small tweaks to Gnus modes cleanup
* lisp/gnus/gnus-sum.el: Remove explicit definition of
`gnus-summary-mode-hook', this is now created automatically.
* lisp/gnus/nnir.el (nnir-open-server): Attach `nnir-mode' to the
`gnus-summary-prepared-hook', instead of
`gnus-summary-mode-hook'. The latter no longer has access to the
buffer-local value of `gnus-newsgroup-name', which `nnir-mode'
needs.
Glenn Morris [Wed, 28 Nov 2018 15:51:12 +0000 (07:51 -0800)]
Merge from origin/emacs-26
74a3a79 (origin/emacs-26) Fix a typo in a doc string 911766d Minor markup fix in frames.texi 19ed1e9 * lisp/net/trampver.el (customize-package-emacs-version-alist... d7132ad * lisp/mh-e/mh-e.el (customize-package-emacs-version-alist): ... 5f39260 * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Pass format to m... a291f62 Don't call xwidget functions until GTK has been initialized f0531b8 Improve documentation of Ediff wordwise commands 2925ce5 Support Hunspell 1.7.0 in ispell.el 03bb7a8 Avoid clearing echo-area message by auto-save-visited-file-name
Alan Mackenzie [Wed, 28 Nov 2018 13:15:50 +0000 (13:15 +0000)]
Make compilation mode work with warnings from compiled buffer functions
In particular, warning messages from compile_defun now contain the source
buffer name and line and column numbers. Typing CR on such a warning now
moves to the pertinent place in the source buffer.
This fixes bug #33475
* lisp/emacs-lisp/bytecomp.el (top-level): Require compile.elc?.
(emacs-lisp-compilation-file-name-or-buffer)
(emacs-lisp-compilation-parse-errors-filename-function): New
variables/constants.
(emacs-lisp-compilation-mode): New mode derived from compilation-mode.
(byte-compile-log-file): Check byte-compile-current-file for being a string,
not merely non-nil. Change wording in message from "buffer" to "in buffer".
Go into emacs-lisp-compilation-mode rather than the plain compilation-mode.
(compile-defun): Bind byte-compile-current-file to current-buffer, not nil.
* lisp/progmodes/compilation-mode
(compilation-parse-errors-filename-function): Amend comments to specify that
this function may return a buffer, and that it need not save the match data.
(Several places): Amend comments to allow for the use of a buffer rather than
a file name.
(compilation-next-error-function): If the "file name" in file struct is
actually a buffer, use it rather than compilation-find-file's result.
(compilation-get-file-structure): save-match-data around the call to
compilation-parse-errors-filename-function. Only call
command-line-normalize-file-name when `filename' is a string.
Michael Albinus [Tue, 27 Nov 2018 13:52:58 +0000 (14:52 +0100)]
Fixes in tramp-clone.el
* lisp/net/tramp-rclone.el (tramp-rclone-parse-device-names):
Wrap by connection property "rclone-device-names".
(tramp-rclone-maybe-open-connection): Do not check for `non-essential'.
Eli Zaretskii [Tue, 27 Nov 2018 08:09:55 +0000 (10:09 +0200)]
Improve documentation of Ediff wordwise commands
* lisp/vc/ediff.el (ediff-windows-wordwise)
(ediff-windows-linewise, ediff-regions-wordwise): Update and
clarify the doc strings.
* doc/misc/ediff.texi (Major Entry Points): Update and clarify
the documentation of 'ediff-windows-wordwise' and
'ediff-regions-wordwise'. See the discussion starting at
https://lists.gnu.org/archive/html/help-gnu-emacs/2018-11/msg00197.html
for the details.
Paul Eggert [Mon, 26 Nov 2018 19:36:51 +0000 (11:36 -0800)]
emacsclient: assume HAVE_INET_SOCKETS
* configure.ac (HAVE_INET_SOCKETS): Remove.
* lib-src/emacsclient.c: Simplify by assuming HAVE_SOCKETS and
HAVE_INET_SOCKETS, which are always true nowadays, except perhaps
for MS-DOS and if so this program shouldn’t be built there anyway.
Don’t bother including sys/types.h, as it’s not needed on modern
systems (and syswait.h does it for us anyway).
(main): Simplify by assuming SIGSTOP (which is always defined
if SIGCONT is), and by assuming HAVE_SOCKETS && HAVE_INET_SOCKETS.
Paul Eggert [Mon, 26 Nov 2018 18:32:35 +0000 (10:32 -0800)]
emacsclient: negate NO_SOCKETS_IN_FILE_SYSTEM
* lib-src/emacsclient.c (SOCKETS_IN_FILE_SYSTEM): Rename from
NO_SOCKETS_IN_FILE_SYSTEM, with inverted sense. All uses changed.
All uses were of the form ‘#ifndef NO_SOCKETS_IN_FILE_SYSTEM’, and
it’s easier to read ‘#ifdef SOCKETS_IN_FILE_SYSTEM’.
Paul Eggert [Mon, 26 Nov 2018 16:25:36 +0000 (08:25 -0800)]
emacsclient: fix some races on POSIX systems
Fix some longstanding race conditions due to emacsclient’s use of
‘signal’ instead of ‘sigaction’ and its use of nested signal
handlers. These races could cause premature exit or incorrect
commands sent to Emacs.
* lib-src/emacsclient.c (signal) [!WINDOWSNT]: Do not undef.
(emacs_socket): Remove this static variable. It is now a parameter.
(send_to_emacs): Do not exit merely because ‘send’ was interrupted.
Instead, act on the signal if possible, and then retry the ‘send’.
(pass_signal_to_emacs): Remove; now done by act_on_signals.
(reinstall_handler_if_needed, handle_sigttou, handle_sigwinch)
(install_handler): New functions.
(got_sigcont, got_sigtstp, got_sigttou, got_sigwinch):
New globals, used for more-portable signal handling.
(handle_sigcont, handle_sigtstp): Just set the static var; other
actions are now done later by act_on_signals.
(install_handler): New function that arranges for signals to
never be reset to default, on modern POSIX platforms.
This fixes some races.
(act_on_signals): New function. When acting on SIGCONT,
don’t bother calling getpgrp if tcgetpgrp fails.
(start_daemon_and_retry_set_socket): Return the socket
rather than setting a global variable. All uses changed.
(flush_stdout): New function that acts on signals received while
flushing.
(main): Use it. emacs_socket is now a local var.
Act on signals received during recv.
Eli Zaretskii [Mon, 26 Nov 2018 17:31:24 +0000 (19:31 +0200)]
Support Hunspell 1.7.0 in ispell.el
* lisp/textmodes/ispell.el
(ispell-find-hunspell-dictionaries): Invoke Hunspell with an
additional command-line argument, to work around a misfeature
in Hunspell 1.7.0 that prevents it from reporting the loaded
dictionary. (Bug#33493)
Wilson Snyder [Mon, 26 Nov 2018 12:11:55 +0000 (07:11 -0500)]
Update verilog-mode with upstream patches.
* lisp/progmodes/verilog-mode.el (verilog-auto-templated-rel)
(verilog-load-file-at-point, verilog-read-arg-pins)
(verilog-read-auto-constants, verilog-read-auto-params)
(verilog-read-auto-template-middle, verilog-read-decls)
(verilog-read-includes, verilog-read-inst-pins)
(verilog-read-instants, verilog-read-sub-decls-gate): Don't copy
properties when parsing AUTOs.
(verilog-font-lock-keywords): Fix SystemVerilog font lock keywords to be
more consistent with IEEE 1364 keywords. Reported by Jeff Riley.
(verilog-highlight-p1800-keywords): Now ignored.
(verilog-simplify-range-expression): Simplify shifts in auto wire
declarations, bug1346. Reported by Maghawan Punde.
(verilog-read-always-signals-recurse): Fix AUTORESET with pattern
assignments. Reported by Bhargava Narumanchi.
(verilog-at-constraint-p): Fix indentation of replicate with parameter.
Reported by Yun He.
(verilog-read-defines, verilog-read-includes)
(verilog-substitute-include-name): Fix handling define names in includes,
bug1324. Reported by John DeRoo.
(verilog-imenu-generic-expression): Fix speedbar for signed functions,
bug1312. Reported by Ian Perryman.
(verilog-indent-buffer): Fix verilog-batch-indent not honoring top mode
line. Reported by James Claffey.
(verilog-set-auto-endcomments): Fix end comments when have variables
starting with class_, bug1259. Reported by Andrea Fedeli.
(verilog-read-decls): Fix AUTOINST for parameterized interfaces,
bug1253. Reported by David Rogoff.
(verilog-read-sub-decls-line, verilog-signals-combine-bus): Fix AUTOOUTPUT
not including nested array references, msg2417.
(verilog-at-constraint-p): begin/end are illegal inside constraint blocks,
so use that knowledge to make smarter indentation decisions.
(verilog-auto-simplify-expressions, verilog-simplify-range-expression):
Add `verilog-auto-simplify-expressions' to disable range simplifications.
(verilog-auto-save-check, verilog-batch-execute-func): Fix .* causing
Emacs batch to always re-save files with no changes, bug1239. Reported by
Brian Etscheid.
Alan Third [Mon, 29 Oct 2018 15:37:35 +0000 (15:37 +0000)]
Fix more drawing bugs in NS port (bug#32932)
* src/nsterm.m (ns_row_rect): New function.
(ns_clip_to_row): Remove function.
(ns_copy_bits): Fix mistake.
(ns_shift_glyphs_for_insert): Mark the frame as dirty instead of
directly copying.
(ns_draw_fringe_bitmap): Stop using ns_clip_to_row.
(ns_draw_window_cursor): Stop using ns_clip_to_row and perform a
display when not in redisplay.
(ns_update_window_begin): Remove redundant code that never executes.
([EmacsView drawRect:]): Show the rectangle being exposed in NSTRACE.
* src/xdisp.c (expose_window_tree) [HAVE_NS]:
(expose_frame) [HAVE_NS]: Redraw even if the frame is garbaged.
Juri Linkov [Sat, 24 Nov 2018 22:59:15 +0000 (00:59 +0200)]
Add new Isearch commands to new Isearch menu (bug#29321, bug#32990)
* lisp/isearch.el (isearch-menu-bar-map): Add menu items for
isearch-beginning-of-buffer and isearch-end-of-buffer.
(isearch-forward): Add them to docstring.
Glenn Morris [Sat, 24 Nov 2018 15:51:04 +0000 (07:51 -0800)]
Merge from origin/emacs-26
56e3e4f Improve indexing in the ELisp manual 7a4992a More Symbola-related extensions for default fontset 4ae0a75 Better support for display of U+1F900..U+1F9FF block 8f0c788 Improve documentation of 'edit-abbrevs-mode' 3c643e7 ; NEWS tweak 477414a Improve documentation of 'dired-do-compress' 9c09b1d ; * etc/NES: Minor change in the description of Dired's 'Z'. 52715e3 Improve doc string and display of 'describe-character' 93242b1 * etc/NEWS: Clarify what 'Z' does in Dired. (Bug#33450) 0d59ae3 Update the docs of object internals
Add tool-bar and menu-bar menu for Isearch (Bug#32990)
* etc/NEWS (Search and Replace): Mention this change.
* lisp/isearch.el: Declare the new, non-autoloaded function
'tmm-menubar-keymap'.
(isearch-tmm-menubar): New function.
(isearch-menu-bar-commands): New variable.
(isearch-menu-bar-yank-map, isearch-menu-bar-map): New variables.
(isearch-mode-map): Define a menu-bar search menu and remap
'tmm-menubar' bindings to point to 'isearch-tmm-menubar'.
(isearch-tool-bar-old-map): New variable.
(isearch-tool-bar-image): New function.
(isearch-tool-bar-map): New variable.
(minor-mode-map-alist): Add an entry for Isearch so that
'isearch-menu-bar-map' shows during search.
(isearch-mode, isearch-done): Save and restore possible
buffer-local 'tool-bar-map' using 'isearch-tool-bar-old-map'.
(iseacrh-mouse-commands): New variable.
(isearch-mouse-leave-buffer): Allow commands in
isearch-mouse-commands.
(with-isearch-suspended): Only push changed states of Isearch
after running the body argument of this macro.
(isearch-pre-command-hook): Additionally allow bindings in
'isearch-tool-bar-map' to pass through, as well as commands
in isearch-menu-bar-commands.
(isearch-post-command-hook): Call 'force-mode-line-update' at its
end to make sure the menu- and tool-bars are up-to-date.
* lisp/tmm.el (tmm-menubar-keymap): New function factored out from
'tmm-menubar'.
(tmm-menubar): Use 'tmm-menubar-keymap'.
(tmm-prompt): New optional argument 'no-execute'.
Alan Mackenzie [Sat, 24 Nov 2018 10:31:53 +0000 (10:31 +0000)]
Fix bug #33416, where typing a ) in a comment at EOB caused a loop (CC Mode).
* lisp/progmodes/cc-mode.el (c-fl-decl-start): A c-forward-syntactic-ws leaves
point inside whitespace when moving over a comment at EOB which has no
terminating LF. Check this possibility and correct for it.
Ulrich Müller [Sat, 17 Nov 2018 10:43:06 +0000 (11:43 +0100)]
Update the calc units table
On 2018-11-16, the 26th meeting of the General Conference on Weights
and Measures (CGPM) has redefined the International System of Units by
adopting fixed values for the Planck constant, the elementary charge,
the Boltzmann constant, and the Avogadro constant:
https://www.bipm.org/utils/en/pdf/CGPM/Draft-Resolution-A-EN.pdf
* lisp/calc/calc-units.el (math-standard-units): Update according
to redefinition of the SI in 2018. (Bug#33412)
Eli Zaretskii [Sat, 24 Nov 2018 08:00:55 +0000 (10:00 +0200)]
Improve indexing in the ELisp manual
* doc/lispref/control.texi (Control Structures, Sequencing)
(Conditionals, Iteration, Catch and Throw, Handling Errors)
(Cleanups):
* doc/lispref/eval.texi (Self-Evaluating Forms)
(Symbol Forms, Function Forms, Macro Forms, Special Forms)
(Quoting, Backquote): Add index entries that begin with
"forms". (Bug#33440)
Eric Abrahamsen [Tue, 26 Jun 2018 00:40:19 +0000 (17:40 -0700)]
Provide new gnus-mode, derive all gnus major modes from this
* lisp/gnus/gnus.el (gnus-mode): New do-nothing major mode, derived
from special mode.
* lisp/gnus/gnus-sum.el (gnus-summary-mode): Change from a function to
a major mode, derive from gnus-mode.
(gnus-summary-setup-buffer): Change call a bit -- can no longer pass
an argument to the mode function.
* lisp/gnus/gnus-srvr.el (gnus-browse-mode): Derive from gnus-mode.
(gnus-server-setup-buffer): Remove unnecessary function.
(gnus-enter-server-buffer): Call gnus-server-mode here, and call it
whether the server buffer already existed or not.
(gnus-server-mode): Change from a function to a major mode.
(gnus-server-mode-hook): Delete custom option, this is automatically
created.
* lisp/gnus/gnus-salt.el (gnus-tree-mode): Derive from gnus-mode.
(gnus-tree-mode-hook): Delete custom option, this is automatically
created.
* lisp/gnus/gnus-kill.el (gnus-kill-file-mode-hook): Delete custom
option.
* lisp/gnus/gnus-group.el (gnus-group-mode):
* lisp/gnus/gnus-art.el (gnus-article-mode):
* lisp/gnus/gnus-agent.el (gnus-category-mode): Derive from gnus-mode.
(gnus-category-mode-hook): Delete custom option.
Paul Eggert [Fri, 23 Nov 2018 08:33:37 +0000 (00:33 -0800)]
emacsclient: fix child exit when exec fails
* lib-src/emacsclient.c (start_daemon_and_retry_set_socket):
If the execvp of Emacs fails exit instead of having the child
run on and do the work of the parent. Coalesce duplicate code.
Paul Eggert [Fri, 23 Nov 2018 07:42:50 +0000 (23:42 -0800)]
emacsclient: tidy socket failure cleanup
* lib-src/emacsclient.c (set_tcp_socket, set_local_socket):
Close socket (instead of leaking it) when ‘connect’ fails.
(socket_status): Return errno if stat fails and -1 if we don’t own.
(set_local_socket): Simplify based on socket_status change.
Juri Linkov [Thu, 22 Nov 2018 22:02:56 +0000 (00:02 +0200)]
Add Isearch commands for going to absolute occurrence of matches (bug#29321)
* lisp/isearch.el (isearch-mode-map): Bind 'M-s M-<' to
'isearch-beginning-of-buffer' and 'isearch-end-of-buffer' to 'M-s M->'.
(isearch-beginning-of-buffer, isearch-end-of-buffer): New commands.