commit 5e5f5b28e92a3bb927bb03c783c426c6c3baeadc (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Thu Apr 6 22:14:59 2023 +0300 Avoid failing the build when org-version.el is updated * lisp/Makefile.in: Force recompilation of all Org files when org-version.el is updated with a new Org version. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 1e0935f565f..437667e7586 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -543,4 +543,12 @@ $(lisp)/progmodes/cc-styles.elc: $(lisp)/progmodes/js.elc: $(lisp)/progmodes/cc-defs.elc \ $(lisp)/progmodes/cc-engine.elc $(lisp)/progmodes/cc-mode.elc +# When org-version.el gets updated with a new version, all the Org +# files need to be recompiled, or else the build will fail due to +# version mismatch, prompting the naive users to bootstrap. So we +# make all the Org *.elc files dependent of org-version.el, to trigger +# their recompilation automatically. +$(lisp)/org/org.elc $(filter-out $(lisp)/org/org-version.elc,$(filter-out $(lisp)/org/org.elc,$(wildcard $(lisp)/org/*.elc))): \ + $(lisp)/org/org-version.el + # Makefile ends here. commit 2d1a96e878ef8dd9a27fb360aa6c85b1dc9b856e Merge: f7e8586104b 305246d9726 Author: Eli Zaretskii Date: Thu Apr 6 14:38:20 2023 -0400 Merge from origin/emacs-29 305246d9726 Add emoji-zoom-reset 470d269ec1f Make emoji-zoom-{increase,decrease} set text properties c... 63d4a86f8d1 Fix transforming sliced images 5e1953a8f85 ; * etc/NEWS: Minor copyedits of entry for 'keymap-*' fun... 6b9f9df9454 ; Improve documentation of 'declare-function' 81d1f46d0fe ; Avoid compiler warning in eglot.el. 38cdfcb2128 ; Fix description of new 'keymap-*' functions 257090b8728 Adapt EMBA scripts. 90c07d3fdd2 Another terminology fix in ELisp reference manual a832bc7090c Correct terminology in Elisp Reference Manual db308233cb3 Comment out GNUSTEP jobs on EMBA (again) 8c1b1022439 ; * lisp/image.el (put-image): Doc fix. eda88c63adf ; * doc/emacs/trouble.texi (Checklist): Minor grammar fix. 728bc09cf3c Fix regexp string escaping mistake in vhdl-mode.el (bug#6... 479626dbac9 Update to Org 9.6.3-2-gf2949d 5a1c9aace70 ; Add a bit more docstring to tsx-ts-mode (bug#62429) 86cf9fd932c Eglot: don't watch directories that don't exist 82d0b6c64ea ; * lisp/subr.el (use-dialog-box-p): Fix last change. 3619663f982 Preserve peer information for web page in eww-readable cb8d6ab648f * lisp/subr.el (use-dialog-box-p): Fix conditions for GUI... fb2c4409207 ; * lisp/progmodes/c-ts-mode.el (c++-ts-mode): Add some n... # Conflicts: # etc/NEWS commit f7e8586104b77254a390e685fab9a24774a7ccd6 Merge: 40860b61eed 89e337c3fc9 Author: Eli Zaretskii Date: Thu Apr 6 14:38:16 2023 -0400 ; Merge from origin/emacs-29 The following commit was skipped: 89e337c3fc9 ; Make sure 'eshell-command' tests don't prompt the user commit 40860b61eed0dc60439d6a13cba4e4cdad36dc15 Merge: c755463f044 b39c3cd1125 Author: Eli Zaretskii Date: Thu Apr 6 14:38:13 2023 -0400 Merge from origin/emacs-29 b39c3cd1125 ; * etc/NEWS: Fix typos. 89ac5ba11c7 Fix ModelSim error regexp in vhdl-mode 24ed9c7ae78 ; * doc/emacs/trouble.texi (Checklist): Minor copyedits (... d1d39a0f09c Document enhancements in handling of echo-area messages # Conflicts: # etc/NEWS commit c755463f0440224254c85b52c1168687383b7a7d Merge: 5ae0c167324 46209b2453b Author: Eli Zaretskii Date: Thu Apr 6 14:38:04 2023 -0400 ; Merge from origin/emacs-29 The following commits were skipped: 46209b2453b ; Fix last change 21a4ee209c1 Fix new Eshell tests on MS-Windows e2ebf3995d0 ; Auto-commit of loaddefs files. 6419d78fa6f Fix using background commands in 'eshell-command' commit 5ae0c16732450603efc1a0c900e5f2721a0f620b Author: Michael Albinus Date: Thu Apr 6 16:31:49 2023 +0200 Describe how to run Emba tests locally * admin/notes/emba: Describe how to run Emba tests locally. * test/infra/Dockerfile.emba (emacs-eglot): Adapt software selection. diff --git a/admin/notes/emba b/admin/notes/emba index 564cc3c54ac..c88b422a4fa 100644 --- a/admin/notes/emba +++ b/admin/notes/emba @@ -83,6 +83,46 @@ Lisp packages, Makefiles, scripts, and other software could determine whether they run on emba by checking for the environment variable EMACS_EMBA_CI. +* Running Emba tests locally + +As usual in GitLab, the tests run in containers, which could be +applied also locally. Unfortunately, the Emba container registry, +emba.gnu.org:5050, is not accessible publicly. Instead, the container +images must be build locally. Change the current directory to a +recent Emacs branch, and apply the command + + docker build --target emacs-inotify --tag emacs-inotify \ + -f test/infra/Dockerfile.emba . + +This creates the Debian-based image emacs-inotify, based on the +instructions in the file Dockerfile.emba. This image is good for the +majority of tests. However, there are also other image build +instructions like emacs-filenotify-gio, emacs-eglot, emacs-gnustep and +emacs-native-comp-speed{0,1,2}. Use the appropriate one. + +The image contains a directory "/checkout", which is a copy of your +local Emacs git repository. Emacs has been built in this directory +via "make bootstrap". In order to use the image, start a container +like + + docker run --interactive --env EMACS_EMBA_CI=1 --name emacs-inotify \ + emacs-inotify /bin/sh -i + +In this container, change the current directory to "/checkout". Now +you can apply all commands known for Emacs, like + + cd /checkout + make -C test files-tests.log + +While this container runs, you can also access its filesystem from +your local Emacs via Tramp. For example, in order to see the result +of the above test run, open the log file in your local Emacs with + + C-x C-f /docker:emacs-inotify:/checkout/test/lisp/files-tests.log + +Note: On local Red Hat-based systems, use "podman" instead of "docker" +in the shell commands and Tramp file names. + This file is part of GNU Emacs. diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index d7b0b0d3ded..0c4a2e414bf 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -60,17 +60,22 @@ RUN ./autogen.sh autoconf RUN ./configure --with-file-notification=gfile RUN make bootstrap -FROM emacs-base as emacs-eglot +# Debian bullseye doesn't provide proper packages. So we use Debian +# sid for this. +FROM debian:sid as emacs-eglot +# This corresponds to emacs-base. RUN apt-get update && \ apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ - wget lsb-release software-properties-common gpg \ + libc-dev gcc g++ make autoconf automake libncurses-dev gnutls-dev \ + libdbus-1-dev libacl1-dev acl git texinfo gdb \ && rm -rf /var/lib/apt/lists/* -# A recent clangd. It must be at least clangd 14, which is in Debian -# bookworm. -RUN bash -c "$(wget --no-check-certificate -O - https://apt.llvm.org/llvm.sh)" -RUN ln -s /usr/bin/clangd-15 /usr/bin/clangd +# Some language servers. +RUN apt-get update && \ + apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ + clangd python3-pylsp python3-autopep8 python3-yapf \ + && rm -rf /var/lib/apt/lists/* COPY . /checkout WORKDIR /checkout commit 305246d9726bbe05a65ad3836880138db5c01dfa (refs/remotes/origin/emacs-29) Author: Robert Pluim Date: Wed Apr 5 17:24:38 2023 +0200 Add emoji-zoom-reset * lisp/international/emoji.el (emoji-zoom-map): Add emoji-zoom-reset. (emoji-zoom-reset): New function, it resets the zoom level. * lisp/international/mule-cmds.el (ctl-x-map): Add emoji-zoom-reset. * etc/NEWS: Announce new command. diff --git a/etc/NEWS b/etc/NEWS index 9adeb47db8c..dc4eb64a63a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1021,6 +1021,11 @@ works for non-Emoji characters.) These are bound to 'C-x 8 e +' and 'C-x 8 e -', respectively. They can be used on any character, but are mainly useful for Emoji. +--- +*** New command 'emoji-zoom-reset'. +This is bound to 'C-x 8 e 0', and undoes any size changes performed by +'emoji-zoom-increase' and 'emoji-zoom-decrease'. + --- *** New input method 'emoji'. This allows you to enter Emoji using short strings, eg ':face_palm:' diff --git a/lisp/international/emoji.el b/lisp/international/emoji.el index ffff2aa1236..04854ede6be 100644 --- a/lisp/international/emoji.el +++ b/lisp/international/emoji.el @@ -700,7 +700,8 @@ emoji--choose-emoji (defvar-keymap emoji-zoom-map "+" #'emoji-zoom-increase - "-" #'emoji-zoom-decrease) + "-" #'emoji-zoom-decrease + "0" #'emoji-zoom-reset) ;;;###autoload (defun emoji-zoom-increase (&optional factor) @@ -741,6 +742,19 @@ emoji-zoom-decrease (interactive) (emoji-zoom-increase 0.9)) +;;;###autoload +(defun emoji-zoom-reset () + "Reset the size of the character under point." + (interactive) + (with-silent-modifications + (let ((old (get-text-property (point) 'face))) + (when (and (consp old) + (remove-text-properties (point) (1+ (point)) '(rear-nonsticky nil))) + (if (eq (car old) :height) + (remove-text-properties (point) (1+ (point)) '(face nil)) + (add-text-properties (point) (1+ (point)) (list 'face + (cdr old)))))))) + (provide 'emoji) ;;; emoji.el ends here diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 4e38b13b1a5..3d6d66970d3 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -3269,7 +3269,8 @@ ctl-x-map "r" #'emoji-recent "l" #'emoji-list "+" #'emoji-zoom-increase - "-" #'emoji-zoom-decrease)) + "-" #'emoji-zoom-decrease + "0" #'emoji-zoom-reset)) (defface confusingly-reordered '((((supports :underline (:style wave))) commit 470d269ec1fe58935ff1b13e04d030ec40dcaa5e Author: Robert Pluim Date: Wed Apr 5 15:19:13 2023 +0200 Make emoji-zoom-{increase,decrease} set text properties correctly * lisp/international/emoji.el (emoji-zoom-increase): Ensure that we're increasing the :height of the anonymous face at point, rather than having two :height properties, which appeared to work by accident, and don't error at eob. (Bug#62675) diff --git a/lisp/international/emoji.el b/lisp/international/emoji.el index bcd4aac4f29..ffff2aa1236 100644 --- a/lisp/international/emoji.el +++ b/lisp/international/emoji.el @@ -707,23 +707,33 @@ emoji-zoom-increase "Increase the size of the character under point. FACTOR is the multiplication factor for the size." (interactive) - (set-transient-map emoji-zoom-map t nil "Zoom with %k") - (let* ((factor (or factor 1.1)) - (old (get-text-property (point) 'face)) - (height (or (and (consp old) - (plist-get old :height)) - 1.0)) - (inhibit-read-only t)) - (with-silent-modifications - (if (consp old) - (add-text-properties - (point) (1+ (point)) - (list 'face (plist-put (copy-sequence old) :height (* height factor)) - 'rear-nonsticky t)) - (add-face-text-property (point) (1+ (point)) - (list :height (* height factor))) - (put-text-property (point) (1+ (point)) - 'rear-nonsticky t))))) + (set-transient-map emoji-zoom-map t #'redisplay "Zoom with %k") + (unless (eobp) + (let* ((factor (or factor 1.1)) + (old (get-text-property (point) 'face)) + ;; The text property is either a named face, or a plist + ;; with :height, or a list starting with such a plist, + ;; followed by one or more faces. + (newheight (* (or (and (consp old) + (or (plist-get (car old) :height) + (plist-get old :height))) + 1.0) + factor)) + (inhibit-read-only t)) + (with-silent-modifications + (if (consp old) + (add-text-properties + (point) (1+ (point)) + (list 'face + (if (eq (car old) :height) + (plist-put (copy-sequence old) :height newheight) + (cons (plist-put (car old) :height newheight) + (cdr old))) + 'rear-nonsticky t)) + (add-face-text-property (point) (1+ (point)) + (list :height newheight)) + (put-text-property (point) (1+ (point)) + 'rear-nonsticky t)))))) ;;;###autoload (defun emoji-zoom-decrease () commit 27a21709c1e8e67a1e90d8c926e6daaa1f9a686a Author: Liu Hui Date: Tue Apr 4 09:13:32 2023 +0800 Restore positions reliably for abbreviated file names in saveplace.el * lisp/saveplace.el (save-place-abbreviate-file-names): Add setter function for rewriting `save-place-alist'. Update docstring. (save-place-to-alist): Save Abbreviated dired-filename. (save-place-load-alist-from-file): Move this function above `save-place-abbreviate-file-names' since it is used in the :set function. (save-place-find-file-hook): (save-place-dired-hook): Use abbreviated file name when `save-place-abbreviate-file-names' is non-nil. (Bug#62413) diff --git a/lisp/saveplace.el b/lisp/saveplace.el index 7512fc87c5d..18d296ba2d9 100644 --- a/lisp/saveplace.el +++ b/lisp/saveplace.el @@ -35,6 +35,8 @@ ;;; Code: +(require 'cl-lib) + ;; this is what I was using during testing: ;; (define-key ctl-x-map "p" 'toggle-save-place-globally) @@ -87,11 +89,77 @@ save-place-forget-unreadable-files `save-place-file'." :type 'boolean) +(defun save-place-load-alist-from-file () + (if (not save-place-loaded) + (progn + (setq save-place-loaded t) + (let ((file (expand-file-name save-place-file))) + ;; make sure that the alist does not get overwritten, and then + ;; load it if it exists: + (if (file-readable-p file) + ;; don't want to use find-file because we have been + ;; adding hooks to it. + (with-current-buffer (get-buffer-create " *Saved Places*") + (delete-region (point-min) (point-max)) + ;; Make sure our 'coding:' cookie in the save-place + ;; file will take effect, in case the caller binds + ;; coding-system-for-read. + (let (coding-system-for-read) + (insert-file-contents file)) + (goto-char (point-min)) + (setq save-place-alist + (with-demoted-errors "Error reading save-place-file: %S" + (car (read-from-string + (buffer-substring (point-min) (point-max)))))) + + ;; If there is a limit, and we're over it, then we'll + ;; have to truncate the end of the list: + (if save-place-limit + (if (<= save-place-limit 0) + ;; Zero gets special cased. I'm not thrilled + ;; with this, but the loop for >= 1 is tight. + (setq save-place-alist nil) + ;; Else the limit is >= 1, so enforce it by + ;; counting and then `setcdr'ing. + (let ((s save-place-alist) + (count 1)) + (while s + (if (>= count save-place-limit) + (setcdr s nil) + (setq count (1+ count))) + (setq s (cdr s)))))) + + (kill-buffer (current-buffer)))) + nil)))) + (defcustom save-place-abbreviate-file-names nil "If non-nil, abbreviate file names before saving them. This can simplify sharing the `save-place-file' file across -different hosts." +different hosts. + +Changing this option requires rewriting `save-place-alist' with +corresponding file name format, therefore setting this option +just using `setq' may cause out-of-sync problems. You should use +either `setopt' or M-x customize-variable to set this option." :type 'boolean + :set (lambda (sym val) + (set-default sym val) + (or save-place-loaded (save-place-load-alist-from-file)) + (let ((fun (if val #'abbreviate-file-name #'expand-file-name))) + (setq save-place-alist + (cl-delete-duplicates + (cl-loop for (k . v) in save-place-alist + collect + (cons (funcall fun k) + (if (listp v) + (cl-loop for (k1 . v1) in v + collect + (cons k1 (funcall fun v1))) + v))) + :key #'car + :from-end t + :test #'equal))) + val) :version "28.1") (defcustom save-place-save-skipped t @@ -214,7 +282,11 @@ save-place-to-alist ((and (derived-mode-p 'dired-mode) directory) (let ((filename (dired-get-filename nil t))) (if filename - `((dired-filename . ,filename)) + (list + (cons 'dired-filename + (if save-place-abbreviate-file-names + (abbreviate-file-name filename) + filename))) (point)))) (t (point))))) (if cell @@ -278,49 +350,6 @@ save-place-alist-to-file (file-error (message "Saving places: can't write %s" file))) (kill-buffer (current-buffer)))))) -(defun save-place-load-alist-from-file () - (if (not save-place-loaded) - (progn - (setq save-place-loaded t) - (let ((file (expand-file-name save-place-file))) - ;; make sure that the alist does not get overwritten, and then - ;; load it if it exists: - (if (file-readable-p file) - ;; don't want to use find-file because we have been - ;; adding hooks to it. - (with-current-buffer (get-buffer-create " *Saved Places*") - (delete-region (point-min) (point-max)) - ;; Make sure our 'coding:' cookie in the save-place - ;; file will take effect, in case the caller binds - ;; coding-system-for-read. - (let (coding-system-for-read) - (insert-file-contents file)) - (goto-char (point-min)) - (setq save-place-alist - (with-demoted-errors "Error reading save-place-file: %S" - (car (read-from-string - (buffer-substring (point-min) (point-max)))))) - - ;; If there is a limit, and we're over it, then we'll - ;; have to truncate the end of the list: - (if save-place-limit - (if (<= save-place-limit 0) - ;; Zero gets special cased. I'm not thrilled - ;; with this, but the loop for >= 1 is tight. - (setq save-place-alist nil) - ;; Else the limit is >= 1, so enforce it by - ;; counting and then `setcdr'ing. - (let ((s save-place-alist) - (count 1)) - (while s - (if (>= count save-place-limit) - (setcdr s nil) - (setq count (1+ count))) - (setq s (cdr s)))))) - - (kill-buffer (current-buffer)))) - nil)))) - (defun save-places-to-alist () ;; go through buffer-list, saving places to alist if save-place-mode ;; is non-nil, deleting them from alist if it is nil. @@ -353,7 +382,11 @@ save-place-find-file-hook "Function added to `find-file-hook' by `save-place-mode'. It runs the hook `save-place-after-find-file-hook'." (or save-place-loaded (save-place-load-alist-from-file)) - (let ((cell (assoc buffer-file-name save-place-alist))) + (let ((cell (and (stringp buffer-file-name) + (assoc (if save-place-abbreviate-file-names + (abbreviate-file-name buffer-file-name) + buffer-file-name) + save-place-alist)))) (if cell (progn (or revert-buffer-in-progress-p @@ -368,25 +401,25 @@ save-place-find-file-hook (defun save-place-dired-hook () "Position the point in a Dired buffer." (or save-place-loaded (save-place-load-alist-from-file)) - (let* ((directory (and (derived-mode-p 'dired-mode) - (boundp 'dired-subdir-alist) - dired-subdir-alist - (dired-current-directory))) - (cell (assoc (and directory - (expand-file-name (if (consp directory) - (car directory) - directory))) - save-place-alist))) - (if cell - (progn - (or revert-buffer-in-progress-p - (cond - ((integerp (cdr cell)) - (goto-char (cdr cell))) - ((and (listp (cdr cell)) (assq 'dired-filename (cdr cell))) - (dired-goto-file (cdr (assq 'dired-filename (cdr cell))))))) - ;; and make sure it will be saved again for later - (setq save-place-mode t))))) + (when-let ((directory (and (derived-mode-p 'dired-mode) + (boundp 'dired-subdir-alist) + dired-subdir-alist + (dired-current-directory))) + (item (expand-file-name (if (consp directory) + (car directory) + directory))) + (cell (assoc (if save-place-abbreviate-file-names + (abbreviate-file-name item) item) + save-place-alist))) + (or revert-buffer-in-progress-p + (cond + ((integerp (cdr cell)) + (goto-char (cdr cell))) + ((listp (cdr cell)) + (when-let ((elt (assq 'dired-filename (cdr cell)))) + (dired-goto-file (expand-file-name (cdr elt))))))) + ;; and make sure it will be saved again for later + (setq save-place-mode t))) (defun save-place-kill-emacs-hook () ;; First update the alist. This loads the old save-place-file if nec. commit 0563dbf95d024c98bb3c81b6a7e55365fe73f955 Author: Wilhelm H Kirschbaum Date: Sun Apr 2 09:43:20 2023 +0200 Handle electric heredocs pairs in elixir-ts-mode * lisp/progmodes/elixir-ts-mode.el (elixir-ts--electric-pair-string-delimiter): New helper. (elixir-ts-mode): Add post-self-insert-hook. (Bug#62536) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index e2d9515c10f..c58854c41c3 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -568,13 +568,27 @@ elixir-ts--syntax-propertize (put-text-property (1- (treesit-node-end node)) (treesit-node-end node) 'syntax-table (string-to-syntax "$"))))))) +(defun elixir-ts--electric-pair-string-delimiter () + "Insert corresponding multi-line string for `electric-pair-mode'." + (when (and electric-pair-mode + (eq last-command-event ?\") + (let ((count 0)) + (while (eq (char-before (- (point) count)) last-command-event) + (cl-incf count)) + (= count 3)) + (eq (char-after) last-command-event)) + (save-excursion + (insert (make-string 2 last-command-event))) + (save-excursion + (newline 1 t)))) + ;;;###autoload (define-derived-mode elixir-ts-mode prog-mode "Elixir" "Major mode for editing Elixir, powered by tree-sitter." :group 'elixir-ts :syntax-table elixir-ts--syntax-table - ;; Comments + ;; Comments. (setq-local comment-start "# ") (setq-local comment-start-skip (rx "#" (* (syntax whitespace)))) @@ -584,9 +598,13 @@ elixir-ts-mode (rx (* (syntax whitespace)) (group (or (syntax comment-end) "\n")))) - ;; Compile + ;; Compile. (setq-local compile-command "mix") + ;; Electric pair. + (add-hook 'post-self-insert-hook + #'elixir-ts--electric-pair-string-delimiter 'append t) + (when (treesit-ready-p 'elixir) ;; The HEEx parser has to be created first for elixir to ensure elixir ;; is the first language when looking for treesit ranges. @@ -617,14 +635,14 @@ elixir-ts-mode ;; Indent. (setq-local treesit-simple-indent-rules elixir-ts--indent-rules) - ;; Navigation + ;; Navigation. (setq-local forward-sexp-function #'elixir-ts--forward-sexp) (setq-local treesit-defun-type-regexp '("call" . elixir-ts--defun-p)) (setq-local treesit-defun-name-function #'elixir-ts--defun-name) - ;; Embedded Heex + ;; Embedded Heex. (when (treesit-ready-p 'heex) (setq-local treesit-range-settings elixir-ts--treesit-range-rules) commit c6bbc20c388fe461db3514db68f3803f44caf01f Author: Wilhelm H Kirschbaum Date: Tue Mar 21 16:34:48 2023 +0200 Propertize heredocs in elixir-ts-mode * lisp/progmodes/elixir-ts-mode.el (elixir-ts--syntax-propertize-query): New variable. (elixir-ts--syntax-propertize): New helper. (elixir-ts-mode): Set syntax-propertize-function. (Bug#62536) diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el index 6d7420b63dc..e2d9515c10f 100644 --- a/lisp/progmodes/elixir-ts-mode.el +++ b/lisp/progmodes/elixir-ts-mode.el @@ -55,7 +55,9 @@ (declare-function treesit-parser-list "treesit.c") (declare-function treesit-node-parent "treesit.c") (declare-function treesit-node-start "treesit.c") +(declare-function treesit-node-end "treesit.c") (declare-function treesit-query-compile "treesit.c") +(declare-function treesit-query-capture "treesit.c") (declare-function treesit-node-eq "treesit.c") (declare-function treesit-node-prev-sibling "treesit.c") @@ -550,6 +552,22 @@ elixir-ts--defun-name (_ nil)))) (_ nil))) +(defvar elixir-ts--syntax-propertize-query + (when (treesit-available-p) + (treesit-query-compile + 'elixir + '(((["\"\"\""] @quoted-text)))))) + +(defun elixir-ts--syntax-propertize (start end) + "Apply syntax text properties between START and END for `elixir-ts-mode'." + (let ((captures + (treesit-query-capture 'elixir elixir-ts--syntax-propertize-query start end))) + (pcase-dolist (`(,name . ,node) captures) + (pcase-exhaustive name + ('quoted-text + (put-text-property (1- (treesit-node-end node)) (treesit-node-end node) + 'syntax-table (string-to-syntax "$"))))))) + ;;;###autoload (define-derived-mode elixir-ts-mode prog-mode "Elixir" "Major mode for editing Elixir, powered by tree-sitter." @@ -630,7 +648,8 @@ elixir-ts-mode ( elixir-sigil elixir-string-escape elixir-string-interpolation )))) - (treesit-major-mode-setup))) + (treesit-major-mode-setup) + (setq-local syntax-propertize-function #'elixir-ts--syntax-propertize))) (if (treesit-ready-p 'elixir) (progn commit 63d4a86f8d1547593c49e8bf493757137eb147e0 Author: Eli Zaretskii Date: Thu Apr 6 12:35:17 2023 +0300 Fix transforming sliced images * lisp/image.el (image--get-image): Support sliced images (bug#62679). Doc fix. (image-mouse-decrease-size, image-mouse-increase-size) (image-decrease-size, image-increase-size): Doc fixes. diff --git a/lisp/image.el b/lisp/image.el index 41bbed5006e..3f878bd4de0 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -1158,9 +1158,11 @@ image--repeat-map "r" #'image-rotate) (defun image-increase-size (&optional n position) - "Increase the image size by a factor of N. -If N is 3, then the image size will be increased by 30%. The -default is 20%." + "Increase the image size at POSITION by a factor specified by N. +If N is 3, then the image size will be increased by 30%. More +generally, the image size is multiplied by 1 plus N divided by 10. +N defaults to 2, which increases the image size by 20%. +POSITION can be a buffer position or a marker, and defaults to point." (interactive "P") (image--delayed-change-size (if n (1+ (/ (prefix-numeric-value n) 10.0)) @@ -1179,9 +1181,11 @@ image--delayed-change-size (run-with-idle-timer 0.3 nil #'image--change-size size position)) (defun image-decrease-size (&optional n position) - "Decrease the image size by a factor of N. -If N is 3, then the image size will be decreased by 30%. The -default is 20%." + "Decrease the image size at POSITION by a factor specified by N. +If N is 3, then the image size will be decreased by 30%. More +generally, the image size is multiplied by 1 minus N divided by 10. +N defaults to 2, which decreases the image size by 20%. +POSITION can be a buffer position or a marker, and defaults to point." (interactive "P") (image--delayed-change-size (if n (- 1 (/ (prefix-numeric-value n) 10.0)) @@ -1191,7 +1195,9 @@ image-decrease-size "Use %k for further adjustments")) (defun image-mouse-increase-size (&optional event) - "Increase the image size using the mouse." + "Increase the image size using the mouse-gesture EVENT. +This increases the size of the image at the position specified by +EVENT, if any, by the default factor used by `image-increase-size'." (interactive "e") (when (listp event) (save-window-excursion @@ -1199,7 +1205,9 @@ image-mouse-increase-size (image-increase-size nil (point-marker))))) (defun image-mouse-decrease-size (&optional event) - "Decrease the image size using the mouse." + "Decrease the image size using the mouse-gesture EVENT. +This decreases the size of the image at the position specified by +EVENT, if any, by the default factor used by `image-decrease-size'." (interactive "e") (when (listp event) (save-window-excursion @@ -1207,12 +1215,24 @@ image-mouse-decrease-size (image-decrease-size nil (point-marker))))) (defun image--get-image (&optional position) - "Return the image at point." - (let ((image (get-char-property (or position (point)) 'display - (when (markerp position) - (marker-buffer position))))) + "Return the image at POSITION. +POSITION can be a buffer position or a marker, and defaults to point." + (let* ((image (get-char-property (or position (point)) 'display + (when (markerp position) + (marker-buffer position)))) + (image-car (car-safe image)) + (image + (cond ((eq image-car 'image) + image) + ;; The value of the display property could be a sliced + ;; image of the form ((slice ...) (image ...)). + ;; FIXME: can we have more than 2 members in the list, + ;; so that the (image ...) part is NOT the cadr? + ((and (listp image) (consp image-car)) + (cadr image)) + (t nil)))) (unless (eq (car-safe image) 'image) - (error "No image under point")) + (error "No recognizable image under point")) image)) ;;;###autoload commit e579c9cc33df536cbd29c2db3960fb30bb7d75c6 Author: Alan Mackenzie Date: Thu Apr 6 09:14:56 2023 +0000 CC Mode: Miscellaneous coding fixes in c-forward-type This fixes bug #62339. * lisp/progmodes/cc-engine.el (c-forward-type): In the implicit int handling, respect the setting of the parameter stop-at-end. In the case "normal identifier", insert a missing (c-forward-syntactic-ws); this fixes the bug. Here, correct the wrong return value `prefix' to t. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index fe9e62ee569..4045576630c 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -9120,7 +9120,7 @@ c-forward-type (c-forward-syntactic-ws)) (let ((start (point)) pos res name-res id-start id-end id-range - post-prefix-pos) + post-prefix-pos prefix-end-pos) ;; Skip leading type modifiers. If any are found we know it's a ;; prefix of a type. @@ -9130,6 +9130,7 @@ c-forward-type (when (looking-at c-no-type-key) (setq res 'no-id))) (goto-char (match-end 1)) + (setq prefix-end-pos (point)) (setq pos (point)) (c-forward-syntactic-ws) (or (eq res 'no-id) @@ -9281,7 +9282,10 @@ c-forward-type (not (looking-at c-type-decl-prefix-key))))) ;; A C specifier followed by an implicit int, e.g. ;; "register count;" - (goto-char id-start) + (goto-char prefix-end-pos) + (setq pos (point)) + (unless stop-at-end + (c-forward-syntactic-ws)) (setq res 'no-id)) (name-res @@ -9289,6 +9293,7 @@ c-forward-type ;; A normal identifier. (goto-char id-end) (setq pos (point)) + (c-forward-syntactic-ws) (if (or res c-promote-possible-types) (progn (when (not (eq c-promote-possible-types 'just-one)) @@ -9296,7 +9301,9 @@ c-forward-type (when (and c-record-type-identifiers id-range) (c-record-type-id id-range)) (unless res - (setq res 'found))) + (setq res 'found)) + (when (eq res 'prefix) + (setq res t))) (setq res (if (c-check-qualified-type id-start) ;; It's an identifier that has been used as ;; a type somewhere else. commit d6ac2627466fc193cc95bb84c59b3f23e9d5b6fa Author: Po Lu Date: Thu Apr 6 10:06:28 2023 +0800 ; Fix compiler warning * src/xterm.c (x_term_init): Fix: "xterm.c", line 30759: warning: improper pointer/integer combination: op "=" diff --git a/src/xterm.c b/src/xterm.c index 70bcb67d80d..d621d94a2cf 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -30756,7 +30756,7 @@ #define NUM_ARGV 10 dpyinfo->invisible_cursor = make_invisible_cursor (dpyinfo); #if defined HAVE_XFIXES && XFIXES_VERSION >= 40000 - dpyinfo->fixes_pointer_blanking = egetenv ("EMACS_XFIXES"); + dpyinfo->fixes_pointer_blanking = (egetenv ("EMACS_XFIXES") != NULL); #endif #ifdef HAVE_X_I18N commit fa669c4b17c04eff852eb23a6179ccb8fab864db Author: Andrea Corallo Date: Wed Apr 5 18:17:58 2023 +0200 Comp: Fix limplification pass (bug#62537) * test/src/comp-resources/comp-test-funcs.el (comp-test-62537-1-f) (comp-test-62537-2-f): New functions. * lisp/emacs-lisp/comp.el (comp-jump-table-optimizable): Make it stricter add a comment. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 841b0ebf29d..025d21631bb 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -1712,6 +1712,10 @@ comp-fill-label-h (defun comp-jump-table-optimizable (jmp-table) "Return t if JMP-TABLE can be optimized out." + ;; Identify LAP sequences like: + ;; (byte-constant #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (created 126 deleted 126 changed 126)) . 24) + ;; (byte-switch) + ;; (TAG 126 . 10) (cl-loop with labels = (cl-loop for target-label being each hash-value of jmp-table collect target-label) @@ -1719,7 +1723,10 @@ comp-jump-table-optimizable for l in (cdr-safe labels) unless (= l x) return nil - finally return t)) + finally return (pcase (nth (1+ (comp-limplify-pc comp-pass)) + (comp-func-lap comp-func)) + (`(TAG ,label . ,_label-sp) + (= label l))))) (defun comp-emit-switch (var last-insn) "Emit a Limple for a lap jump table given VAR and LAST-INSN." diff --git a/test/src/comp-resources/comp-test-funcs.el b/test/src/comp-resources/comp-test-funcs.el index fff881dd595..73da7182a54 100644 --- a/test/src/comp-resources/comp-test-funcs.el +++ b/test/src/comp-resources/comp-test-funcs.el @@ -518,6 +518,19 @@ comp-test-47868-4-f (defun comp-test-48029-nonascii-žžž-f (arg) (when arg t)) +(defun comp-test-62537-1-f ()) + +(defun comp-test-62537-2-f () + (when (let ((val (comp-test-62537-1-f))) + (cond + ((eq val 'x) + t) + ((eq val 'y) + 'y))) + (comp-test-62537-1-f)) + t) + + ;;;;;;;;;;;;;;;;;;;; ;; Tromey's tests ;; commit 5e1953a8f852eaa6e6bdd1020ce6949052209e58 Author: Eli Zaretskii Date: Wed Apr 5 16:50:58 2023 +0300 ; * etc/NEWS: Minor copyedits of entry for 'keymap-*' functions. diff --git a/etc/NEWS b/etc/NEWS index d3f057308dc..9adeb47db8c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -4323,9 +4323,11 @@ that binding is ignored by 'where-is-internal'. +++ *** New functions for defining and manipulating keystrokes. -These all take the syntax defined by 'key-valid-p'. None of the older -functions have been deprecated or altered, but they are now -de-emphasized in the documentation. +These all take the syntax defined by 'key-valid-p', which is basically +the same syntax as the one accepted by the 'kbd' macro. None of the +older functions have been deprecated or altered, but they are now +de-emphasized in the documentation, and we encourage Lisp programs to +switch to these new functions. +++ *** Use 'keymap-set' instead of 'define-key'. commit a42f4a775bab61581d6b8dbd4fe2eeab55a6ea31 Author: Alan Mackenzie Date: Wed Apr 5 13:02:12 2023 +0000 CC Mode: Fix fontification problems shown by test file templates-20.cc Also fix one problem evident in test file decls-10.cc. * lisp/progmodes/cc-engine.el (c-brace-stack-at): Bind c-record-type-identifiers to nil to prevent called functions recording identifiers spuriously. (c-forward-<>-arglist-recur): Revert the ill-advised optimization from autumn 2022 which attempted to avoid re-marking c-type text properties inside angle bracket arglists. (c-forward-decl-or-cast-1): Accept the semicolon at the end of "t8 * id;" as sufficient evidence to fontify as a declaration (not a multiplication). * lisp/progmodes/cc-fonts.el (c-font-lock-c++-using): No longer fontify the last component of foo::bar with c-reference-face-name. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 81446c3c00b..fe9e62ee569 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -146,11 +146,6 @@ ;; "typedef" keyword. It's value is a list of the identifiers that ;; the "typedef" declares as types. ;; -;; 'c-<>-c-types-set -;; This property is set on an opening angle bracket, and indicates that -;; any "," separators within the template/generic expression have been -;; marked with a 'c-type property value 'c-<>-arg-sep (see above). -;; ;; 'c-awk-NL-prop ;; Used in AWK mode to mark the various kinds of newlines. See ;; cc-awk.el. @@ -6172,12 +6167,18 @@ c-update-brace-stack (cons (point) (cons bound-<> s))))) +(defvar c-record-type-identifiers) ; Specially for `c-brace-stack-at'. + (defun c-brace-stack-at (here) ;; Given a buffer position HERE, Return the value of the brace stack there. (save-excursion (save-restriction (widen) - (let ((c c-bs-cache) + (let (c-record-type-identifiers ; In case `c-forward-<>-arglist' would + ; otherwise record identifiers outside + ; of the restriction in force before + ; this function. + (c c-bs-cache) (can-use-prev (<= c-bs-prev-pos c-bs-cache-limit)) elt stack pos npos high-elt) ;; Trim the cache to take account of buffer changes. @@ -8630,11 +8631,9 @@ c-forward-<>-arglist-recur ;; List that collects the positions after the argument ;; separating ',' in the arglist. arg-start-pos) - ;; If the '<' has paren open syntax then we've marked it as an angle - ;; bracket arglist before, so skip to the end. - (if (and syntax-table-prop-on-< - (or (not c-parse-and-markup-<>-arglists) - (c-get-char-property (point) 'c-<>-c-types-set))) + (if (and (not c-parse-and-markup-<>-arglists) + syntax-table-prop-on-<) + (progn (forward-char) (if (and (c-go-up-list-forward) @@ -8731,7 +8730,6 @@ c-forward-<>-arglist-recur (c-unmark-<->-as-paren (point))))) (c-mark-<-as-paren start) (c-mark->-as-paren (1- (point))) - (c-put-char-property start 'c-<>-c-types-set t) (c-truncate-lit-pos-cache start)) (setq res t) nil)) ; Exit the loop. @@ -11200,7 +11198,7 @@ c-forward-decl-or-cast-1 ;; declaration. (setq maybe-expression t) (when (or (not c-asymmetry-fontification-flag) - (looking-at "=[^=]") + (looking-at "=\\([^=]\\|$\\)\\|;") (c-fdoc-assymetric-space-about-asterisk)) (when (eq at-type 'maybe) (setq unsafe-maybe t)) diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index f726fef467e..17b3c7be199 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -2678,9 +2678,7 @@ c-font-lock-c++-using 'same) (looking-at c-colon-type-list-re))) ;; Inherited protected member: leave unfontified - ) - (t (goto-char pos) - (c-font-lock-declarators limit nil c-label-face-name nil))) + )) (eq (char-after) ?,))) (forward-char))) ; over the comma. nil)) commit 6b9f9df9454a59b74790c402916df8628bb9d477 Author: Eli Zaretskii Date: Wed Apr 5 12:31:01 2023 +0300 ; Improve documentation of 'declare-function' * doc/lispref/functions.texi (Declaring Functions): * lisp/subr.el (declare-function): Document explicitly that ARGLIST argument, if provided, should include the parentheses. diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 551e743a653..948c6bb96f8 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -2688,13 +2688,14 @@ Declaring Functions Tell the byte compiler to assume that @var{function} is defined in the file @var{file}. The optional third argument @var{arglist} is either @code{t}, meaning the argument list is unspecified, or a list of -formal parameters in the same style as @code{defun}. An omitted -@var{arglist} defaults to @code{t}, not @code{nil}; this is atypical -behavior for omitted arguments, and it means that to supply a fourth -but not third argument one must specify @code{t} for the third-argument -placeholder instead of the usual @code{nil}. The optional fourth -argument @var{fileonly} non-@code{nil} means check only that -@var{file} exists, not that it actually defines @var{function}. +formal parameters in the same style as @code{defun} (including the +parentheses). An omitted @var{arglist} defaults to @code{t}, not +@code{nil}; this is atypical behavior for omitted arguments, and it +means that to supply a fourth but not third argument one must specify +@code{t} for the third-argument placeholder instead of the usual +@code{nil}. The optional fourth argument @var{fileonly} +non-@code{nil} means check only that @var{file} exists, not that it +actually defines @var{function}. @end defmac @findex check-declare-file diff --git a/lisp/subr.el b/lisp/subr.el index 131ed110149..2e31929e548 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -45,7 +45,8 @@ declare-function `check-declare' will check such files if they are found, and skip them without error if they are not. -Optional ARGLIST specifies FN's arguments, or is t to not specify +Optional ARGLIST specifies FN's arguments, in the same form as +in `defun' (including the parentheses); or it is t to not specify FN's arguments. An omitted ARGLIST defaults to t, not nil: a nil ARGLIST specifies an empty argument list, and an explicit t ARGLIST is a placeholder that allows supplying a later arg. commit 81d1f46d0fe0e4d8656e4994fd77b60b197f2bcf Author: Eli Zaretskii Date: Wed Apr 5 12:23:54 2023 +0300 ; Avoid compiler warning in eglot.el. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 4a9209ab9b4..cb9190a7523 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1605,6 +1605,7 @@ eglot--path-to-uri (directory-file-name (file-local-name truepath)) eglot--uri-path-allowed-chars))))) +(declare-function w32-long-file-name "w32proc.c" (fn)) (defun eglot--uri-to-path (uri) "Convert URI to file path, helped by `eglot--current-server'." (when (keywordp uri) (setq uri (substring (symbol-name uri) 1))) commit 38cdfcb2128d5a7b2eb174faca0ef1e32f641e85 Author: Eli Zaretskii Date: Wed Apr 5 11:31:15 2023 +0300 ; Fix description of new 'keymap-*' functions * doc/lispref/keymaps.texi (Prefix Keys): Fix example (bug#62673). (Functions for Key Lookup): Clarify the possible values of KEYMAP argument of 'keymap-lookup'. (Active Keymaps): Fix typo in function name; add cross-reference. diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index fdab5075b94..6d07ad5be2c 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -768,8 +768,8 @@ Prefix Keys In the following example, we make @kbd{C-p} a prefix key in the local keymap, in such a way that @kbd{C-p} is identical to @kbd{C-x}. Then the binding for @kbd{C-p C-f} is the function @code{find-file}, just -like @kbd{C-x C-f}. The key sequence @kbd{C-p 6} is not found in any -active keymap. +like @kbd{C-x C-f}. By contrast, the key sequence @kbd{C-p 9} is not +found in any active keymap. @example @group @@ -778,15 +778,14 @@ Prefix Keys @end group @group (keymap-local-set "C-p" ctl-x-map) - @result{} nil + @result{} (keymap #^[nil nil keymap @dots{} @end group @group -(keymap-binding "C-p C-f") +(keymap-lookup nil "C-p C-f") @result{} find-file @end group - @group -(keymap-binding "C-p 6") +(keymap-lookup nil "C-p 9") @result{} nil @end group @end example @@ -883,7 +882,7 @@ Active Keymaps then it pays attention to them. @var{position} can optionally be either an event position as returned by @code{event-start} or a buffer position, and may change the keymaps as described for -@code{keymap-binding}. +@code{keymap-lookup} (@pxref{Functions for Key Lookup, keymap-lookup}). @end defun @node Searching Keymaps @@ -1308,7 +1307,11 @@ Functions for Key Lookup @end group @end example -The @var{keymap} argument can also be a list of keymaps. +The @var{keymap} argument can be @code{nil}, meaning to look up +@var{key} in the current keymaps (as returned by +@code{current-active-maps}, @pxref{Active Keymaps}); or it can be a +keymap or a list of keymaps, meaning to look up @var{key} only in the +specified keymaps. Unlike @code{read-key-sequence}, this function does not modify the specified events in ways that discard information (@pxref{Key Sequence commit 257090b8728e6457f6d99f8f0bb32d96594d20f4 Author: Michael Albinus Date: Tue Apr 4 20:01:19 2023 +0200 Adapt EMBA scripts. * test/infra/Dockerfile.emba (emacs-gnustep): Add zlib1g-dev. Remove make instrumentation. * test/infra/gitlab-ci.yml (build-image-gnustep, test-gnustep): Uncomment. diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba index 946aa9235fb..7f12d682a13 100644 --- a/test/infra/Dockerfile.emba +++ b/test/infra/Dockerfile.emba @@ -64,14 +64,14 @@ FROM emacs-base as emacs-gnustep RUN apt-get update && \ apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \ - gnustep-devel \ + gnustep-devel zlib1g-dev \ && rm -rf /var/lib/apt/lists/* COPY . /checkout WORKDIR /checkout RUN ./autogen.sh autoconf RUN ./configure --with-ns -RUN make V=1 bootstrap +RUN make bootstrap FROM emacs-base as emacs-native-comp diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index 41778321773..de1148460aa 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -229,24 +229,22 @@ test-filenotify-gio: # This is needed in order to get a JUnit test report. make_params: '-k -C test check-expensive LOGFILES="lisp/autorevert-tests.log lisp/filenotify-tests.log"' -# The next two jobs are commented out due to bug#62210. - -# build-image-gnustep: -# stage: platform-images -# extends: [.job-template, .build-template, .gnustep-template] -# variables: -# target: emacs-gnustep +build-image-gnustep: + stage: platform-images + extends: [.job-template, .build-template, .gnustep-template] + variables: + target: emacs-gnustep -# test-gnustep: -# # This tests the GNUstep build process. -# stage: platforms -# extends: [.job-template, .gnustep-template] -# needs: -# - job: build-image-gnustep -# optional: true -# variables: -# target: emacs-gnustep -# make_params: install +test-gnustep: + # This tests the GNUstep build process. + stage: platforms + extends: [.job-template, .gnustep-template] + needs: + - job: build-image-gnustep + optional: true + variables: + target: emacs-gnustep + make_params: install # The next two jobs are commented out due to high workload on # emba.gnu.org. commit 90c07d3fdd2be9b34d34c7fa98e838a54488a997 Author: Eli Zaretskii Date: Tue Apr 4 14:22:56 2023 +0300 Another terminology fix in ELisp reference manual * doc/lispref/frames.texi (Mouse Tracking): * doc/lispref/commands.texi (Motion Events, Event Examples): 'track-mouse' is a macro, not a special form. diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 62a0939a47e..30765a7e8f7 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -1960,8 +1960,8 @@ Motion Events location outside the boundaries of the initially selected frame, in which case the list contains that frame in place of a window. -The special form @code{track-mouse} enables generation of motion -events within its body. Outside of @code{track-mouse} forms, Emacs +The @code{track-mouse} macro enables generation of motion +events within its body. Outside of @code{track-mouse} body, Emacs does not generate events for mere motion of the mouse, and these events do not appear. @xref{Mouse Tracking}. @@ -2443,7 +2443,7 @@ Event Examples The frame with input focus might not take up the entire screen, and the user might move the mouse outside the scope of the frame. Inside -the @code{track-mouse} special form, that produces an event like this: +the @code{track-mouse} macro, that produces an event like this: @smallexample (mouse-movement (# nil (563 . 205) 532301936)) diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index e0766ad0b43..7cae94d2627 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -3577,7 +3577,7 @@ Mouse Tracking @code{drag-source}. This is useful to determine if a frame is not directly visible underneath the mouse pointer. -The @code{track-mouse} form causes Emacs to generate mouse motion +The @code{track-mouse} macro causes Emacs to generate mouse motion events by binding the variable @code{track-mouse} to a non-@code{nil} value. If that variable has the special value @code{dragging}, it additionally instructs the display engine to commit a832bc7090c6f2657afaec1cf86d1444344cfa56 Author: Shynur Date: Tue Apr 4 15:07:37 2023 +0800 Correct terminology in Elisp Reference Manual * doc/lispref/functions.texi (Function Names): 'defun' is a macro, not a special form. (Bug#62661) Copyright-paperwork-exempt: yes diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index d38f6ef38bc..551e743a653 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -593,8 +593,8 @@ Function Names In practice, nearly all functions have names, and are referred to by their names. You can create a named Lisp function by defining a lambda expression and putting it in a function cell (@pxref{Function -Cells}). However, it is more common to use the @code{defun} special -form, described in the next section. +Cells}). However, it is more common to use the @code{defun} macro, +described in the next section. @ifnottex @xref{Defining Functions}. @end ifnottex commit db308233cb3d839eef0c99290c7b244194a40899 Author: Michael Albinus Date: Tue Apr 4 13:00:51 2023 +0200 Comment out GNUSTEP jobs on EMBA (again) * test/infra/gitlab-ci.yml (build-image-gnustep, test-gnustep): Comment out jobs due to bug#62210. diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index de1148460aa..41778321773 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml @@ -229,22 +229,24 @@ test-filenotify-gio: # This is needed in order to get a JUnit test report. make_params: '-k -C test check-expensive LOGFILES="lisp/autorevert-tests.log lisp/filenotify-tests.log"' -build-image-gnustep: - stage: platform-images - extends: [.job-template, .build-template, .gnustep-template] - variables: - target: emacs-gnustep +# The next two jobs are commented out due to bug#62210. -test-gnustep: - # This tests the GNUstep build process. - stage: platforms - extends: [.job-template, .gnustep-template] - needs: - - job: build-image-gnustep - optional: true - variables: - target: emacs-gnustep - make_params: install +# build-image-gnustep: +# stage: platform-images +# extends: [.job-template, .build-template, .gnustep-template] +# variables: +# target: emacs-gnustep + +# test-gnustep: +# # This tests the GNUstep build process. +# stage: platforms +# extends: [.job-template, .gnustep-template] +# needs: +# - job: build-image-gnustep +# optional: true +# variables: +# target: emacs-gnustep +# make_params: install # The next two jobs are commented out due to high workload on # emba.gnu.org. commit 8c1b10224390e6613e9a742c438c700b20bb8742 Author: Eli Zaretskii Date: Mon Apr 3 19:32:46 2023 +0300 ; * lisp/image.el (put-image): Doc fix. diff --git a/lisp/image.el b/lisp/image.el index 29c39c5dd55..41bbed5006e 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -595,8 +595,8 @@ put-image IMAGE must be an image created with `create-image' or `defimage'. IMAGE is displayed by putting an overlay into the current buffer with a `before-string' STRING that has a `display' property whose value is the -image. STRING is defaulted if you omit it. -The overlay created will have the `put-image' property set to t. +image. STRING defaults to \"x\" if it's nil or omitted. +The overlay created by this function has the `put-image' property set to t. POS may be an integer or marker. AREA is where to display the image. AREA nil or omitted means display it in the text area, a value of `left-margin' means commit eda88c63adfabcac30b1d1051b1108fe6855d153 Author: Robert Pluim Date: Mon Apr 3 14:42:54 2023 +0200 ; * doc/emacs/trouble.texi (Checklist): Minor grammar fix. diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index 0166c613144..db78895bb5b 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi @@ -1075,7 +1075,7 @@ Checklist @file{*.el} source files before triggering the error, so do that if you know how to find and load those files.) -To debug the error, we suggest to use Edebug. @xref{Edebug,, Edebug, +To debug the error, we suggest using Edebug. @xref{Edebug,, Edebug, elisp, the Emacs Lisp Reference Manual}, for information on debugging Emacs Lisp programs with the Edebug package. commit 728bc09cf3c44ea43437903c2b4ca399af5de389 Author: Mattias Engdegård Date: Mon Apr 3 12:57:54 2023 +0200 Fix regexp string escaping mistake in vhdl-mode.el (bug#62508) * lisp/progmodes/vhdl-mode.el (vhdl-compiler-alist): Quote brackets correctly. diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index b0699d8308b..45fd17f65c4 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -286,7 +286,7 @@ vhdl-compiler-alist ;; counter_rtl.vhd(29):Conditional signal assignment line__29 ("ModelSim" "vcom" "-93 -work \\1" "make" "-f \\1" nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "modelsim" - ("^\\(ERROR\\|WARNING\\|\\*\\* Error\\|\\*\\* Warning\\)[^:]*:\\( *\[[0-9]+\]\\| ([^)]+)\\)? \\([^ \t\n]+\\)(\\([0-9]+\\)):" 3 4 nil) + ("^\\(ERROR\\|WARNING\\|\\*\\* Error\\|\\*\\* Warning\\)[^:]*:\\( *\\[[0-9]+]\\| ([^)]+)\\)? \\([^ \t\n]+\\)(\\([0-9]+\\)):" 3 4 nil) ("" 0) ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat" "\\1/_primary.dat" "\\1/body.dat" downcase)) commit 479626dbac97d4415ae861c3f66fc33c5fd6fa14 Author: Kyle Meyer Date: Sun Apr 2 23:03:32 2023 -0400 Update to Org 9.6.3-2-gf2949d diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index 0ef05353341..f8894d9dc1c 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,5 +1,5 @@ % Reference Card for Org Mode -\def\orgversionnumber{9.6.2} +\def\orgversionnumber{9.6.3} \def\versionyear{2023} % latest update \input emacsver.tex diff --git a/lisp/org/ob-comint.el b/lisp/org/ob-comint.el index 54bf5127e16..adfe31c4008 100644 --- a/lisp/org/ob-comint.el +++ b/lisp/org/ob-comint.el @@ -81,19 +81,7 @@ org-babel-comint-with-output (let* ((string-buffer "") (comint-output-filter-functions (cons (lambda (text) - (setq string-buffer - (concat - string-buffer - ;; Upon concatenation, the prompt may no - ;; longer match `comint-prompt-regexp'. - ;; In particular, when the regexp has ^ - ;; and the output does not contain - ;; trailing newline. Use more reliable - ;; match to split the output later. - (replace-regexp-in-string - comint-prompt-regexp - ,org-babel-comint-prompt-separator - text)))) + (setq string-buffer (concat string-buffer text))) comint-output-filter-functions)) dangling-text) ;; got located, and save dangling text @@ -108,21 +96,28 @@ org-babel-comint-with-output (while (progn (goto-char comint-last-input-end) (not (save-excursion - (and (re-search-forward - (regexp-quote ,eoe-indicator) nil t) - (re-search-forward - comint-prompt-regexp nil t))))) + (and (re-search-forward + (regexp-quote ,eoe-indicator) nil t) + (re-search-forward + comint-prompt-regexp nil t))))) (accept-process-output (get-buffer-process (current-buffer)))) ;; replace cut dangling text (goto-char (process-mark (get-buffer-process (current-buffer)))) (insert dangling-text) - ;; Replace partially supplied input lines. - ;; This is needed when output filter spits partial lines that - ;; do not include a full prompt at a time. + ;; Filter out prompts. (setq string-buffer (replace-regexp-in-string - comint-prompt-regexp + ;; Sometimes, we get multiple agglomerated + ;; prompts together in a single output: + ;; "prompt prompt prompt output" + ;; Remove them progressively, so that + ;; possible "^" in the prompt regexp gets to + ;; work as we remove the heading prompt + ;; instance. + (if (string-prefix-p "^" comint-prompt-regexp) + (format "^\\(%s\\)+" (substring comint-prompt-regexp 1)) + comint-prompt-regexp) ,org-babel-comint-prompt-separator string-buffer)) ;; remove echo'd FULL-BODY from input diff --git a/lisp/org/org-version.el b/lisp/org/org-version.el index fd75f4785d6..43fdcb82832 100644 --- a/lisp/org/org-version.el +++ b/lisp/org/org-version.el @@ -5,13 +5,13 @@ (defun org-release () "The release version of Org. Inserted by installing Org mode or when a release is made." - (let ((org-release "9.6.2")) + (let ((org-release "9.6.3")) org-release)) ;;;###autoload (defun org-git-version () "The Git version of Org mode. Inserted by installing Org or when a release is made." - (let ((org-git-version "release_9.6.2")) + (let ((org-git-version "release_9.6.3-2-gf2949d")) org-git-version)) (provide 'org-version) diff --git a/lisp/org/org.el b/lisp/org/org.el index 1649722ab0c..be9d0e32dd0 100644 --- a/lisp/org/org.el +++ b/lisp/org/org.el @@ -9,7 +9,7 @@ ;; URL: https://orgmode.org ;; Package-Requires: ((emacs "26.1")) -;; Version: 9.6.2 +;; Version: 9.6.3 ;; This file is part of GNU Emacs. ;; @@ -3600,13 +3600,13 @@ org-highlight-latex-and-related (const :tag "Entities" entities)))) (defcustom org-hide-emphasis-markers nil - "Non-nil mean font-lock should hide the emphasis marker characters." + "Non-nil means font-lock should hide the emphasis marker characters." :group 'org-appearance :type 'boolean :safe #'booleanp) (defcustom org-hide-macro-markers nil - "Non-nil mean font-lock should hide the brackets marking macro calls." + "Non-nil means font-lock should hide the brackets marking macro calls." :group 'org-appearance :type 'boolean) @@ -3618,7 +3618,7 @@ org-pretty-entities :type 'boolean) (defcustom org-pretty-entities-include-sub-superscripts t - "Non-nil means, pretty entity display includes formatting sub/superscripts." + "Non-nil means pretty entity display includes formatting sub/superscripts." :group 'org-appearance :version "24.1" :type 'boolean) @@ -10215,7 +10215,7 @@ org-remove-timestamp-with-keyword (replace-match "") (if (and (string-match "\\S-" (buffer-substring (line-beginning-position) (point))) (equal (char-before) ?\ )) - (backward-delete-char 1) + (delete-char -1) (when (string-match "^[ \t]*$" (buffer-substring (line-beginning-position) (line-end-position))) (delete-region (line-beginning-position) @@ -12006,18 +12006,17 @@ org-fast-tag-selection (setq current nil) (when exit-after-next (setq exit-after-next 'now))) ((= c ?\t) - (condition-case nil - (unless tab-tags - (setq tab-tags - (delq nil - (mapcar (lambda (x) - (let ((item (car-safe x))) - (and (stringp item) - (list item)))) - (org--tag-add-to-alist - (with-current-buffer buf - (org-get-buffer-tags)) - table)))))) + (unless tab-tags + (setq tab-tags + (delq nil + (mapcar (lambda (x) + (let ((item (car-safe x))) + (and (stringp item) + (list item)))) + (org--tag-add-to-alist + (with-current-buffer buf + (org-get-buffer-tags)) + table))))) (setq tg (completing-read "Tag: " tab-tags)) (when (string-match "\\S-" tg) (cl-pushnew (list tg) tab-tags :test #'equal) @@ -16532,7 +16531,7 @@ org-delete-backward-char (looking-at-p ".*?|") (org-at-table-p)) (progn (forward-char -1) (org-delete-char 1)) - (backward-delete-char N) + (funcall-interactively #'backward-delete-char N) (org-fix-tags-on-the-fly)))) (defun org-delete-char (N) commit 5a1c9aace70b1f26b6cce38dbd79270c854bc080 Author: Yuan Fu Date: Sun Apr 2 15:09:41 2023 -0700 ; Add a bit more docstring to tsx-ts-mode (bug#62429) * lisp/progmodes/typescript-ts-mode.el: (tsx-ts-mode): Explain a bit more. diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 23815c79906..11f20add3ee 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -396,7 +396,10 @@ tsx-ts-mode This major mode defines two additional JSX-specific faces: `typescript-ts-jsx-attribute-face' and `typescript-ts-jsx-attribute-face' that are used for HTML tags -and attributes, respectively." +and attributes, respectively. + +The JSX-specific faces are used when `treesit-font-lock-level' is +at least 3 (which is the default value)." :group 'typescript :syntax-table typescript-ts-mode--syntax-table commit 86cf9fd932c654cc502bedf634458a918ee5e9cb Author: João Távora Date: Sun Apr 2 23:01:29 2023 +0100 Eglot: don't watch directories that don't exist project-files isn't guaranteed to return existing files, so better check if they exist because placing a watcher on them. Originally reported at: https://github.com/joaotavora/eglot/issues/1198 * lisp/progmodes/eglot.el (eglot-register-capability workspace/didChangeWatchedFiles): Check if directories exist. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 8f64f849d72..4a9209ab9b4 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -3433,8 +3433,9 @@ eglot-register-capability (unwind-protect (progn (dolist (dir dirs-to-watch) - (push (file-notify-add-watch dir '(change) #'handle-event) - (gethash id (eglot--file-watches server)))) + (when (file-readable-p dir) + (push (file-notify-add-watch dir '(change) #'handle-event) + (gethash id (eglot--file-watches server))))) (setq success `(:message ,(format "OK, watching %s directories in %s watchers" commit 82d0b6c64eaaa5d7de2bb0653cec60fabada5643 Author: Eli Zaretskii Date: Sun Apr 2 11:42:43 2023 +0300 ; * lisp/subr.el (use-dialog-box-p): Fix last change. diff --git a/lisp/subr.el b/lisp/subr.el index cf6500d32c7..131ed110149 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3538,10 +3538,9 @@ y-or-n-p-use-read-key (defvar from--tty-menu-p nil "Non-nil means the current command was invoked from a TTY menu.") (defun use-dialog-box-p () - "Say whether the current command should prompt the user via a dialog box." + "Return non-nil if the current command should prompt the user via a dialog box." (and last-input-event ; not during startup - (or (and last-nonmenu-event ; nil is listp... - (listp last-nonmenu-event)) ; invoked by a mouse event + (or (consp last-nonmenu-event) ; invoked by a mouse event from--tty-menu-p) ; invoked via TTY menu use-dialog-box)) commit 3619663f9822f7732854a13e6a890cb0925fbfaa Author: Eshel Yaron Date: Fri Mar 31 17:54:12 2023 +0300 Preserve peer information for web page in eww-readable The :peer property in eww-data affects the face of the page title in 'header-line-format' as set by 'eww-update-header-line-format'. Preserving this property in eww-readable avoids having the header line's appearance change when this command is called. * lisp/net/eww.el (eww-readable): Preserve eww-data's :peer property. (Bug#62574) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 22b078217bd..eac47e592b2 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1012,7 +1012,7 @@ eww-readable (list 'base (list (cons 'href base)) (eww-highest-readability dom)) nil (current-buffer)) - (dolist (elem '(:source :url :title :next :previous :up)) + (dolist (elem '(:source :url :title :next :previous :up :peer)) (plist-put eww-data elem (plist-get old-data elem))) (eww--after-page-change))) commit cb8d6ab648fa74f03b0ba1c5f33eb53e1e017f3a Author: Eli Zaretskii Date: Sun Apr 2 10:34:43 2023 +0300 * lisp/subr.el (use-dialog-box-p): Fix conditions for GUI dialogs. diff --git a/lisp/subr.el b/lisp/subr.el index f82826e819c..cf6500d32c7 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3540,7 +3540,8 @@ from--tty-menu-p (defun use-dialog-box-p () "Say whether the current command should prompt the user via a dialog box." (and last-input-event ; not during startup - (or (listp last-nonmenu-event) ; invoked by a mouse event + (or (and last-nonmenu-event ; nil is listp... + (listp last-nonmenu-event)) ; invoked by a mouse event from--tty-menu-p) ; invoked via TTY menu use-dialog-box)) commit fb2c44092077cfffb80ba534b70d3b462093267d Author: Yuan Fu Date: Sat Apr 1 23:14:15 2023 -0700 ; * lisp/progmodes/c-ts-mode.el (c++-ts-mode): Add some notice. diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index e2705462025..981c7766375 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -996,7 +996,11 @@ c++-ts-mode (add-to-list \\='major-mode-remap-alist \\='(c-or-c++-mode . c-or-c++-ts-mode)) -in your configuration." +in your configuration. + +Since this mode uses a parser, unbalanced brackets might cause +some breakage in indentation/fontification. Therefore, it's +recommended to enable `electric-pair-mode' with this mode." :group 'c++ :after-hook (c-ts-mode-set-modeline) commit 89e337c3fc9a51454afb86176a507f46c198be9f Author: Jim Porter Date: Sat Apr 1 10:28:02 2023 -0700 ; Make sure 'eshell-command' tests don't prompt the user * test/lisp/eshell/eshell-tests.el (eshell-test/eshell-command/background) (eshell-test/eshell-command/background-pipeline): Wait for the process to finish. diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index bf7ec0389f0..fbff51a8873 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -136,6 +136,8 @@ eshell-test/eshell-command/background ;; buffer. (eshell-command "*echo hi &") (with-current-buffer "*Eshell Async Command Output*" + (while (get-buffer-process (current-buffer)) + (accept-process-output)) (goto-char (point-min)) (should (looking-at "\\[echo\\(\\.exe\\)?\\(<[0-9]+>\\)?\\]")))))) @@ -149,6 +151,8 @@ eshell-test/eshell-command/background-pipeline ;; XXX: As above, we can't write to the current buffer here. (eshell-command "*echo hi | *cat &") (with-current-buffer "*Eshell Async Command Output*" + (while (get-buffer-process (current-buffer)) + (accept-process-output)) (goto-char (point-min)) (should (looking-at "\\[cat\\(\\.exe\\)?\\(<[0-9]+>\\)?\\]")))))) commit b39c3cd1125590bf4b77880b41ac08b29cdfcff6 Author: Michael Albinus Date: Sat Apr 1 17:04:50 2023 +0200 ; * etc/NEWS: Fix typos. diff --git a/etc/NEWS b/etc/NEWS index e43a82b1426..d3f057308dc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -795,7 +795,7 @@ part of the buffer. +++ ** New user option 'set-message-functions'. -It allows more flexible control of how echo-area message are displayed +It allows more flexible control of how echo-area messages are displayed by adding functions to this list. The default value is a list of one element: 'set-minibuffer-message', which displays echo-area messages at the end of the minibuffer text when the minibuffer is active. commit 89ac5ba11c773764f418c92ab47a237287a0d233 Author: Eli Zaretskii Date: Sat Apr 1 13:07:42 2023 +0300 Fix ModelSim error regexp in vhdl-mode * lisp/progmodes/vhdl-mode.el (vhdl-compiler-alist): Fix ModelSim error regexp. Suggested by Reto Zimmermann . (Bug#62508) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index c5ab5013fc8..b0699d8308b 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -286,7 +286,7 @@ vhdl-compiler-alist ;; counter_rtl.vhd(29):Conditional signal assignment line__29 ("ModelSim" "vcom" "-93 -work \\1" "make" "-f \\1" nil "vlib \\1; vmap \\2 \\1" "./" "work/" "Makefile" "modelsim" - ("\\(ERROR:\\|WARNING\\[[0-9]+\\]:\\|\\*\\* Error:\\|\\*\\* Warning: \\[[0-9]+\\]\\| +\\) \\([^ ]+\\)(\\([0-9]+\\)):" 2 3 nil) + ("^\\(ERROR\\|WARNING\\|\\*\\* Error\\|\\*\\* Warning\\)[^:]*:\\( *\[[0-9]+\]\\| ([^)]+)\\)? \\([^ \t\n]+\\)(\\([0-9]+\\)):" 3 4 nil) ("" 0) ("\\1/_primary.dat" "\\2/\\1.dat" "\\1/_primary.dat" "\\1/_primary.dat" "\\1/body.dat" downcase)) commit 24ed9c7ae780780338d83603c6eec2b1cecf95d5 Author: Eli Zaretskii Date: Sat Apr 1 13:00:36 2023 +0300 ; * doc/emacs/trouble.texi (Checklist): Minor copyedits (bug#62320). diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index ded9d02cf54..0166c613144 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi @@ -856,7 +856,7 @@ Checklist @cindex dribble file @cindex logging keystrokes One way to record the input to Emacs precisely is to write a dribble -file. To start the file, use the @kbd{M-x open-dribble-file} command. +file. To start the file, use the command @w{@kbd{M-x open-dribble-file}}. From then on, Emacs copies all your input to the specified dribble file until the Emacs process is killed. Be aware that sensitive information (such as passwords) may end up recorded in the dribble @@ -1071,9 +1071,13 @@ Checklist say, you must give that command and then make the bug happen). This causes the error to start the Lisp debugger, which shows you a backtrace. Copy the text of the debugger's backtrace into the bug -report. @xref{Edebug,, Edebug, elisp, the Emacs Lisp Reference -Manual}, for information on debugging Emacs Lisp programs with the -Edebug package. +report. (The backtrace is more detailed if you load the relevant Lisp +@file{*.el} source files before triggering the error, so do that if +you know how to find and load those files.) + +To debug the error, we suggest to use Edebug. @xref{Edebug,, Edebug, +elisp, the Emacs Lisp Reference Manual}, for information on debugging +Emacs Lisp programs with the Edebug package. This use of the debugger is possible only if you know how to make the bug happen again. If you can't make it happen again, at least copy commit d1d39a0f09c272a8bdea54ecd13f560bbd8264eb Author: Eli Zaretskii Date: Sat Apr 1 12:49:18 2023 +0300 Document enhancements in handling of echo-area messages * etc/NEWS: * doc/lispref/display.texi (Displaying Messages): * lisp/minibuffer.el (inhibit-message-regexps) (set-message-functions, inhibit-message, set-multi-message): Improve the documentation of functions dealing with display of echo-area messages. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 550d711c73a..85fac4b30a6 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -310,29 +310,29 @@ Displaying Messages "%s" @var{string})}. @end defun +The following facilities allow users and Lisp programs to control how +echo-area messages are displayed. + @defvar set-message-function If this variable is non-@code{nil}, it should be a function of one -argument, the text of a message to display in the echo area. This +argument, the text of a message to display in the echo area. That function will be called by @code{message} and related functions. If the function returns @code{nil}, the message is displayed in the echo -area as usual. If this function returns a string, that string is -displayed in the echo area instead of the original one. If this -function returns other non-@code{nil} values, that means the message -was already handled, so @code{message} will not display anything in -the echo area. See also @code{clear-message-function} that can be -used to clear the message displayed by this function. - -The default value is the function that displays the message at the end -of the minibuffer when the minibuffer is active. However, if the text -shown in the active minibuffer has the @code{minibuffer-message} text -property (@pxref{Special Properties}) on some character, the message -will be displayed before the first character having that property. +area as usual. If the function returns a string, that string is +displayed in the echo area @emph{instead} of the original message. If +the function returns any other non-@code{nil} value, that means the +message was already handled, so @code{message} will not display +anything in the echo area. + +The default value calls @code{set-minibuffer-message}, described +below. @end defvar @defvar clear-message-function -If this variable is non-@code{nil}, @code{message} and related -functions call it with no arguments when their argument message is -@code{nil} or the empty string. +If this variable is non-@code{nil}, it should be a function of no +arguments; @code{message} and related functions call it when their +argument message is @code{nil} or the empty string, to clear the echo +area. Usually this function is called when the next input event arrives after displaying an echo-area message. The function is expected to @@ -358,11 +358,51 @@ Displaying Messages function returns a non-@code{nil} value that is not a string, the message is considered to be handled, and no further functions in the list are called. + +The three useful functions to be put in the list that is the value of +this option are described below. @end defopt +@defun set-minibuffer-message message +This function displays @var{message} in the echo-area when the +minibuffer is not active, and at the end of the minibuffer when the +minibuffer is active. However, if the text shown in the active +minibuffer has the @code{minibuffer-message} text property +(@pxref{Special Properties}) on some character, the message will be +displayed before the first character having that property. + +This function is by default the only member of the list in +@code{set-message-functions}. +@end defun + +@vindex inhibit-message-regexps +@defun inhibit-message message +If an echo-area @var{message} matches any regexp in the list that is +the value of the user option @code{inhibit-message-regexps}, this +function suppresses the display of that message and returns a +non-@code{nil} value that is not a string. Thus, if this function is +in the list @code{set-message-functions}, the rest of the functions in +the list will not be called when @var{message} matches the regexps in +@code{inhibit-message-regexps}. To ensure a matching @var{message} +will never be displayed, make this function be the first element of +the list in @code{set-message-functions}. +@end defun + +@vindex multi-message-max +@vindex multi-message-timeout +@defun set-multi-message message +This function accumulates several echo-area messages emitted one after +another, and returns them as a single string in which individual +messages are separated by newlines. Up to @code{multi-message-max} +recent messages can be accumulated. The accumulated messages are +discarded when more than @code{multi-message-timeout} seconds have +elapsed since the time the first message was emitted. +@end defun + @defvar inhibit-message When this variable is non-@code{nil}, @code{message} and related functions -will not use the Echo Area to display messages. +will not display any messages in the Echo Area. Echo-area messages +are still logged in the @file{*Messages*} buffer, though. @end defvar @defmac with-temp-message message &rest body diff --git a/etc/NEWS b/etc/NEWS index d7a6cf7986d..e43a82b1426 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -795,13 +795,14 @@ part of the buffer. +++ ** New user option 'set-message-functions'. -It allows selecting more functions for 'set-message-function' -in addition to the default function that handles messages -in the active minibuffer. The most useful are 'inhibit-message' -that allows specifying a list of messages to inhibit via -'inhibit-message-regexps', and 'set-multi-message' that -accumulates recent messages and displays them stacked -in the echo area. +It allows more flexible control of how echo-area message are displayed +by adding functions to this list. The default value is a list of one +element: 'set-minibuffer-message', which displays echo-area messages +at the end of the minibuffer text when the minibuffer is active. +Other useful functions include 'inhibit-message', which allows +specifying, via 'inhibit-message-regexps', the list of messages whose +display shall be inhibited; and 'set-multi-message' that accumulates +recent messages and displays them stacked together. --- ** New user option 'find-library-include-other-files'. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 21d4607e7cf..be91987d635 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -862,7 +862,18 @@ set-message-functions next function in the list, and if the last function returns a string, it's displayed in the echo area. If a function returns any other non-nil value, no more functions are -called from the list, and no message will be displayed in the echo area." +called from the list, and no message will be displayed in the echo area. + +Useful functions to add to this list are: + + `inhibit-message' -- if this function is the first in the list, + messages that match the value of + `inhibit-message-regexps' will be suppressed. + `set-multi-message' -- accumulate multiple messages and display them + together as a single message. + `set-minibuffer-message' -- if the minibuffer is active, display the + message at the end of the minibuffer text + (this is the default)." :type '(choice (const :tag "No special message handling" nil) (repeat (choice (function-item :tag "Inhibit some messages" @@ -884,13 +895,18 @@ set-message-functions message) (defcustom inhibit-message-regexps nil - "List of regexps that inhibit messages by the function `inhibit-message'." + "List of regexps that inhibit messages by the function `inhibit-message'. +When the list in `set-message-functions' has `inhibit-message' as its +first element, echo-area messages which match the value of this variable +will not be displayed." :type '(repeat regexp) :version "29.1") (defun inhibit-message (message) "Don't display MESSAGE when it matches the regexp `inhibit-message-regexps'. -This function is intended to be added to `set-message-functions'." +This function is intended to be added to `set-message-functions'. +To suppress display of echo-area messages that match `inhibit-message-regexps', +make this function be the first element of `set-message-functions'." (or (and (consp inhibit-message-regexps) (string-match-p (mapconcat #'identity inhibit-message-regexps "\\|") message)) @@ -912,6 +928,10 @@ multi-message-list (defun set-multi-message (message) "Return recent messages as one string to display in the echo area. +Individual messages will be separated by a newline. +Up to `multi-message-max' messages can be accumulated, and the +accumulated messages are discarded when `multi-message-timeout' +seconds have elapsed since the first message. Note that this feature works best only when `resize-mini-windows' is at its default value `grow-only'." (let ((last-message (car multi-message-list))) commit 46209b2453b1a53fcf0019f6e1a21b7fef85bcbc Author: Eli Zaretskii Date: Sat Apr 1 09:55:29 2023 +0300 ; Fix last change * test/lisp/eshell/eshell-tests.el (eshell-test/eshell-command/background-pipeline): Fix last change. diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 8c049cb342d..bf7ec0389f0 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -150,7 +150,7 @@ eshell-test/eshell-command/background-pipeline (eshell-command "*echo hi | *cat &") (with-current-buffer "*Eshell Async Command Output*" (goto-char (point-min)) - (should (looking-at "\\[cat\\(\\.exe\\)\\(<[0-9]+>\\)?\\]")))))) + (should (looking-at "\\[cat\\(\\.exe\\)?\\(<[0-9]+>\\)?\\]")))))) (ert-deftest eshell-test/command-running-p () "Modeline should show no command running" commit 21a4ee209c19031e29e98e4308aa9d67890a0515 Author: Eli Zaretskii Date: Sat Apr 1 09:24:38 2023 +0300 Fix new Eshell tests on MS-Windows * test/lisp/eshell/eshell-tests.el (eshell-test/eshell-command/background) (eshell-test/eshell-command/background-pipeline): Allow for ".exe" in the program's name. This fixes these tests on MS-Windows. diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index b57abe3226c..8c049cb342d 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -137,7 +137,7 @@ eshell-test/eshell-command/background (eshell-command "*echo hi &") (with-current-buffer "*Eshell Async Command Output*" (goto-char (point-min)) - (should (looking-at "\\[echo\\(<[0-9]+>\\)?\\]")))))) + (should (looking-at "\\[echo\\(\\.exe\\)?\\(<[0-9]+>\\)?\\]")))))) (ert-deftest eshell-test/eshell-command/background-pipeline () "Test that `eshell-command' works for background commands. @@ -150,7 +150,7 @@ eshell-test/eshell-command/background-pipeline (eshell-command "*echo hi | *cat &") (with-current-buffer "*Eshell Async Command Output*" (goto-char (point-min)) - (should (looking-at "\\[cat\\(<[0-9]+>\\)?\\]")))))) + (should (looking-at "\\[cat\\(\\.exe\\)\\(<[0-9]+>\\)?\\]")))))) (ert-deftest eshell-test/command-running-p () "Modeline should show no command running" commit e2ebf3995d099fdd077ce0e672778850a7ad198e Author: Stefan Kangas Date: Sat Apr 1 05:10:47 2023 +0200 ; Auto-commit of loaddefs files. diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 094d6f56f3a..1f111ff556a 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -3779,8 +3779,18 @@ "cc-styles" ;;; Generated autoloads from progmodes/cc-vars.el +(autoload 'c-string-list-p "cc-vars" "\ +Return non-nil if VAL is a list of strings. + +(fn VAL)") (put 'c-basic-offset 'safe-local-variable 'integerp) (put 'c-backslash-column 'safe-local-variable 'integerp) + (put 'c-font-lock-extra-types 'safe-local-variable #'c-string-list-p) + (put 'c++-font-lock-extra-types 'safe-local-variable #'c-string-list-p) + (put 'objc-font-lock-extra-types 'safe-local-variable #'c-string-list-p) + (put 'java-font-lock-extra-types 'safe-local-variable #'c-string-list-p) + (put 'idl-font-lock-extra-types 'safe-local-variable #'c-string-list-p) + (put 'pike-font-lock-extra-types 'safe-local-variable #'c-string-list-p) (put 'c-file-style 'safe-local-variable 'string-or-null-p) (register-definition-prefixes "cc-vars" '("awk-mode-hook" "c++-" "c-" "defcustom-c-stylevar" "idl-" "java-" "objc-" "pike-")) @@ -8228,15 +8238,23 @@ 'define-global-minor-mode TURN-ON is a function that will be called with no args in every buffer and that should try to turn MODE on if applicable for that buffer. -Each of KEY VALUE is a pair of CL-style keyword arguments. :predicate -specifies which major modes the globalized minor mode should be switched on -in. As the minor mode defined by this function is always global, any -:global keyword is ignored. Other keywords have the same meaning as in -`define-minor-mode', which see. In particular, :group specifies the custom -group. The most useful keywords are those that are passed on to the -`defcustom'. It normally makes no sense to pass the :lighter or :keymap -keywords to `define-globalized-minor-mode', since these are usually passed -to the buffer-local version of the minor mode. +Each of KEY VALUE is a pair of CL-style keyword arguments. +The :predicate argument specifies in which major modes should the +globalized minor mode be switched on. The value should be t (meaning +switch on the minor mode in all major modes), nil (meaning don't +switch on in any major mode), a list of modes (meaning switch on only +in those modes and their descendants), or a list (not MODES...), +meaning switch on in any major mode except MODES. The value can also +mix all of these forms, see the info node `Defining Minor Modes' for +details. +As the minor mode defined by this function is always global, any +:global keyword is ignored. +Other keywords have the same meaning as in `define-minor-mode', +which see. In particular, :group specifies the custom group. +The most useful keywords are those that are passed on to the `defcustom'. +It normally makes no sense to pass the :lighter or :keymap keywords +to `define-globalized-minor-mode', since these are usually passed to +the buffer-local version of the minor mode. BODY contains code to execute each time the mode is enabled or disabled. It is executed after toggling the mode, and before running @@ -9210,7 +9228,6 @@ "edt-vt100" ;;; Generated autoloads from progmodes/eglot.el -(push (purecopy '(eglot 1 12)) package--builtin-versions) (autoload 'eglot "eglot" "\ Start LSP server in support of PROJECT's buffers under MANAGED-MAJOR-MODE. @@ -22410,7 +22427,7 @@ "opascal" ;;; Generated autoloads from org/org.el -(push (purecopy '(org 9 6 1)) package--builtin-versions) +(push (purecopy '(org 9 6 2)) package--builtin-versions) (autoload 'org-babel-do-load-languages "org" "\ Load the languages defined in `org-babel-load-languages'. @@ -23504,48 +23521,6 @@ "package" (autoload 'package-vc-install-selected-packages "package-vc" "\ Ensure packages specified in `package-vc-selected-packages' are installed." t) -(defvar package-vc-selected-packages 'nil "\ -List of packages that must be installed. -Each member of the list is of the form (NAME . SPEC), where NAME -is a symbol designating the package and SPEC is one of: - -- nil, if any package version can be installed; -- a version string, if that specific revision is to be installed; -- a property list, describing a package specification. Valid - key/value pairs are - - `:url' (string) - The URL of the repository used to fetch the package source. - - `:branch' (string) - If given, the name of the branch to checkout after cloning the directory. - - `:lisp-dir' (string) - The repository-relative name of the directory to use for loading the Lisp - sources. If not given, the value defaults to the root directory - of the repository. - - `:main-file' (string) - The main file of the project, relevant to gather package metadata. - If not given, the assumed default is the package name with \".el\" - appended to it. - - `:vc-backend' (symbol) - A symbol of the VC backend to use for cloning the package. The - value ought to be a member of `vc-handled-backends'. If omitted, - `vc-clone' will fall back onto the archive default or on - `package-vc-default-backend'. - - All other keys are ignored. - -This user option differs from `package-selected-packages' in that -it is meant to be specified manually. If you want to install all -the packages in the list, you cal also use -`package-vc-install-selected-packages'. - -Note that this option will not override an existing source -package installation or revert the checked out revision.") -(custom-autoload 'package-vc-selected-packages "package-vc" nil) (autoload 'package-vc-update-all "package-vc" "\ Attempt to update all installed VC packages." t) (autoload 'package-vc-update "package-vc" "\ @@ -33147,7 +33122,12 @@ "type-break" (fn)" t) (autoload 'tsx-ts-mode "typescript-ts-mode" "\ -Major mode for editing TypeScript. +Major mode for editing TSX and JSX documents. + +This major mode defines two additional JSX-specific faces: +`typescript-ts-jsx-attribute-face' and +`typescript-ts-jsx-attribute-face' that are used for HTML tags +and attributes, respectively. (fn)" t) (register-definition-prefixes "typescript-ts-mode" '("typescript-ts-mode-")) @@ -36916,7 +36896,7 @@ 'xref-pop-marker-stack Go back to the previous position in xref history. To undo, use \\[xref-go-forward]." t) (autoload 'xref-go-forward "xref" "\ -Got to the point where a previous \\[xref-go-back] was invoked." t) +Go to the point where a previous \\[xref-go-back] was invoked." t) (autoload 'xref-marker-stack-empty-p "xref" "\ Whether the xref back-history is empty.") (autoload 'xref-forward-history-empty-p "xref" "\ commit 6419d78fa6f8a7794893da5a8a5d65f75a5a29fa Author: Jim Porter Date: Thu Mar 30 17:39:24 2023 -0700 Fix using background commands in 'eshell-command' Do not merge to master. This regressed due to the patch for bug#53715, which changed how Eshell pipelines return the processes in the pipeline (bug#62556). * lisp/eshell/esh-cmd.el (eshell-eval-command): Allow process-pairs. * test/lisp/eshell/eshell-tests.el (eshell-test/eshell-command/simple) (eshell-test/eshell-command/pipeline) (eshell-test/eshell-command/background) (eshell-test/eshell-command/background-pipeline): New tests. diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index f4ac384ccc5..706477a5f45 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -1032,18 +1032,20 @@ eshell-eval-command (setq eshell-current-command command) (let* ((delim (catch 'eshell-incomplete (eshell-resume-eval))) - (val (car-safe delim))) + (val (car-safe delim)) + (val-is-process (or (eshell-processp val) + (eshell-process-pair-p val)))) ;; If the return value of `eshell-resume-eval' is wrapped in a ;; list, it indicates that the command was run asynchronously. ;; In that case, unwrap the value before checking the delimiter ;; value. (if (and val - (not (eshell-processp val)) + (not val-is-process) (not (eq val t))) (error "Unmatched delimiter: %S" val) ;; Eshell-command expect a list like () to know if the ;; command should be async or not. - (or (and (eshell-processp val) delim) val))))) + (or (and val-is-process delim) val))))) (defun eshell-resume-command (proc status) "Resume the current command when a process ends." diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index 3c4a8ec97ea..b57abe3226c 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -105,6 +105,53 @@ eshell-test/lisp-reset-in-pipeline (format template "format \"%s\" eshell-in-pipeline-p") "nil"))) +(ert-deftest eshell-test/eshell-command/simple () + "Test that the `eshell-command' function writes to the current buffer." + (skip-unless (executable-find "echo")) + (ert-with-temp-directory eshell-directory-name + (let ((eshell-history-file-name nil)) + (with-temp-buffer + (eshell-command "*echo hi" t) + (should (equal (buffer-string) "hi\n")))))) + +(ert-deftest eshell-test/eshell-command/pipeline () + "Test that the `eshell-command' function writes to the current buffer. +This test uses a pipeline for the command." + (skip-unless (and (executable-find "echo") + (executable-find "cat"))) + (ert-with-temp-directory eshell-directory-name + (let ((eshell-history-file-name nil)) + (with-temp-buffer + (eshell-command "*echo hi | *cat" t) + (should (equal (buffer-string) "hi\n")))))) + +(ert-deftest eshell-test/eshell-command/background () + "Test that `eshell-command' works for background commands." + (skip-unless (executable-find "echo")) + (ert-with-temp-directory eshell-directory-name + (let ((eshell-history-file-name nil)) + ;; XXX: We can't write to the current buffer here, since + ;; `eshell-command' will produce an invalid command in that + ;; case. Just make sure the command runs and produces an output + ;; buffer. + (eshell-command "*echo hi &") + (with-current-buffer "*Eshell Async Command Output*" + (goto-char (point-min)) + (should (looking-at "\\[echo\\(<[0-9]+>\\)?\\]")))))) + +(ert-deftest eshell-test/eshell-command/background-pipeline () + "Test that `eshell-command' works for background commands. +This test uses a pipeline for the command." + (skip-unless (and (executable-find "echo") + (executable-find "cat"))) + (ert-with-temp-directory eshell-directory-name + (let ((eshell-history-file-name nil)) + ;; XXX: As above, we can't write to the current buffer here. + (eshell-command "*echo hi | *cat &") + (with-current-buffer "*Eshell Async Command Output*" + (goto-char (point-min)) + (should (looking-at "\\[cat\\(<[0-9]+>\\)?\\]")))))) + (ert-deftest eshell-test/command-running-p () "Modeline should show no command running" (with-temp-eshell