commit 101f3cf5b9b5600147d4406c3be8daf174e1a543 (HEAD, refs/remotes/origin/master) Author: Sean Whitton Date: Sun Sep 18 14:47:23 2022 -0700 Add support for user edits to VC command arguments * lisp/vc/vc-dispatcher.el (vc-pre-command-functions): New hook. (vc-want-edit-command-p): New variable. (vc-do-command): If vc-want-edit-command-p is non-nil, prompt the user to edit the VC command & arguments before execution. Run the new hook. (vc-do-async-command): Use the new hook to insert into BUFFER the command that's next to be run. * lisp/vc/vc-git.el (vc-git--pushpull): Drop prompting code. Bind vc-want-edit-command-p so that vc-do-command handles the prompting. Use the new hook to update compile-command with the edited command. * lisp/vc/vc.el (vc-print-branch-log): A non-nil prefix argument now means vc-want-edit-command-p is bound to a non-nil value (bug#57807). diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 88bf6627ae..459c2ae103 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -156,6 +156,9 @@ BEWARE: Despite its name, this variable is not itself a hook!") (defvar vc-parent-buffer-name nil) (put 'vc-parent-buffer-name 'permanent-local t) +(defvar vc-want-edit-command-p nil + "If non-nil, let user edit the VC shell command before running it.") + ;; Common command execution logic (defun vc-process-filter (p s) @@ -262,6 +265,12 @@ CODE should be a function of no arguments." (declare (indent 0) (debug (def-body))) `(vc-exec-after (lambda () ,@body))) +(defvar vc-pre-command-functions nil + "Hook run at the beginning of `vc-do-command'. +Each function is called inside the buffer in which the command +will be run and is passed 3 arguments: the COMMAND, the FILES and +the FLAGS.") + (defvar vc-post-command-functions nil "Hook run at the end of `vc-do-command'. Each function is called inside the buffer in which the command was run @@ -296,8 +305,27 @@ FILE-OR-LIST is the name of a working file; it may be a list of files or be nil (to execute commands that don't expect a file name or set of files). If an optional list of FLAGS is present, that is inserted into the command line before the filename. + +If `vc-want-edit-command-p' is non-nil, prompt the user to edit +COMMAND and FLAGS before execution. + Return the return value of the slave command in the synchronous case, and the process object in the asynchronous case." + (when vc-want-edit-command-p + (let* ((files-separator-p (string= "--" (car (last flags)))) + (edited (split-string-and-unquote + (read-shell-command + (format "Edit VC command & arguments%s: " + (if file-or-list + " (files list to be appended)" + "")) + (combine-and-quote-strings + (cons command (remq nil (if files-separator-p + (butlast flags) + flags)))))))) + (setq command (car edited) + flags (nconc (cdr edited) + (and files-separator-p '("--")))))) (when vc-tor (push command flags) (setq command "torsocks")) @@ -327,6 +355,8 @@ case, and the process object in the asynchronous case." (string= (buffer-name) buffer)) (eq buffer (current-buffer))) (vc-setup-buffer buffer)) + (run-hook-with-args 'vc-pre-command-functions + command file-or-list flags) ;; If there's some previous async process still running, just kill it. (let ((squeezed (remq nil flags)) (inhibit-read-only t) @@ -386,22 +416,25 @@ Send the output to BUFFER, which should be a buffer or the name of a buffer, which is created. ROOT should be the directory in which the command should be run. Display the buffer in some window, but don't select it." - (let* ((dir default-directory) - (inhibit-read-only t) - window new-window-start) + (letrec ((dir default-directory) + (inhibit-read-only t) + (fun (lambda (command _ args) + (remove-hook 'vc-pre-command-functions fun) + (goto-char (point-max)) + (unless (eq (point) (point-min)) + (insert " \n")) + (setq new-window-start (point)) + (insert "Running \"" command) + (dolist (arg args) + (insert " " arg)) + (insert "\"...\n"))) + (window nil) (new-window-start nil)) (setq buffer (get-buffer-create buffer)) (if (get-buffer-process buffer) (error "Another VC action on %s is running" root)) (with-current-buffer buffer (setq default-directory root) - (goto-char (point-max)) - (unless (eq (point) (point-min)) - (insert " \n")) - (setq new-window-start (point)) - (insert "Running \"" command) - (dolist (arg args) - (insert " " arg)) - (insert "\"...\n") + (add-hook 'vc-pre-command-functions fun) ;; Run in the original working directory. (let ((default-directory dir)) (apply #'vc-do-command t 'async command nil args))) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index a5d12f03bc..2228cf8665 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1089,35 +1089,30 @@ It is based on `log-edit-mode', and has Git-specific extensions." (declare-function vc-compilation-mode "vc-dispatcher" (backend)) (defvar compilation-directory) (defvar compilation-arguments) +(defvar vc-want-edit-command-p) (defun vc-git--pushpull (command prompt extra-args) "Run COMMAND (a string; either push or pull) on the current Git branch. If PROMPT is non-nil, prompt for the Git command to run." (let* ((root (vc-git-root default-directory)) (buffer (format "*vc-git : %s*" (expand-file-name root))) - (git-program vc-git-program) - args) - ;; If necessary, prompt for the exact command. - ;; TODO if pushing, prompt if no default push location - cf bzr. - (when prompt - (setq args (split-string - (read-shell-command - (format "Git %s command: " command) - (format "%s %s" git-program command) - 'vc-git-history) - " " t)) - (setq git-program (car args) - command (cadr args) - args (cddr args))) - (setq args (nconc args extra-args)) + ;; TODO if pushing, prompt if no default push location - cf bzr. + (vc-want-edit-command-p prompt)) (require 'vc-dispatcher) - (apply #'vc-do-async-command buffer root git-program command args) + (when vc-want-edit-command-p + (with-current-buffer (get-buffer-create buffer) + (add-hook 'vc-pre-command-functions + (pcase-lambda (_ _ `(,new-command . ,new-args)) + (setq command new-command extra-args new-args)) + nil t))) + (apply #'vc-do-async-command + buffer root vc-git-program command extra-args) (with-current-buffer buffer (vc-run-delayed (vc-compilation-mode 'git) (setq-local compile-command - (concat git-program " " command " " - (mapconcat #'identity args " "))) + (concat vc-git-program " " command " " + (mapconcat #'identity extra-args " "))) (setq-local compilation-directory root) ;; Either set `compilation-buffer-name-function' locally to nil ;; or use `compilation-arguments' to set `name-function'. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 6ee6e36a04..a45e0e0c52 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1046,6 +1046,7 @@ Within directories, only files already under version control are noticed." (defvar log-edit-vc-backend) (defvar diff-vc-backend) (defvar diff-vc-revisions) +(defvar vc-want-edit-command-p) (defun vc-deduce-backend () (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) @@ -2744,17 +2745,26 @@ with its diffs (if the underlying VCS supports that)." (setq vc-parent-buffer-name nil))) ;;;###autoload -(defun vc-print-branch-log (branch) - "Show the change log for BRANCH root in a window." +(defun vc-print-branch-log (branch &optional arg) + "Show the change log for BRANCH root in a window. +Optional prefix ARG non-nil requests an opportunity for the user +to edit the VC shell command that will be run to generate the +log." + ;; The original motivation for ARG was to make it possible to + ;; produce a log of more than one Git branch without modifying the + ;; print-log VC API. The user can append the other branches to the + ;; command line arguments to 'git log'. See bug#57807. (interactive (let* ((backend (vc-responsible-backend default-directory)) (rootdir (vc-call-backend backend 'root default-directory))) (list - (vc-read-revision "Branch to log: " (list rootdir) backend)))) + (vc-read-revision "Branch to log: " (list rootdir) backend) + current-prefix-arg))) (when (equal branch "") (error "No branch specified")) (let* ((backend (vc-responsible-backend default-directory)) - (rootdir (vc-call-backend backend 'root default-directory))) + (rootdir (vc-call-backend backend 'root default-directory)) + (vc-want-edit-command-p arg)) (vc-print-log-internal backend (list rootdir) branch t (when (> vc-log-show-limit 0) vc-log-show-limit)))) commit 447ff572be1019249afb2c67411d4a5bdb0a4407 Author: Stefan Kangas Date: Wed Sep 21 18:02:51 2022 +0200 Prefer command remapping in image-dired-minor-mode * lisp/image/image-dired-dired.el (image-dired-minor-mode-map): Prefer command remapping. (image-dired-minor-mode): Improve docstring. diff --git a/lisp/image/image-dired-dired.el b/lisp/image/image-dired-dired.el index ba3145c702..8c50691f2e 100644 --- a/lisp/image/image-dired-dired.el +++ b/lisp/image/image-dired-dired.el @@ -200,12 +200,8 @@ With prefix argument, move ARG lines." (defvar-keymap image-dired-minor-mode-map :doc "Keymap for `image-dired-minor-mode'." - ;; Hijack previous and next line movement. Let C-p and C-b be - ;; though... - "p" #'image-dired-dired-previous-line - "n" #'image-dired-dired-next-line - "" #'image-dired-dired-previous-line - "" #'image-dired-dired-next-line + " " #'image-dired-dired-previous-line + " " #'image-dired-dired-next-line "C-S-n" #'image-dired-next-line-and-display "C-S-p" #'image-dired-previous-line-and-display @@ -252,8 +248,8 @@ With prefix argument, move ARG lines." ;;;###autoload (define-minor-mode image-dired-minor-mode "Setup easy-to-use keybindings for the commands to be used in Dired mode. -Note that n, p and and will be hijacked and bound to -`image-dired-dired-next-line' and `image-dired-dired-previous-line'." + +\\{image-dired-minor-mode-map}" :keymap image-dired-minor-mode-map) (declare-function clear-image-cache "image.c" (&optional filter)) commit 080289a922e30adf894a0b8539607ac8f7829674 Author: Stefan Kangas Date: Wed Sep 21 17:38:30 2022 +0200 Obsolete image-mode--images-in-directory * lisp/image-mode.el (image-mode--images-in-directory): Make unused function obsolete. diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 0f1c490159..a4c292f2b6 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -1369,16 +1369,6 @@ If no such buffer exists, it will be opened." (message "%s%s" (capitalize (substring string 0 1)) (substring string 1))))) -(defun image-mode--images-in-directory (file) - (let* ((dir (file-name-directory buffer-file-name)) - (files (directory-files dir nil - (image-file-name-regexp) t))) - ;; Add the current file to the list of images if necessary, in - ;; case it does not match `image-file-name-regexp'. - (unless (member file files) - (push file files)) - (sort files 'string-lessp))) - ;;; Support for bookmark.el (declare-function bookmark-make-record-default @@ -1631,6 +1621,17 @@ ROTATION should be in degrees." image--transform-smoothing nil) (image-toggle-display-image)) +(defun image-mode--images-in-directory (file) + (declare (obsolete nil "29.1")) + (let* ((dir (file-name-directory buffer-file-name)) + (files (directory-files dir nil + (image-file-name-regexp) t))) + ;; Add the current file to the list of images if necessary, in + ;; case it does not match `image-file-name-regexp'. + (unless (member file files) + (push file files)) + (sort files 'string-lessp))) + (define-obsolete-function-alias 'image-transform-original #'image-transform-reset-to-original "29.1") (define-obsolete-function-alias 'image-transform-reset #'image-transform-reset-to-initial "29.1") commit 69fab1589a834562c6a92508867e836215e91fca Author: Robert Pluim Date: Wed Sep 21 17:18:34 2022 +0200 Update version tag of rmail-retry-ignored-headers * lisp/mail/rmail.el (rmail-retry-ignored-headers): Set :version to "29.1". diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 9cc097d28d..812e9a201b 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -382,7 +382,7 @@ If nil, display all header fields except those matched by "Headers that should be stripped when retrying a failed message." :type '(choice regexp (const :value nil :tag "None")) :group 'rmail-headers - :version "23.2") + :version "29.1") ;;;###autoload (defcustom rmail-highlighted-headers (purecopy "^From:\\|^Subject:") commit 5f6e1c059c601a1be1981347b29604eda2e2f385 Author: Eli Zaretskii Date: Wed Sep 21 17:18:40 2022 +0300 ; * lisp/emacs-lisp/gv.el (gv-synthetic-place): Doc fix. diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index d4aed3ac39..ade8064114 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -540,8 +540,10 @@ The return value is the last VAL in the list. "Special place described by its setter and getter. GETTER and SETTER (typically obtained via `gv-letplace') get and set that place. I.e. this function allows you to do the -\"reverse\" of what `gv-letplace' does. This function only makes -sense when used in a place." +\"reverse\" of what `gv-letplace' does. + +This function is only useful when used in conjunction with +generalized variables in place forms." (declare (gv-expander funcall) (compiler-macro (lambda (_) getter))) (ignore setter) getter) commit 661be73b5eb148a6cd6d79837487375cfd422d4d Author: Stefan Kangas Date: Wed Sep 21 15:13:40 2022 +0200 * test/lisp/image/image-dired-util-tests.el: New file. diff --git a/test/lisp/image/image-dired-util-tests.el b/test/lisp/image/image-dired-util-tests.el new file mode 100644 index 0000000000..547e391401 --- /dev/null +++ b/test/lisp/image/image-dired-util-tests.el @@ -0,0 +1,40 @@ +;;; image-dired-util-tests.el --- Tests for image-dired.el -*- lexical-binding: t -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Code: + +(require 'ert) +(require 'image-dired) +(require 'image-dired-util) + +(ert-deftest image-dired-thumb-name () + (let ((image-dired-thumbnail-storage 'standard)) + (should (file-name-absolute-p (image-dired-thumb-name "foo.jpg"))) + (should (equal (file-name-nondirectory (image-dired-thumb-name "foo.jpg")) + "4abfc97f9a5d3c4c519bfb23e4da8b90.png"))) + (let ((image-dired-thumbnail-storage 'image-dired)) + (should (file-name-absolute-p (image-dired-thumb-name "foo.jpg"))) + (should (equal (file-name-nondirectory (image-dired-thumb-name "foo.jpg")) + "foo_5baffb8d7984b3088db58efd7d8909c5.thumb.jpg"))) + (let ((image-dired-thumbnail-storage 'per-directory)) + (should (file-name-absolute-p (image-dired-thumb-name "foo.jpg"))) + (should (equal (file-name-nondirectory (image-dired-thumb-name "foo.jpg")) + "foo.thumb.jpg")))) + +;;; image-dired-util-tests.el ends here commit 13bd79e34fc6085410057f669cea435f2d1d046a Author: Richard Stallman Date: Wed Sep 21 08:43:29 2022 -0400 Add more headers to default value of rmail-retry-ignored-headers. * rmail.el (rmail-retry-ignored-headers): Add more headers to default. Don't bother with `purecopy'. Split value readably. diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index fed0a2057b..9cc097d28d 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -372,11 +372,17 @@ If nil, display all header fields except those matched by :group 'rmail-headers) ;;;###autoload -(defcustom rmail-retry-ignored-headers (purecopy "^x-authentication-warning:\\|^x-detected-operating-system:\\|^x-spam[-a-z]*:\\|content-type:\\|content-transfer-encoding:\\|mime-version:\\|message-id:") +(defcustom rmail-retry-ignored-headers + (concat "^x-authentication-warning:\\|^x-detected-operating-system:\\|" + "^x-spam[-a-z]*:\\|^arc-.*:\\|" + "^content-type:\\|^content-transfer-encoding:\\|" + "^mime-version:\\|^message-id:\\|^x-google-smtp-source:\\|" + "^x-received:\\|^received-spf:\\|" + "^authentication-results:\\|^dkim-signature:") "Headers that should be stripped when retrying a failed message." :type '(choice regexp (const :value nil :tag "None")) :group 'rmail-headers - :version "23.2") ; added x-detected-operating-system, x-spam + :version "23.2") ;;;###autoload (defcustom rmail-highlighted-headers (purecopy "^From:\\|^Subject:") commit fa37deba2eaca900fa3da6624c287ddec1fa61c4 Author: Stefan Kangas Date: Wed Sep 21 14:22:26 2022 +0200 ; Explicitly declare linum-mode obsolete * lisp/obsolete/linum.el (linum-mode, global-linum-mode): Explicitly declare obsolete to warn the user, and recommend using 'display-line-numbers-mode' instead. Suggested by Philip Kaludercic . diff --git a/lisp/obsolete/linum.el b/lisp/obsolete/linum.el index 017c06e426..c6ce3d6d11 100644 --- a/lisp/obsolete/linum.el +++ b/lisp/obsolete/linum.el @@ -248,6 +248,9 @@ Linum mode is a buffer-local minor mode." (defconst linum-version "0.9x") (make-obsolete-variable 'linum-version 'emacs-version "28.1") +(make-obsolete 'linum-mode #'display-line-numbers-mode "29.1") +(make-obsolete 'global-linum-mode #'global-display-line-numbers-mode "29.1") + (provide 'linum) ;;; linum.el ends here commit b0a85111e5e9c9aa8802a359b19034e5e88cd22d Author: Stefan Kangas Date: Wed Sep 21 14:00:23 2022 +0200 Add new function xdg-session-type to xdg.el * lisp/xdg.el (xdg-session-type): New function. diff --git a/etc/NEWS b/etc/NEWS index 97174ba7a2..398cc2598e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3575,6 +3575,12 @@ identify the current desktop environment. (This variable was introduced in XDG Desktop Entry Specification version 1.2.) +--- +*** New function 'xdg-session-type'. +It returns the 'XDG_SESSION_TYPE' environment variable. (This is not +part of any official standard; see the man page pam_systemd(8) for +more information.) + +++ ** New macro 'with-delayed-message'. This macro is like 'progn', but will output the specified message if diff --git a/lisp/xdg.el b/lisp/xdg.el index 5d60aa2f28..82f1f07df5 100644 --- a/lisp/xdg.el +++ b/lisp/xdg.el @@ -30,6 +30,7 @@ ;; - Thumbnail Managing Standard ;; - xdg-user-dirs configuration ;; - Desktop Entry Specification +;; - Unofficial extension $XDG_SESSION_TYPE from systemd ;;; Code: @@ -397,6 +398,18 @@ Results are cached in `xdg-mime-table'." (put 'xdg-mime-table 'mtime (current-time))) (puthash subtype (delq nil files) (cdr (assoc type xdg-mime-table))))))) + +;; Unofficial extension from systemd. + +(defun xdg-session-type () + "Return the value of $XDG_SESSION_TYPE. +Should be one of \"unspecified\", \"tty\", \"x11\", \"wayland\", +or \"mir\". + +This is not part of any official Freedesktop.org standard, but is +documented in the man page `pam_systemd'." + (getenv "XDG_SESSION_TYPE")) + (provide 'xdg) ;;; xdg.el ends here commit 7a36828dc37e3dd79367e35664f5ae5349b278f0 Author: Thuna Date: Wed Sep 21 13:51:53 2022 +0200 Correct the usage of `image-file-name-regexps' * lisp/image-file.el (image-file-name-regexp): Treat `image-file-name-regexps' as a list of regexps (as documented) in addition to a regexp string (bug#57971). Copyright-paperwork-exempt: yes diff --git a/lisp/image-file.el b/lisp/image-file.el index 0ed88e8e74..63f9e1100c 100644 --- a/lisp/image-file.el +++ b/lisp/image-file.el @@ -91,9 +91,10 @@ the variable is set using \\[customize]." "\\'")))) (mapconcat #'identity - (delq nil (list exts-regexp - image-file-name-regexps - (car (rassq 'imagemagick image-type-file-name-regexps)))) + (delq nil + (nconc (list exts-regexp + (car (rassq 'imagemagick image-type-file-name-regexps))) + (ensure-list image-file-name-regexps))) "\\|"))) commit 3ed9a1b0be024523703397b91c1b2ba66d848596 Author: Po Lu Date: Wed Sep 21 19:49:31 2022 +0800 Fix handling of nil device names * lisp/frame.el (device-class): * lisp/term/pgtk-win.el (pgtk-device-class): * lisp/term/x-win.el (x-device-class): Handle `nil' correctly. (bug#57969) diff --git a/lisp/frame.el b/lisp/frame.el index 6bedffc358..1d7784dc76 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -2516,6 +2516,7 @@ symbols." ((eq frame-type 'pgtk) (pgtk-device-class name)) (t (cond + ((not name) nil) ((string= name "Virtual core pointer") 'core-pointer) ((string= name "Virtual core keyboard") diff --git a/lisp/term/pgtk-win.el b/lisp/term/pgtk-win.el index b93e259d82..20f1573916 100644 --- a/lisp/term/pgtk-win.el +++ b/lisp/term/pgtk-win.el @@ -371,6 +371,7 @@ This uses `icon-map-list' to map icon file names to stock icon names." "Return the device class of NAME. Users should not call this function; see `device-class' instead." (cond + ((not name) nil) ((string-match-p "XTEST" name) 'test) ((string= "Virtual core pointer" name) 'core-pointer) ((string= "Virtual core keyboard" name) 'core-keyboard) diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 38266baa96..9d3e780365 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -1573,41 +1573,42 @@ frames on all displays." (defun x-device-class (name) "Return the device class of NAME. Users should not call this function; see `device-class' instead." - (let ((downcased-name (downcase name))) - (cond - ((string-match-p "XTEST" name) 'test) - ((string= "Virtual core pointer" name) 'core-pointer) - ((string= "Virtual core keyboard" name) 'core-keyboard) - ((string-match-p "eraser" downcased-name) 'eraser) - ((string-match-p " pad" downcased-name) 'pad) - ((or (or (string-match-p "wacom" downcased-name) - (string-match-p "pen" downcased-name)) - (string-match-p "stylus" downcased-name)) - 'pen) - ((or (string-prefix-p "xwayland-touch:" name) - (string-match-p "touchscreen" downcased-name)) - 'touchscreen) - ((or (string-match-p "trackpoint" downcased-name) - (string-match-p "stick" downcased-name)) - 'trackpoint) - ((or (string-match-p "mouse" downcased-name) - (string-match-p "optical" downcased-name) - (string-match-p "pointer" downcased-name)) - 'mouse) - ((string-match-p "cursor" downcased-name) 'puck) - ((or (string-match-p "keyboard" downcased-name) - ;; One of my cheap keyboards is really named this... - (string= name "USB USB Keykoard")) - 'keyboard) - ((string-match-p "button" downcased-name) 'power-button) - ((string-match-p "touchpad" downcased-name) 'touchpad) - ((or (string-match-p "midi" downcased-name) - (string-match-p "piano" downcased-name)) - 'piano) - ((or (string-match-p "wskbd" downcased-name) ; NetBSD/OpenBSD - (and (string-match-p "/dev" downcased-name) - (string-match-p "kbd" downcased-name))) - 'keyboard)))) + (and name + (let ((downcased-name (downcase name))) + (cond + ((string-match-p "XTEST" name) 'test) + ((string= "Virtual core pointer" name) 'core-pointer) + ((string= "Virtual core keyboard" name) 'core-keyboard) + ((string-match-p "eraser" downcased-name) 'eraser) + ((string-match-p " pad" downcased-name) 'pad) + ((or (or (string-match-p "wacom" downcased-name) + (string-match-p "pen" downcased-name)) + (string-match-p "stylus" downcased-name)) + 'pen) + ((or (string-prefix-p "xwayland-touch:" name) + (string-match-p "touchscreen" downcased-name)) + 'touchscreen) + ((or (string-match-p "trackpoint" downcased-name) + (string-match-p "stick" downcased-name)) + 'trackpoint) + ((or (string-match-p "mouse" downcased-name) + (string-match-p "optical" downcased-name) + (string-match-p "pointer" downcased-name)) + 'mouse) + ((string-match-p "cursor" downcased-name) 'puck) + ((or (string-match-p "keyboard" downcased-name) + ;; One of my cheap keyboards is really named this... + (string= name "USB USB Keykoard")) + 'keyboard) + ((string-match-p "button" downcased-name) 'power-button) + ((string-match-p "touchpad" downcased-name) 'touchpad) + ((or (string-match-p "midi" downcased-name) + (string-match-p "piano" downcased-name)) + 'piano) + ((or (string-match-p "wskbd" downcased-name) ; NetBSD/OpenBSD + (and (string-match-p "/dev" downcased-name) + (string-match-p "kbd" downcased-name))) + 'keyboard))))) (setq x-dnd-movement-function #'x-dnd-movement) (setq x-dnd-unsupported-drop-function #'x-dnd-handle-unsupported-drop) commit 517268d943b95f0cb3bd7dfa11e02ade06d3abf4 Author: Po Lu Date: Wed Sep 21 19:31:45 2022 +0800 Small adjustments to precision pixel scrolling * lisp/pixel-scroll.el (pixel-scroll-precision-interpolation-factor): Adjust for increased accuracy. (pixel-scroll-precision-interpolate): Slightly decrease accuracy in exchange for consing less floats. (pixel-scroll-interpolate-down, pixel-scroll-interpolate-up): Fix usage of function. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index a04a34b01e..10da9cb9ab 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -193,7 +193,7 @@ Nil means to not interpolate such scrolls." :type 'float :version "29.1") -(defcustom pixel-scroll-precision-interpolation-factor 4.0 +(defcustom pixel-scroll-precision-interpolation-factor 2.0 "A factor to apply to the distance of an interpolated scroll." :group 'mouse :type 'float @@ -635,18 +635,19 @@ to `pixel-scroll-precision-interpolation-factor'." (selected-window)) (redisplay t)) (sleep-for between-scroll) - (setq time-elapsed (+ time-elapsed - (- (float-time) last-time)) - percentage (/ time-elapsed total-time)) - (let* ((throw-on-input nil) - (absolute-delta (* (min 1 percentage) delta factor)) - (relative-delta (abs - (round (- absolute-delta last-delta))))) - (setq last-delta absolute-delta) - (if (< delta 0) - (pixel-scroll-precision-scroll-down relative-delta) - (pixel-scroll-precision-scroll-up relative-delta))) - (setq last-time (float-time))) + (let ((time (float-time))) + (setq time-elapsed (+ time-elapsed + (- time last-time)) + percentage (/ time-elapsed total-time)) + (let* ((throw-on-input nil) + (absolute-delta (* (min 1 percentage) delta factor)) + (relative-delta (abs + (round (- absolute-delta last-delta))))) + (setq last-delta absolute-delta) + (if (< delta 0) + (pixel-scroll-precision-scroll-down relative-delta) + (pixel-scroll-precision-scroll-up relative-delta))) + (setq last-time time))) (if (< percentage 1) (progn (set-window-parameter nil 'interpolated-scroll-remainder @@ -830,7 +831,7 @@ It is a vector of the form [ VELOCITY TIME SIGN ]." ;; interpolation factor, ;; since we want exactly 1 ;; page to be scrolled. - 0) + nil 1) (cua-scroll-up))) (defun pixel-scroll-interpolate-up () @@ -838,7 +839,7 @@ It is a vector of the form [ VELOCITY TIME SIGN ]." (interactive) (if pixel-scroll-precision-interpolate-page (pixel-scroll-precision-interpolate (window-text-height nil t) - 0) + nil 1) (cua-scroll-down))) ;;;###autoload commit 61e4964a8ad2e911928136c1f1667eb5ff55149e Author: Po Lu Date: Wed Sep 21 19:24:06 2022 +0800 Improve scroll interpolation in pixel-s-precision-mode * lisp/pixel-scroll.el (pixel-scroll-precision-interpolate): New arg FACTOR. Use it to determine the interpolation factor if non-nil. Also, clear scroll remainder if direction changes, and determine deltas based on the absolute amount of time passed. (bug#57967) (pixel-scroll-interpolate-down, pixel-scroll-interpolate-up): Pass factor of 0 to scroll exactly 1 page. diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index c4d59728ae..a04a34b01e 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -603,19 +603,25 @@ the height of the current window." (when (< delta 0) (set-window-vscroll nil (- delta) t t))))) -(defun pixel-scroll-precision-interpolate (delta &optional old-window) +(defun pixel-scroll-precision-interpolate (delta &optional old-window factor) "Interpolate a scroll of DELTA pixels. OLD-WINDOW is the window which will be selected when redisplay takes place, or nil for the current window. This results in the -window being scrolled by DELTA pixels with an animation." +window being scrolled by DELTA pixels with an animation. FACTOR +is a scale by which DELTA will be modified. If nil, it defaults +to `pixel-scroll-precision-interpolation-factor'." (let ((percentage 0) (total-time pixel-scroll-precision-interpolation-total-time) - (factor pixel-scroll-precision-interpolation-factor) + (factor (or factor pixel-scroll-precision-interpolation-factor)) (last-time (float-time)) - (time-elapsed 0.0) + (time-elapsed 0) (between-scroll pixel-scroll-precision-interpolation-between-scroll) (rem (window-parameter nil 'interpolated-scroll-remainder)) - (time (window-parameter nil 'interpolated-scroll-remainder-time))) + (time (window-parameter nil 'interpolated-scroll-remainder-time)) + (last-delta 0)) + (unless (or (not rem) (eq (< delta 0) (< rem 0))) + ;; The direction changed. Clear the remainder. + (setq rem nil)) (when (and rem time (< (- (float-time) time) 1.0) (eq (< delta 0) (< rem 0))) @@ -632,14 +638,14 @@ window being scrolled by DELTA pixels with an animation." (setq time-elapsed (+ time-elapsed (- (float-time) last-time)) percentage (/ time-elapsed total-time)) - (let ((throw-on-input nil)) + (let* ((throw-on-input nil) + (absolute-delta (* (min 1 percentage) delta factor)) + (relative-delta (abs + (round (- absolute-delta last-delta))))) + (setq last-delta absolute-delta) (if (< delta 0) - (pixel-scroll-precision-scroll-down - (ceiling (abs (* (* delta factor) - (/ between-scroll total-time))))) - (pixel-scroll-precision-scroll-up - (ceiling (* (* delta factor) - (/ between-scroll total-time)))))) + (pixel-scroll-precision-scroll-down relative-delta) + (pixel-scroll-precision-scroll-up relative-delta))) (setq last-time (float-time))) (if (< percentage 1) (progn @@ -819,14 +825,20 @@ It is a vector of the form [ VELOCITY TIME SIGN ]." "Interpolate a scroll downwards by one page." (interactive) (if pixel-scroll-precision-interpolate-page - (pixel-scroll-precision-interpolate (- (window-text-height nil t))) + (pixel-scroll-precision-interpolate (- (window-text-height nil t)) + ;; Don't use an + ;; interpolation factor, + ;; since we want exactly 1 + ;; page to be scrolled. + 0) (cua-scroll-up))) (defun pixel-scroll-interpolate-up () "Interpolate a scroll upwards by one page." (interactive) (if pixel-scroll-precision-interpolate-page - (pixel-scroll-precision-interpolate (window-text-height nil t)) + (pixel-scroll-precision-interpolate (window-text-height nil t) + 0) (cua-scroll-down))) ;;;###autoload commit 760df6a5f1d3022f303416a03215c015216abb30 Author: Lars Ingebrigtsen Date: Wed Sep 21 13:13:39 2022 +0200 Make emacs-build-description into a command * lisp/mail/emacsbug.el (report-emacs-bug, submit-emacs-patch): Adjust callers. (emacs-build-description): Rename from `emacs-bug--system-description' and make into a command. diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index a85ceaf1a5..60f733435a 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -300,7 +300,7 @@ usually do not have translators for other languages.\n\n"))) (let ((txt (delete-and-extract-region (1+ user-point) (point)))) (insert (propertize "\n" 'display txt))) - (emacs-bug--system-description) + (emacs-build-description) (insert "Configured features:\n" system-configuration-features "\n\n") (fill-region (line-beginning-position -1) (point)) (when (and (featurep 'native-compile) @@ -386,7 +386,10 @@ copy text to your preferred mail program.\n" (buffer-substring-no-properties (point-min) (point))) (goto-char user-point))) -(defun emacs-bug--system-description () +;;;###autoload +(defun emacs-build-description () + "Insert a description of the current Emacs build in the current buffer." + (interactive) (let ((start (point))) (insert "\nIn " (emacs-version)) (if emacs-build-system @@ -521,7 +524,7 @@ Message buffer where you can explain more about the patch." (compose-mail-other-window report-emacs-bug-address subject) (message-goto-body) (insert "\n\n\n") - (emacs-bug--system-description) + (emacs-build-description) (mml-attach-file file "text/patch" nil "attachment") (message-goto-body) (message "Write a description of the patch and use %s to send it" commit a6bad4d60f10c3c3faddced3d557c5be6b6a3c73 Author: Gregory Heytings Date: Wed Sep 21 10:37:09 2022 +0200 ; * Makefile.in: Minor improvements of failure messages. diff --git a/Makefile.in b/Makefile.in index 79a1d4204c..4968b710a5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -380,14 +380,14 @@ bootstrap-all: actual-all: ${SUBDIR} info $(gsettings_SCHEMAS:.xml=.valid) src-depending-on-lisp # ADVICE-ON-FAILURE-BEGIN:all -# You might try to: +# You could try to: # - run "make bootstrap", which might fix the problem # - run "make V=1", which displays the full commands invoked by make, # to further investigate the problem # ADVICE-ON-FAILURE-END:all # ADVICE-ON-FAILURE-BEGIN:bootstrap -# You might try to: +# You could try to: # - run "make extraclean" and run "make" again (or, equivalently, run # "make bootstrap configure=default"), to rebuild Emacs with the # default configuration options, which might fix the problem @@ -407,6 +407,7 @@ actual-all: ${SUBDIR} info $(gsettings_SCHEMAS:.xml=.valid) src-depending-on-lis advice-on-failure: @echo >&2 '***' @echo >&2 '*** '"\"make ${make-target}\" failed with exit status ${exit-status}." + @echo >&2 '***' @cat Makefile | \ sed -n '/^# ADVICE-ON-FAILURE-BEGIN:${make-target}/,$${p;/^# ADVICE-ON-FAILURE-END:${make-target}/q};' | \ sed 's/^# /*** /' | grep -v '^*** ADVICE-ON-FAILURE-' >&2 @@ -420,6 +421,7 @@ sanity-check: [ "X$$v" = "X3628800" ] && exit 0; \ echo >&2 '***'; \ echo >&2 '*** '"\"make ${make-target}\" succeeded, but Emacs is not functional."; \ + echo >&2 '***'; \ cat Makefile | \ sed -n '/^# ADVICE-ON-FAILURE-BEGIN:${make-target}/,$${p;/^# ADVICE-ON-FAILURE-END:${make-target}/q};' | \ sed 's/^# /*** /' | grep -v '^*** ADVICE-ON-FAILURE-' >&2; \ commit 9b14e312f409216dab647f839724d5df029e8195 Merge: 43c0ebd8bc 478b786d5a Author: Stefan Kangas Date: Wed Sep 21 10:24:25 2022 +0200 Merge from origin/emacs-28 478b786d5a ; * doc/lispref/windows.texi (Window Hooks): Fix a typo (b... 5085351645 * lisp/text-modes/tex-mode.el (tex-mode): Fix AUCTeX regre... ee6f8598ca Add vc-annotate-switches to manual 616dcf27e5 ; Fix typos in Lisp symbols 5405852541 Remove mention of non-existent `annotate-switches' 191505b8a3 Mention that src/macuvs.h sometimes needs committing 10373c4b68 ; More comment fixes in font.h (bug#57935) c2595b8dcc ; * src/font.h (struct font_driver): Comment fix. 97b928ce09 MacOS ld warning from native compilation (bug#57849) commit 43c0ebd8bcdd33e534b514d87ea843e93b11b89d Author: Stefan Kangas Date: Wed Sep 21 10:11:15 2022 +0200 * admin/gitmerge.el (gitmerge): Use substitute-command-keys. diff --git a/admin/gitmerge.el b/admin/gitmerge.el index 4f7c66cc5c..ddd3e18442 100644 --- a/admin/gitmerge.el +++ b/admin/gitmerge.el @@ -634,12 +634,18 @@ Branch FROM will be prepended to the list." (with-current-buffer (gitmerge-setup-log-buffer gitmerge--commits gitmerge--from) (goto-char (point-min)) - (insert (propertize "Commands: " 'font-lock-face 'bold) - "(s) Toggle skip, (l) Show log, (d) Show diff, " - "(f) Show files, (m) Start merge\n" - (propertize "Flags: " 'font-lock-face 'bold) - "(C) Detected backport (cherry-mark), (R) Matches skip " - "regexp, (M) Manually picked\n\n") + (insert (substitute-command-keys + (concat + (propertize "Commands: " 'font-lock-face 'bold) + "\\" + "(\\[gitmerge-toggle-skip]) Toggle skip, " + "(\\[gitmerge-show-log]) Show log, " + "(\\[gitmerge-show-diff]) Show diff, " + "(\\[gitmerge-show-files]) Show files, " + "(\\[gitmerge-start-merge]) Start merge\n" + (propertize "Flags: " 'font-lock-face 'bold) + "(C) Detected backport (cherry-mark), (R) Matches skip " + "regexp, (M) Manually picked\n\n"))) (gitmerge-mode) (pop-to-buffer (current-buffer)) (if noninteractive (gitmerge-start-merge)))))) commit 00f6bb1286c6f52bd2f70650e720c88ec090dae9 Author: Stefan Kangas Date: Wed Sep 21 10:10:22 2022 +0200 Bind 'n'/'p' in gitmerge-mode to line scroll * admin/gitmerge.el (gitmerge-mode-map): Bind 'n' and 'p' to 'next-line' and 'previous-line'. diff --git a/admin/gitmerge.el b/admin/gitmerge.el index 25bed949ad..4f7c66cc5c 100644 --- a/admin/gitmerge.el +++ b/admin/gitmerge.el @@ -97,11 +97,14 @@ If nil, the function `gitmerge-default-branch' guesses.") (defvar gitmerge-mode-map (let ((map (make-keymap))) - (define-key map [(l)] 'gitmerge-show-log) - (define-key map [(d)] 'gitmerge-show-diff) - (define-key map [(f)] 'gitmerge-show-files) - (define-key map [(s)] 'gitmerge-toggle-skip) - (define-key map [(m)] 'gitmerge-start-merge) + (define-key map [(l)] #'gitmerge-show-log) + (define-key map [(d)] #'gitmerge-show-diff) + (define-key map [(f)] #'gitmerge-show-files) + (define-key map [(s)] #'gitmerge-toggle-skip) + (define-key map [(m)] #'gitmerge-start-merge) + ;; For convenience: + (define-key map [(n)] #'next-line) + (define-key map [(p)] #'previous-line) map) "Keymap for gitmerge major mode.") commit cee9a2cbe0cd2cb1af602077727c03f2ae62fa90 Author: Robert Pluim Date: Wed Sep 21 09:12:53 2022 +0200 Fix substitute-command-keys for global binding lookup The previous change forgot to account for the (rare) case of doing a lookup for a global binding when a specific keymap is in force. * lisp/help.el (substitute-command-keys): Redo lookup in global map if lookup in specific map fails. * test/lisp/help-tests.el (help-tests-substitute-command-keys/keymap-change): Add testcase for specific map overriding advertised-binding. diff --git a/lisp/help.el b/lisp/help.el index 0ec5b9c85b..b4b9120da3 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1208,6 +1208,12 @@ Otherwise, return a new string." (and keymap (list keymap)) t)))) + ;; If we're looking in a particular keymap which has + ;; no binding, then we need to redo the lookup, with + ;; the global map as well this time. + (when (and (not key) keymap) + (setq key (with-current-buffer orig-buf + (where-is-internal fun keymap t)))) (if (not key) ;; Function is not on any key. (let ((op (point))) diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el index 6f1dcfa5b6..0fcaacb644 100644 --- a/test/lisp/help-tests.el +++ b/test/lisp/help-tests.el @@ -181,8 +181,12 @@ M-g M-c switch-to-completions (ert-deftest help-tests-substitute-command-keys/keymap-change () (with-substitute-command-keys-test + ;; Global binding should be found even if specifying a specific map (test "\\\\[abort-recursive-edit]" "C-]") - (test "\\\\[eval-defun]" "C-M-x"))) + (test "\\\\[eval-defun]" "C-M-x") + ;; Specific map overrides advertised-binding + (test "\\\\[undo]" "u") + (test "\\[undo]" "C-x u"))) (defvar-keymap help-tests-remap-map :full t commit 478b786d5aa74fbb6476b51f0dea4e9ccf1f211b (refs/remotes/origin/emacs-28) Author: Eli Zaretskii Date: Tue Sep 20 21:22:13 2022 +0300 ; * doc/lispref/windows.texi (Window Hooks): Fix a typo (bug#51930). diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 597e31fe85..5d31f70e01 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -6399,7 +6399,7 @@ during redisplay provided a significant, non-scrolling change of a window has been detected. For simplicity, these hooks and the functions they call will be collectively referred to as @dfn{window change functions}. As any hook, these hooks can be set either -globally of buffer-locally via the @var{local} argument of +globally or buffer-locally via the @var{local} argument of @code{add-hook} (@pxref{Setting Hooks}) when the hook is installed. @cindex window buffer change commit 5085351645dc503150823660443f497c5cf8d2ec Author: Stefan Monnier Date: Tue Sep 20 09:58:21 2022 -0400 * lisp/text-modes/tex-mode.el (tex-mode): Fix AUCTeX regression As discussed in https://lists.gnu.org/r/auctex/2022-08/msg00004.html AUCTeX installs its own advice to redefine `tex-mode`, and that advice used to take precedence before commit 6075a7c5ae3fa456cd. diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 64e38ad697..587ec406ef 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1013,7 +1013,10 @@ such as if there are no commands in the file, the value of `tex-default-mode' says which mode to use." (tex-common-initialization)) -(advice-add 'tex-mode :around #'tex--redirect-to-submode) +(advice-add 'tex-mode :around #'tex--redirect-to-submode + ;; Give it lower precedence than normal advice, so + ;; AUCTeX's advice takes precedence over it. + '((depth . 50))) (defvar tex-mode--recursing nil) (defun tex--redirect-to-submode (orig-fun) "Redirect to one of the submodes when called directly." commit ee6f8598ca14b90f458fa71d7e69ce05aa2d6e21 Author: Robert Pluim Date: Tue Sep 20 14:02:44 2022 +0200 Add vc-annotate-switches to manual * doc/emacs/maintaining.texi (Old Revisions): Add description of `vc-annotate-switches' and `vc-BACKEND-annotate-switches'. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 81a24d0587..e8eb21c380 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -897,7 +897,14 @@ is non-@code{nil}, the colors expressing the age of each line are applied to the background color, leaving the foreground at its default color. - When you give a prefix argument to this command, Emacs reads two +@vindex vc-annotate-switches + You can customize the @code{annotate} options that @kbd{C-x v g} +uses by customizing @code{vc-@var{backend}-annotate-switches} and +@code{vc-annotate-switches}. They function similarly to +@code{vc-@var{backend}-diff-switches} and @code{vc-diff-switches}, +described above. + + When you give a prefix argument to @kbd{C-x v g}, Emacs reads two arguments using the minibuffer: the revision to display and annotate (instead of the current file contents), and the time span in days the color range should cover. commit 616dcf27e57388403d4c28d441bf7310bb665241 Author: Stefan Kangas Date: Tue Sep 20 12:21:40 2022 +0200 ; Fix typos in Lisp symbols diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index 736fb7d99d..7a65777d32 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el @@ -312,7 +312,7 @@ enhancements, directly.") (defvar-local allout-inhibit-body-modification-hook nil "Override de-escaping of text-prefixes in item bodies during specific changes. -This is used by `allout-buffer-modification-handler' to signal such changes +This is used by `allout-body-modification-handler' to signal such changes to `allout-body-modification-handler', and is always reset by `allout-post-command-business'.") ;;;_ = allout-widgets-icons-cache @@ -2180,7 +2180,7 @@ Operation is inhibited by `allout-inhibit-body-modification-handler'." ;; `allout-before-modification-handler' and ;; `allout-inhibit-body-modification-handler'. ;; -;; Adds the overlay to the `allout-unresolved-body-mod-workhash' during +;; Adds the overlay to the `allout-unresolved-body-mod-workroster' during ;; before-change operation, and removes from that list during after-change ;; operation. (cond (allout-inhibit-body-modification-hook nil))) diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 97a122b7bc..f66c4935d7 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -677,7 +677,7 @@ will use an up-to-date value of `auto-revert-interval'." ;; ;; We do this by reverting immediately in response to the first in a ;; flurry of notifications. Any notifications during the following -;; `auto-revert-lockout-interval' seconds are noted but not acted upon +;; `auto-revert--lockout-interval' seconds are noted but not acted upon ;; until the end of that interval. (defconst auto-revert--lockout-interval 2.5 diff --git a/lisp/cedet/ede/autoconf-edit.el b/lisp/cedet/ede/autoconf-edit.el index faf50edaa1..e7a1522055 100644 --- a/lisp/cedet/ede/autoconf-edit.el +++ b/lisp/cedet/ede/autoconf-edit.el @@ -34,8 +34,7 @@ "Initialize a new configure.ac in ROOTDIR for PROGRAM using TESTFILE. ROOTDIR is the root directory of a given autoconf controlled project. PROGRAM is the program to be configured. -TESTFILE is the file used with AC_INIT. -Configure the initial configure script using `autoconf-new-automake-string'." +TESTFILE is the file used with AC_INIT." (interactive "DRoot Dir: \nsProgram: \nsTest File: ") (require 'ede/srecode) (if (bufferp rootdir) diff --git a/lisp/emacs-lisp/benchmark.el b/lisp/emacs-lisp/benchmark.el index c5f621c6c8..7535f0e2f5 100644 --- a/lisp/emacs-lisp/benchmark.el +++ b/lisp/emacs-lisp/benchmark.el @@ -70,7 +70,7 @@ number of repetitions actually used." (defun benchmark--adaptive (func time) "Measure the run time of FUNC, calling it enough times to last TIME seconds. -Result is (REPETITIONS . DATA) where DATA is as returned by `branchmark-call'." +Result is (REPETITIONS . DATA) where DATA is as returned by `benchmark-call'." (named-let loop ((repetitions 1) (data (let ((x (list 0))) (setcdr x x) x))) ;; (message "Running %d iteration" repetitions) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 7629e19040..21cd747518 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1666,7 +1666,7 @@ URLs." (seq "(" (* (not ")")) ")"))) ")"))) "" - ;; Heuristic: We can't reliably do `subsititute-command-keys' + ;; Heuristic: We can't reliably do `substitute-command-keys' ;; substitutions, since the value of a keymap in general can't be ;; known at compile time. So instead, we assume that these ;; substitutions are of some length N. diff --git a/lisp/epa-ks.el b/lisp/epa-ks.el index 8ece09d148..fc32061449 100644 --- a/lisp/epa-ks.el +++ b/lisp/epa-ks.el @@ -41,7 +41,7 @@ (defcustom epa-keyserver "pgp.mit.edu" "Domain of keyserver. -This is used by `epa-ks-lookup-key', for looking up public keys." +This is used by `epa-search-keys', for looking up public keys." :type '(choice :tag "Keyserver" (repeat :tag "Random pool" (string :tag "Keyserver address")) @@ -182,7 +182,7 @@ If EXACT is non-nil, don't accept approximate matches." "Prepare KEYS for `tabulated-list-mode', for buffer BUF. KEYS is a list of `epa-ks-key' structures, as parsed by -`epa-ks-parse-result'." +`epa-ks--parse-buffer'." (when (buffer-live-p buf) (let (entries) (dolist (key keys) diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el index 842f27a492..a94fb276b8 100644 --- a/lisp/eshell/em-glob.el +++ b/lisp/eshell/em-glob.el @@ -198,7 +198,7 @@ The basic syntax is: [a-b] [a-b] matches a character or range [^a] [^a] excludes a character or range -If any characters in PATTERN have the text property `eshell-escaped' +If any characters in PATTERN have the text property `escaped' set to true, then these characters will match themselves in the resulting regular expression." (let ((matched-in-pattern 0) ; How much of PATTERN handled diff --git a/lisp/frame.el b/lisp/frame.el index a6b0f17189..96914cd2b2 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1776,7 +1776,7 @@ of frames like calls to map a frame or change its visibility." (insert (format ", DS=%sx%s" (nth 0 item) (nth 1 item)))) (insert "\n")) ((and (eq (nth 0 item) frame) (= (nth 1 item) 5)) - ;; Length 5 is an `adjust-frame-size' item. + ;; Length 5 is an 'adjust_frame_size' item. (insert (format "%s (%s)" (nth 3 item) (nth 2 item))) (setq item (nth 0 (cdr entry))) (unless (and (= (nth 0 item) (nth 2 item)) diff --git a/lisp/hexl.el b/lisp/hexl.el index 7f965486ea..b8d25bfb1f 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el @@ -687,7 +687,7 @@ If there is no byte at the target address move to the last byte in that line." (defun hexl-beginning-of-buffer (arg) "Move to the beginning of the hexl buffer. -Leaves `hexl-mark' at previous position. +Leaves mark at previous position. With prefix arg N, puts point N bytes of the way from the true beginning." (interactive "p") (push-mark) diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el index 10e2512e9d..b245d9df16 100644 --- a/lisp/hilit-chg.el +++ b/lisp/hilit-chg.el @@ -118,7 +118,6 @@ ;; ;; Other interactive functions (that could be bound if desired): ;; `highlight-changes-mode' -;; `highlight-changes-toggle-visibility' ;; `highlight-changes-remove-highlight' ;; `highlight-compare-with-file' ;; `highlight-compare-buffers' diff --git a/lisp/imenu.el b/lisp/imenu.el index a87860f006..c18b5f00a6 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -310,7 +310,7 @@ element recalculates the buffer's index alist.") (defvar imenu--history-list nil ;; Making this buffer local caused it not to work! - "History list for `jump-to-function-in-buffer'.") + "History list for `imenu-choose-buffer-index'.") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 8978a97e79..2788a93a5a 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -755,7 +755,7 @@ VALUE must be a translation table to use on encoding. VALUE must be a function to call after some text is inserted and decoded by the coding system itself and before any functions in -`after-insert-functions' are called. This function is passed one +`after-insert-file-functions' are called. This function is passed one argument: the number of characters in the text to convert, with point at the start of the text. The function should leave point and the match data unchanged, and should return the new character diff --git a/lisp/org/ox.el b/lisp/org/ox.el index a6209ee98f..6316c687db 100644 --- a/lisp/org/ox.el +++ b/lisp/org/ox.el @@ -4605,7 +4605,7 @@ from the export back-end." ;; a given element, excluded. Note: "-n" switches reset that count. ;; ;; `org-export-unravel-code' extracts source code (along with a code -;; references alist) from an `element-block' or `src-block' type +;; references alist) from an `example-block' or `src-block' type ;; element. ;; ;; `org-export-format-code' applies a formatting function to each line diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 04e4a62c60..eaedf987c5 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -3188,7 +3188,7 @@ Returns true if comment is found. In POD will not move the point." Mark as generic string if STRING, as generic comment otherwise. A single character is marked as punctuation and directly fontified. Do nothing if BEGIN and END are equal. If -`cperl-use-syntax-text-property' is nil, just fontify." +`cperl-use-syntax-table-text-property' is nil, just fontify." (if (and cperl-use-syntax-table-text-property (> end begin)) (progn diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 1e9f3e1f9b..de98e0458b 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -1526,7 +1526,7 @@ POS can be a buffer position or a button" (flymake-show-diagnostic (if (button-type pos) (button-start pos) pos)))) (defun flymake--tabulated-entries-1 (diags project-root) - "Helper for `flymake--diagnostic-buffer-entries'. + "Helper for `flymake--diagnostics-buffer-entries'. PROJECT-ROOT indicates that each entry should be preceded by the filename of the diagnostic relative to that directory." (cl-loop diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index f6a4711e24..8eee8bd092 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -413,7 +413,7 @@ overlays created." ;; hidden with `hide-ifdef-lines' equals to nil while another part with 't, ;; this case happens. ;; TODO: Should we merge? or just create a container overlay? -- this can - ;; prevent `hideif-show-ifdef' expanding too many hidden contents since there + ;; prevent `show-ifdefs' expanding too many hidden contents since there ;; is only a big overlay exists there without any smaller overlays. (save-restriction (widen) ; Otherwise `point-min' and `point-max' will be restricted and thus @@ -733,7 +733,7 @@ Assuming we've just regexp-matched with `hif-decfloat-regexp' and it matched. if REMATCH is t, do a rematch." ;; In elisp `(string-to-number "01.e2")' will return 1 instead of the expected ;; 100.0; therefore we need to write our own. - ;; This function relies on the regexp groups of `hif-dexfloat-regexp' + ;; This function relies on the regexp groups of `hif-hexfloat-regexp' (if (or fix exp) (setq fix (hif-delete-char-in-string ?' fix) exp (hif-delete-char-in-string ?' exp)) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f7f1784b17..d73c1d4b23 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2909,8 +2909,8 @@ interpreter is run. Variables `python-shell-font-lock-enable', `python-shell-completion-setup-code', `python-shell-completion-string-code', -`python-eldoc-setup-code', `python-eldoc-string-code', -`python-ffap-setup-code' and `python-ffap-string-code' can +`python-eldoc-setup-code', +`python-ffap-setup-code' can customize this mode for different Python interpreters. This mode resets `comint-output-filter-functions' locally, so you diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el index d9085323d9..c59536e85a 100644 --- a/lisp/tar-mode.el +++ b/lisp/tar-mode.el @@ -169,7 +169,7 @@ This information is useful, but it takes screen space away from file names." (defun tar-swap-data () "Swap buffer contents between current buffer and `tar-data-buffer'. -Preserve the modified states of the buffers and set `buffer-swapped-with'." +Preserve the modified states of the buffers and set `tar-data-swapped'." (let ((data-buffer-modified-p (buffer-modified-p tar-data-buffer)) (current-buffer-modified-p (buffer-modified-p))) (buffer-swap-text tar-data-buffer) diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el index 8b55a78f84..ab67f450a4 100644 --- a/lisp/vc/add-log.el +++ b/lisp/vc/add-log.el @@ -812,7 +812,7 @@ if it were to exist." (defun add-log-find-changelog-buffer (changelog-file-name) "Find a ChangeLog buffer for CHANGELOG-FILE-NAME. -Respect `add-log-use-pseudo-changelog', which see." +Respect `add-log--pseudo-changelog-buffer-name', which see." (if (or (file-exists-p changelog-file-name) (not add-log-dont-create-changelog-file)) (find-file-noselect changelog-file-name) diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el index 1263767476..efa42429b3 100644 --- a/test/lisp/electric-tests.el +++ b/test/lisp/electric-tests.el @@ -909,7 +909,7 @@ baz\"\"" (should (equal (buffer-string) "int main () {\n \n}")))) (ert-deftest electric-layout-control-reindentation () - "Same as `emacs-lisp-int-main-kernel-style', but checking + "Same as `electric-layout-int-main-kernel-style', but checking Bug#35254." (ert-with-test-buffer () (plainer-c-mode) commit 540585254133af722739339ef420e68e09fe62e5 Author: Robert Pluim Date: Tue Sep 20 11:46:04 2022 +0200 Remove mention of non-existent `annotate-switches' * lisp/vc/vc.el (vc-annotate-switches): Remove mention of `annotate-switches'. As far as I can tell this has never existed in Emacs. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index bebd0946de..82da5e7448 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -803,12 +803,12 @@ not specific to any particular backend." (defcustom vc-annotate-switches nil "A string or list of strings specifying switches for annotate under VC. When running annotate under a given BACKEND, VC uses the first -non-nil value of `vc-BACKEND-annotate-switches', `vc-annotate-switches', -and `annotate-switches', in that order. Since nil means to check the -next variable in the sequence, either of the first two may use -the value t to mean no switches at all. `vc-annotate-switches' -should contain switches that are specific to version control, but -not specific to any particular backend. +non-nil value of `vc-BACKEND-annotate-switches' and +`vc-annotate-switches', in that order. Since nil means to check +the next variable in the sequence, setting the first to the value +t means no switches at all. `vc-annotate-switches' should +contain switches that are specific to version control, but not +specific to any particular backend. As very few switches (if any) are used across different VC tools, please consider using the specific `vc-BACKEND-annotate-switches' commit 191505b8a3a450e4b5658f90913c8e201517be98 Author: Robert Pluim Date: Mon Sep 19 14:49:55 2022 +0200 Mention that src/macuvs.h sometimes needs committing * admin/notes/unicode: src/macuvs.h is generated, but needs to be committed sometimes. diff --git a/admin/notes/unicode b/admin/notes/unicode index 7b86a36a14..6d443f3c4e 100644 --- a/admin/notes/unicode +++ b/admin/notes/unicode @@ -88,6 +88,10 @@ modified to follow suit. If there's trailing whitespace in BidiCharacterTest.txt, it should be removed before committing the new version. +src/macuvs.h is a generated file, but if it has changed as a result +of the updates, please commit it as well (see +admin/unidata/Makefile.in for an explanation). + Visit "emoji-data.txt" with the rebuilt Emacs, and check that an appropriate font is being used for the emoji (by default Emacs uses "Noto Color Emoji"). Running the following command in that buffer commit 10373c4b686106179607c2ceaaa8c105ee55c1cd Author: Eli Zaretskii Date: Mon Sep 19 18:57:32 2022 +0300 ; More comment fixes in font.h (bug#57935) diff --git a/src/font.h b/src/font.h index d083ae8f84..5564d73b71 100644 --- a/src/font.h +++ b/src/font.h @@ -659,7 +659,7 @@ struct font_driver /* Optional. Draw glyphs between FROM and TO of S->char2b at (X Y) pixel - position of frame S->F with S->FACE and S->GC. If WITH_BACKGROUND, + position of frame S->f with S->face and S->gc. If WITH_BACKGROUND, fill the background in advance. It is assured that WITH_BACKGROUND is false when (FROM > 0 || TO < S->nchars). */ int (*draw) (struct glyph_string *s, int from, int to, commit c2595b8dcc3c46d2097f1ec25050da0c5efa55b2 Author: Manuel Giraud Date: Mon Sep 19 17:15:50 2022 +0200 ; * src/font.h (struct font_driver): Comment fix. diff --git a/src/font.h b/src/font.h index 97e8c5b43a..d083ae8f84 100644 --- a/src/font.h +++ b/src/font.h @@ -659,7 +659,7 @@ struct font_driver /* Optional. Draw glyphs between FROM and TO of S->char2b at (X Y) pixel - position of frame F with S->FACE and S->GC. If WITH_BACKGROUND, + position of frame S->F with S->FACE and S->GC. If WITH_BACKGROUND, fill the background in advance. It is assured that WITH_BACKGROUND is false when (FROM > 0 || TO < S->nchars). */ int (*draw) (struct glyph_string *s, int from, int to, commit 97b928ce09d6034ebcb541fb548e5d4862302add Author: Gerd Möllmann Date: Sun Sep 18 08:05:52 2022 +0200 MacOS ld warning from native compilation (bug#57849) * lisp/emacs-lisp/comp.el (native-comp-driver-options): Add "-Wl,-w" on Darwin systems. * etc/NEWS: Describe change. diff --git a/etc/NEWS b/etc/NEWS index 8694b575a7..6e5ddfa066 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -30,6 +30,15 @@ with a prefix argument or by typing 'C-u C-h C-n'. * Changes in Specialized Modes and Packages in Emacs 28.3 +** 'native-comp-driver-options' on macOS + +The value of 'native-comp-driver-options' has been changed to contain +"-Wl,-w" to suppress warnings of the form + + ld: warning: -undefined dynamic_lookup may not work with chained fixups + +emitted during native compilation on macOS 12.6 with Xcode 14. + * New Modes and Packages in Emacs 28.3 diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index a5ab12ae38..d0234a81aa 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -178,14 +178,15 @@ and above." :type '(repeat string) :version "28.1") -(defcustom native-comp-driver-options nil +(defcustom native-comp-driver-options (when (eq system-type 'darwin) + '("-Wl,-w")) "Options passed verbatim to the native compiler's back-end driver. Note that not all options are meaningful; typically only the options affecting the assembler and linker are likely to be useful. Passing these options is only available in libgccjit version 9 and above." - :type '(repeat string) ; FIXME is this right? + :type '(repeat string) :version "28.1") (defcustom comp-libgccjit-reproducer nil