commit c5f2eb56c0164e87abc881955552e0b718921186 (HEAD, refs/remotes/origin/master) Author: Lars Ingebrigtsen Date: Fri Dec 18 10:24:48 2020 +0100 Fix previous frame-focus server.el change * lisp/server.el (server-execute): Always give Emacs focus, whether we open a new frame or not. diff --git a/lisp/server.el b/lisp/server.el index cd55d66a97..7773da09c7 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1327,6 +1327,8 @@ The following commands are accepted by the client: (t (server-return-error proc err)))) (defun server-execute (proc files nowait commands dontkill frame tty-name) + (when server-raise-frame + (select-frame-set-input-focus (or frame (selected-frame)))) ;; This is run from timers and process-filters, i.e. "asynchronously". ;; But w.r.t the user, this is not really asynchronous since the timer ;; is run after 0s and the process-filter is run in response to the @@ -1334,8 +1336,6 @@ The following commands are accepted by the client: ;; inhibit-quit flag, which is good since `commands' (as well as ;; find-file-noselect via the major-mode) can run arbitrary code, ;; including code that needs to wait. - (when (and frame server-raise-frame) - (select-frame-set-input-focus frame)) (with-local-quit (condition-case err (let ((buffers (server-visit-files files proc nowait))) commit e3f83a89aa7da460615064390273c87844bdb0dc Author: Eric Abrahamsen Date: Thu Dec 17 19:16:00 2020 -0800 Fix regexp in IMAP search-string preparation * lisp/gnus/gnus-search.el (gnus-search-run-search): This was failing to catch all of X-GM-RAW. diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 829e0fa3ad..16f3a024aa 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1071,7 +1071,7 @@ Responsible for handling and, or, and parenthetical expressions.") ;; A bit of backward-compatibility slash convenience: if the ;; query string doesn't start with any known IMAP search ;; keyword, assume it is a "TEXT" search. - (unless (and (string-match "\\`[[:word:]]+" q-string) + (unless (and (string-match "\\`[^ [:blank:]]+" q-string) (memql (intern-soft (downcase (match-string 0 q-string))) gnus-search-imap-search-keys)) commit fa4c2768cf6cf670e4c7af0c2b74ad139e65aad4 Author: Dmitry Gutov Date: Fri Dec 18 04:05:18 2020 +0200 flymake-diag-region: Fix the recent test breakage * lisp/progmodes/flymake.el (flymake-diag-region): Make sure to save the match data (bug#29193). diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 6c3e0a1981..da026da86a 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -438,7 +438,8 @@ region is invalid." (let* ((beg (progn (forward-char (1- col)) (point))) (sexp-end (or (ignore-errors (end-of-thing 'sexp)) - (ignore-errors (end-of-thing 'symbol)))) + (save-match-data + (ignore-errors (end-of-thing 'symbol))))) (end (or (and sexp-end (not (= sexp-end beg)) sexp-end) commit 5ada3eecec79703a84e2f2c38cae16ef4b2600cc Author: Stefan Monnier Date: Thu Dec 17 18:21:47 2020 -0500 * lisp/org/org-refile.el (org-copy): Fix missing obsoletion version diff --git a/lisp/org/org-refile.el b/lisp/org/org-refile.el index 2a3fad53e8..9eab7e1ede 100644 --- a/lisp/org/org-refile.el +++ b/lisp/org/org-refile.el @@ -373,7 +373,7 @@ the *old* location.") (defvar org-refile-keep nil "Non-nil means `org-refile' will copy instead of refile.") -(define-obsolete-function-alias 'org-copy 'org-refile-copy) +(define-obsolete-function-alias 'org-copy 'org-refile-copy "Org 9.4") ;;;###autoload (defun org-refile-copy () commit ddff5d3d879d23f0684b8abe7d923fce4f86ec2e Author: Michael Albinus Date: Thu Dec 17 18:52:23 2020 +0100 Some minor Tramp changes * doc/lispref/os.texi (Timers): Speak about `remote-file-error'. * doc/misc/tramp.texi (Frequently Asked Questions): Speak about `remote-file-error'. (External packages): New subsection "Timers". * lisp/net/tramp-adb.el (tramp-adb-handle-make-process): * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Adapt error function. Handle coding. * lisp/net/tramp.el (tramp-handle-make-process): Adapt error function. diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index bc602205f5..85f930d189 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -2106,6 +2106,19 @@ run while waiting. If a timer function needs to perform an action after a certain time has elapsed, it can do this by scheduling a new timer. + If a timer function performs a remote file operation, it can be in +conflict with an already running remote file operation of the same +connection. Such conflicts are detected, and they result in a +@code{remote-file-error} error (@pxref{Standard Errors}). This should +be protected by wrapping the timer function body with + +@lisp +@group +(ignore-error 'remote-file-error + @dots{}) +@end group +@end lisp + If a timer function calls functions that can change the match data, it should save and restore the match data. @xref{Saving Match Data}. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 59b8bdbdf3..0557ca5469 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2508,7 +2508,7 @@ whatever shell is installed on the device with this setting: @lisp @group (add-to-list 'tramp-connection-properties - (list (regexp-quote "192.168.0.26") "remote-shell" "sh")) + (list (regexp-quote "192.168.0.26") "remote-shell" "sh")) @end group @end lisp @@ -2560,7 +2560,7 @@ the previous example, fix the connection properties as follows: @lisp @group (add-to-list 'tramp-connection-properties - (list (regexp-quote "android") "remote-shell" "sh")) + (list (regexp-quote "android") "remote-shell" "sh")) @end group @end lisp @@ -4341,9 +4341,9 @@ configure @file{~/.ssh/config} on the proxy host: @example @group Host * - ControlMaster auto - ControlPath tramp.%C - ControlPersist no + ControlMaster auto + ControlPath tramp.%C + ControlPersist no @end group @end example @@ -4877,6 +4877,25 @@ In case you have installed it from its Git repository, @ref{Recompilation}. @end ifset +@item +I get an error @samp{Remote file error: Forbidden reentrant call of Tramp} + +Timers, process filters and sentinels, and other event based functions +can run at any time, when a remote file operation is still running. +This can cause @value{tramp} to block. When such a situation is +detected, this error is triggered. It shall be fixed in the +respective function (an error report will help), but for the time +being you can suppress this error by the following code in your +@file{~/.emacs}: + +@lisp +@group +(setq debug-ignored-errors + (cons 'remote-file-error debug-ignored-errors)) +@end group +@end lisp + + @item How to disable other packages from calling @value{tramp}? @@ -4982,7 +5001,7 @@ handlers. @node External packages @section Integrating with external Lisp packages -@subsection File name completion. +@subsection File name completion @vindex non-essential Sometimes, it is not convenient to open a new connection to a remote @@ -5000,7 +5019,7 @@ bind it to non-@code{nil} value. @end lisp -@subsection File attributes cache. +@subsection File attributes cache Keeping a local cache of remote file attributes in sync with the remote host is a time-consuming operation. Flushing and re-querying @@ -5040,6 +5059,25 @@ root-directory, it is most likely sufficient to make the @code{default-directory} of the process buffer as the root directory. +@subsection Timers + +Timers run asynchronously at any time when Emacs is waiting for +sending a string to a process, or waiting for process output. They +can run any remote file operation, which would conflict with the +already running remote file operation, if the same connection is +affected. @value{tramp} detects this situation, and raises the +@code{remote-file-error} error. A timer function shall avoid this +situation. At least, it shall protect itself against this error, by +wrapping the timer function body with + +@lisp +@group +(ignore-error 'remote-file-error + @dots{}) +@end group +@end lisp + + @node Traces and Profiles @chapter How to Customize Traces @vindex tramp-verbose diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index f6e89339b6..9ea72668e7 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -929,7 +929,7 @@ alternative implementation will be used." (unless (or (null sentinel) (functionp sentinel)) (signal 'wrong-type-argument (list #'functionp sentinel))) (unless (or (null stderr) (bufferp stderr) (stringp stderr)) - (signal 'wrong-type-argument (list #'stringp stderr))) + (signal 'wrong-type-argument (list #'bufferp stderr))) (when (and (stringp stderr) (tramp-tramp-file-p stderr) (not (tramp-equal-remote default-directory stderr))) (signal 'file-error (list "Wrong stderr" stderr))) @@ -981,7 +981,11 @@ alternative implementation will be used." ;; otherwise we might be interrupted by ;; `verify-visited-file-modtime'. (let ((buffer-undo-list t) - (inhibit-read-only t)) + (inhibit-read-only t) + (coding-system-for-write + (if (symbolp coding) coding (car coding))) + (coding-system-for-read + (if (symbolp coding) coding (cdr coding)))) (clear-visited-file-modtime) (narrow-to-region (point-max) (point-max)) ;; We call `tramp-adb-maybe-open-connection', diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index f4a93c840c..e30fe61de4 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -2871,7 +2871,7 @@ implementation will be used." (unless (or (null sentinel) (functionp sentinel)) (signal 'wrong-type-argument (list #'functionp sentinel))) (unless (or (null stderr) (bufferp stderr) (stringp stderr)) - (signal 'wrong-type-argument (list #'stringp stderr))) + (signal 'wrong-type-argument (list #'bufferp stderr))) (when (and (stringp stderr) (tramp-tramp-file-p stderr) (not (tramp-equal-remote default-directory stderr))) (signal 'file-error (list "Wrong stderr" stderr))) @@ -2985,7 +2985,11 @@ implementation will be used." ;; `verify-visited-file-modtime'. (let ((buffer-undo-list t) (inhibit-read-only t) - (mark (point-max))) + (mark (point-max)) + (coding-system-for-write + (if (symbolp coding) coding (car coding))) + (coding-system-for-read + (if (symbolp coding) coding (cdr coding)))) (clear-visited-file-modtime) (narrow-to-region (point-max) (point-max)) ;; We call `tramp-maybe-open-connection', in @@ -6139,4 +6143,9 @@ function cell is returned to be applied on a buffer." ;; ;; * Implement `:stderr' of `make-process' as pipe process. +;; * One interesting solution (with other applications as well) would +;; be to stipulate, as a directory or connection-local variable, an +;; additional rc file on the remote machine that is sourced every +;; time Tramp connects. + ;;; tramp-sh.el ends here diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 70bf1eee26..a4865ec4f2 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3788,7 +3788,7 @@ It does not support `:stderr'." (unless (or (null sentinel) (functionp sentinel)) (signal 'wrong-type-argument (list #'functionp sentinel))) (unless (or (null stderr) (bufferp stderr)) - (signal 'wrong-type-argument (list #'stringp stderr))) + (signal 'wrong-type-argument (list #'bufferp stderr))) (let* ((buffer (if buffer commit d428cc1b927ae1bf8240ed30b37c9418e819381d Author: Stefan Kangas Date: Thu Dec 17 19:08:40 2020 +0100 Remove incorrect comment from erc-goodies.el * lisp/erc/erc-goodies.el (erc-move-to-prompt-setup): Remove incorrect comment; the XEmacs compat code has been removed. diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index b799b2427c..cd04a3ab2c 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -242,7 +242,6 @@ global-level ERC button keys yet.") (defun erc-button-setup () "Add ERC mode-level button movement keys. This is only done once." - ;; Make XEmacs use `erc-button-face'. ;; Add keys. (unless erc-button-keys-added (define-key erc-mode-map (kbd "") 'erc-button-previous) commit d5941d8396a6bbe67bb06c339af008a5f688c73e Author: Stefan Monnier Date: Thu Dec 17 11:53:56 2020 -0500 Fix my two most common causes of all windows/frames redisplay * src/buffer.c (Fkill_all_local_variables): Only redisplay the buffer. * src/window.c (set_window_scroll_bars): Only redisplay the window. diff --git a/src/buffer.c b/src/buffer.c index 4215acbf1d..dfc34faf6e 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2814,7 +2814,7 @@ the normal hook `change-major-mode-hook'. */) /* Force mode-line redisplay. Useful here because all major mode commands call this function. */ - update_mode_lines = 12; + bset_update_mode_line (current_buffer); return Qnil; } diff --git a/src/window.c b/src/window.c index 4eab786958..bcc989b5a7 100644 --- a/src/window.c +++ b/src/window.c @@ -7822,7 +7822,7 @@ set_window_scroll_bars (struct window *w, Lisp_Object width, if more than a single window needs to be considered, see redisplay_internal. */ if (changed) - windows_or_buffers_changed = 31; + wset_redisplay (w); return changed ? w : NULL; } commit 02c4f65a1ea5d55a569a559bb181c6df5171319b Author: Zajcev Evgeny Date: Thu Dec 17 11:27:20 2020 +0300 Make "Invalid modifier in string" ordinary invalid-read-syntax error * src/lread.ec (read1): Raise "Invalid modifier in string" error as `invalid-read-syntax'. This fixes raise of unhandled error in `elisp--local-variables' diff --git a/src/lread.c b/src/lread.c index a3d5fd7bb8..3ef874039a 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3438,7 +3438,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) /* Any modifiers remaining are invalid. */ if (modifiers) - error ("Invalid modifier in string"); + invalid_syntax ("Invalid modifier in string"); p += CHAR_STRING (ch, (unsigned char *) p); } else commit 526abadd071e8c2cd67b91c2e282b44e01917fdb Author: Lars Ingebrigtsen Date: Thu Dec 17 12:32:29 2020 +0100 Fix fallback use of write-file in ido-mode * lisp/ido.el (ido-file-internal): Make `write-file' respect the directory we've navigated to (bug#28513). diff --git a/lisp/ido.el b/lisp/ido.el index 5758d3fdea..99241ce1a3 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -2367,7 +2367,16 @@ If cursor is not at the end of the user input, move to end of input." (read-file-name-function nil)) (setq this-command (or ido-fallback fallback 'find-file)) (run-hook-with-args 'ido-before-fallback-functions this-command) - (call-interactively this-command))) + (if (eq this-command 'write-file) + (write-file (read-file-name + "Write file: " + default-directory + (and buffer-file-name + (expand-file-name + (file-name-nondirectory buffer-file-name) + default-directory))) + t) + (call-interactively this-command)))) ((eq ido-exit 'switch-to-buffer) (ido-buffer-internal commit 7fad9591142f9d9d0bfce37dd8c65a847dbe8aa9 Author: Philipp Stephani Date: Thu Dec 17 12:06:15 2020 +0100 Ensure that byte compilation works for relative files (Bug#45287). * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don’t fail if target filename doesn’t contain a directory name. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--target-file-no-directory): New unit test. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index e23bb9f5e6..64f2c01082 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1967,7 +1967,11 @@ See also `emacs-lisp-byte-compile-and-load'." ;; We attempt to create a temporary file in the ;; target directory, so the target directory must be ;; writable. - (file-writable-p (file-name-directory target-file))) + (file-writable-p + (file-name-directory + ;; Need to expand in case TARGET-FILE doesn't + ;; include a directory (Bug#45287). + (expand-file-name target-file)))) ;; We must disable any code conversion here. (let* ((coding-system-for-write 'no-conversion) ;; Write to a tempfile so that if another Emacs diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index c2a3e3ba11..4a6e28f7c7 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -1016,6 +1016,21 @@ mountpoint (Bug#44631)." (set-file-modes directory #o700) (delete-directory directory :recursive)))))) +(ert-deftest bytecomp-tests--target-file-no-directory () + "Check that Bug#45287 is fixed." + (let ((directory (make-temp-file "bytecomp-tests-" :directory))) + (unwind-protect + (let* ((default-directory directory) + (byte-compile-dest-file-function (lambda (_) "test.elc")) + (byte-compile-error-on-warn t)) + (write-region "" nil "test.el" nil nil nil 'excl) + (should (byte-compile-file "test.el")) + (should (file-regular-p "test.elc")) + (should (cl-plusp (file-attribute-size + (file-attributes "test.elc"))))) + (with-demoted-errors "Error cleaning up directory: %s" + (delete-directory directory :recursive))))) + ;; Local Variables: ;; no-byte-compile: t ;; End: commit 32d76c0cbc32aa8740bf742a0aea05dd92d28275 Author: Lars Ingebrigtsen Date: Thu Dec 17 12:17:23 2020 +0100 Default the init file to init.el, not init * lisp/startup.el (startup--load-user-init-file): Make the default init file be "init.el", not "init" (bug#45197). diff --git a/lisp/startup.el b/lisp/startup.el index b652977798..b1128f6d02 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -949,10 +949,10 @@ init-file, or to a default value if loading is not possible." (when (and (eq user-init-file t) alternate-filename-function) (let ((alt-file (funcall alternate-filename-function))) - (and (equal (file-name-extension alt-file) "el") - (setq alt-file (file-name-sans-extension alt-file))) (unless init-file-name (setq init-file-name alt-file)) + (and (equal (file-name-extension alt-file) "el") + (setq alt-file (file-name-sans-extension alt-file))) (load alt-file 'noerror 'nomessage))) ;; If we did not find the user's init file, set @@ -1382,7 +1382,7 @@ please check its value") "~/.emacs"))) (lambda () (expand-file-name - "init" + "init.el" startup-init-directory)) (not inhibit-default-init)) commit c51d9140be18697fbff60233d68b18f2f682a3b9 Author: Pankaj Jangid Date: Wed Dec 16 23:34:20 2020 +0100 Fix resetting of gnus-pick-line-number * lisp/gnus/gnus-sum.el (gnus-summary-read-group-1): Move setting gnus-pick-line-number from here (bug#45269)... (gnus-summary-prepare): To here. This ensures that the number is reset when regenerating the buffer, for instance when limiting it. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 9488b32487..16152e252a 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -4100,8 +4100,6 @@ If SELECT-ARTICLES, only select those articles from GROUP." ;; The group was successfully selected. (t (gnus-set-global-variables) - (when (boundp 'gnus-pick-line-number) - (setq gnus-pick-line-number 0)) (when (boundp 'spam-install-hooks) (spam-initialize)) ;; Save the active value in effect when the group was entered. @@ -4226,6 +4224,8 @@ If SELECT-ARTICLES, only select those articles from GROUP." gnus-newsgroup-data-reverse nil) (gnus-run-hooks 'gnus-summary-generate-hook) ;; Generate the buffer, either with threads or without. + (when (boundp 'gnus-pick-line-number) + (setq gnus-pick-line-number 0)) (when gnus-newsgroup-headers (gnus-summary-prepare-threads (if gnus-show-threads commit 922e43ad7db2145f2a93ba66401289e420c129a5 Author: Juri Linkov Date: Wed Dec 16 23:27:11 2020 +0200 Don't show minibuffer keybindings for suggestions in read-extended-command * lisp/simple.el (read-extended-command): Use 'affixation-function' instead of 'annotation-function'. (Bug#45035) (read-extended-command--affixation): New function created from 'read-extended-command--annotation'. diff --git a/lisp/simple.el b/lisp/simple.el index 6059c23a14..090162b973 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1958,22 +1958,27 @@ to get different commands to edit and resubmit." (lambda (string pred action) (if (and suggest-key-bindings (eq action 'metadata)) '(metadata - (annotation-function . read-extended-command--annotation) + (affixation-function . read-extended-command--affixation) (category . command)) (complete-with-action action obarray string pred))) #'commandp t nil 'extended-command-history))) -(defun read-extended-command--annotation (command-name) - (let* ((fun (and (stringp command-name) (intern-soft command-name))) - (binding (where-is-internal fun overriding-local-map t)) - (obsolete (get fun 'byte-obsolete-info)) - (alias (symbol-function fun))) - (cond ((symbolp alias) - (format " (%s)" alias)) - (obsolete - (format " (%s)" (car obsolete))) - ((and binding (not (stringp binding))) - (format " (%s)" (key-description binding)))))) +(defun read-extended-command--affixation (command-names) + (with-selected-window (or (minibuffer-selected-window) (selected-window)) + (mapcar + (lambda (command-name) + (let* ((fun (and (stringp command-name) (intern-soft command-name))) + (binding (where-is-internal fun overriding-local-map t)) + (obsolete (get fun 'byte-obsolete-info)) + (alias (symbol-function fun)) + (suffix (cond ((symbolp alias) + (format " (%s)" alias)) + (obsolete + (format " (%s)" (car obsolete))) + ((and binding (not (stringp binding))) + (format " (%s)" (key-description binding)))))) + (if suffix (list command-name suffix) command-name))) + command-names))) (defcustom suggest-key-bindings t "Non-nil means show the equivalent key-binding when M-x command has one. commit 67fb182cfa6afeb9e212c89d78caac9bd4a82f3a Author: Juri Linkov Date: Wed Dec 16 23:19:46 2020 +0200 Give affixation-function higher priority over annotation-function (bug#45234) * doc/lispref/minibuf.texi (Completion Variables) (Programmed Completion): Describe precedence rules of affixation-function and annotation-function. * lisp/minibuffer.el (completion-metadata) (completion-extra-properties): Describe precedence rules of affixation-function and annotation-function. (minibuffer-completion-help): First try to apply affixation-function, if there is no such function, try annotation-function. diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 56bc0b8ab6..48f068ee60 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1803,7 +1803,8 @@ The value should be a function to add prefixes and suffixes to completions. This function must accept one argument, a list of completions, and should return such a list of completions where each element contains a list of three elements: a completion, -a prefix string, and a suffix string. +a prefix string, and a suffix string. This function takes priority +over @code{:annotation-function}. @item :exit-function The value should be a function to run after performing completion. @@ -1911,7 +1912,8 @@ completions. The function should take one argument, return such a list of @var{completions} where each element contains a list of three elements: a completion, a prefix which is displayed before the completion string in the @file{*Completions*} buffer, and -a suffix displayed after the completion string. +a suffix displayed after the completion string. This function +takes priority over @code{annotation-function}. @item display-sort-function The value should be a function for sorting completions. The function diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 456193d52e..7d05f7704e 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -123,7 +123,8 @@ This metadata is an alist. Currently understood keys are: - `affixation-function': function to prepend/append a prefix/suffix to entries. Takes one argument (COMPLETIONS) and should return a list of completions with a list of three elements: completion, its prefix - and suffix. + and suffix. This function takes priority over `annotation-function' + when both are provided, so only this function is used. - `display-sort-function': function to sort entries in *Completions*. Takes one argument (COMPLETIONS) and should return a new list of completions. Can operate destructively. @@ -1926,6 +1927,8 @@ These include: completions. The function must accept one argument, a list of completions, and return a list where each element is a list of three elements: a completion, a prefix and a suffix. + This function takes priority over `:annotation-function' + when both are provided, so only this function is used. `:exit-function': Function to run after completion is performed. @@ -2056,15 +2059,16 @@ variables.") (if sort-fun (funcall sort-fun completions) (sort completions 'string-lessp)))) - (when ann-fun + (cond + (aff-fun + (setq completions + (funcall aff-fun completions))) + (ann-fun (setq completions (mapcar (lambda (s) (let ((ann (funcall ann-fun s))) (if ann (list s ann) s))) - completions))) - (when aff-fun - (setq completions - (funcall aff-fun completions))) + completions)))) (with-current-buffer standard-output (setq-local completion-base-position commit 32d85e3079a8cdfb0f083b766f2fafd361ee6e00 Author: Harald Jörg Date: Tue Dec 15 18:53:03 2020 +0100 CPerl-mode: don't treat <<>> as starting a here-doc * lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Detect the "<<>>" operator (Bug#42455). * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-45255): Verify that <<>> does not start a HERE-doc. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 5cf40fe959..15987a3b9b 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3694,13 +3694,14 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', ;; ;; "\\([^= \t0-9$@%&]\\|[ \t]+[^ \t\n0-9$@%&]\\)" ; 6 + 1 ;; "\\(\\)" ; To preserve count of pars :-( 6 + 1 ;; "\\)" - ((match-beginning 3) ; 2 + 1 + ((match-beginning 3) ; 2 + 1: found "<<", detect its type (setq b (point) tb (match-beginning 0) c (and ; not HERE-DOC (match-beginning 6) (save-match-data (or (looking-at "[ \t]*(") ; << function_call() + (looking-at ">>") ; <<>> operator (save-excursion ; 1 << func_name, or $foo << 10 (condition-case nil (progn diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index 896160bb88..cb2d067a61 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -312,4 +312,12 @@ have a face property." (let ((code "{ $a- / $b } # /")) (should (equal (nth 8 (cperl-test-ppss code "/")) 7)))) +(ert-deftest cperl-test-bug-45255 () + "Verify that \"<<>>\" is recognized as not starting a HERE-doc." + (let ((code (concat "while (<<>>) {\n" + " ...;\n" + "}\n"))) + ;; The yadda-yadda operator should not be in a string. + (should (equal (nth 8 (cperl-test-ppss code "\\.")) nil)))) + ;;; cperl-mode-tests.el ends here commit 6eb6357423dbef73079732206f5a71cec09eed41 Author: E. Choroba Date: Tue Dec 15 14:37:50 2020 +0100 Update short docs in cperl-mode * lisp/progmodes/cperl-mode.el (cperl-short-docs): Update with some missing entries. (Bug#45254) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index ae839a6622..5cf40fe959 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -7260,6 +7260,7 @@ __DATA__ Ends program source. __FILE__ Current (source) filename. __LINE__ Current line in current source. __PACKAGE__ Current package. +__SUB__ Current sub. ARGV Default multi-file input filehandle. is a synonym for <>. ARGVOUT Output filehandle with -i flag. BEGIN { ... } Immediately executed (during compilation) piece of code. @@ -7525,14 +7526,17 @@ use PACKAGE [SYMBOL1, ...] Compile-time `require' with consequent `import'. prototype \\&SUB Returns prototype of the function given a reference. =head1 Top-level heading. =head2 Second-level heading. -=head3 Third-level heading (is there such?). +=head3 Third-level heading. +=head4 Fourth-level heading. =over [ NUMBER ] Start list. =item [ TITLE ] Start new item in the list. =back End list. =cut Switch from POD to Perl. =pod Switch from Perl to POD. -=begin Switch from Perl6 to POD. -=end Switch from POD to Perl6. +=begin formatname Start directly formatted region. +=end formatname End directly formatted region. +=for formatname text Paragraph in special format. +=encoding encodingname Encoding of the document. ") (defun cperl-switch-to-doc-buffer (&optional interactive) commit d1b1a5c0e653c0cbc3d95759adf4822a60c21ed0 Author: Stefan Kangas Date: Wed Dec 16 15:20:46 2020 +0100 ; * lisp/play/5x5.el: Fix my last change. diff --git a/lisp/play/5x5.el b/lisp/play/5x5.el index 5ab1493c7a..8538dd5d3e 100644 --- a/lisp/play/5x5.el +++ b/lisp/play/5x5.el @@ -31,7 +31,7 @@ ;; o The code for updating the grid needs to be re-done. At the moment it ;; simply re-draws the grid every time a move is made. ;; -;; o Look into starting up the display with color. gamegrid.el looks +;; o Look into improving the display with color. gamegrid.el looks ;; interesting, perhaps that is the way to go? ;;; Thanks: