The following commits were skipped:
6a4ed891d8 Fix replace-buffer-contents undefined behavior
720a8b17f8 Fix filenotify-tests.el for Solaris (bug#47262), do not merge
This patch adjust the x position of preeditarea with both left fringe
and left margin, which prevents IME preedit box (such as fcitx) from
placing at the wrong position in GUI emacs.
* src/xfns.c (xic_set_preeditarea): Adjust X for left margin width.
(Bug#47377)
* src/editfns.c (Freplace_buffer_contents): Avoid undefined
behavior with competing side effects in parallel subexpressions.
Problem reported by Apple clang version 12.0.0 (clang-1200.0.32.29).
* test/lisp/filenotify-tests.el (file-notify--test-read-event):
Check also for GFamDirectoryMonitor.
(file-notify--test-timeout): Increase cygwin timeout.
(file-notify--test-monitor): Use `alist-get'.
(file-notify--test-event-actions): New defun.
(file-notify--test-with-actions-explainer): Use it.
(file-notify--test-with-actions-check): Use it. If
file-notify-debug is non-nil, trace received events instead of
checking them.
(file-notify-test03-events, file-notify-test05-file-validity)
(file-notify-test07-many-events, file-notify-test08-backup)
(file-notify-test09-watched-file-in-watched-dir):
Handle GFamFileMonitor and GFamDirectoryMonitor.
* lisp/net/tramp-integration.el (tramp-use-ssh-controlmaster-options):
Declare it.
* lisp/net/tramp-sh.el (tramp-sh-handle-file-notify-add-watch):
Remove "gvfs-monitor-dir".
(tramp-sh-gvfs-monitor-dir-process-filter)
(tramp-get-remote-gvfs-monitor-dir): Remove.
(tramp-get-remote-gio-file-monitor): Support also cygwin, and
GFamDirectoryMonitor, GPollFileMonitor.
* etc/NEWS: Mention the new command.
* lisp/progmodes/project.el (project--remove-from-project-list): Add
new argument, report-message, used to signal various messages when
removal has happened.
* lisp/progmodes/project.el (project-remove-known-project): New
command that removes the selected directory from the project-list-file.
* lisp/progmodes/project.el (project-current): Add the report message.
* doc/emacs/maintaining.text: Add information about the new command to
the manual.
* lisp/progmodes/idlw-complete-structtag.el: Use lexical-binding.
* lisp/progmodes/idlw-help.el: Use lexical-binding.
Delete redundant `:group` arguments.
(idlwave-query-class, idlwave-force-class-query, idlw-help-name)
(idlw-help-kwd, idlw-help-link): Declare vars.
(idlwave-highlight-linked-completions): Remove unused var `class`.
(idlwave-help-find-in-doc-header): Remove unused var `header-re`.
* lisp/progmodes/idlw-shell.el (idlwave-shell-input-mode-magic):
Remove XEmacs-only code.
(idlwave-shell-filter, idlwave-shell-scan-for-state):
Use `functionp` since a function can also satisfy `listp`.
(idlwave-shell--mouse-examine): Rename from `idlwave-shell-mouse-examine`.
Make it a function, and simplify for Emacs≥22. Simplify calling convention
since all callers always immediately `funcall`d the result.
Update all callers.
(idlwave-default-mouse-track-event-is-with-button): Use `always`.
(idlwave-shell-filter-bp): Simplify a tiny bit.
* lisp/progmodes/idlw-toolbar.el: Use lexical-binding.
(idlwave-toolbar-add, idlwave-toolbar-remove)
(idlwave-toolbar-add-everywhere, idlwave-toolbar-remove-everywhere)
(idlwave-toolbar-toggle): Remove XEmacs-only code.
* lisp/progmodes/idlwave.el: Use lexical-binding.
(idlwave--dlet): New macro.
(<toplevel>): Use it.
(idlwave-keyword-abbrev): Turn it into a function.
(idlwave-code-abbrev): Delete macro.
(idlwave-mode-abbrev-table): Use `:enable-function` instead.
(idlwave-with-special-syntax): Delete macro; use `with-syntax-table`
instead in all callers.
(idlwave-action-and-binding): Use `alist-get` and replace `(lambda...)
with a proper closure. Change all callers to prefer passing a function
in the `cmd` argument.
(idlwave-fill-function): Delete constant var.
Replace its uses with its value (the symbol `auto-fill-function`).
(idlwave-mode): Set `normal-auto-fill-function` instead of the
cumbersome use of `idlwave-fill-function`. Tighten a regexp.
Don't set `imenu-create-index-function` to the value it should already have.
(idlwave-auto-fill-mode): Make it an obsolete alias for `auto-fill-mode`.
(idlwave-modify-abbrev): Rename from `idlwave-check-abbrev`.
Don't check `idlwave-quoted` since `:enable-function` did it for us already.
(idlwave--command-function): Rename from `idlwave-command-hook`
and make it hold a function rather than an expression.
(idlwave-command-hook, idlwave-modify-abbrev): Adjust accordingly.
(idlwave-show-begin-check): Don't check `idlwave-quoted` since
`:enable-function` did it for us already.
(idlwave-do-action): Use `functionp` since a function can also satisfy `listp`
(idlwave-new-sintern-type): Make it a macro, so we don't need to
`declare-function` for the functions it defines.
(idlwave--class-selector, idlwave--type-selector)
(idlwave--method-selector, idlwave--super-classes): Rename those vars
by adding the `idlwave--` prefix. Adjust all uses.
(idlwave-complete-functions): Rename from `idlwave-complete-special`.
(idlwave-call-special): Declare obsolete. Change all callers to use
`run-hook-with-args-until-success` instead.
(idlwave-complete-filename): Use `dlet`.
(idlwave-rinfo-assq-any-class): Remove unused var `class`.
(idlwave-determine-class-functions): Rename from
`idlwave-determine-class-special`; fix docstring since the functions
are called with only one argument.
(idlwave--complete-after-success-function): Rename from
`idlwave-complete-after-success-form` and make it hold a function.
Adjust all users.
(idlwave--complete-after-success-force-function): Rename from
`idlwave-complete-after-success-form-force` and make it hold a function.
Adjust all users.
(idlwave-attach-classes): Remove always-t variable `do-dots`.
(idlwave-local-value): Use `local-variable-p` and `buffer-local-value`
to avoid `with-current-buffer`.
(idlwave-default-choose-completion): Comment out (unused and calls
a function that doesn't exist).
(idlwave-shell-filter-sysvars): Remove unused vars `type`, `name`, and `class`
(idlwave-fix-module-if-obj_new): Remove unused var `name`.
(idlwave-fix-keywords): Bind `idlwave--super-classes` via `let` than
via the function's argument.
(idlwave-twin-class, idlwave-twin-name): Move before first use.
(idlwave-study-twins): Remove stealth/redundant `type` variable.
(idlwave-routine-entry-compare-twins): Remove unused var `type`.
(idlwave-path-alist-add-flag): Avoid `add-to-list` on a local var.
(idlwave-list-abbrevs): Simplify a tiny bit.
In particular, on a failure, output the test's doc string to
electric-tests.log, along with all the other failure information.
Fixes bug #47320.
* electric-tests.el (electric-pair-test-for) New parameter doc-string. On a
test failure, output the doc-string parameter with message.
(electric-pair-define-test-form): Set the new variable doc-string to the
generated doc string, and pass this as argument to both ert-deftest and
electric-pair-test-for.
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-fontify-declarations): New test to ensure consistency
between perl-mode.el and cperl-mode.el (bug#47345).
* lisp/progmodes/perl-mode.el (perl-font-lock-keywords-1): pick
correct capture groups for "use Pack::Age;"
Fontify all components of "Pack::Age", not just "Pack"
(perl-font-lock-keywords-2): Use keyword-face for declarators
* lisp/font-lock.el (font-lock-update): Remove call to
font-lock-unfontify-region and font-lock-mode toggle with ARG; this
did not perform what original author intended
* lisp/mh-e/mh-alias.el: Use lexical-binding.
(mh-alias-insert-file): Completion tables can be mere lists of strings.
* lisp/mh-e/mh-mime.el: Use lexical-binding.
(mh-mm-inline-message): Remove always-nil var `visible-headers`.
* lisp/mh-e/mh-search.el: Use lexical-binding.
(mh-search-folder): Remove unused var `pick-folder`.
* lisp/mh-e/mh-show.el: Use lexical-binding.
(mh-display-msg): Remove always-nil var `visible-headers`.
* lisp/mh-e/mh-utils.el: Use lexical-binding.
(completion-root-regexp): Always declare var.
* lisp/mh-e/mh-buffers.el: Use lexical-binding.
* lisp/mh-e/mh-comp.el: Use lexical-binding.
* lisp/mh-e/mh-folder.el: Use lexical-binding.
* lisp/mh-e/mh-funcs.el: Use lexical-binding.
* lisp/mh-e/mh-gnus.el: Use lexical-binding.
* lisp/mh-e/mh-identity.el: Use lexical-binding.
* lisp/mh-e/mh-inc.el: Use lexical-binding.
* lisp/mh-e/mh-junk.el: Use lexical-binding.
* lisp/mh-e/mh-letter.el: Use lexical-binding.
* lisp/mh-e/mh-limit.el: Use lexical-binding.
* lisp/mh-e/mh-print.el: Use lexical-binding.
* lisp/mh-e/mh-scan.el: Use lexical-binding.
* lisp/mh-e/mh-seq.el: Use lexical-binding.
* lisp/mh-e/mh-speed.el: Use lexical-binding.
* lisp/mh-e/mh-thread.el: Use lexical-binding.
* lisp/mh-e/mh-tool-bar.el: Use lexical-binding.
* lisp/mh-e/mh-xface.el: Use lexical-binding.
Reported by Michael Heerdegen <michael_heerdegen@web.de>.
(wdired-change-to-wdired-mode, wdired-change-to-dired-mode):
The `(local FOO)` form takes an expression, so the var needs to be quoted.
(tab-bar-tabs, tab-bar-select-tab, tab-bar-new-tab-to):
Use tab-bar--current-tab-make instead of tab-bar--current-tab.
(tab-bar--tab): Add arg 'frame' to tab-bar--current-tab-find.
(tab-bar--current-tab, tab-bar--current-tab-make): Move most of body
from the former to the latter, thus reverting tab-bar--current-tab
to its previous behavior.
https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00959.html
This happened with minibuffer-follows-selected-frame set to t.
* doc/emacs/mini.texi (Basic Minibuffer): State where a command's action takes
place when a minibuffer's frame has been deleted.
* lisp/window.el (window--before-delete-windows, record-window-buffer): Take
into account that minibuffers are now recorded on w->prev_buffers field.
* src/fns.c (merge_c): New version of `merge' taking a C function, rather than
a Lisp function as the comparison function.
* src/frame.c (do_switch_frame): Pass arguments sf and for_deletion to
move_minibuffers_onnto_frame.
* src/lisp.h (top level): Declare merge_c and
move_minibuffers_onto_selected_frame.
* src/minibuf.c (MB_frame): New Lisp_Object recording the minibuffer's frame.
(choose_minibuf_frame): Remove all code except that which sets minibuf_window
to the current frame's minibuffer.
(minibuffer_ent_greater): New comparison function, passed to merge_c.
(zip_minibuffer_stacks): New function.
(move_minibuffers_onto_frame): Renamed from `move_minibuffer_onto_frame' given
two arguments, the old frame and for_deletion, and simplified. Minibuffers
are now stacked in the mini-window's ->prev_buffers field.
(read_minibuf): Several detailed amendments.
(exp_MB_frame): New Lisp_Object, the expired minibuffer's frame.
(read_minibuf_unwind): Search for the expired minibuffer's frame, rather than
taking it from (unreliable) variables. Switch temporarily to this frame for
tidying up operations.
(minibuffer_unwind): New function which pops a stacked minibuffer.
(syms_of_minibuf): Call staticpro for the two new Lisp variables.
* src/window.c (Fset_window_configuration): Don't record minibuffers with
record-window-buffer.
* src/xdisp.c (gui_consider_frame_title): Remove redundant Fselect_window,
which caused an unwanted frame switch. Amend the arguments to
format_mode_line_unwind_data to match.
* lisp/progmodes/project.el (project-shell): Behave the same way as
'M-x project-eshell'.
* lisp/shell.el (shell): Behave the same way as 'M-x eshell'.
* etc/NEWS: Add news entry describing the change.
* lisp/tutorial.el: Use lexical-binding.