commit 35fa7126903a0ac6a28901d194f0753acf60928d (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Sun Feb 9 09:40:44 2025 +0200 * lisp/vc/diff-mode.el (diff-mode): Disable view-mode keybindings. Put the property 'mode-class' with the value 'special' on the symbol 'diff-mode'. This fixes the case when 'view-read-only' is non-nil by disabling activation of 'view-mode' that overrides single keys from 'diff-mode-shared-map' (bug#75993). diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 8d93b31ea35..517b3d9f4f3 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -1550,6 +1550,7 @@ else cover the whole buffer." (defvar whitespace-style) (defvar whitespace-trailing-regexp) +(put 'diff-mode 'mode-class 'special) ;;;###autoload (define-derived-mode diff-mode fundamental-mode "Diff" "Major mode for viewing/editing context diffs. commit 821ec7851216f7c8012a8b2c7a538abc8a43a1bb Author: Eli Zaretskii Date: Sun Feb 9 07:24:28 2025 +0200 ; * etc/NEWS: Fix a recent change. diff --git a/etc/NEWS b/etc/NEWS index 636cf6f113b..acaa88d5574 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1097,8 +1097,9 @@ When invoked with a prefix argument, 'package-install-selected-packages' will not prompt the user for confirmation before installing packages. --- -*** 'package-refresh-contents' runs asynchronously -Refreshing the package index will not block when invoked interactively. +*** 'package-refresh-contents' runs asynchronously. +Refreshing the package index will no longer block when invoked +interactively. ** Xref commit d93342cf322fae0040b268dfaabfbc720ee12d98 Merge: 1294c5ed5fb 563efd6838c Author: Po Lu Date: Sun Feb 9 12:08:27 2025 +0800 Merge from savannah/emacs-30 563efd6838c Fix program execution on Android 15 QPR2 Beta commit 563efd6838c1b62c8962385911b5fd5c5637ab96 Author: Po Lu Date: Sun Feb 9 12:06:52 2025 +0800 Fix program execution on Android 15 QPR2 Beta * exec/trace.c (process_vm_readv, process_vm_writev): New function pointers. Attempt to load them on recent Android systems when `exec' was not linked with a sufficiently up-to-date libc. (read_memory, user_copy): Always use process_vm_readv and process_vm_writev if available. (handle_openat): Write trailing NULL byte of filename to user buffer. (exec_init): Attempt to dlsym process_vm_readv and process_vm_writev. diff --git a/exec/trace.c b/exec/trace.c index 1b4297e08ab..ee163327313 100644 --- a/exec/trace.c +++ b/exec/trace.c @@ -45,6 +45,9 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_SYS_UIO_H #include /* for process_vm_readv */ +#ifndef HAVE_PROCESS_VM +#include +#endif /* !HAVE_PROCESS_VM */ #endif /* HAVE_SYS_UIO_H */ #ifndef SYS_SECCOMP @@ -70,6 +73,22 @@ along with GNU Emacs. If not, see . */ /* Number of tracees children are allowed to create. */ #define MAX_TRACEES 4096 +#if defined HAVE_SYS_UIO_H && !defined HAVE_PROCESS_VM + +/* Load have_process_vm dynamically if possible to avoid PTRACE_PEEKDATA + restrictions on Android 15 QPR2+. */ + +static ssize_t (*process_vm_readv) (pid_t, const struct iovec *, + unsigned long, + const struct iovec *, + unsigned long, unsigned long); +static ssize_t (*process_vm_writev) (pid_t, const struct iovec *, + unsigned long, + const struct iovec *, + unsigned long, unsigned long); + +#endif /* HAVE_SYS_UIO_H && !HAVE_PROCESS_VM */ + #ifdef __aarch64__ /* Place PID's registers into *REGS. Return 1 upon failure, else @@ -138,7 +157,7 @@ static struct exec_tracee *tracing_processes; ADDRESS. Return its contents in BUFFER. If there are unreadable pages within ADDRESS + N, the contents of - BUFFER after the first such page becomes undefined. */ + BUFFER after the first such page become undefined. */ static void read_memory (struct exec_tracee *tracee, char *buffer, @@ -146,7 +165,7 @@ read_memory (struct exec_tracee *tracee, char *buffer, { USER_WORD word, n_words, n_bytes, i; long rc; -#ifdef HAVE_PROCESS_VM +#ifdef HAVE_SYS_UIO_H struct iovec iov, remote; /* If `process_vm_readv' is available, use it instead. */ @@ -160,11 +179,14 @@ read_memory (struct exec_tracee *tracee, char *buffer, read, consider the read to have been a success. */ if (n <= SSIZE_MAX - && ((size_t) process_vm_readv (tracee->pid, &iov, 1, - &remote, 1, 0) != -1)) +#ifndef HAVE_PROCESS_VM + && process_vm_readv +#endif /* !HAVE_PROCESS_VM */ + && (process_vm_readv (tracee->pid, &iov, 1, + &remote, 1, 0) != -1)) return; -#endif /* HAVE_PROCESS_VM */ +#endif /* !HAVE_SYS_UIO_H */ /* First, read entire words from the tracee. */ n_words = n & ~(sizeof (USER_WORD) - 1); @@ -283,7 +305,7 @@ user_copy (struct exec_tracee *tracee, const unsigned char *buffer, { USER_WORD start, end, word; unsigned char *bytes; -#ifdef HAVE_PROCESS_VM +#ifdef HAVE_SYS_UIO_H struct iovec iov, remote; /* Try to use `process_vm_writev' if possible, but fall back to @@ -295,10 +317,13 @@ user_copy (struct exec_tracee *tracee, const unsigned char *buffer, remote.iov_len = n; if (n <= SSIZE_MAX - && ((size_t) process_vm_writev (tracee->pid, &iov, 1, - &remote, 1, 0) == n)) +#ifndef HAVE_PROCESS_VM + && process_vm_writev +#endif /* !HAVE_PROCESS_VM */ + && (process_vm_writev (tracee->pid, &iov, 1, + &remote, 1, 0) == n)) return 0; -#endif /* HAVE_PROCESS_VM */ +#endif /* HAVE_SYS_UIO_H */ /* Calculate the start and end positions for the write. */ @@ -1149,10 +1174,7 @@ handle_openat (USER_WORD callno, USER_REGS_STRUCT *regs, return 0; /* Now check if the caller is looking for /proc/self/exe or its - equivalent with the PID made explicit. - - dirfd can be ignored, as for now only absolute file names are - handled. FIXME. */ + equivalent with the PID made explicit. */ p = stpcpy (proc_pid_exe, "/proc/"); p = format_pid (p, tracee->pid); @@ -1173,7 +1195,7 @@ handle_openat (USER_WORD callno, USER_REGS_STRUCT *regs, if (!address || user_copy (tracee, (unsigned char *) tracee->exec_file, - address, length)) + address, length + 1)) goto fail; /* Replace the file name buffer with ADDRESS. */ @@ -1699,4 +1721,12 @@ void exec_init (const char *loader) { loader_name = loader; +#if defined HAVE_SYS_UIO_H && !defined HAVE_PROCESS_VM + { + *(void **) (&process_vm_readv) + = dlsym (RTLD_DEFAULT, "process_vm_readv"); + *(void **) (&process_vm_writev) + = dlsym (RTLD_DEFAULT, "process_vm_writev"); + } +#endif /* HAVE_SYS_UIO_H && !HAVE_PROCESS_VM */ } commit 1294c5ed5fb9251c16c0b48293953e2a6ce06e96 Author: Sebastián Monía Date: Sun Dec 1 00:29:08 2024 -0500 Use vtable in eww-list-bookmarks * lisp/net/eww.el (eww-list-bookmarks): Move logic to... (eww--bookmark-prepare, eww--bookmark-format-data) ... these, and use 'vtable'. (eww-bookmark-kill, eww-bookmark-yank, eww-bookmark-browse) (eww-next-bookmark, eww-previous-bookmark, eww-buffers-mode-map): Use 'vtable-current-object'. diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 7c7303d073d..6e598de1be4 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -2390,6 +2390,7 @@ If CHARSET is nil then use UTF-8." (plist-get eww-data :title)))) (defun eww-write-bookmarks () + "Write the bookmarks in `eww-bookmarks-directory'." (with-temp-file (expand-file-name "eww-bookmarks" eww-bookmarks-directory) (insert ";; Auto-generated file; don't edit -*- mode: lisp-data -*-\n") (let ((print-length nil) @@ -2409,115 +2410,146 @@ If ERROR-OUT, signal user-error if there are no bookmarks." (user-error "No bookmarks are defined")))) ;;;###autoload -(defun eww-list-bookmarks () - "Display the bookmarks." +(defun eww-list-bookmarks (&optional build-only) + "Display the eww bookmarks. +Optional argument BUILD-ONLY, when non-nil, means to build the buffer +without popping it." (interactive) (eww-read-bookmarks t) - (pop-to-buffer "*eww bookmarks*") - (eww-bookmark-prepare)) - -(defun eww-bookmark-prepare () - (set-buffer (get-buffer-create "*eww bookmarks*")) - (eww-bookmark-mode) - (let* ((width (/ (window-width) 2)) - (format (format "%%-%ds %%s" width)) - (inhibit-read-only t) - start title) + (with-current-buffer (get-buffer-create "*eww bookmarks*") + (eww-bookmark-mode) + (eww--bookmark-prepare)) + (unless build-only + (pop-to-buffer "*eww bookmarks*"))) + +(defun eww--bookmark-prepare () + "Display a table with the list of eww bookmarks. +Will remove all buffer contents first." + (let ((inhibit-read-only t)) (erase-buffer) - (setq header-line-format (concat " " (format format "Title" "URL"))) - (dolist (bookmark eww-bookmarks) - (setq start (point) - title (plist-get bookmark :title)) - (when (> (length title) width) - (setq title (truncate-string-to-width title width))) - (insert (format format title (plist-get bookmark :url)) "\n") - (put-text-property start (1+ start) 'eww-bookmark bookmark)) - (goto-char (point-min)))) + (make-vtable + :columns '((:name "Order" :min-width 6) + (:name "Title" :min-width "25%" :max-width "50%") + (:name "URL")) + :objects-function #'eww--bookmark-format-data + ;; use fixed-font face + :face 'default + :sort-by '((0 . ascend)) + ))) + +(defun eww--bookmark-format-data () + "Format `eww-bookmarks' for use in a vtable. +The data is returned as a list (order title url bookmark), for use +in of `eww-bookmark-mode'. Order stars counting from 1." + (seq-map-indexed (lambda (bm index) + (list + (+ 1 index) + (plist-get bm :title) + (plist-get bm :url) + bm)) + eww-bookmarks)) (defvar eww-bookmark-kill-ring nil) +(defun eww--bookmark-check-order-sort () + "Signal a user error unless the bookmark vtable is sorted by asc order." + ;; vtables sort respecting the previous sort column. As long as + ;; "order" was last, the kill/yank operations will make sense, no + ;; matter what sort was used before. + (when-let* ((the-table (vtable-current-table)) + (last-sort-pair (car (last (vtable-sort-by the-table))))) + (unless (and (= 0 (car last-sort-pair)) + (eq 'ascend (cdr last-sort-pair))) + (user-error + "Can't kill/yank bookmarks unless the table is sorted by ascending Order")))) + (defun eww-bookmark-kill () "Kill the current bookmark." (interactive nil eww-bookmark-mode) - (let* ((start (line-beginning-position)) - (bookmark (get-text-property start 'eww-bookmark)) - (inhibit-read-only t)) - (unless bookmark + (eww--bookmark-check-order-sort) + (let ((bookmark-at-point (nth 3 (vtable-current-object))) + (position (point))) + (unless bookmark-at-point (user-error "No bookmark on the current line")) (forward-line 1) - (push (buffer-substring start (point)) eww-bookmark-kill-ring) - (delete-region start (point)) - (setq eww-bookmarks (delq bookmark eww-bookmarks)) - (eww-write-bookmarks))) + (push bookmark-at-point eww-bookmark-kill-ring) + (setq eww-bookmarks (delq bookmark-at-point eww-bookmarks)) + (eww-write-bookmarks) + (when (= (point) (point-max)) + (previous-line)) ; don't go outside the vtable, or reverting fails + (vtable-revert-command) + (goto-char position))) (defun eww-bookmark-yank () "Yank a previously killed bookmark to the current line." (interactive nil eww-bookmark-mode) + (eww--bookmark-check-order-sort) (unless eww-bookmark-kill-ring (user-error "No previously killed bookmark")) - (beginning-of-line) - (let ((inhibit-read-only t) - (start (point)) - bookmark) - (insert (pop eww-bookmark-kill-ring)) - (setq bookmark (get-text-property start 'eww-bookmark)) - (if (= start (point-min)) - (push bookmark eww-bookmarks) - (let ((line (count-lines start (point)))) - (setcdr (nthcdr (1- line) eww-bookmarks) - (cons bookmark (nthcdr line eww-bookmarks))))) - (eww-write-bookmarks))) + (let* ((bookmark-at-point (nth 3 (vtable-current-object))) + (index-bap (seq-position eww-bookmarks bookmark-at-point)) + ;; store in a list, for simpler concat + (bookmark-to-insert (list (pop eww-bookmark-kill-ring))) + (position (point))) + (setq eww-bookmarks + (if (= (point) (point-max)) + ;; special case: point is in the last line of the buffer, + ;; so we know to append the bookmark at the end + (progn + (goto-char (point-min)) ; move inside the vtable instance + (seq-concatenate 'list eww-bookmarks bookmark-to-insert)) + ;; TODO: a simpler way of doing this? + (seq-concatenate 'list + (seq-subseq eww-bookmarks 0 index-bap) + bookmark-to-insert + (seq-subseq eww-bookmarks index-bap)))) + (eww-write-bookmarks) + (vtable-revert-command) + (vtable-beginning-of-table) + (goto-char position))) (defun eww-bookmark-browse () "Browse the bookmark under point in eww." (interactive nil eww-bookmark-mode) - (let ((bookmark (get-text-property (line-beginning-position) 'eww-bookmark))) - (unless bookmark + (let ((bookmark-at-point (nth 3 (vtable-current-object)))) + (unless bookmark-at-point (user-error "No bookmark on the current line")) (quit-window) - (eww-browse-url (plist-get bookmark :url)))) + (eww-browse-url (plist-get bookmark-at-point :url)))) (defun eww-next-bookmark () "Go to the next bookmark in the list." (interactive nil eww-bookmark-mode) - (let ((first nil) - bookmark) + (let (fresh-buffer target-bookmark) (unless (get-buffer "*eww bookmarks*") - (setq first t) - (eww-read-bookmarks t) - (eww-bookmark-prepare)) + (setq fresh-buffer t) + (eww-list-bookmarks t)) (with-current-buffer "*eww bookmarks*" - (when (and (not first) - (not (eobp))) - (forward-line 1)) - (setq bookmark (get-text-property (line-beginning-position) - 'eww-bookmark)) - (unless bookmark - (user-error "No next bookmark"))) - (eww-browse-url (plist-get bookmark :url)))) + (unless fresh-buffer + (forward-line 1)) + (setq target-bookmark (nth 3 (vtable-current-object)))) + (unless target-bookmark + ;; usually because we moved past end of the table + (user-error "No next bookmark")) + (eww-browse-url (plist-get target-bookmark :url)))) (defun eww-previous-bookmark () "Go to the previous bookmark in the list." (interactive nil eww-bookmark-mode) - (let ((first nil) - bookmark) + (let (fresh-buffer target-bookmark) (unless (get-buffer "*eww bookmarks*") - (setq first t) - (eww-read-bookmarks t) - (eww-bookmark-prepare)) + (setq fresh-buffer t) + (eww-list-bookmarks t)) (with-current-buffer "*eww bookmarks*" - (if first - (goto-char (point-max)) - (beginning-of-line)) - ;; On the final line. - (when (eolp) - (forward-line -1)) - (if (bobp) - (user-error "No previous bookmark") - (forward-line -1)) - (setq bookmark (get-text-property (line-beginning-position) - 'eww-bookmark))) - (eww-browse-url (plist-get bookmark :url)))) + (when fresh-buffer + (vtable-end-of-table)) + ;; didn't move to a previous line, because we + ;; were already on the first one + (unless (= -1 (forward-line -1)) + (setq target-bookmark (nth 3 (vtable-current-object))))) + (unless target-bookmark + (user-error "No previous bookmark")) + (eww-browse-url (plist-get target-bookmark :url)))) (defun eww-bookmark-urls () "Get the URLs from the current list of bookmarks." @@ -2532,9 +2564,9 @@ If ERROR-OUT, signal user-error if there are no bookmarks." :menu '("Eww Bookmark" ["Exit" quit-window t] ["Browse" eww-bookmark-browse - :active (get-text-property (line-beginning-position) 'eww-bookmark)] + :active (nth 3 (vtable-current-object))] ["Kill" eww-bookmark-kill - :active (get-text-property (line-beginning-position) 'eww-bookmark)] + :active (nth 3 (vtable-current-object))] ["Yank" eww-bookmark-yank :active eww-bookmark-kill-ring])) commit eb365182440f236e6b5fe2a9192a0c3675e0e306 Author: Philip Kaludercic Date: Sat Feb 8 22:39:47 2025 +0100 ;* doc/misc/dired-x.texi: Remove unnecessary paren (Bug#76148) diff --git a/doc/misc/dired-x.texi b/doc/misc/dired-x.texi index c678e8e1e40..bd8010edcb1 100644 --- a/doc/misc/dired-x.texi +++ b/doc/misc/dired-x.texi @@ -179,7 +179,7 @@ In your @file{~/.emacs} file, or in the system-wide initialization file (require 'dired-x) ;; Set dired-x global variables here. For example: ;; (setq dired-x-hands-off-my-keys nil) - )) + ) (add-hook 'dired-mode-hook (lambda () ;; Set dired-x buffer-local variables here. For example: commit 4cc8709ac2ceb0888ed1868292400049b98fe642 Author: Philip Kaludercic Date: Fri Jan 31 08:55:02 2025 +0100 Refresh package list without blocking * lisp/emacs-lisp/package.el (package-refresh-contents): Run asynchronously when invoked interactively. * etc/NEWS: Mention the change. diff --git a/etc/NEWS b/etc/NEWS index 4ab24df14d2..636cf6f113b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1096,6 +1096,10 @@ removing packages. When invoked with a prefix argument, 'package-install-selected-packages' will not prompt the user for confirmation before installing packages. +--- +*** 'package-refresh-contents' runs asynchronously +Refreshing the package index will not block when invoked interactively. + ** Xref --- diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index b29e0a5f564..3611f7f1f5d 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1858,8 +1858,11 @@ For each archive configured in the variable `package-archives', inform Emacs about the latest versions of all packages it offers, and make them available for download. Optional argument ASYNC specifies whether to perform the -downloads in the background." - (interactive) +downloads in the background. This is always the case when the command +is invoked interactively." + (interactive (list t)) + (when async + (message "Refreshing package contents...")) (unless (file-exists-p package-user-dir) (make-directory package-user-dir t)) (let ((default-keyring (expand-file-name "package-keyring.gpg" commit a0e1115caa49be098efb2be4d721a7ba218fc30f Author: Andreas Schwab Date: Sat Feb 8 19:32:06 2025 +0100 Don't try to unregister tracker ID twice * lisp/vc/diff-mode.el (diff-minor-mode): Clear diff--track-changes after unregistering. diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 77807fc4f35..8d93b31ea35 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -1620,15 +1620,16 @@ a diff with \\[diff-reverse-direction]. \\{diff-minor-mode-map}" :group 'diff-mode :lighter " Diff" ;; FIXME: setup font-lock - (when diff--track-changes (track-changes-unregister diff--track-changes)) + (when diff--track-changes + (track-changes-unregister diff--track-changes) + (setq diff--track-changes nil)) (remove-hook 'write-contents-functions #'diff-write-contents-hooks t) (when diff-minor-mode (if (not diff-update-on-the-fly) (add-hook 'write-contents-functions #'diff-write-contents-hooks nil t) - (unless diff--track-changes - (setq diff--track-changes - (track-changes-register #'diff--track-changes-signal - :nobefore t)))))) + (setq diff--track-changes + (track-changes-register #'diff--track-changes-signal + :nobefore t))))) ;;; Handy hook functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; commit bdf77074bf3ce4d532d6accb44faf4ec0769f7ea Author: Michael Albinus Date: Sat Feb 8 17:36:16 2025 +0100 * doc/misc/ert.texi (Helper Functions): New node. diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index 4617453d06d..35128fcfeb0 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi @@ -535,6 +535,7 @@ help ERT find the defining call to the macro by putting the property * Useful Techniques:: Some examples. * erts files:: Files containing many buffer tests. * Syntax Highlighting Tests:: Tests for face assignment. +* Helper Functions:: Various helper functions. @end menu @@ -950,6 +951,7 @@ non-@code{nil} value, the test will be skipped. If you need to use the literal line single line @samp{=-=} in a test section, you can quote it with a @samp{\} character. + @node Syntax Highlighting Tests @section Syntax Highlighting Tests @@ -1082,6 +1084,304 @@ The @code{ert-font-lock-deftest} and @code{ert-font-lock-deftest-file} macros accept the same keyword parameters as @code{ert-deftest} i.e., @code{:tag} and @code{:expected-result}. + +@node Helper Functions +@section Various Helper Functions + +The package @file{ert-x.el} contains some macros and functions useful +for writing tests. + +@subsection Test Buffers + +@defmac ert-with-test-buffer ((&key ((:name name-form))) &body body) +This macro creates a test buffer and runs @var{body} in that buffer. If +@var{body} finishes successfully, the test buffer is killed; if there is +an error, the test buffer is kept around for further inspection. + +The test buffer name is derived from the name of the ERT test and the +result of @var{NAME-FORM}. Example: + +@lisp +(ert-deftest backtrace-tests--variables () + (ert-with-test-buffer (:name "variables") + @dots{})) +@end lisp + +This uses the test buffer @t{"*Test buffer (backtrace-tests--variables): +variables*"}. +@end defmac + +@defmac ert-with-buffer-selected (buffer &body body) +The macro display a buffer in a temporary selected window and runs +@var{body}. If @var{buffer} is @code{nil}, the current buffer is used. + +The buffer is made the current buffer, and the temporary window +becomes the @code{selected-window}, before @var{body} is evaluated. The +modification hooks @code{before-change-functions} and +@code{after-change-functions} are not inhibited during the evaluation +of @var{body}, which makes it easier to use @code{execute-kbd-macro} to +simulate user interaction. The window configuration is restored +before returning, even if @var{body} exits nonlocally. The return +value is the last form in @var{body}. Example: + +@lisp +(with-temp-buffer + (ert-with-buffer-selected nil + @dots{})) +@end lisp + +This displays a temporary buffer @t{" *temp*-739785"*}. +@end defmac + +@defmac ert-with-test-buffer-selected ((&key name) &body body) +This creates a test buffer, switches to it, and runs @var{body}. + +It combines @code{ert-with-test-buffer} and +@code{ert-with-buffer-selected}. The return value is the last form in +@var{body}. Example: + +@lisp +(ert-deftest whitespace-tests--global () + (ert-with-test-buffer-selected (:name "global") + @dots{})) +@end lisp + +This displays the test buffer @t{"*Test buffer +(whitespace-tests--global): global*"}. +@end defmac + +@defun ert-kill-all-test-buffers () +It kills all test buffers that are still live. +@end defun + +@defmac ert-with-buffer-renamed ((buffer-name-form) &body body) +This macro protects the buffer @var{buffer-name} from side-effects and +runs @var{body}. It renames the buffer @var{buffer-name} to a new +temporary name, creates a new buffer named @var{buffer-name}, executes +@var{body}, kills the new buffer, and renames the original buffer back +to @var{buffer-name}. + +This is useful if @var{body} has undesirable side-effects on an Emacs +buffer with a fixed name such as @t{"*Messages*"}. Example: + +@lisp +(ert-with-buffer-renamed ("*Messages*") @dots{}) +@end lisp +@end defmac + +@defmac ert-with-message-capture (var &rest body) +This macro executes @var{body} while collecting messages in @var{var}. +It captures messages issued by Lisp code and concatenates them separated +by newlines into one string. This includes messages written by +@code{message} as well as objects printed by @code{print}, @code{prin1} +and @code{princ} to the echo area. Messages issued from C code using +the above mentioned functions will not be captured. + +This is useful for separating the issuance of messages by the code under +test from the behavior of the @t{"*Messages*"} buffer. Example: + +@lisp +(ert-with-message-capture captured-messages @dots{}) +@end lisp +@end defmac + +@subsection Test Directories and Files + +@defmac ert-resource-directory () +It returns the absolute file name of the resource (test data) directory. +The path to the resource directory is the @file{resources} directory in +the same directory as the test file this is called from. + +If that directory doesn't exist, find a directory based on the test file +name. If the file is named @file{foo-tests.el}, it returns the absolute +file name for @file{foo-resources}. Example: + +@lisp +(let ((dir (ert-resource-directory))) + @dots{}) +@end lisp + +In order to use a different resource directory naming scheme, the +variable @code{ert-resource-directory-format} can be changed. Before +formatting, the file name will be trimmed using @code{string-trim} with +arguments @code{ert-resource-directory-trim-left-regexp} and +@code{ert-resource-directory-trim-right-regexp}. Example: + +@lisp +(let* ((ert-resource-directory-format "test-resources-%s/") + (ert-resource-directory-trim-left-regexp ".*/") + (dir (ert-resource-directory))) + @dots{}) +@end lisp + +uses the absolute file name for @file{test-resources-foo}. +@end defmac + +@defmac ert-resource-file (file) +It returns the absolute file name of resource (test data) file named +@var{file}, which should be a relative file name. A resource file is +defined as any file placed in the resource directory as returned by +@code{ert-resource-directory}. Example: + +@lisp +(let ((file (ert-resource-file "bar/baz"))) + @dots{}) +@end lisp + +It returns the absolute file name for @file{foo-resources/bar/baz} when +called in file @file{foo-tests.el}. +@end defmac + +@defmac ert-with-temp-file (name &rest body) +This macro binds @var{name} to the name of a new temporary file and evaluates @var{body}. +It deletes the temporary file after @var{body} exits normally or +non-locally. @var{name} will be bound to the file name of the temporary +file. + +The following keyword arguments are supported: + +@table @code +@item :prefix @var{string} +If non-nil, pass @var{string} to @code{make-temp-file} as +the @var{prefix} argument. Otherwise, use the value of +@code{ert-temp-file-prefix}. + +@item :suffix @var{string} +If non-nil, pass @var{string} to @code{make-temp-file} as the +@var{suffix} argument. Otherwise, use the value of +@code{ert-temp-file-suffix}; if the value of that variable is nil, +generate a suffix based on the name of the file that +@code{ert-with-temp-file} is called from. + +@item :text @var{string} +If non-nil, pass @var{string} to @code{make-temp-file} as the @var{text} argument. + +@item :buffer @var{symbol} +Open the temporary file using @code{find-file-noselect} and bind +@var{symbol} to the buffer. Kill the buffer after @var{body} exits +normally or non-locally. + +@item :coding @var{coding} +If non-nil, bind @code{coding-system-for-write} to @var{coding} when +executing @var{body}. This is handy when @var{string} includes +non-ASCII characters or the temporary file must have a specific encoding +or end-of-line format. +@end table + +Example: + +@lisp +(ert-with-temp-file temp-file + :prefix "foo" + :suffix "bar" + :text "foobar3" + @dots{}) +@end lisp +@end defmac + +@defmac ert-with-temp-directory (name &rest body) +This macro binds @var{name} to the name of a new temporary directory and +evaluates @var{body}. It deletes the temporary directory after +@var{body} exits normally or non-locally. + +@var{name} is bound to the directory name, not the directory file name. +(In other words, it will end with the directory delimiter; on Unix-like +systems, it will end with @t{"/"}.) + +The same keyword arguments are supported as in +@code{ert-with-temp-file}, except for @code{:text}. Example: + +@lisp +(ert-with-temp-directory temp-dir + :prefix "foo" + :suffix "bar" + @dots{}) +@end lisp +@end defmac + +@defvar ert-remote-temporary-file-directory +This variable provides the name of a temporary directory for remote file +tests. Per default, a mock-up connection method is used (this might not +be possible when running on MS Windows). The default value is +@t{"/mock::/tmp/"}. + +If a real remote connection shall be used for testing, this can be +overwritten by the environment variable +@env{REMOTE_TEMPORARY_FILE_DIRECTORY}. Example + +@example +# env REMOTE_TEMPORARY_FILE_DIRECTORY=/ssh:host:/tmp make @dots{} +@end example +@end defvar + +@subsection Miscellaneous Utilities + +@defun ert-simulate-command (command) +Simulate calling @var{command} the way the Emacs command loop would call +it. It runs hooks like @code{pre-command-hook} and +@code{post-command-hook}, and sets variables like @code{this-command} +and @code{last-command}. + +@var{command} should be a list where the @code{car} is the command +symbol and the rest are arguments to the command. Example: + +@lisp +(ert-simulate-command '(find-file "project/foo.c")) +@end lisp + +@strong{Note}: Since the command is not called by +@code{call-interactively}, a test for @code{(called-interactively-p 'interactive)} +in the command will fail. +@end defun + +@defmac ert-simulate-keys (keys &rest body) +This executes @var{body} with @var{keys} as pseudo-interactive input. +@var{keys} is either a string, a list of characters, or a character +vector. Examples: + +@lisp +(ert-simulate-keys '(?n ?\C-m) @dots{}) +(ert-simulate-keys "\r\r\r\ry\r" @dots{}) +(ert-simulate-keys (kbd "#fake C-m C-a C-k C-m") @dots{}) +(ert-simulate-keys [?b ?2 return] @dots{}) +@end lisp +@end defmac + +@defun ert-filter-string (s &rest regexps) +This function returns a copy of string @var{s} with all matches of +@var{regexps} removed. Elements of @var{regexps} may also be +two-element lists @code{(@var{regexp} @var{subexp})}, where @var{subexp} +is the number of a subexpression in @var{regexp}. In that case, only +that subexpression will be removed rather than the entire match. +Example: + +@lisp +(with-current-buffer @dots{} + (ert-filter-string (buffer-string) + '("Started at:\\(.*\\)$" 1) + '("Finished at:\\(.*\\)$" 1)) + @dots{}) +@end lisp +@end defun + +@defun ert-propertized-string (&rest args) +This function returns a string with properties as specified by @var{args}. + +@var{args} is a list of strings and plists. The strings in @var{args} +are concatenated to produce an output string. In the output string, +each string from @var{args} will be have the preceding plist as its +property list, or no properties if there is no plist before it. +Example: + +@lisp +(ert-propertized-string "foo " '(face italic) "bar" " baz" nil " quux") +@end lisp + +This returns the string @t{"foo @i{bar baz} quux"} where the substring +@t{"@i{bar baz}"} has a @code{face} property with the value @code{italic}. +@end defun + + @node How to Debug Tests @chapter How to Debug Tests commit 37c07f383b053a40b31439076bec0b170c1281de Author: João Távora Date: Sat Feb 8 13:42:08 2025 +0000 Eglot: auto-expand first level in type and call hierarchies * lisp/progmodes/eglot.el (eglot--hierarchy-2): Use widget-apply-action. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index a69d239214f..00142c9c829 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -4564,7 +4564,8 @@ If NOERROR, return predicate, else erroring function." (let ((inhibit-read-only t)) (erase-buffer) (mapc (lambda (r) - (widget-create (convert r))) + (let ((w (widget-create (convert r)))) + (widget-apply-action w))) eglot--hierarchy-roots) (goto-char (point-min)))) (pop-to-buffer (current-buffer))) commit 3fde13a5019bafbd2b1059e061a4b0869123564f Author: Felicián Németh Date: Sat Feb 8 11:53:31 2025 +0100 Eglot: do not activate unsupported menu items * lisp/progmodes/eglot.el (eglot-menu): Do not activate items that the server does not support. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 728227f0e9a..a69d239214f 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2311,8 +2311,10 @@ If it is activated, also signal textDocument/didOpen." ["Quickfix" eglot-code-action-quickfix :visible (eglot-server-capable :codeActionProvider)] "--" - ["Show type hierarchy" eglot-show-type-hierarchy] - ["Show call hierarchy" eglot-show-call-hierarchy] + ["Show type hierarchy" eglot-show-type-hierarchy + :active (eglot-server-capable :typeHierarchyProvider)] + ["Show call hierarchy" eglot-show-call-hierarchy + :active (eglot-server-capable :callHierarchyProvider)] "--")) (easy-menu-define eglot-server-menu nil "Manage server communication" commit 36c91fdacc4995672e88e147c34b19d9244da033 Author: Eli Zaretskii Date: Sat Feb 8 07:40:44 2025 -0500 ; Update ldefs-boot.el diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 648633004c9..c1deb84754d 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -417,7 +417,7 @@ indented." t) ;;; Generated autoloads from allout.el -(push (purecopy '(allout 2 3)) package--builtin-versions) +(push '(allout 2 3) package--builtin-versions) (autoload 'allout-auto-activation-helper "allout" "\ Institute `allout-auto-activation'. @@ -758,7 +758,7 @@ for details on preparing Emacs for automatic allout activation. ;;; Generated autoloads from allout-widgets.el -(push (purecopy '(allout-widgets 1 0)) package--builtin-versions) +(push '(allout-widgets 1 0) package--builtin-versions) (autoload 'allout-widgets-setup "allout-widgets" "\ Commission or decommission `allout-widgets-mode' along with `allout-mode'. @@ -874,7 +874,7 @@ the buffer *Birthday-Present-for-Name*. ;;; Generated autoloads from ansi-color.el -(push (purecopy '(ansi-color 3 4 2)) package--builtin-versions) +(push '(ansi-color 3 4 2) package--builtin-versions) (autoload 'ansi-color-for-comint-mode-on "ansi-color" "\ Set `ansi-color-for-comint-mode' to t." t) (autoload 'ansi-color-process-output "ansi-color" "\ @@ -909,7 +909,7 @@ and is meant to be used in `compilation-filter-hook'.") ;;; Generated autoloads from progmodes/antlr-mode.el -(push (purecopy '(antlr-mode 2 2 3)) package--builtin-versions) +(push '(antlr-mode 2 2 3) package--builtin-versions) (autoload 'antlr-show-makefile-rules "antlr-mode" "\ Show Makefile rules for all grammar files in the current directory. If the `major-mode' of the current buffer has the value `makefile-mode', @@ -1420,9 +1420,7 @@ Features a private abbrev table and the following bindings: The character used for making comments is set by the variable `asm-comment-char' (which defaults to `?\\;'). - -Alternatively, you may set this variable in `asm-mode-set-comment-hook', -which is called near the beginning of mode initialization. +Alternatively, you may set this variable in `asm-mode-hook'. Turning on Asm mode runs the hook `asm-mode-hook' at the end of initialization. @@ -1470,7 +1468,7 @@ by doing (clear-string STRING). ;;; Generated autoloads from auth-source-pass.el -(push (purecopy '(auth-source-pass 5 0 0)) package--builtin-versions) +(push '(auth-source-pass 5 0 0) package--builtin-versions) (autoload 'auth-source-pass-enable "auth-source-pass" "\ Enable auth-source-password-store.") (autoload 'auth-source-pass-get "auth-source-pass" "\ @@ -1684,6 +1682,11 @@ The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG)" t) +(defvar inhibit-auto-revert-buffers nil "\ +A list of buffers with suppressed auto-revert.") +(defmacro inhibit-auto-revert (&rest body) "\ +Deactivate auto-reverting of current buffer temporarily. +Run BODY." (declare (indent 0) (debug (body))) (let ((buf (make-symbol "buf"))) `(progn (dolist (,buf inhibit-auto-revert-buffers) (unless (buffer-live-p ,buf) (setq inhibit-auto-revert-buffers (delq ,buf inhibit-auto-revert-buffers)))) (let ((,buf (and (not (memq (current-buffer) inhibit-auto-revert-buffers)) (current-buffer)))) (unwind-protect (progn (when ,buf (add-to-list 'inhibit-auto-revert-buffers ,buf)) ,@body) (when ,buf (setq inhibit-auto-revert-buffers (delq ,buf inhibit-auto-revert-buffers)))))))) (register-definition-prefixes "autorevert" '("auto-revert-" "global-auto-revert-")) @@ -1729,7 +1732,7 @@ definition of \"random distance\".) ;;; Generated autoloads from emacs-lisp/backtrace.el -(push (purecopy '(backtrace 1 0)) package--builtin-versions) +(push '(backtrace 1 0) package--builtin-versions) (autoload 'backtrace "backtrace" "\ Print a trace of Lisp function calls currently active. Output stream used is value of `standard-output'.") @@ -1958,7 +1961,7 @@ Major mode for editing BibTeX style files. ;;; Generated autoloads from bind-key.el -(push (purecopy '(bind-key 2 4 1)) package--builtin-versions) +(push '(bind-key 2 4 1) package--builtin-versions) (defvar personal-keybindings nil "\ List of bindings performed by `bind-key'. @@ -2384,7 +2387,7 @@ deletion, or > if it is flagged for displaying." t) (defalias 'edit-bookmarks 'bookmark-bmenu-list) (autoload 'bookmark-bmenu-search "bookmark" "\ Incremental search of bookmarks, hiding the non-matches as we go." '(bookmark-bmenu-mode)) -(defvar menu-bar-bookmark-map (let ((map (make-sparse-keymap "Bookmark functions"))) (bindings--define-key map [load] '(menu-item "Load a Bookmark File..." bookmark-load :help "Load bookmarks from a bookmark file)")) (bindings--define-key map [write] '(menu-item "Save Bookmarks As..." bookmark-write :help "Write bookmarks to a file (reading the file name with the minibuffer)")) (bindings--define-key map [save] '(menu-item "Save Bookmarks" bookmark-save :help "Save currently defined bookmarks")) (bindings--define-key map [edit] '(menu-item "Edit Bookmark List" bookmark-bmenu-list :help "Display a list of existing bookmarks")) (bindings--define-key map [delete] '(menu-item "Delete Bookmark..." bookmark-delete :help "Delete a bookmark from the bookmark list")) (bindings--define-key map [delete-all] '(menu-item "Delete all Bookmarks..." bookmark-delete-all :help "Delete all bookmarks from the bookmark list")) (bindings--define-key map [rename] '(menu-item "Rename Bookmark..." bookmark-rename :help "Change the name of a bookmark")) (bindings--define-key map [locate] '(menu-item "Insert Location..." bookmark-locate :help "Insert the name of the file associated with a bookmark")) (bindings--define-key map [insert] '(menu-item "Insert Contents..." bookmark-insert :help "Insert the text of the file pointed to by a bookmark")) (bindings--define-key map [set] '(menu-item "Set Bookmark..." bookmark-set :help "Set a bookmark named inside a file.")) (bindings--define-key map [jump] '(menu-item "Jump to Bookmark..." bookmark-jump :help "Jump to a bookmark (a point in some file)")) map)) +(defvar menu-bar-bookmark-map (let ((map (make-sparse-keymap "Bookmark functions"))) (define-key map [load] '(menu-item "Load a Bookmark File..." bookmark-load :help "Load bookmarks from a bookmark file)")) (define-key map [write] '(menu-item "Save Bookmarks As..." bookmark-write :help "Write bookmarks to a file (reading the file name with the minibuffer)")) (define-key map [save] '(menu-item "Save Bookmarks" bookmark-save :help "Save currently defined bookmarks")) (define-key map [edit] '(menu-item "Edit Bookmark List" bookmark-bmenu-list :help "Display a list of existing bookmarks")) (define-key map [delete] '(menu-item "Delete Bookmark..." bookmark-delete :help "Delete a bookmark from the bookmark list")) (define-key map [delete-all] '(menu-item "Delete all Bookmarks..." bookmark-delete-all :help "Delete all bookmarks from the bookmark list")) (define-key map [rename] '(menu-item "Rename Bookmark..." bookmark-rename :help "Change the name of a bookmark")) (define-key map [locate] '(menu-item "Insert Location..." bookmark-locate :help "Insert the name of the file associated with a bookmark")) (define-key map [insert] '(menu-item "Insert Contents..." bookmark-insert :help "Insert the text of the file pointed to by a bookmark")) (define-key map [set] '(menu-item "Set Bookmark..." bookmark-set :help "Set a bookmark named inside a file.")) (define-key map [jump] '(menu-item "Jump to Bookmark..." bookmark-jump :help "Jump to a bookmark (a point in some file)")) map)) (defalias 'menu-bar-bookmark-map menu-bar-bookmark-map) (register-definition-prefixes "bookmark" '("bookmark-" "with-buffer-modified-unmodified")) @@ -2487,7 +2490,13 @@ Optional prefix argument ARG non-nil inverts the value of the option (fn &optional ARG)" t) (autoload 'browse-url-with-browser-kind "browse-url" "\ Browse URL with a browser of the given browser KIND. -KIND is either `internal' or `external'. + +KIND is either `internal' or `external'. In order to find an +appropriate browser for the given KIND, first consult the `browse-url-handlers' +and `browse-url-default-handlers' lists. If no handler is found, try the +functions `browse-url-browser-function', +`browse-url-secondary-browser-function', `browse-url-default-browser' +and `eww', in that order. When called interactively, the default browser kind is the opposite of the browser kind of `browse-url-browser-function'. @@ -2568,6 +2577,12 @@ If `browse-url-android-share' is non-nil, try to share URL using an external program instead. Default to the URL around or before point. +(fn URL &optional NEW-WINDOW)" t) +(autoload 'browse-url-default-gtk-browser "browse-url" "\ +Browse URL with GTK's idea of the default browser. +If the selected frame isn't a GTK frame, fall back to +`browse-url-default-browser'. + (fn URL &optional NEW-WINDOW)" t) (autoload 'browse-url-emacs "browse-url" "\ Ask Emacs to load URL into a buffer and show it in another window. @@ -2575,41 +2590,6 @@ Optional argument SAME-WINDOW non-nil means show the URL in the currently selected window instead. (fn URL &optional SAME-WINDOW)" t) -(autoload 'browse-url-gnome-moz "browse-url" "\ -Ask Mozilla to load URL via the GNOME program `gnome-moz-remote'. -Default to the URL around or before point. The strings in variable -`browse-url-gnome-moz-arguments' are also passed. - -When called interactively, if variable `browse-url-new-window-flag' is -non-nil, load the document in a new browser window, otherwise use an -existing one. A non-nil interactive prefix argument reverses the -effect of `browse-url-new-window-flag'. - -When called non-interactively, optional second argument NEW-WINDOW is -used instead of `browse-url-new-window-flag'. - -(fn URL &optional NEW-WINDOW)" t) -(make-obsolete 'browse-url-gnome-moz 'nil "25.1") -(autoload 'browse-url-conkeror "browse-url" "\ -Ask the Conkeror WWW browser to load URL. -Default to the URL around or before point. Also pass the strings -in the variable `browse-url-conkeror-arguments' to Conkeror. - -When called interactively, if variable -`browse-url-new-window-flag' is non-nil, load the document in a -new Conkeror window, otherwise use a random existing one. A -non-nil interactive prefix argument reverses the effect of -`browse-url-new-window-flag'. - -If variable `browse-url-conkeror-new-window-is-buffer' is -non-nil, then whenever a document would otherwise be loaded in a -new window, load it in a new buffer in an existing window instead. - -When called non-interactively, use optional second argument -NEW-WINDOW instead of `browse-url-new-window-flag'. - -(fn URL &optional NEW-WINDOW)" t) -(make-obsolete 'browse-url-conkeror 'nil "28.1") (autoload 'browse-url-w3 "browse-url" "\ Ask the w3 WWW browser to load URL. Default to the URL around or before point. @@ -2623,13 +2603,6 @@ used instead of `browse-url-new-window-flag'. (fn URL &optional NEW-WINDOW)" t) (make-obsolete 'browse-url-w3 'nil "29.1") -(autoload 'browse-url-w3-gnudoit "browse-url" "\ -Ask another Emacs running emacsclient to load the URL using the W3 browser. -The `browse-url-gnudoit-program' program is used with options given by -`browse-url-gnudoit-args'. Default to the URL around or before point. - -(fn URL &optional NEW-WINDOW)" t) -(make-obsolete 'browse-url-w3-gnudoit 'nil "25.1") (autoload 'browse-url-text-xterm "browse-url" "\ Ask a text browser to load URL. URL defaults to the URL around or before point. @@ -3595,7 +3568,7 @@ the absolute file name of the file if STYLE-NAME is nil. ;;; Generated autoloads from progmodes/cc-mode.el -(push (purecopy '(cc-mode 5 33 1)) package--builtin-versions) +(push '(cc-mode 5 33 1) package--builtin-versions) (autoload 'c-initialize-cc-mode "cc-mode" "\ Initialize CC Mode for use in the current buffer. If the optional NEW-STYLE-INIT is nil or left out then all necessary @@ -4116,7 +4089,7 @@ See the documentation of `define-ccl-program' for the detail of CCL program. ;;; Generated autoloads from cedet/cedet.el -(push (purecopy '(cedet 2 0)) package--builtin-versions) +(push '(cedet 2 0) package--builtin-versions) (register-definition-prefixes "cedet" '("cedet-")) @@ -4142,7 +4115,7 @@ See the documentation of `define-ccl-program' for the detail of CCL program. ;;; Generated autoloads from progmodes/cfengine.el -(push (purecopy '(cfengine 1 4)) package--builtin-versions) +(push '(cfengine 1 4) package--builtin-versions) (autoload 'cfengine3-mode "cfengine" "\ Major mode for editing CFEngine3 input. There are no special keybindings by default. @@ -4508,7 +4481,7 @@ disabled. ;;; Generated autoloads from emacs-lisp/cl-generic.el -(push (purecopy '(cl-generic 1 0)) package--builtin-versions) +(push '(cl-generic 1 0) package--builtin-versions) ;;; Generated autoloads from emacs-lisp/cl-indent.el @@ -4595,7 +4568,7 @@ instead. ;;; Generated autoloads from emacs-lisp/cl-lib.el -(push (purecopy '(cl-lib 1 0)) package--builtin-versions) +(push '(cl-lib 1 0) package--builtin-versions) (defvar cl-custom-print-functions nil "\ This is a list of functions that format user objects for printing. Each function is called in turn with three arguments: the object, the @@ -4654,7 +4627,7 @@ disabled. ;;; Generated autoloads from emacs-lisp/cl-print.el -(push (purecopy '(cl-print 1 0)) package--builtin-versions) +(push '(cl-print 1 0) package--builtin-versions) (autoload 'cl-print-object "cl-print" "\ Dispatcher to print OBJECT on STREAM according to its type. You can add methods to it to customize the output. @@ -4849,7 +4822,7 @@ See `make-comint' and `comint-exec'. (fn PROGRAM &optional SWITCHES)" t) (function-put 'comint-run 'interactive-only 'make-comint) -(defvar comint-file-name-prefix (purecopy "") "\ +(defvar comint-file-name-prefix "" "\ Prefix prepended to absolute file names taken from process input. This is used by Comint's and shell's completion functions, and by shell's directory tracking functions.") @@ -4945,6 +4918,8 @@ Force the produced .eln to be outputted in the eln system directory (the last entry in `native-comp-eln-load-path') unless `native-compile-target-directory' is non-nil. If the environment variable \"NATIVE_DISABLED\" is set, only byte compile.") +(autoload 'native-compile-prune-cache "comp" "\ +Remove .eln files that aren't applicable to the current Emacs invocation." t) (register-definition-prefixes "comp" '("comp-" "native-comp" "no-native-compile")) @@ -5120,7 +5095,7 @@ List of directories to search for source files named in error messages. Elements should be directory names, not file names of directories. The value nil as an element means to try the default directory.") (custom-autoload 'compilation-search-path "compile" t) -(defvar compile-command (purecopy "make -k ") "\ +(defvar compile-command "make -k " "\ Last shell command used to do a compilation; default for next compilation. Sometimes it is useful for files to supply local values for this variable. @@ -5417,7 +5392,43 @@ list.") ;;; Generated autoloads from emacs-lisp/cond-star.el -(register-definition-prefixes "cond-star" '("cond*" "match*")) +(autoload 'cond* "cond-star" "\ +Extended form of traditional Lisp `cond' construct. +A `cond*' construct is a series of clauses, and a clause +normally has the form (CONDITION BODY...). + +CONDITION can be a Lisp expression, as in `cond'. +Or it can be one of `(pcase* PATTERN DATUM)', +`(bind* BINDINGS...)', or `(match* PATTERN DATUM)', + +`(pcase* PATTERN DATUM)' means to match DATUM against the +pattern PATTERN, using the same pattern syntax as `pcase'. +The condition counts as true if PATTERN matches DATUM. + +`(bind* BINDINGS...)' means to bind BINDINGS (as if they were in `let*') +for the body of the clause. As a condition, it counts as true +if the first binding's value is non-nil. All the bindings are made +unconditionally for whatever scope they cover. + +`(match* PATTERN DATUM)' is an alternative to `pcase*' that uses another +syntax for its patterns, see `match*'. + +When a clause's condition is true, and it exits the `cond*' +or is the last clause, the value of the last expression +in its body becomes the return value of the `cond*' construct. + +Non-exit clause: + +If a clause has only one element, or if its first element is +a `bind*' clause, this clause never exits the `cond*' construct. +Instead, control always falls through to the next clause (if any). +All bindings made in CONDITION for the BODY of the non-exit clause +are passed along to the rest of the clauses in this `cond*' construct. + +\\[match*\\] for documentation of the patterns for use in `match*'. + +(fn &rest CLAUSES)" nil t) +(register-definition-prefixes "cond-star" '("cond*-" "match*")) ;;; Generated autoloads from textmodes/conf-mode.el @@ -7545,7 +7556,7 @@ the word at mouse click. ;;; Generated autoloads from vc/diff.el -(defvar diff-switches (purecopy "-u") "\ +(defvar diff-switches "-u" "\ A string or list of strings specifying switches to be passed to diff. This variable is also used in the `vc-diff' command (and related @@ -7553,7 +7564,7 @@ commands) if the backend-specific diff switch variable isn't set (`vc-git-diff-switches' for git, for instance), and `vc-diff-switches' isn't set.") (custom-autoload 'diff-switches "diff" t) -(defvar diff-command (purecopy "diff") "\ +(defvar diff-command "diff" "\ The command to use to run diff.") (custom-autoload 'diff-command "diff" t) (autoload 'diff "diff" "\ @@ -7680,7 +7691,7 @@ If given a \\[universal-argument] \\[universal-argument] prefix, also prompt for ;;; Generated autoloads from dired.el -(defvar dired-listing-switches (purecopy "-al") "\ +(defvar dired-listing-switches "-al" "\ Switches passed to `ls' for Dired. MUST contain the `l' option. May contain all other options that don't contradict `-l'; may contain even `F', `b', `i' and `s'. See also the variable @@ -7893,16 +7904,24 @@ redefine OBJECT if it is a symbol. Return a new, empty display table.") (autoload 'display-table-slot "disp-table" "\ Return the value of the extra slot in DISPLAY-TABLE named SLOT. -SLOT may be a number from 0 to 5 inclusive, or a slot name (symbol). +SLOT may be a number from 0 to 17 inclusive, or a slot name (symbol). Valid symbols are `truncation', `wrap', `escape', `control', -`selective-display', and `vertical-border'. +`selective-display', `vertical-border', `box-vertical', +`box-horizontal', `box-down-right', `box-down-left', `box-up-right', +`box-up-left',`box-double-vertical', `box-double-horizontal', +`box-double-down-right', `box-double-down-left', +`box-double-up-right', `box-double-up-left', (fn DISPLAY-TABLE SLOT)") (autoload 'set-display-table-slot "disp-table" "\ Set the value of the extra slot in DISPLAY-TABLE named SLOT to VALUE. -SLOT may be a number from 0 to 5 inclusive, or a name (symbol). +SLOT may be a number from 0 to 17 inclusive, or a name (symbol). Valid symbols are `truncation', `wrap', `escape', `control', -`selective-display', and `vertical-border'. +`selective-display', `vertical-border', `box-vertical', +`box-horizontal', `box-down-right', `box-down-left', `box-up-right', +`box-up-left',`box-double-vertical', `box-double-horizontal', +`box-double-down-right', `box-double-down-left', +`box-double-up-right', `box-double-up-left', (fn DISPLAY-TABLE SLOT VALUE)") (autoload 'describe-display-table "disp-table" "\ @@ -7911,6 +7930,13 @@ Describe the display table DT in a help buffer. (fn DT)") (autoload 'describe-current-display-table "disp-table" "\ Describe the display table in use in the selected window and buffer." t) +(autoload 'standard-display-unicode-special-glyphs "disp-table" "\ +Display some glyps using Unicode characters. +The glyphs being changed by this function are `vertical-border', +`box-vertical',`box-horizontal', `box-down-right', `box-down-left', +`box-up-right', `box-up-left',`box-double-vertical', +`box-double-horizontal', `box-double-down-right', +`box-double-down-left', `box-double-up-right', `box-double-up-left'," t) (autoload 'standard-display-8bit "disp-table" "\ Display characters representing raw bytes in the range L to H literally. @@ -8227,7 +8253,7 @@ Default is 2. ;;; Generated autoloads from dnd.el -(defvar dnd-protocol-alist `((,(purecopy "^file:///") . dnd-open-local-file) (,(purecopy "^file://[^/]") . dnd-open-file) (,(purecopy "^file:/[^/]") . dnd-open-local-file) (,(purecopy "^file:[^/]") . dnd-open-local-file) (,(purecopy "^\\(https?\\|ftp\\|nfs\\)://") . dnd-open-file)) "\ +(defvar dnd-protocol-alist '(("^file:///" . dnd-open-local-file) ("^file://[^/]" . dnd-open-file) ("^file:/[^/]" . dnd-open-local-file) ("^file:[^/]" . dnd-open-local-file) ("^\\(https?\\|ftp\\|nfs\\)://" . dnd-open-file)) "\ The functions to call for different protocols when a drop is made. This variable is used by `dnd-handle-multiple-urls'. The list contains of (REGEXP . FUNCTION) pairs. @@ -8981,7 +9007,7 @@ Read the .ecompleterc file.") ;;; Generated autoloads from cedet/ede.el -(push (purecopy '(ede 2 0)) package--builtin-versions) +(push '(ede 2 0) package--builtin-versions) (defvar global-ede-mode nil "\ Non-nil if Global Ede mode is enabled. See the `global-ede-mode' command @@ -9073,7 +9099,7 @@ Toggle edebugging of all forms." t) ;;; Generated autoloads from vc/ediff.el -(push (purecopy '(ediff 2 81 6)) package--builtin-versions) +(push '(ediff 2 81 6) package--builtin-versions) (autoload 'ediff-files "ediff" "\ Run Ediff on a pair of files, FILE-A and FILE-B. STARTUP-HOOKS is a list of functions that Emacs calls without @@ -9409,7 +9435,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see." t) ;;; Generated autoloads from editorconfig.el -(push (purecopy '(editorconfig 0 11 0)) package--builtin-versions) +(push '(editorconfig 0 11 0) package--builtin-versions) (defvar editorconfig-mode nil "\ Non-nil if Editorconfig mode is enabled. See the `editorconfig-mode' command @@ -9559,7 +9585,7 @@ Turn on EDT Emulation." t) ;;; Generated autoloads from progmodes/eglot.el -(push (purecopy '(eglot 1 17)) package--builtin-versions) +(push '(eglot 1 18) package--builtin-versions) (define-obsolete-function-alias 'eglot-update #'eglot-upgrade-eglot "29.1") (autoload 'eglot "eglot" "\ Start LSP server for PROJECT's buffers under MANAGED-MAJOR-MODES. @@ -9661,7 +9687,7 @@ BUFFER is put back into its original major mode. ;;; Generated autoloads from emacs-lisp/eieio.el -(push (purecopy '(eieio 1 4)) package--builtin-versions) +(push '(eieio 1 4) package--builtin-versions) (autoload 'make-instance "eieio" "\ Make a new instance of CLASS based on INITARGS. For example: @@ -9684,7 +9710,7 @@ for each slot. For example: ;;; Generated autoloads from emacs-lisp/eieio-core.el -(push (purecopy '(eieio-core 1 4)) package--builtin-versions) +(push '(eieio-core 1 4) package--builtin-versions) (autoload 'eieio-defclass-autoload "eieio-core" "\ Create autoload symbols for the EIEIO class CNAME. SUPERCLASSES are the superclasses that CNAME inherits from. @@ -9746,7 +9772,7 @@ Describe CTR if it is a class constructor. ;;; Generated autoloads from emacs-lisp/eldoc.el -(push (purecopy '(eldoc 1 15 0)) package--builtin-versions) +(push '(eldoc 1 15 0) package--builtin-versions) ;;; Generated autoloads from elec-pair.el @@ -10462,7 +10488,9 @@ The buffer is expected to contain a mail message." t) (function-put 'epa-mail-decrypt 'interactive-only 't) (autoload 'epa-mail-verify "epa-mail" "\ Verify OpenPGP cleartext signed messages in the current buffer. -The buffer is expected to contain a mail message." t) +The buffer is expected to contain a mail message. + +If the verification fails, signal an error." t) (function-put 'epa-mail-verify 'interactive-only 't) (autoload 'epa-mail-sign "epa-mail" "\ Sign the current buffer. @@ -10522,7 +10550,7 @@ disabled. ;;; Generated autoloads from epg.el -(push (purecopy '(epg 1 0 0)) package--builtin-versions) +(push '(epg 1 0 0) package--builtin-versions) (autoload 'epg-make-context "epg" "\ Return a context object. @@ -10565,7 +10593,7 @@ Look at CONFIG and try to expand GROUP. ;;; Generated autoloads from erc/erc.el -(push (purecopy '(erc 5 6 1 -4)) package--builtin-versions) +(push '(erc 5 6 1 -4) package--builtin-versions) (dolist (symbol '( erc-sasl erc-spelling ; 29 erc-imenu erc-nicks)) ; 30 (custom-add-load symbol symbol)) @@ -11025,7 +11053,7 @@ Default bookmark handler for Eshell buffers. ;;; Generated autoloads from eshell/eshell.el -(push (purecopy '(eshell 2 4 2)) package--builtin-versions) +(push '(eshell 2 4 2) package--builtin-versions) (autoload 'eshell "eshell" "\ Create an interactive Eshell buffer. Start a new Eshell session, or switch to an already active @@ -11081,7 +11109,7 @@ To switch to a new tags table, do not set this variable; instead, invoke `visit-tags-table', which is the only reliable way of setting the value of this variable, whether buffer-local or global. Use the `etags' program to make a tags table file.") - (put 'tags-file-name 'variable-interactive (purecopy "fVisit tags table: ")) + (put 'tags-file-name 'variable-interactive "fVisit tags table: ") (put 'tags-file-name 'safe-local-variable 'stringp) (defvar tags-case-fold-search 'default "\ Whether tags operations should be case-sensitive. @@ -11096,7 +11124,7 @@ To switch to a new list of tags tables, setting this variable is sufficient. If you set this variable, do not also set `tags-file-name'. Use the `etags' program to make a tags table file.") (custom-autoload 'tags-table-list "etags" t) -(defvar tags-compression-info-list (purecopy '("" ".Z" ".bz2" ".gz" ".xz" ".tgz")) "\ +(defvar tags-compression-info-list '("" ".Z" ".bz2" ".gz" ".xz" ".tgz") "\ List of extensions tried by etags when `auto-compression-mode' is on. An empty string means search the non-compressed file.") (custom-autoload 'tags-compression-info-list "etags" t) @@ -11627,7 +11655,7 @@ queries the server for the existing fields and displays a corresponding form. (autoload 'eudc-load-eudc "eudc" "\ Load the Emacs Unified Directory Client. This does nothing except loading eudc by autoload side-effect." t) -(defvar eudc-tools-menu (let ((map (make-sparse-keymap "Directory Servers"))) (define-key map [phone] `(menu-item ,(purecopy "Get Phone") eudc-get-phone :help ,(purecopy "Get the phone field of name from the directory server"))) (define-key map [email] `(menu-item ,(purecopy "Get Email") eudc-get-email :help ,(purecopy "Get the email field of NAME from the directory server"))) (define-key map [separator-eudc-email] menu-bar-separator) (define-key map [expand-inline] `(menu-item ,(purecopy "Expand Inline Query") eudc-expand-inline :help ,(purecopy "Query the directory server, and expand the query string before point"))) (define-key map [query] `(menu-item ,(purecopy "Query with Form") eudc-query-form :help ,(purecopy "Display a form to query the directory server"))) (define-key map [separator-eudc-query] menu-bar-separator) (define-key map [new] `(menu-item ,(purecopy "New Server") eudc-set-server :help ,(purecopy "Set the directory server to SERVER using PROTOCOL"))) (define-key map [load] `(menu-item ,(purecopy "Load Hotlist of Servers") eudc-load-eudc :help ,(purecopy "Load the Emacs Unified Directory Client"))) map)) +(defvar eudc-tools-menu (let ((map (make-sparse-keymap "Directory Servers"))) (define-key map [phone] '(menu-item "Get Phone" eudc-get-phone :help "Get the phone field of name from the directory server")) (define-key map [email] '(menu-item "Get Email" eudc-get-email :help "Get the email field of NAME from the directory server")) (define-key map [separator-eudc-email] menu-bar-separator) (define-key map [expand-inline] '(menu-item "Expand Inline Query" eudc-expand-inline :help "Query the directory server, and expand the query string before point")) (define-key map [query] '(menu-item "Query with Form" eudc-query-form :help "Display a form to query the directory server")) (define-key map [separator-eudc-query] menu-bar-separator) (define-key map [new] '(menu-item "New Server" eudc-set-server :help "Set the directory server to SERVER using PROTOCOL")) (define-key map [load] '(menu-item "Load Hotlist of Servers" eudc-load-eudc :help "Load the Emacs Unified Directory Client")) map)) (fset 'eudc-tools-menu (symbol-value 'eudc-tools-menu)) (register-definition-prefixes "eudc" '("eudc-")) @@ -11837,8 +11865,9 @@ new buffer instead of reusing the default EWW buffer. (fn FILE &optional NEW-BUFFER)" t) (autoload 'eww-search-words "eww" "\ Search the web for the text in the region. -If region is active (and not whitespace), search the web for -the text between region beginning and end. Else, prompt the +If region is active (and not whitespace), search the web for the +text between region beginning and end, subject to user's confirmation +controlled by `eww-search-confirm-send-region'. Else, prompt the user for a search string. See the variable `eww-search-prefix' for the search engine used." t) (autoload 'eww-mode "eww" "\ @@ -11952,7 +11981,7 @@ This is used only in conjunction with `expand-add-abbrevs'." t) ;;; Generated autoloads from external-completion.el -(push (purecopy '(external-completion 0 1)) package--builtin-versions) +(push '(external-completion 0 1) package--builtin-versions) (register-definition-prefixes "external-completion" '("external-completion-")) @@ -12270,7 +12299,7 @@ color. The function should accept a single argument, the color name. ;;; Generated autoloads from emacs-lisp/faceup.el -(push (purecopy '(faceup 0 0 6)) package--builtin-versions) +(push '(faceup 0 0 6) package--builtin-versions) (autoload 'faceup-view-buffer "faceup" "\ Display the faceup representation of the current buffer." t) (autoload 'faceup-write-file "faceup" "\ @@ -12307,7 +12336,7 @@ FUNCTION must return an explanation when the test fails and ;;; Generated autoloads from mail/feedmail.el -(push (purecopy '(feedmail 11)) package--builtin-versions) +(push '(feedmail 11) package--builtin-versions) (autoload 'feedmail-send-it "feedmail" "\ Send the current mail buffer using the Feedmail package. This is a suitable value for `send-mail-function'. It can be used @@ -12737,7 +12766,7 @@ Set up hooks, load the cache file -- if existing -- and build the menu.") ;;; Generated autoloads from find-cmd.el -(push (purecopy '(find-cmd 0 6)) package--builtin-versions) +(push '(find-cmd 0 6) package--builtin-versions) (autoload 'find-cmd "find-cmd" "\ Initiate the building of a find command. For example: @@ -12819,7 +12848,7 @@ specifies what to use in place of \"-ls\" as the final argument. ;;; Generated autoloads from find-file.el -(defvar ff-special-constructs `((,(purecopy "^#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]") \, (lambda nil (match-string 2)))) "\ +(defvar ff-special-constructs `(("^#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]" \, (lambda nil (match-string 2)))) "\ List of special constructs recognized by `ff-treat-as-special'. Each element, tried in order, has the form (REGEXP . EXTRACT). If REGEXP matches the current line (from the beginning of the line), @@ -12939,12 +12968,21 @@ Search for SYMBOL's definition of type TYPE in LIBRARY. Visit the library in a buffer, and return a cons cell (BUFFER . POSITION), or just (BUFFER . nil) if the definition can't be found in the file. -If TYPE is nil, look for a function definition. -Otherwise, TYPE specifies the kind of definition, -and it is interpreted via `find-function-regexp-alist'. +If TYPE is nil, look for a function definition, +otherwise, TYPE specifies the kind of definition. +TYPE is looked up in SYMBOL's property `find-function-type-alist' +(which can be maintained with `find-function-update-type-alist') +or the variable `find-function-regexp-alist'. + The search is done in the source for library LIBRARY. (fn SYMBOL TYPE LIBRARY)") +(autoload 'find-function-update-type-alist "find-func" "\ +Update SYMBOL property `find-function-type-alist' with (TYPE . VARIABLE). +Property `find-function-type-alist' is a symbol-specific version +of variable `find-function-regexp-alist' and has the same format. + +(fn SYMBOL TYPE VARIABLE)") (autoload 'find-function-noselect "find-func" "\ Return a pair (BUFFER . POINT) pointing to the definition of FUNCTION. @@ -13157,7 +13195,7 @@ lines. ;;; Generated autoloads from progmodes/flymake.el -(push (purecopy '(flymake 1 3 7)) package--builtin-versions) +(push '(flymake 1 3 7) package--builtin-versions) (autoload 'flymake-log "flymake" "\ Log, at level LEVEL, the message MSG formatted with ARGS. LEVEL is passed to `display-warning', which is used to display @@ -13278,7 +13316,7 @@ REPORT-FN is Flymake's callback. ;;; Generated autoloads from progmodes/flymake-proc.el -(push (purecopy '(flymake-proc 1 0)) package--builtin-versions) +(push '(flymake-proc 1 0) package--builtin-versions) (register-definition-prefixes "flymake-proc" '("flymake-proc-")) @@ -13354,7 +13392,7 @@ Flyspell whole buffer." t) ;;; Generated autoloads from foldout.el -(push (purecopy '(foldout 1 10)) package--builtin-versions) +(push '(foldout 1 10) package--builtin-versions) (register-definition-prefixes "foldout" '("foldout-")) @@ -14235,7 +14273,7 @@ DEFAULT-MAP specifies the default key map for ICON-LIST. ;;; Generated autoloads from gnus/gnus.el -(push (purecopy '(gnus 5 13)) package--builtin-versions) +(push '(gnus 5 13) package--builtin-versions) (custom-autoload 'gnus-select-method "gnus") (autoload 'gnus-child-no-server "gnus" "\ Read network news as a child, without connecting to the local server. @@ -15221,14 +15259,14 @@ Face name to use for grep matches.") (defconst grep-regexp-alist `((,(concat "^\\(?:" "\\(?1:[^\0\n]+\\)\\(?3:\0\\)\\(?2:[0-9]+\\):" "\\|" "\\(?1:" "\\(?:[a-zA-Z]:\\)?" "[^\n:]+?[^\n/:]\\):[\11 ]*\\(?2:[1-9][0-9]*\\)[\11 ]*:" "\\)") 1 2 (,(lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face grep-match-face))) (when mbeg (- mbeg beg))))) \, (lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face grep-match-face)) (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) (when mend (- mend beg 1)))))) nil nil (3 '(face nil display ":"))) ("^Binary file \\(.+\\) matches" 1 nil nil 0 1)) "\ Regexp used to match grep hits. See `compilation-error-regexp-alist' for format details.") -(defvar grep-program (purecopy "grep") "\ +(defvar grep-program "grep" "\ The default grep program for `grep-command' and `grep-find-command'. This variable's value takes effect when `grep-compute-defaults' is called.") -(defvar find-program (purecopy "find") "\ +(defvar find-program "find" "\ The default find program. This is used by commands like `grep-find-command', `find-dired' and others.") -(defvar xargs-program (purecopy "xargs") "\ +(defvar xargs-program "xargs" "\ The default xargs program for `grep-find-command'. See `grep-find-use-xargs'. This variable's value takes effect when `grep-compute-defaults' is called.") @@ -15707,20 +15745,20 @@ If the `kbd-help' text or overlay property at point produces a string, return it. Otherwise, use the `help-echo' property. If this produces no string either, return nil.") (autoload 'display-local-help "help-at-pt" "\ -Display local help in the echo area. -This command, by default, displays a short help message, namely -the string produced by the `kbd-help' property at point. If -`kbd-help' does not produce a string, but the `help-echo' -property does, then that string is printed instead. +Display in the echo area `kbd-help' or `help-echo' text at point. +This command displays the help message which is the string produced +by the `kbd-help' property at point. If `kbd-help' at point does not +produce a string, but the `help-echo' property does, then that string +is displayed instead. The string is passed through `substitute-command-keys' before it is displayed. -If INHIBIT-WARNING is non-nil, this prevents display of a message -in case there is no help. +If INHIBIT-WARNING is non-nil, do not display a warning message when +there is no help property at point. If DESCRIBE-BUTTON in non-nil (interactively, the prefix arg), and -there's a button/widget at point, pop a buffer describing that +there's a button/widget at point, pop up a buffer describing that button/widget instead. (fn &optional INHIBIT-WARNING DESCRIBE-BUTTON)" t) @@ -16461,7 +16499,7 @@ disabled. ;;; Generated autoloads from progmodes/hideshow.el -(defvar hs-special-modes-alist (mapcar #'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c-ts-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (c++-ts-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (java-ts-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil) (js-ts-mode "{" "}" "/[*/]" nil) (lua-ts-mode "{\\|\\[\\[" "}\\|\\]\\]" "--" nil) (mhtml-mode "{\\|<[^/>]*?" "}\\|]*[^/]>" "