commit ea04dd8ca93d609c0ee475c4acf58a56dfc0f1f3 (HEAD, refs/remotes/origin/master) Author: Gerd Möllmann Date: Thu Feb 6 05:31:38 2025 +0100 Use read-key in amp-y-or-n-p (bug#75886) * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Use read-key so that C-g in recognized when defined in input-decode-map. diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el index 14cbbfda033..18277b60fb8 100644 --- a/lisp/emacs-lisp/map-ynp.el +++ b/lisp/emacs-lisp/map-ynp.el @@ -185,7 +185,12 @@ The function's value is the number of actions taken." (let ((overriding-text-conversion-style nil)) (when (fboundp 'set-text-conversion-style) (set-text-conversion-style text-conversion-style)) - (setq char (read-event))) + ;; Do NOT use read-event here. That + ;; function does not consult + ;; input-decode-map (bug#75886). + (setq char (read-key)) + (when (eq char ?\C-g) + (signal 'quit nil))) (when (fboundp 'set-text-conversion-style) (set-text-conversion-style text-conversion-style))) ;; Show the answer to the question. commit 1f4a26df862917c956e79fc2ca111caebf895623 Merge: d10acd16c90 5c36b412653 Author: Stefan Monnier Date: Wed Feb 5 20:21:03 2025 -0500 Merge remote-tracking branch 'origin/emacs-30' commit d10acd16c90afe9fc8534fcd174397b7c403eda9 Author: Antero Mejr Date: Sat Jan 18 22:35:39 2025 -0500 Add scheme-mode indentation for SRFI 64, R7RS guard * lisp/progmodes/scheme.el: Add properties for SRFI 64 and R7RS guard identifiers. (Bug#75999) diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index 8896c2547c8..6fa92164f43 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el @@ -681,10 +681,15 @@ indentation." (put 'define-values 'scheme-indent-function 1) (put 'define-record-type 'scheme-indent-function 1) ;; is 1 correct? (put 'define-library 'scheme-indent-function 1) +(put 'guard 'scheme-indent-function 1) ;; SRFI-8 (put 'receive 'scheme-indent-function 2) +;; SRFI 64 +(put 'test-group 'scheme-indent-function 1) +(put 'test-group-with-cleanup 'scheme-indent-function 1) + ;; SRFI-204 (withdrawn, but provided in many implementations, see the SRFI text) (put 'match 'scheme-indent-function 1) (put 'match-lambda 'scheme-indent-function 0) commit 4be087f1e12afb2ea4de1a5686d14a28a9a20940 Author: Stefan Monnier Date: Wed Feb 5 19:43:45 2025 -0500 (font-ccl-encoder-alist): Delete variable, unused * src/ccl.c (syms_of_ccl): Remove `font-ccl-encoder-alist`. * lisp/language/ethiopic.el (ccl-encode-ethio-font): Delete CCL program. (font-ccl-encoder-alist): Don't modify it. diff --git a/lisp/language/ethiopic.el b/lisp/language/ethiopic.el index 14098c7e470..9c254cbfc6e 100644 --- a/lisp/language/ethiopic.el +++ b/lisp/language/ethiopic.el @@ -36,28 +36,6 @@ ;;; Code: -(define-ccl-program ccl-encode-ethio-font - '(0 - ;; In: R0:ethiopic (not checked) - ;; R1:position code 1 - ;; R2:position code 2 - ;; Out: R1:font code point 1 - ;; R2:font code point 2 - ((r1 -= 33) - (r2 -= 33) - (r1 *= 94) - (r2 += r1) - (if (r2 < 256) - (r1 = #x12) - (if (r2 < 448) - ((r1 = #x13) (r2 -= 256)) - ((r1 = #xfd) (r2 -= 208)) - )))) - "CCL program to encode an Ethiopic code to code point of Ethiopic font.") - -(setq font-ccl-encoder-alist - (cons (cons "ethiopic" ccl-encode-ethio-font) font-ccl-encoder-alist)) - (set-language-info-alist "Ethiopic" '((setup-function . setup-ethiopic-environment-internal) (exit-function . exit-ethiopic-environment) diff --git a/src/ccl.c b/src/ccl.c index 78845ebaf65..a45fe0439c4 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -2379,19 +2379,6 @@ syms_of_ccl (void) doc: /* Vector of code conversion maps. */); Vcode_conversion_map_vector = make_nil_vector (16); - DEFVAR_LISP ("font-ccl-encoder-alist", Vfont_ccl_encoder_alist, - doc: /* Alist of fontname patterns vs corresponding CCL program. -Each element looks like (REGEXP . CCL-CODE), - where CCL-CODE is a compiled CCL program. -When a font whose name matches REGEXP is used for displaying a character, - CCL-CODE is executed to calculate the code point in the font - from the charset number and position code(s) of the character which are set - in CCL registers R0, R1, and R2 before the execution. -The code point in the font is set in CCL registers R1 and R2 - when the execution terminated. - If the font is single-byte font, the register R2 is not used. */); - Vfont_ccl_encoder_alist = Qnil; - DEFVAR_LISP ("translation-hash-table-vector", Vtranslation_hash_table_vector, doc: /* Vector containing all translation hash tables ever defined. Comprises pairs (SYMBOL . TABLE) where SYMBOL and TABLE were set up by calls commit bfc8540da4521d460b72fdbc20edb3a0488c23c2 Author: Eli Zaretskii Date: Wed Feb 5 15:48:49 2025 +0200 * lisp/dired-x.el (dired-omit-expunge): Escape '%' (bug#75877). diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 4a05f609b2b..89390a482f0 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -498,8 +498,10 @@ status message." nil (if dired-omit-verbose (format "Omitted %%d line%%s in %s" - (abbreviate-file-name - dired-directory)) + (replace-regexp-in-string + "%" "%%" + (abbreviate-file-name + dired-directory))) "") init-count))) (force-mode-line-update)))) commit 85113fcda97970bc2468f409278e27d6570fc76f Author: Mauro Aranda Date: Fri Jan 17 17:12:08 2025 -0300 Prepare markers for insertions inside of a widget Recreating child widgets without recreating the parent widget may lead to situations where the parent widget doesn't cover its children or buttons entirely anymore. This bug manifests as a faulty fontification of children or buttons, for example. (Bug#69941) * lisp/wid-edit.el (widget--prepare-markers-for-inside-insertion) (widget--prepare-markers-for-outside-insertion): New functions. (widget-default-create): Use them. * test/lisp/wid-edit-tests.el (widget-test-insertion-at-parent-markers) (widget-test-insertion-at-parent-markers-2): New tests. diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 7260f60196a..a1d4c4850ae 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -1730,6 +1730,49 @@ The value of the :type attribute should be an unconverted widget type." (call-interactively (widget-get widget :complete-function)))))))) +(defun widget--prepare-markers-for-inside-insertion (widget) + "Prepare the WIDGET's parent for insertions inside it, if necessary. + +Usually, the :from marker has type t, while the :to marker has type nil. +When recreating a child or a button inside a composite widget right at these +markers, they have to be changed to nil and t respectively, +so that the WIDGET's parent (if any), properly contains all of its +recreated children and buttons. + +Prepares also the markers of the WIDGET's grandparent, if necessary. + +Returns a list of the markers that had its type changed, for later resetting." + (let* ((parent (widget-get widget :parent)) + (parent-from-marker (and parent (widget-get parent :from))) + (parent-to-marker (and parent (widget-get parent :to))) + (lst nil) + (pos (point))) + (when (and parent-from-marker + (eq pos (marker-position parent-from-marker)) + (marker-insertion-type parent-from-marker)) + (set-marker-insertion-type parent-from-marker nil) + (push (cons parent-from-marker t) lst)) + (when (and parent-to-marker + (eq pos (marker-position parent-to-marker)) + (not (marker-insertion-type parent-to-marker))) + (set-marker-insertion-type parent-to-marker t) + (push (cons parent-to-marker nil) lst)) + (when lst + (nconc lst (widget--prepare-markers-for-inside-insertion parent))))) + +(defun widget--revert-markers-for-outside-insertion (markers) + "Revert MARKERS for insertions that do not belong to a widget. + +MARKERS is a list of the form (MARKER . NEW-TYPE), as returned by +`widget--prepare-markers-for-inside-insertion' and this function sets MARKER +to NEW-TYPE. + +Coupled with `widget--prepare-parent-for-inside-insertion', this has the effect +of setting markers back to the type needed for insertions that do not belong +to a given widget." + (dolist (marker markers) + (set-marker-insertion-type (car marker) (cdr marker)))) + (defun widget-default-create (widget) "Create WIDGET at point in the current buffer." (widget-specify-insert @@ -1737,7 +1780,8 @@ The value of the :type attribute should be an unconverted widget type." button-begin button-end sample-begin sample-end doc-begin doc-end - value-pos) + value-pos + (markers (widget--prepare-markers-for-inside-insertion widget))) (insert (widget-get widget :format)) (goto-char from) ;; Parse escapes in format. @@ -1797,7 +1841,8 @@ The value of the :type attribute should be an unconverted widget type." (widget-specify-doc widget doc-begin doc-end)) (when value-pos (goto-char value-pos) - (widget-apply widget :value-create))) + (widget-apply widget :value-create)) + (widget--revert-markers-for-outside-insertion markers)) (let ((from (point-min-marker)) (to (point-max-marker))) (set-marker-insertion-type from t) diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el index c18e6d14c4c..e34aa64f8d1 100644 --- a/test/lisp/wid-edit-tests.el +++ b/test/lisp/wid-edit-tests.el @@ -430,4 +430,55 @@ return nil, even with a non-nil bubblep argument." (should-not (overlay-buffer field-overlay)) (should-not (overlay-buffer field-end-overlay))))) +;; The following two tests are for Bug#69941. Markers need to be prepared +;; against "inside" insertions at them. That is, a recreated child should +;; still be covered by the parent's :from and :to markers. +(ert-deftest widget-test-insertion-at-parent-markers () + "Test that recreating a child keeps the parent's markers covering it. + +Test the most common situation, where only one parent needs to be adjusted." + (with-temp-buffer + (let* ((group (widget-create 'group + :format "%v" + '(item :value 1 :format "%v"))) + (item (car (widget-get group :children))) + (ofrom (marker-position (widget-get group :from))) + (oto (marker-position (widget-get group :to)))) + (widget-insert "\n") + (widget-setup) + ;; Change item, without recreating the group. This causes changes + ;; right at the :from and :to markers, and if they don't have + ;; the right type, the group's :from-:to span won't include its + ;; child, the item widget, anymore. + (widget-value-set item 2) + ;; The positions should be the same as they were when the group + ;; widget was first created. + (should (= ofrom (widget-get group :from))) + (should (= oto (widget-get group :to)))))) + +(ert-deftest widget-test-insertion-at-parent-markers-2 () + "Test that recreating a child keeps the parent's marker covering it. + +Test the uncommon situation in which we might need to prepare the grandparent's +markers (and so on) as well." + (with-temp-buffer + (let* ((group (widget-create '(group + :format "%v" + (group + :format "%v" + (item :value 1 :format "%v"))))) + (group2 (car (widget-get group :children))) + (item (car (widget-get group2 :children))) + (ofrom (marker-position (widget-get group :from))) + (oto (marker-position (widget-get group :to))) + (ofrom2 (marker-position (widget-get group2 :from))) + (oto2 (marker-position (widget-get group2 :to)))) + (widget-insert "\n") + (widget-setup) + (widget-value-set item 2) + (should (= ofrom (widget-get group :from))) + (should (= oto (widget-get group :to))) + (should (= ofrom2 (widget-get group2 :from))) + (should (= oto2 (widget-get group2 :to)))))) + ;;; wid-edit-tests.el ends here commit a1f2f5995d69db646f58a7203ab6208556f0df4b Author: Eli Zaretskii Date: Wed Feb 5 14:44:01 2025 +0200 Revert "Improve bidi_get_time runtime checking" This reverts commit 782ec71053d8535511522f27f28c11682ca0f40b. It makes the code less readable and less future-proof, so a net loss. (Bug#75964) diff --git a/src/bidi.c b/src/bidi.c index fd0bebb85e0..d8754e2db73 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -282,6 +282,12 @@ bidi_get_type (int ch, bidi_dir_t override) emacs_abort (); default_type = (bidi_type_t) XFIXNUM (CHAR_TABLE_REF (bidi_type_table, ch)); + /* Every valid character code, even those that are unassigned by the + UCD, have some bidi-class property, according to + DerivedBidiClass.txt file. Therefore, if we ever get UNKNOWN_BT + (= zero) code from CHAR_TABLE_REF, that's a bug. */ + if (default_type == UNKNOWN_BT) + emacs_abort (); switch (default_type) { @@ -297,26 +303,13 @@ bidi_get_type (int ch, bidi_dir_t override) case FSI: case PDI: return default_type; - - case STRONG_L: case STRONG_R: - case WEAK_EN: case WEAK_AN: - case STRONG_AL: - case WEAK_ES: case WEAK_ET: case WEAK_CS: case WEAK_NSM: - case NEUTRAL_S: case NEUTRAL_WS: case NEUTRAL_ON: + default: if (override == L2R) return STRONG_L; else if (override == R2L) return STRONG_R; else return default_type; - - case UNKNOWN_BT: - default: - /* Every valid character code, even those unassigned by the UCD, - have some bidi-class property, according to DerivedBidiClass.txt. - Therefore, if we ever get UNKNOWN_BT (= zero) or some unknown - code from CHAR_TABLE_REF, that's a bug. */ - emacs_abort (); } } commit a476295620a692657f7febd4630cf67f128c4c65 Author: Michael Albinus Date: Wed Feb 5 09:41:49 2025 +0100 * lisp/autorevert.el (defvar): Fix debug declaration. diff --git a/lisp/autorevert.el b/lisp/autorevert.el index ddb116bb828..aeb80ff7884 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -780,7 +780,7 @@ If the buffer needs to be reverted, do it now." (defmacro inhibit-auto-revert (&rest body) "Deactivate auto-reverting of current buffer temporarily. Run BODY." - (declare (indent 0) (debug ((form body) body))) + (declare (indent 0) (debug (body))) `(progn ;; Cleanup. (dolist (buf inhibit-auto-revert-buffers) commit 5c36b4126533764bb8b90413f274d766e1a6f0d6 (refs/remotes/origin/emacs-30) Author: Eli Zaretskii Date: Tue Feb 4 16:06:36 2025 +0200 * src/fileio.c (Fsubstitute_in_file_name): Doc fix (bug#76023). diff --git a/src/fileio.c b/src/fileio.c index e522dd93cd6..7042dbca258 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2050,7 +2050,9 @@ the value of this function. If `/~' appears, all of FILENAME through that `/' is discarded. If `//' appears, everything up to and including the first of -those `/' is discarded. */) +those `/' is discarded. More generally, if a variable substitution +produces an absolute file name, everything before that file name +is discarded. */) (Lisp_Object filename) { char *nm, *p, *x, *endp; commit 73a45ce7206a107695b2b4d9761e249edd7502e9 Author: Stefan Kangas Date: Mon Feb 3 23:51:15 2025 +0100 ; Update link to picons database * lisp/gnus/gnus-art.el (gnus-picon-databases): Fix broken link. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 218cf319448..eb4263812ea 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -981,11 +981,11 @@ be controlled by `gnus-treat-body-boundary'." "/usr/share/picons") "Defines the location of the faces database. For information on obtaining this database of pretty pictures, please -see http://www.cs.indiana.edu/picons/ftp/index.html" +see https://kinzler.com/ftp/faces/picons/" :version "22.1" :type '(repeat directory) :link '(url-link :tag "download" - "http://www.cs.indiana.edu/picons/ftp/index.html") + "https://kinzler.com/ftp/faces/picons/") :link '(custom-manual "(gnus)Picons") :group 'gnus-picon) commit 1c3a8bc9b51cf89fc1eff181d39941d7f0c7b2e2 Author: Stefan Monnier Date: Mon Feb 3 15:50:36 2025 -0500 * lisp/emacs-lisp/track-changes.el (track-changes-fetch): Fix bug#75906 diff --git a/lisp/emacs-lisp/track-changes.el b/lisp/emacs-lisp/track-changes.el index 3f3b8d7bed9..1aac53b5f33 100644 --- a/lisp/emacs-lisp/track-changes.el +++ b/lisp/emacs-lisp/track-changes.el @@ -364,7 +364,9 @@ and re-enable the TRACKER corresponding to ID." track-changes--state)) ;; Nothing to do. nil) - (cl-assert (not (memq id track-changes--clean-trackers))) + ;; ID may still be in `track-changes--clean-trackers' if + ;; `after-change-functions' was skipped. + ;;(cl-assert (not (memq id track-changes--clean-trackers))) (cl-assert (<= (point-min) beg end (point-max))) ;; Update the tracker's state *before* running `func' so we don't risk ;; mistakenly replaying the changes in case `func' exits non-locally. commit a3b3083081299049b2ac2333d078c9cac62f2be4 Author: Stefan Kangas Date: Mon Feb 3 12:37:06 2025 +0100 ; Don't use HTTPS in HTTP-specific example * doc/misc/org.org (External Links): Change HTTP example to use HTTP. Changing it to HTTPS has been done before, but it's a mistake. To avoid making this mistake again, change the URL to orgmode.org to make it more similar to the example on the next line, thereby contrasting the two. diff --git a/doc/misc/org.org b/doc/misc/org.org index 363a95fa65c..26cb46cf13c 100644 --- a/doc/misc/org.org +++ b/doc/misc/org.org @@ -3403,7 +3403,7 @@ options: | Link Type | Example | |------------+--------------------------------------------------------------------| -| http | =https://staff.science.uva.nl/c.dominik/= | +| http | =http://orgmode.org/= | | https | =https://orgmode.org/= | | doi | =doi:10.1000/182= | | file | =file:/home/dominik/images/jupiter.jpg= | commit fbc13ba9ccf4590ccd15dafa35d3872807af9cbd Author: Michael Albinus Date: Mon Feb 3 12:51:48 2025 +0100 Better NaN handling in proced-tests.el * test/lisp/proced-tests.el (proced--cpu-at-point): Make it more robust. (proced--assert-process-valid-cpu-refinement): Handle `ert-test-skipped' signal. diff --git a/test/lisp/proced-tests.el b/test/lisp/proced-tests.el index e24163c3884..ecf23c5d037 100644 --- a/test/lisp/proced-tests.el +++ b/test/lisp/proced-tests.el @@ -38,10 +38,10 @@ (defun proced--cpu-at-point () "Return as an integer the current CPU value at point." (if (string-suffix-p "nan" (thing-at-point 'sexp)) - (let ((pid (proced-pid-at-point))) - (ert-skip - (format - "Found NaN value for %%CPU at point for process with PID %d" pid))) + (ert-skip + (format + "Found NaN value for %%CPU at point for process with PID %s" + (substring-no-properties (thing-at-point 'sexp)))) (thing-at-point 'number))) (defun proced--assert-emacs-pid-in-buffer () @@ -61,6 +61,7 @@ (proced--move-to-column "%CPU") (condition-case err (>= (proced--cpu-at-point) cpu) + (ert-test-skipped (signal (car err) (cdr err))) (error (ert-fail (list err (proced--assert-process-valid-cpu-refinement-explainer cpu)))))) commit a7f34a532cf7d99dac58bd7187f7ad82c1e4d789 Author: Robert Pluim Date: Sun Feb 2 13:33:37 2025 +0100 Fix padding when using which-key-setup-side-window-right * lisp/which-key.el (which-key--pad-column): Insert zero padding spaces when the description string is longer than the column width. (Bug#75765) diff --git a/lisp/which-key.el b/lisp/which-key.el index d33e8b1a3bb..6ae8dcbb1f0 100644 --- a/lisp/which-key.el +++ b/lisp/which-key.el @@ -2038,7 +2038,7 @@ that width." (mapcar (pcase-lambda (`(,key ,sep ,desc ,_doc)) (concat (format col-format key sep desc) - (make-string (- col-desc-width (string-width desc)) ?\s))) + (make-string (max (- col-desc-width (string-width desc)) 0) ?\s))) col-keys)))) (defun which-key--partition-list (n list) commit 6d7e7899d84600de3aa4bb5e4cb4013e48f7a8b5 Author: Eli Zaretskii Date: Sun Feb 2 15:58:18 2025 +0200 Improve documentation of 'display-monitor-attributes- * doc/lispref/frames.texi (Multiple Terminals): * lisp/frame.el (display-monitor-attributes-list): Better documentation of what the 'source' key means on X. (Bug#75936) diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 2426c9c890f..39bfed48e4e 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -420,7 +420,12 @@ Name of the physical monitor as @var{string}. @item source Source of the multi-monitor information as @var{string}; -e.g., @samp{XRandR 1.5}, @samp{XRandr} or @samp{Xinerama}. +on X, it could be @samp{XRandR 1.5}, @samp{XRandr}, @samp{Xinerama}, +@samp{Gdk}, or @samp{fallback}. The last value of @samp{source} means +that Emacs was built without GTK and without XRandR or Xinerama +extensions, in which case the information about multiple physical +monitors will be provided as if they all as a whole formed a single +monitor. @end table @var{x}, @var{y}, @var{width}, and @var{height} are integers. diff --git a/lisp/frame.el b/lisp/frame.el index 64b9f6acff8..ec3d38fa3fa 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -2465,6 +2465,10 @@ details depend on the platform and environment. The `source' attribute describes the source from which the information was obtained. On X, this may be one of: \"Gdk\", \"XRandR 1.5\", \"XRandr\", \"Xinerama\", or \"fallback\". +If it is \"fallback\", it means Emacs was built without GTK +and without XrandR or Xinerama extensions, in which case the +information about multiple physical monitors will be provided +as if they all as a whole formed a single monitor. A frame is dominated by a physical monitor when either the largest area of the frame resides in the monitor, or the monitor