commit 7d75ee2bd0b0b82e211f7d6e300c1592a6ab25ff (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Fri Oct 10 09:36:09 2025 +0300 ; * lisp/progmodes/flymake.el (flymake-margin-indicators-string): Doc fix. diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 19b6b31ec80..88ebf1ccd97 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -215,8 +215,9 @@ the corresponding string. The option `flymake-margin-indicator-position' controls how and where this is used. -When the \"DOUBLE EXCLAMATION MARK\" character is not displayable -by the terminal, it will be replaced by the ASCII equivalent." +Note that the default value \"DOUBLE EXCLAMATION MARK\" for the +indicator of the \\+`error' type will be silently replaced by the +ASCII equivalent if that character is not displayable by the terminal." :version "30.1" :type '(repeat :tag "Error types lists" (list :tag "String and face for error types" commit 816a7b5e25a6c1be84168f0edec45d942d500989 Author: Juri Linkov Date: Thu Oct 9 22:15:03 2025 +0300 * lisp/progmodes/flymake.el: Improve flymake--resize-margins. (flymake--resize-margins): Move checking for a non-displayable character to the loop over all supported symbols. (flymake-margin-indicators-string): Mention the character name in the docstring. diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 7268be9c8f8..19b6b31ec80 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -215,7 +215,7 @@ the corresponding string. The option `flymake-margin-indicator-position' controls how and where this is used. -When the default character for the error indicator is not displayable +When the \"DOUBLE EXCLAMATION MARK\" character is not displayable by the terminal, it will be replaced by the ASCII equivalent." :version "30.1" :type '(repeat :tag "Error types lists" @@ -876,10 +876,6 @@ associated `flymake-category' return DEFAULT." (defun flymake--resize-margins (&optional orig-width) "Resize current window margins according to `flymake-margin-indicator-position'. Return to original margin width if ORIG-WIDTH is non-nil." - (let ((indicator (get 'flymake-error 'flymake-margin-string))) - (when (and (equal (car indicator) "‼") (not (char-displayable-p ?‼))) - (put 'flymake-error 'flymake-margin-string (cons "!!" (cdr indicator))))) - (when (and (eq flymake-indicator-type 'margins) flymake-autoresize-margins) (cond @@ -888,10 +884,16 @@ Return to original margin width if ORIG-WIDTH is non-nil." (setq left-margin-width flymake--original-margin-width) (setq right-margin-width flymake--original-margin-width))) (t - (let ((width (apply #'max (mapcar (lambda (sym) - (string-width - (car (get sym 'flymake-margin-string)))) - '(flymake-error flymake-warning flymake-note))))) + (let* ((indicators + (mapcar (lambda (sym) + (let ((ind (get sym 'flymake-margin-string))) + (when (and (equal (car ind) "‼") + (not (char-displayable-p ?‼))) + (setq ind (cons "!!" (cdr ind))) + (put sym 'flymake-margin-string ind)) + (car ind))) + '(flymake-error flymake-warning flymake-note))) + (width (apply #'max (mapcar #'string-width indicators)))) (if (eq flymake-margin-indicator-position 'left-margin) (setq flymake--original-margin-width left-margin-width left-margin-width width) commit e2567eab108aa0b452fe7d84f501ef05b16429bb Author: Spencer Baugh Date: Thu Aug 14 15:15:29 2025 -0400 Treat a completion boundary change as completion In completion--do-completion, check if completion-try-completion moved point out of the old completion boundaries. If that happened, then we did non-trivial completion even if the string is otherwise unchanged. For example, ~/src/emacs/trunk/lisp|/progmodes/project.el hitting TAB moves us to: ~/src/emacs/trunk/lisp/|progmodes/project.el then hitting TAB again moves us to ~/src/emacs/trunk/lisp/progmodes/|project.el Both of these completions are successful, but we previously ran code for completion failure (the t branch of the cond in completion--do-completion) in the second case. In particular, we would always run minibuffer-completion-help, ignoring the specific value of completion-auto-help which controls whether or not to run minibuffer-completion-help. Now we correctly run code for successful completion for both cases. We also always have checked that we're in the same boundaries before doing completion cycling; that check is now more accurate (bug#79238). * lisp/minibuffer.el (completion--in-boundaries-p): Add. (completion--do-completion): Check completion--in-boundaries-p. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 9e87af82a24..472bcf618bf 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1562,6 +1562,15 @@ pair of a group title string and a list of group candidate strings." (if completion-show-inline-help (minibuffer-message msg))) +(defun completion--in-boundaries-p (string collection pred suffix pos) + "Return non-nil if POS is in the current completion boundaries. + +Calls `completion-boundaries' with STRING, COLLECTION, PRED, SUFFIX." + (let* ((boundaries (completion-boundaries string collection pred suffix)) + (start (car boundaries)) + (end (+ (length string) (cdr boundaries)))) + (>= start pos end))) + (defun completion--do-completion (beg end &optional try-completion-function expect-exact) "Do the completion and return a summary of what happened. @@ -1583,13 +1592,14 @@ TRY-COMPLETION-FUNCTION is a function to use in place of `try-completion'. EXPECT-EXACT, if non-nil, means that there is no need to tell the user when the buffer's text is already an exact match." (let* ((string (buffer-substring beg end)) + (pos (- (point) beg)) (md (completion--field-metadata beg)) (comp (funcall (or try-completion-function #'completion-try-completion) string minibuffer-completion-table minibuffer-completion-predicate - (- (point) beg) + pos md))) (cond ((null comp) @@ -1611,7 +1621,16 @@ when the buffer's text is already an exact match." (let* ((comp-pos (cdr comp)) (completion (car comp)) (completed (not (string-equal-ignore-case completion string))) - (unchanged (string-equal completion string))) + (unchanged (string-equal completion string)) + (only-changed-boundaries + (and (not completed) + (/= comp-pos pos) + (not (completion--in-boundaries-p + (substring string 0 pos) + minibuffer-completion-table + minibuffer-completion-predicate + (substring string pos) + comp-pos))))) (if unchanged (goto-char end) ;; Insert in minibuffer the chars we got. @@ -1640,15 +1659,8 @@ when the buffer's text is already an exact match." ;; try-completion and all-completions, for things ;; like completion-ignored-extensions. (when (and threshold - ;; Check that the completion didn't make - ;; us jump to a different boundary. - (or (not completed) - (< (car (completion-boundaries - (substring completion 0 comp-pos) - minibuffer-completion-table - minibuffer-completion-predicate - "")) - comp-pos))) + (not completed) + (not only-changed-boundaries)) (completion-all-sorted-completions beg end)))) (completion--flush-all-sorted-completions) (cond @@ -1662,7 +1674,7 @@ when the buffer's text is already an exact match." (setq completed t exact t) (completion--cache-all-sorted-completions beg end comps) (minibuffer-force-complete beg end)) - (completed + ((or completed only-changed-boundaries) (cond ((pcase completion-auto-help ('visible (minibuffer--completions-visible)) @@ -1686,8 +1698,8 @@ when the buffer's text is already an exact match." ;; means we've already given a "Complete, but not unique" message ;; and the user's hit TAB again, so now we give him help. (t - (if (and (eq this-command last-command) completion-auto-help) - (minibuffer-completion-help beg end)) + (when (and (eq this-command last-command) completion-auto-help) + (minibuffer-completion-help beg end)) (completion--done completion 'exact (unless (or expect-exact (and completion-auto-select commit 7c7bfa625ee3cc0e7ae8aec2a989e1dc14bfe6a7 Author: Juri Linkov Date: Thu Oct 9 20:27:41 2025 +0300 * lisp/xdg.el (xdg-mime-apps): Fix recent regression. After the change that introduced 'hash-table-contains-p' it's necessary to keep setting 'files' to the hash value. diff --git a/lisp/xdg.el b/lisp/xdg.el index a9f443c3d73..1e1495f8c7f 100644 --- a/lisp/xdg.el +++ b/lisp/xdg.el @@ -385,7 +385,8 @@ Results are cached in `xdg-mime-table'." (when (null (assoc type xdg-mime-table)) (push (cons type (make-hash-table :test #'equal)) xdg-mime-table)) (if (let ((table (cdr (assoc type xdg-mime-table)))) - (hash-table-contains-p subtype table)) + (and (hash-table-contains-p subtype table) + (setq files (gethash subtype table)))) files (and files (setq files nil)) (let ((dirs (mapcar (lambda (dir) (expand-file-name "applications" dir)) commit 0925e19064c20c4a62d09e7af5affd589f9552a7 Author: Juri Linkov Date: Thu Oct 9 20:14:41 2025 +0300 Use shorter margin indicators in flymake-mode (bug#76254) * lisp/progmodes/flymake.el (flymake-margin-indicators-string): Replace two-character error indicator "!!" with one character "‼". Update the docstring. (flymake--resize-margins): Use "!!" when "‼" is not displayable. Calculate the margin width depending on the indicator string width. diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 8b6d477c385..7268be9c8f8 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -203,7 +203,7 @@ See Info node `Fringes' and Info node `(elisp)Display Margins'." (const :tag "No indicators" nil))) (defcustom flymake-margin-indicators-string - '((error "!!" compilation-error) + '((error "‼" compilation-error) (warning "!" compilation-warning) (note "!" compilation-info)) "Strings used for margins indicators. @@ -213,7 +213,10 @@ or a list of 2 elements specifying only the error type and the corresponding string. The option `flymake-margin-indicator-position' controls how and where -this is used." +this is used. + +When the default character for the error indicator is not displayable +by the terminal, it will be replaced by the ASCII equivalent." :version "30.1" :type '(repeat :tag "Error types lists" (list :tag "String and face for error types" @@ -873,6 +876,10 @@ associated `flymake-category' return DEFAULT." (defun flymake--resize-margins (&optional orig-width) "Resize current window margins according to `flymake-margin-indicator-position'. Return to original margin width if ORIG-WIDTH is non-nil." + (let ((indicator (get 'flymake-error 'flymake-margin-string))) + (when (and (equal (car indicator) "‼") (not (char-displayable-p ?‼))) + (put 'flymake-error 'flymake-margin-string (cons "!!" (cdr indicator))))) + (when (and (eq flymake-indicator-type 'margins) flymake-autoresize-margins) (cond @@ -881,11 +888,15 @@ Return to original margin width if ORIG-WIDTH is non-nil." (setq left-margin-width flymake--original-margin-width) (setq right-margin-width flymake--original-margin-width))) (t - (if (eq flymake-margin-indicator-position 'left-margin) - (setq flymake--original-margin-width left-margin-width - left-margin-width 2) - (setq flymake--original-margin-width right-margin-width - right-margin-width 2)))) + (let ((width (apply #'max (mapcar (lambda (sym) + (string-width + (car (get sym 'flymake-margin-string)))) + '(flymake-error flymake-warning flymake-note))))) + (if (eq flymake-margin-indicator-position 'left-margin) + (setq flymake--original-margin-width left-margin-width + left-margin-width width) + (setq flymake--original-margin-width right-margin-width + right-margin-width width))))) ;; Apply margin to all windows available. (mapc (lambda (x) (set-window-buffer x (window-buffer x))) commit 854690a9e3e1dfe5053535520aa8ab1ff7dbfb87 Author: Eli Zaretskii Date: Thu Oct 9 15:21:38 2025 +0300 * src/w32console.c: Fix last change (bug#79298). diff --git a/src/w32console.c b/src/w32console.c index 30f511d93f9..a92ed788e00 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -351,22 +351,12 @@ w32con_write_glyphs (struct frame *f, register struct glyph *string, conversion_buffer = (LPCSTR) encode_terminal_code (string, n, coding); if (coding->produced > 0) { - /* By default, assume single-byte encoding and single-column - characters... */ - ptrdiff_t nchars = coding->produced; - ptrdiff_t ncols = nchars; - /* ...but if we are using UTF-8, correct that by computing - characters. Note: multibyte_chars_in_text and strwidth - handle the internal encoding of characters, which is a - superset of UTF-8. - FIXME: this doesn't handle character compositions. */ - if (coding->encoder == encode_coding_utf_8) - { - ncols = strwidth (conversion_buffer, nchars); - nchars = multibyte_chars_in_text (conversion_buffer, nchars); - } + /* Compute the string's width on display by accounting for + character's width. FIXME: this doesn't handle character + compositions. */ + ptrdiff_t ncols = strwidth (coding->source, coding->src_bytes); /* Set the attribute for these characters. */ - if (!FillConsoleOutputAttribute (cur_screen, char_attr, nchars, + if (!FillConsoleOutputAttribute (cur_screen, char_attr, ncols, cursor_coords, &r)) { printf ("Failed writing console attributes: %lu\n", @@ -420,20 +410,15 @@ w32con_write_glyphs_with_face (struct frame *f, register int x, register int y, /* Compute the character attributes corresponding to the face. */ DWORD char_attr = w32_face_attributes (f, face_id); COORD start_coords; - /* By default, assume single-byte encoding... */ - ptrdiff_t nchars = coding->produced; - /* ...but if we are using UTF-8, correct that by counting - characters. Note: multibyte_chars_in_text handles the - internal encoding of characters, which is a superset of - UTF-8. - FIXME: this doesn't handle character compositions. */ - if (coding->encoder == encode_coding_utf_8) - nchars = multibyte_chars_in_text (conversion_buffer, nchars); + /* Compute the string's width on display by accounting for + character's width. FIXME: this doesn't handle character + compositions. */ + ptrdiff_t ncols = strwidth (coding->source, coding->src_bytes); start_coords.X = x; start_coords.Y = y; /* Set the attribute for these characters. */ - if (!FillConsoleOutputAttribute (cur_screen, char_attr, nchars, + if (!FillConsoleOutputAttribute (cur_screen, char_attr, ncols, start_coords, &filled)) DebPrint (("Failed writing console attributes: %d\n", GetLastError ())); else commit d8448facd9169b17f0e78774865381f544f350c2 Author: Arash Esbati Date: Thu Oct 9 11:54:45 2025 +0200 Remove setting of reference format * lisp/textmodes/reftex-vars.el (reftex-label-alist-builtin): Don't set the reference format for ?f and ?t type indicators in entries of subfig. diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el index 6c852566df9..0c3f0eae33f 100644 --- a/lisp/textmodes/reftex-vars.el +++ b/lisp/textmodes/reftex-vars.el @@ -86,9 +86,9 @@ ;; compat macros for the old subfigure package. The context regexp ;; must match combinations of ;; \subfigure[list-capt.][sub-capt.]{body} - (("\\subfigure[][]{}" ?f "fig:" "~\\subref{%s}" + (("\\subfigure[][]{}" ?f "fig:" nil "\\\\subfigure\\(?:\\(?:\\[[^]]*\\]\\)?\\[\\|{\\)") - ("\\subtable[][]{}" ?t "tab:" "~\\subref{%s}" + ("\\subtable[][]{}" ?t "tab:" nil "\\\\subtable\\(?:\\(?:\\[[^]]*\\]\\)?\\[\\|{\\)"))) (wrapfig "The wrapfigure and wraptable environments" commit 5a70f5096eafb9bf2ea5b2e798293def1a8cf404 Author: Eli Zaretskii Date: Thu Oct 9 12:07:57 2025 +0300 Fix text-terminal output with UTF-8 encoding on MS-Windows * src/w32console.c (w32con_write_glyphs) (w32con_write_glyphs_with_face): Support UTF-8 encoded text better, by counting characters and using display columns, not bytes, to move the cursor after writing the text. (Bug#79298) diff --git a/src/w32console.c b/src/w32console.c index 1bca0cadff9..30f511d93f9 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -351,10 +351,23 @@ w32con_write_glyphs (struct frame *f, register struct glyph *string, conversion_buffer = (LPCSTR) encode_terminal_code (string, n, coding); if (coding->produced > 0) { + /* By default, assume single-byte encoding and single-column + characters... */ + ptrdiff_t nchars = coding->produced; + ptrdiff_t ncols = nchars; + /* ...but if we are using UTF-8, correct that by computing + characters. Note: multibyte_chars_in_text and strwidth + handle the internal encoding of characters, which is a + superset of UTF-8. + FIXME: this doesn't handle character compositions. */ + if (coding->encoder == encode_coding_utf_8) + { + ncols = strwidth (conversion_buffer, nchars); + nchars = multibyte_chars_in_text (conversion_buffer, nchars); + } /* Set the attribute for these characters. */ - if (!FillConsoleOutputAttribute (cur_screen, char_attr, - coding->produced, cursor_coords, - &r)) + if (!FillConsoleOutputAttribute (cur_screen, char_attr, nchars, + cursor_coords, &r)) { printf ("Failed writing console attributes: %lu\n", GetLastError ()); @@ -371,7 +384,7 @@ w32con_write_glyphs (struct frame *f, register struct glyph *string, fflush (stdout); } - cursor_coords.X += coding->produced; + cursor_coords.X += ncols; w32con_move_cursor (f, cursor_coords.Y, cursor_coords.X); } len -= n; @@ -407,19 +420,28 @@ w32con_write_glyphs_with_face (struct frame *f, register int x, register int y, /* Compute the character attributes corresponding to the face. */ DWORD char_attr = w32_face_attributes (f, face_id); COORD start_coords; + /* By default, assume single-byte encoding... */ + ptrdiff_t nchars = coding->produced; + /* ...but if we are using UTF-8, correct that by counting + characters. Note: multibyte_chars_in_text handles the + internal encoding of characters, which is a superset of + UTF-8. + FIXME: this doesn't handle character compositions. */ + if (coding->encoder == encode_coding_utf_8) + nchars = multibyte_chars_in_text (conversion_buffer, nchars); start_coords.X = x; start_coords.Y = y; /* Set the attribute for these characters. */ - if (!FillConsoleOutputAttribute (cur_screen, char_attr, - coding->produced, start_coords, - &filled)) + if (!FillConsoleOutputAttribute (cur_screen, char_attr, nchars, + start_coords, &filled)) DebPrint (("Failed writing console attributes: %d\n", GetLastError ())); else { /* Write the characters. */ if (!WriteConsoleOutputCharacter (cur_screen, conversion_buffer, - filled, start_coords, &written)) + coding->produced, start_coords, + &written)) DebPrint (("Failed writing console characters: %d\n", GetLastError ())); }