commit 218fc1cc04fa4af4182e076668fc6ebe6967f286 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Tue Aug 19 19:18:28 2025 +0300 ; * lisp/progmodes/eglot.el (eglot--managed-mode): Pacify byte-compiler. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 4a7c525003c..29e6c269fdf 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2242,7 +2242,7 @@ Use `eglot-managed-p' to determine if current buffer is managed.") (when (and eglot-autoshutdown (null (eglot--managed-buffers server)) ;; Don't shutdown if up again soon. - (not revert-buffer-in-progress-p)) + (with-no-warnings (not revert-buffer-in-progress-p))) (eglot-shutdown server))))))) (defun eglot--managed-mode-off () commit 63662f6ceeb7644d24cbd8b50c8bd8d0c19e79ed Author: Spencer Baugh Date: Tue Apr 8 17:13:08 2025 -0400 Signal end-of-file with more correct data end_of_file_error previously always signaled end-of-file with load-true-file-name if that was non-nil (and a string). However, this might be the wrong thing to do; for example, if a file being loaded calls read on a buffer. * src/lread.c (end_of_file_error): : New argument; check it to determine what data to signal with. (bug#68546) (read_char_escape, read_char_literal, read_string_literal) (skip_space_and_comments, read0): Pass source to end_of_file_error. diff --git a/src/lread.c b/src/lread.c index 57d3239e283..80172dbe7c8 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2114,12 +2114,16 @@ build_load_history (Lisp_Object filename, bool entire) information. */ static AVOID -end_of_file_error (void) +end_of_file_error (source_t *source) { - if (STRINGP (Vload_true_file_name)) + if (from_file_p (source)) + /* Only Fload calls read on a file, and Fload always binds + load-true-file-name around the call. */ xsignal1 (Qend_of_file, Vload_true_file_name); - - xsignal0 (Qend_of_file); + else if (source->get == source_buffer_get) + xsignal1 (Qend_of_file, source->object); + else + xsignal0 (Qend_of_file); } static Lisp_Object @@ -2604,7 +2608,7 @@ read_char_escape (source_t *source, int next_char) switch (c) { case -1: - end_of_file_error (); + end_of_file_error (source); case 'a': chr = '\a'; break; case 'b': chr = '\b'; break; @@ -2777,7 +2781,7 @@ read_char_escape (source_t *source, int next_char) { int c = readchar (source); if (c < 0) - end_of_file_error (); + end_of_file_error (source); if (c == '}') break; if (c >= 0x80) @@ -2819,7 +2823,7 @@ read_char_escape (source_t *source, int next_char) break; } if (chr < 0) - end_of_file_error (); + end_of_file_error (source); eassert (chr >= 0 && chr < (1 << CHARACTERBITS)); /* Apply Control modifiers, using the rules: @@ -2982,7 +2986,7 @@ read_char_literal (source_t *source) { int ch = readchar (source); if (ch < 0) - end_of_file_error (); + end_of_file_error (source); /* Accept `single space' syntax like (list ? x) where the whitespace character is SPC or TAB. @@ -3118,7 +3122,7 @@ read_string_literal (source_t *source) } if (ch < 0) - end_of_file_error (); + end_of_file_error (source); if (!force_multibyte && force_singlebyte) { @@ -3548,7 +3552,7 @@ skip_space_and_comments (source_t *source) c = readchar (source); while (c >= 0 && c != '\n'); if (c < 0) - end_of_file_error (); + end_of_file_error (source); } while (c <= 32 || c == NO_BREAK_SPACE); unreadchar (source, c); @@ -3734,7 +3738,7 @@ read0 (source_t *source, bool locate_syms) Lisp_Object obj; int c = readchar (source); if (c < 0) - end_of_file_error (); + end_of_file_error (source); switch (c) { @@ -4151,7 +4155,7 @@ read0 (source_t *source, bool locate_syms) { c = readchar (source); if (c < 0) - end_of_file_error (); + end_of_file_error (source); quoted = true; } commit ab577467e4feb681246a8d28afde729c6040dfc7 Author: Gerd Möllmann Date: Tue Aug 19 14:43:58 2025 +0200 ; Revert last change in eglot * lisp/progmodes/eglot.el (eglot--managed-mode): Use revert-buffer-in-progress-p again. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 96391ca8dfe..4a7c525003c 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2242,7 +2242,7 @@ Use `eglot-managed-p' to determine if current buffer is managed.") (when (and eglot-autoshutdown (null (eglot--managed-buffers server)) ;; Don't shutdown if up again soon. - (not revert-buffer-in-progress)) + (not revert-buffer-in-progress-p)) (eglot-shutdown server))))))) (defun eglot--managed-mode-off () commit e92da50e057787c6ebbe0f4eb6ced3b2bc8d5bc4 Author: Gerd Möllmann Date: Tue Aug 19 13:02:34 2025 +0200 ; Pacify byte-compiler * lisp/progmodes/eglot.el (eglot--managed-mode): Use revert-buffer-in-progress instead of revert-buffer-in-progress-p. * lisp/vc/vc-hooks.el (vc-dir-resynch-file): Declare some functions. diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 4a7c525003c..96391ca8dfe 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2242,7 +2242,7 @@ Use `eglot-managed-p' to determine if current buffer is managed.") (when (and eglot-autoshutdown (null (eglot--managed-buffers server)) ;; Don't shutdown if up again soon. - (not revert-buffer-in-progress-p)) + (not revert-buffer-in-progress)) (eglot-shutdown server))))))) (defun eglot--managed-mode-off () diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index e3b2d207156..53602491cad 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -687,6 +687,9 @@ Before doing that, check if there are any old backups and get rid of them." (vc-make-version-backup file))))) (declare-function vc-dir-resynch-file "vc-dir" (&optional fname)) +(declare-function vc-fileset-diff-outgoing "vc" (&optional remote-location fileset)) +(declare-function vc-fileset-diff-incoming "vc" (&optional remote-location fileset)) +(declare-function vc-working-tree-switch-project "vc" (dir)) (defvar vc-dir-buffers nil "List of `vc-dir' buffers.") commit d40c7549297bd08be09b72debe35c0b1bf345cea Author: Philipp Stephani Date: Tue Aug 19 11:09:46 2025 +0200 Clarify that sequence/map functions don't alter their argument * lisp/emacs-lisp/seq.el (seq-sort, seq-sort-by, seq-reverse) (seq-concatenate, seq-into-sequence, seq-into, seq-filter, seq-remove) (seq-remove-at-position, seq-reduce, seq-find, seq-uniq, seq-mapcat) (seq-partition, seq-union, seq-intersection, seq-difference) (seq-group-by, seq-split, seq-keep): * lisp/emacs-lisp/map.el (map-filter, map-remove, map-merge) (map-merge-with): Clarify that these functions don't modify their sequence/map arguments. diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el index deeeec132cf..1e88630959d 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el @@ -350,7 +350,8 @@ The default implementation delegates to `map-apply'." (cl-defgeneric map-filter (pred map) "Return an alist of key/val pairs for which (PRED key val) is non-nil in MAP. -The default implementation delegates to `map-apply'." +The default implementation delegates to `map-apply'. +This does not modify MAP." (delq nil (map-apply (lambda (key val) (and (funcall pred key val) (cons key val))) @@ -358,7 +359,8 @@ The default implementation delegates to `map-apply'." (cl-defgeneric map-remove (pred map) "Return an alist of the key/val pairs for which (PRED key val) is nil in MAP. -The default implementation delegates to `map-filter'." +The default implementation delegates to `map-filter'. +This does not modify MAP." (map-filter (lambda (key val) (not (funcall pred key val))) map)) @@ -457,7 +459,8 @@ MAP may be of a type other than TYPE." (defun map-merge (type &rest maps) "Merge into a map of TYPE all the key/value pairs in MAPS. -See `map-into' for all supported values of TYPE." +See `map-into' for all supported values of TYPE. +This does not modify any of the MAPS." (apply #'map--merge (lambda (result key value) (setf (map-elt result key) value) @@ -469,7 +472,8 @@ See `map-into' for all supported values of TYPE." When two maps contain the same key, call FUNCTION on the two values and use the value FUNCTION returns. Each of MAPS can be an alist, plist, hash-table, or array. -See `map-into' for all supported values of TYPE." +See `map-into' for all supported values of TYPE. +This does not modify any of the MAPS." (let ((not-found (list nil))) (apply #'map--merge (lambda (result key value) diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index a7954e7614c..d8ffdb1fa20 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -274,7 +274,8 @@ Value is a sequence of the same type as SEQUENCE." (cl-defgeneric seq-sort (pred sequence) "Sort SEQUENCE using PRED as the sorting comparison function. -The result is a sequence of the same type as SEQUENCE." +The result is a sequence of the same type as SEQUENCE. The sort +operates on a copy of SEQUENCE and does not modify SEQUENCE." (let ((result (seq-sort pred (append sequence nil)))) (seq-into result (type-of sequence)))) @@ -285,7 +286,8 @@ The result is a sequence of the same type as SEQUENCE." (defun seq-sort-by (function pred sequence) "Sort SEQUENCE transformed by FUNCTION using PRED as the comparison function. Elements of SEQUENCE are transformed by FUNCTION before being -sorted. FUNCTION must be a function of one argument." +sorted. FUNCTION must be a function of one argument. The sort +operates on a copy of SEQUENCE and does not modify SEQUENCE." (seq-sort (lambda (a b) (funcall pred (funcall function a) @@ -293,7 +295,8 @@ sorted. FUNCTION must be a function of one argument." sequence)) (cl-defgeneric seq-reverse (sequence) - "Return a sequence with elements of SEQUENCE in reverse order." + "Return a sequence with elements of SEQUENCE in reverse order. +This does not modify SEQUENCE." (let ((result '())) (seq-map (lambda (elt) (push elt result)) @@ -307,6 +310,7 @@ sorted. FUNCTION must be a function of one argument." (cl-defgeneric seq-concatenate (type &rest sequences) "Concatenate SEQUENCES into a single sequence of type TYPE. TYPE must be one of following symbols: `vector', `string' or `list'. +This does not modify any of the SEQUENCES. \n(fn TYPE SEQUENCE...)" (setq sequences (mapcar #'seq-into-sequence sequences)) @@ -321,7 +325,9 @@ TYPE must be one of following symbols: `vector', `string' or `list'. The default implementation is to signal an error if SEQUENCE is not a sequence, specific functions should be implemented for new types -of sequence." +of sequence. + +This does not modify SEQUENCE." (unless (sequencep sequence) (error "Cannot convert %S into a sequence" sequence)) sequence) @@ -329,7 +335,7 @@ of sequence." (cl-defgeneric seq-into (sequence type) "Concatenate the elements of SEQUENCE into a sequence of type TYPE. TYPE can be one of the following symbols: `vector', `string' or -`list'." +`list'. This does not modify SEQUENCE." (pcase type (`vector (seq--into-vector sequence)) (`string (seq--into-string sequence)) @@ -338,7 +344,8 @@ TYPE can be one of the following symbols: `vector', `string' or ;;;###autoload (cl-defgeneric seq-filter (pred sequence) - "Return a list of all the elements in SEQUENCE for which PRED returns non-nil." + "Return a list of all the elements in SEQUENCE for which PRED returns non-nil. +This does not modify SEQUENCE." (let ((exclude (make-symbol "exclude"))) (delq exclude (seq-map (lambda (elt) (if (funcall pred elt) @@ -348,7 +355,8 @@ TYPE can be one of the following symbols: `vector', `string' or ;;;###autoload (cl-defgeneric seq-remove (pred sequence) - "Return a list of all the elements in SEQUENCE for which PRED returns nil." + "Return a list of all the elements in SEQUENCE for which PRED returns nil. +This does not modify SEQUENCE." (seq-filter (lambda (elt) (not (funcall pred elt))) sequence)) @@ -359,7 +367,8 @@ TYPE can be one of the following symbols: `vector', `string' or N is the (zero-based) index of the element that should not be in the result. -The result is a sequence of the same type as SEQUENCE." +The result is a sequence of the same type as SEQUENCE. +This does not modify SEQUENCE." (seq-concatenate (if (listp sequence) 'list (type-of sequence)) (seq-subseq sequence 0 n) @@ -376,7 +385,9 @@ third element of SEQUENCE, etc. FUNCTION will be called with INITIAL-VALUE (and then the accumulated value) as the first argument, and the elements from SEQUENCE as the second argument. -If SEQUENCE is empty, return INITIAL-VALUE and FUNCTION is not called." +If SEQUENCE is empty, return INITIAL-VALUE and FUNCTION is not called. + +This does not modify SEQUENCE." (if (seq-empty-p sequence) initial-value (let ((acc initial-value)) @@ -411,7 +422,9 @@ If no such element is found, return DEFAULT. Note that `seq-find' has an ambiguity if the found element is identical to DEFAULT, as in that case it is impossible to know -whether an element was found or not." +whether an element was found or not. + +This does not modify SEQUENCE." (catch 'seq--break (seq-doseq (elt sequence) (when (funcall pred elt) @@ -485,7 +498,8 @@ The result is a list of (zero-based) indices." ;;;###autoload (cl-defgeneric seq-uniq (sequence &optional testfn) "Return a list of the elements of SEQUENCE with duplicates removed. -TESTFN is used to compare elements, and defaults to `equal'." +TESTFN is used to compare elements, and defaults to `equal'. +This does not modify SEQUENCE." (let ((result '())) (seq-doseq (elt sequence) (unless (seq-contains-p result elt testfn) @@ -521,14 +535,16 @@ TESTFN is used to compare elements, and defaults to `equal'." (cl-defgeneric seq-mapcat (function sequence &optional type) "Concatenate the results of applying FUNCTION to each element of SEQUENCE. -The result is a sequence of type TYPE; TYPE defaults to `list'." +The result is a sequence of type TYPE; TYPE defaults to `list'. +This does not modify SEQUENCE." (apply #'seq-concatenate (or type 'list) (seq-map function sequence))) (cl-defgeneric seq-partition (sequence n) "Return list of elements of SEQUENCE grouped into sub-sequences of length N. The last sequence may contain less than N elements. If N is a -negative integer or 0, the function returns nil." +negative integer or 0, the function returns nil. +This does not modify SEQUENCE." (unless (< n 1) (let ((result '())) (while (not (seq-empty-p sequence)) @@ -540,7 +556,8 @@ negative integer or 0, the function returns nil." (cl-defgeneric seq-union (sequence1 sequence2 &optional testfn) "Return a list of all the elements that appear in either SEQUENCE1 or SEQUENCE2. \"Equality\" of elements is defined by the function TESTFN, which -defaults to `equal'." +defaults to `equal'. +This does not modify SEQUENCE1 or SEQUENCE2." (let* ((accum (lambda (acc elt) (if (seq-contains-p acc elt testfn) acc @@ -553,7 +570,8 @@ defaults to `equal'." (cl-defgeneric seq-intersection (sequence1 sequence2 &optional testfn) "Return a list of all the elements that appear in both SEQUENCE1 and SEQUENCE2. \"Equality\" of elements is defined by the function TESTFN, which -defaults to `equal'." +defaults to `equal'. +This does not modify SEQUENCE1 or SEQUENCE2." (seq-reduce (lambda (acc elt) (if (seq-contains-p sequence2 elt testfn) (cons elt acc) @@ -564,7 +582,8 @@ defaults to `equal'." (cl-defgeneric seq-difference (sequence1 sequence2 &optional testfn) "Return list of all the elements that appear in SEQUENCE1 but not in SEQUENCE2. \"Equality\" of elements is defined by the function TESTFN, which -defaults to `equal'." +defaults to `equal'. +This does not modify SEQUENCE1 or SEQUENCE2." (seq-reduce (lambda (acc elt) (if (seq-contains-p sequence2 elt testfn) acc @@ -576,7 +595,7 @@ defaults to `equal'." (cl-defgeneric seq-group-by (function sequence) "Apply FUNCTION to each element of SEQUENCE. Separate the elements of SEQUENCE into an alist using the results as -keys. Keys are compared using `equal'." +keys. Keys are compared using `equal'. This does not modify SEQUENCE." (seq-reduce (lambda (acc elt) (let* ((key (funcall function elt)) @@ -692,7 +711,7 @@ Signal an error if SEQUENCE is empty." (defun seq-split (sequence length) "Split SEQUENCE into a list of sub-sequences of at most LENGTH elements. All the sub-sequences will be LENGTH long, except the last one, -which may be shorter." +which may be shorter. This does not modify SEQUENCE." (when (< length 1) (error "Sub-sequence length must be larger than zero")) (let ((result nil) @@ -705,7 +724,8 @@ which may be shorter." (nreverse result))) (defun seq-keep (function sequence) - "Apply FUNCTION to SEQUENCE and return the list of all the non-nil results." + "Apply FUNCTION to SEQUENCE and return the list of all the non-nil results. +This does not modify SEQUENCE." (delq nil (seq-map function sequence))) (provide 'seq)