commit c0a52efed32ddc63b26c9e1d9dd769da55d857e5 (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Fri Jan 10 09:56:08 2025 +0200 * lisp/progmodes/typescript-ts-mode.el: Fix syntax of tsx tags. (tsx-ts--syntax-propertize-captures): For tag angle brackets use the same syntax as in 'sgml-make-syntax-table' (bug#73978). diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 1c60c5ed603..4edfb22909b 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -692,7 +692,11 @@ at least 3 (which is the default value)." ne t) (put-text-property (match-beginning 0) (match-end 0) - 'syntax-table (string-to-syntax "."))))))))) + 'syntax-table (string-to-syntax + (cond + ((equal (match-string 0) "<") "(<") + ((equal (match-string 0) ">") ")>") + (t "."))))))))))) (if (treesit-ready-p 'tsx) (add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode))) commit 42a5ac3b513ff03c64c9609fc7e79c2b7932b2a4 Author: Juri Linkov Date: Fri Jan 10 09:33:49 2025 +0200 Use the treesit thing 'list' with symbol property 'treesit-thing-symbol' * doc/lispref/parsing.texi (User-defined Things): Mention new functions 'treesit-forward-list', 'treesit-down-list', 'treesit-up-list', 'treesit-show-paren-data' that use the thing 'list' with the symbol property 'treesit-thing-symbol' (bug#73404). * lisp/treesit.el: Put the property 'treesit-thing-symbol' on the symbol 'list'. (treesit--forward-list-with-default, treesit-down-list) (treesit-up-list, treesit-navigate-thing) (treesit-show-paren-data--categorize, treesit-major-mode-setup): Replace 'sexp-list' with 'list'. * lisp/progmodes/c-ts-mode.el (c-ts-mode--thing-settings): * lisp/progmodes/js.el (js-ts-mode): * lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode): * lisp/progmodes/typescript-ts-mode.el (typescript-ts-base-mode) (tsx-ts-mode): * lisp/textmodes/html-ts-mode.el (html-ts-mode): Replace 'sexp-list' with 'list'. * src/treesit.c (treesit_traverse_validate_predicate) (treesit_traverse_match_predicate): Check if the 'pred' symbol has the property 'Qtreesit_thing_symbol'. (syms_of_treesit): New symbol 'Qtreesit_thing_symbol'. diff --git a/doc/lispref/parsing.texi b/doc/lispref/parsing.texi index f6680ea589c..e16aea6a38d 100644 --- a/doc/lispref/parsing.texi +++ b/doc/lispref/parsing.texi @@ -1628,10 +1628,14 @@ exactly how C and C@t{++} modes define things. Emacs builtin functions already make use some thing definitions. Command @code{treesit-forward-sexp} uses the @code{sexp} definition if -major mode defines it; @code{treesit-forward-sentence} uses the -@code{sentence} definition. Defun movement functions like -@code{treesit-end-of-defun} uses the @code{defun} definition -(@code{defun} definition is overridden by +major mode defines it; @code{treesit-forward-list}, +@code{treesit-down-list}, @code{treesit-up-list}, +@code{treesit-show-paren-data} use the @code{list} definition (its +symbol @code{list} has the symbol property @code{treesit-thing-symbol} +to avoid ambiguity with the function that has the same name); +@code{treesit-forward-sentence} uses the @code{sentence} definition. +Defun movement functions like @code{treesit-end-of-defun} uses the +@code{defun} definition (@code{defun} definition is overridden by @var{treesit-defun-type-regexp} for backward compatibility). Major modes can also define @code{comment}, @code{string}, @code{text} (generally comments and strings). diff --git a/etc/NEWS b/etc/NEWS index ba73843825d..fc762d01942 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1024,15 +1024,15 @@ override flag by 'treesit-font-lock-setting-query', 'treesit-font-lock-setting-feature', 'treesit-font-lock-setting-enable', and 'treesit-font-lock-setting-override'. -*** New treesit thing 'sexp-list'. +*** New treesit thing 'list'. Unlike the existing thing 'sexp' that defines both lists and atoms, -'sexp-list' defines only lists to be navigated by 'forward-sexp'. -The new function 'treesit-forward-sexp-list' uses 'sexp-list' +'list' defines only lists to be navigated by 'forward-sexp'. +The new function 'treesit-forward-sexp-list' uses 'list' to move across lists. But to move across atoms inside the list it uses 'forward-sexp-default-function'. -*** New tree-sitter based functions for moving by sexp-lists. -If a major mode defines 'sexp-list' in 'treesit-thing-settings', +*** New tree-sitter based functions for moving by lists. +If a major mode defines 'list' in 'treesit-thing-settings', tree-sitter setup for these modes sets 'forward-list-function' to 'treesit-forward-list', 'up-list-function' to 'treesit-up-list', and 'down-list-function' to 'treesit-down-list'. This enables the diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index ac92032f92a..80e635fe76d 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -1151,7 +1151,7 @@ if `c-ts-mode-emacs-sources-support' is non-nil." `(;; It's more useful to include semicolons as sexp so ;; that users can move to the end of a statement. (sexp (not ,(rx (or "{" "}" "[" "]" "(" ")" ",")))) - (sexp-list + (list ,(regexp-opt '("preproc_params" "preproc_parenthesized_expression" "preproc_argument_list" diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index db5b02cf691..101b882c718 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3876,7 +3876,7 @@ See `treesit-thing-settings' for more information.") "Nodes that designate sexps in JavaScript. See `treesit-thing-settings' for more information.") -(defvar js--treesit-sexp-list-nodes +(defvar js--treesit-list-nodes '("export_clause" "named_imports" "statement_block" @@ -3941,7 +3941,7 @@ See `treesit-thing-settings' for more information.") (setq-local treesit-thing-settings `((javascript (sexp ,(js--regexp-opt-symbol js--treesit-sexp-nodes)) - (sexp-list ,(js--regexp-opt-symbol js--treesit-sexp-list-nodes)) + (list ,(js--regexp-opt-symbol js--treesit-list-nodes)) (sentence ,(js--regexp-opt-symbol js--treesit-sentence-nodes)) (text ,(js--regexp-opt-symbol '("comment" "string_fragment")))))) diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index a776abe881e..15394f28b27 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -1132,7 +1132,7 @@ leading double colon is not added." (equal (treesit-node-type (treesit-node-child node 0)) "("))) -(defun ruby-ts--sexp-list-p (node) +(defun ruby-ts--list-p (node) ;; Distinguish between the named `unless' node and the ;; node with the same value of type. (when (treesit-node-check node 'named) @@ -1213,7 +1213,7 @@ leading double colon is not added." ) eol) #'ruby-ts--sexp-p)) - (sexp-list + (list ,(cons (rx bol (or @@ -1253,7 +1253,7 @@ leading double colon is not added." "array" "hash") eol) - #'ruby-ts--sexp-list-p)) + #'ruby-ts--list-p)) (text ,(lambda (node) (or (member (treesit-node-type node) '("comment" "string_content" "heredoc_content")) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 09f29a4ac65..1c60c5ed603 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -482,7 +482,7 @@ See `treesit-thing-settings' for more information.") "Nodes that designate sexps in TypeScript. See `treesit-thing-settings' for more information.") -(defvar typescript-ts-mode--sexp-list-nodes +(defvar typescript-ts-mode--list-nodes '("export_clause" "named_imports" "statement_block" @@ -536,7 +536,7 @@ This mode is intended to be inherited by concrete major modes." (setq-local treesit-thing-settings `((typescript (sexp ,(regexp-opt typescript-ts-mode--sexp-nodes 'symbols)) - (sexp-list ,(regexp-opt typescript-ts-mode--sexp-list-nodes + (list ,(regexp-opt typescript-ts-mode--list-nodes 'symbols)) (sentence ,(regexp-opt typescript-ts-mode--sentence-nodes 'symbols)) @@ -621,9 +621,9 @@ at least 3 (which is the default value)." (sexp ,(regexp-opt (append typescript-ts-mode--sexp-nodes '("jsx")))) - (sexp-list ,(concat "^" + (list ,(concat "^" (regexp-opt - (append typescript-ts-mode--sexp-list-nodes + (append typescript-ts-mode--list-nodes '( "jsx_element" "jsx_self_closing_element" diff --git a/lisp/textmodes/html-ts-mode.el b/lisp/textmodes/html-ts-mode.el index b29e018cfb6..dad49b7ed4c 100644 --- a/lisp/textmodes/html-ts-mode.el +++ b/lisp/textmodes/html-ts-mode.el @@ -117,7 +117,7 @@ Return nil if there is no name or if NODE is not a defun node." "text" "attribute" "value"))) - (sexp-list ,(regexp-opt '("element")) 'symbols) + (list ,(regexp-opt '("element")) 'symbols) (sentence "tag") (text ,(regexp-opt '("comment" "text")))))) diff --git a/lisp/treesit.el b/lisp/treesit.el index 4746e7a16a8..6107ae10ad5 100644 --- a/lisp/treesit.el +++ b/lisp/treesit.el @@ -2420,6 +2420,9 @@ delimits medium sized statements in the source code. It is, however, smaller in scope than sentences. This is used by `treesit-forward-sexp' and friends.") +;; Avoid interpreting the symbol `list' as a function. +(put 'list 'treesit-thing-symbol t) + (defun treesit--scan-error (pred arg) (when-let* ((parent (treesit-thing-at (point) pred t)) (boundary (treesit-node-child parent (if (> arg 0) -1 0)))) @@ -2443,7 +2446,7 @@ What constitutes as text and source code sexp is determined by `text' and `sexp' in `treesit-thing-settings'. There is an alternative implementation in `treesit-forward-sexp-list' -that uses `sexp-list' in `treesit-thing-settings' to move only +that uses `list' in `treesit-thing-settings' to move only across lists, whereas uses `forward-sexp-default-function' to move across atoms (such as symbols or words) inside the list." (interactive "^p") @@ -2475,7 +2478,7 @@ Fall back to DEFAULT-FUNCTION as long as it doesn't cross the boundaries of the list. ARG is described in the docstring of `forward-list'." - (let* ((pred (or treesit-sexp-type-regexp 'sexp-list)) + (let* ((pred (or treesit-sexp-type-regexp 'list)) (arg (or arg 1)) (cnt arg) (inc (if (> arg 0) 1 -1))) @@ -2515,7 +2518,7 @@ ARG is described in the docstring of `forward-list'." Whereas `treesit-forward-sexp' moves across both lists and atoms using `sexp' in `treesit-thing-settings', this function uses -`sexp-list' in `treesit-thing-settings' to move only across lists. +`list' in `treesit-thing-settings' to move only across lists. But to move across atoms (such as symbols or words) inside the list it uses `forward-sexp-default-function' as long as it doesn't go outside of the boundaries of the current list. @@ -2526,7 +2529,7 @@ ARG is described in the docstring of `forward-sexp-function'." (defun treesit-forward-list (&optional arg) "Move forward across a list. -What constitutes a list is determined by `sexp-list' in +What constitutes a list is determined by `list' in `treesit-thing-settings' that usually defines parentheses-like expressions. @@ -2543,7 +2546,7 @@ ARG is described in the docstring of `forward-list-function'." (defun treesit-down-list (&optional arg) "Move forward down one level of parentheses. What constitutes a level of parentheses is determined by -`sexp-list' in `treesit-thing-settings' that usually defines +`list' in `treesit-thing-settings' that usually defines parentheses-like expressions. This command is the tree-sitter variant of `down-list' @@ -2551,7 +2554,7 @@ redefined by the variable `down-list-function'. ARG is described in the docstring of `down-list'." (interactive "^p") - (let* ((pred 'sexp-list) + (let* ((pred 'list) (arg (or arg 1)) (cnt arg) (inc (if (> arg 0) 1 -1))) @@ -2583,7 +2586,7 @@ ARG is described in the docstring of `down-list'." (defun treesit-up-list (&optional arg escape-strings no-syntax-crossing) "Move forward out of one level of parentheses. What constitutes a level of parentheses is determined by -`sexp-list' in `treesit-thing-settings' that usually defines +`list' in `treesit-thing-settings' that usually defines parentheses-like expressions. This command is the tree-sitter variant of `up-list' @@ -2591,7 +2594,7 @@ redefined by the variable `up-list-function'. ARG is described in the docstring of `up-list'." (interactive "^p") - (let* ((pred 'sexp-list) + (let* ((pred 'list) (arg (or arg 1)) (cnt arg) (inc (if (> arg 0) 1 -1))) @@ -3076,7 +3079,7 @@ function is called recursively." (setq pos (funcall advance (cond ((and (null next) (null prev) - (not (eq thing 'sexp-list))) + (not (eq thing 'list))) parent) ((> arg 0) next) (t prev)))) @@ -3420,9 +3423,9 @@ For BOUND, MOVE, BACKWARD, LOOKING-AT, see the descriptions in ;;; Show paren mode (defun treesit-show-paren-data--categorize (pos &optional end-p) - (let* ((pred 'sexp-list) + (let* ((pred 'list) (parent (when (treesit-thing-defined-p - 'sexp-list (treesit-language-at pos)) + pred (treesit-language-at pos)) (treesit-parent-until (treesit-node-at (if end-p (1- pos) pos)) pred))) (first (when parent (treesit-node-child parent 0))) @@ -3594,7 +3597,7 @@ before calling this function." (setq-local forward-sexp-function #'treesit-forward-sexp) (setq-local transpose-sexps-function #'treesit-transpose-sexps)) - (when (treesit-thing-defined-p 'sexp-list nil) + (when (treesit-thing-defined-p 'list nil) (setq-local forward-sexp-function #'treesit-forward-sexp-list) (setq-local forward-list-function #'treesit-forward-list) (setq-local down-list-function #'treesit-down-list) diff --git a/src/treesit.c b/src/treesit.c index b3214dad836..878c1f0b340 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -3618,7 +3618,8 @@ treesit_traverse_validate_predicate (Lisp_Object pred, } if (STRINGP (pred)) return true; - else if (FUNCTIONP (pred)) + else if (FUNCTIONP (pred) + && !(SYMBOLP (pred) && !NILP (Fget (pred, Qtreesit_thing_symbol)))) return true; else if (SYMBOLP (pred)) { @@ -3722,7 +3723,8 @@ treesit_traverse_match_predicate (TSTreeCursor *cursor, Lisp_Object pred, const char *type = ts_node_type (node); return fast_c_string_match (pred, type, strlen (type)) >= 0; } - else if (FUNCTIONP (pred)) + else if (FUNCTIONP (pred) + && !(SYMBOLP (pred) && !NILP (Fget (pred, Qtreesit_thing_symbol)))) { Lisp_Object lisp_node = make_treesit_node (parser, node); return !NILP (CALLN (Ffuncall, pred, lisp_node)); @@ -4333,6 +4335,8 @@ syms_of_treesit (void) DEFSYM (Qtreesit_invalid_predicate, "treesit-invalid-predicate"); DEFSYM (Qtreesit_predicate_not_found, "treesit-predicate-not-found"); + DEFSYM (Qtreesit_thing_symbol, "treesit-thing-symbol"); + DEFSYM (Qor, "or"); #ifdef WINDOWSNT commit 351b6ac16d29459c5800bd980d428e61ee43cb7d Author: Juri Linkov Date: Thu Jan 9 20:33:03 2025 +0200 * lisp/man.el (Man-fit-to-window): Don't update on tty with MANWIDTH. Check if 'Man-columns' is non-nil before trying to reformat the manpage buffer. The value of the varible 'Man-columns' is nil on a non-window system where "MANWIDTH" or "COLUMNS" is defined. And the return value of the function 'Man-columns' is meaningless in this case anyway. So no need to react to changes in window width (bug#74924). diff --git a/lisp/man.el b/lisp/man.el index be31d8d2489..a5881f30980 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1291,6 +1291,7 @@ Return the buffer in which the manpage will appear." (when (window-live-p window) (with-current-buffer (window-buffer window) (when (and (derived-mode-p 'Man-mode) + Man-columns (not (eq Man-columns (Man-columns)))) (let ((proc (get-buffer-process (current-buffer)))) (unless (and proc (not (eq (process-status proc) 'exit))) commit 6d02539dd48255e1b53f48dbdc8069b50be63767 Author: David Ponce Date: Thu Jan 9 11:01:40 2025 +0100 Improve UI of customizing icons * lisp/cus-edit.el (custom-icon--images-sub-type) (custom-icon--emojis-sub-type, custom-icon--symbols-sub-type) (custom-icon--texts-sub-type, custom-icon--type): New defconst's. (custom-icon-value-create): Use them. (Bug#73178) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index be08e0d5d46..95dd4c9e354 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -5552,6 +5552,53 @@ its standard value." "A menu for `custom-icon' widgets. Used in `custom-icon-action' to show a menu to the user.") +(defconst custom-icon--images-sub-type + '(list :format "%{%t%}:\n%v\n" + :tag "Images" + (const :tag "" image) + (repeat :tag "Values" + (string :tag "Image filename")) + (plist :tag "Image attributes"))) + +(defconst custom-icon--emojis-sub-type + '(list :format "%{%t%}:\n%v\n" + :tag "Colorful Emojis" + (const :tag "" emoji) + (repeat :tag "Values" + (string :tag "Emoji text")) + (plist :tag "Emoji text properties"))) + +(defconst custom-icon--symbols-sub-type + '(list :format "%{%t%}:\n%v\n" + :tag "Monochrome Symbols" + (const :tag "" symbol) + (repeat :tag "Values" + (string :tag "Symbol text")) + (plist :tag "Symbol text properties"))) + +(defconst custom-icon--texts-sub-type + '(list :format "%{%t%}:\n%v\n" + :tag "Texts Only" + (const :tag "" text) + (repeat :tag "Values" + (string :tag "Text")) + (plist :tag "Text properties"))) + +(defconst custom-icon--type + `(repeat :format ,(concat "%{%t%}" + (propertize ":" 'display "") + "\n\n%v%i\n") + :tag "Icon elements: +- Only the first occurrence of a same element counts. +- Missing elements will take their default value. +- At least one element should be provided with a valid value." + (choice :void ,custom-icon--texts-sub-type + :extra-offset -3 + ,custom-icon--images-sub-type + ,custom-icon--emojis-sub-type + ,custom-icon--symbols-sub-type + ,custom-icon--texts-sub-type))) + (defun custom-icon-value-create (widget) "Here is where you edit the icon's specification." (custom-load-widget widget) @@ -5562,13 +5609,7 @@ Used in `custom-icon-action' to show a menu to the user.") (form (widget-get widget :custom-form)) (symbol (widget-get widget :value)) (tag (widget-get widget :tag)) - (type '(repeat - (list (choice (const :tag "Images" image) - (const :tag "Colorful Emojis" emoji) - (const :tag "Monochrome Symbols" symbol) - (const :tag "Text Only" text)) - (repeat string) - plist))) + (type custom-icon--type) (prefix (widget-get widget :custom-prefix)) (last (widget-get widget :custom-last)) (style (widget-get widget :custom-style)) commit 81cf42c8af75b9ee2f2cee36254e3286b2077cbc Author: Eshel Yaron Date: Thu Jan 9 12:22:03 2025 +0100 Auto-adapt completion preview background color Teach Completion Preview mode to automatically remap its faces such that the background color of the preview overlay matches the background color of the buffer text that is being completed. Crucially, this resolves an issue where the preview overlay didn't look nice with hl-line-mode on. Also see related discussion in bug#71282. * lisp/completion-preview.el (completion-preview-adapt-background-color): New option. (completion-preview--bg-color): New function. (completion-preview--face-remap-cookie-jar): New variable. (completion-preview--make-overlay): Use them. diff --git a/lisp/completion-preview.el b/lisp/completion-preview.el index 315975d980c..e3ddea02830 100644 --- a/lisp/completion-preview.el +++ b/lisp/completion-preview.el @@ -89,6 +89,12 @@ ;; when you pause typing for a short duration rather than after every ;; key. Try setting it to 0.2 seconds and see how that works for you. ;; +;; By default, Completion Preview mode automatically adapts the +;; background color of the preview overlay to match the background color +;; of the buffer text it's completing. If you prefer a distinct +;; background color for the preview, disable this feature by customizing +;; `completion-preview-adapt-background-color' to nil. +;; ;; Sometimes you may want to use Completion Preview mode alongside other ;; Emacs features that place an overlay after point, in a way that could ;; "compete" with the preview overlay. In such cases, you should give @@ -191,6 +197,26 @@ See also `completion-ignore-case'." :type 'boolean :version "31.1") +(defcustom completion-preview-adapt-background-color 'completion-preview + "Control automatic adaptation of completion preview background color. + +This is either a face name or a (possibly empty) list of face names, +which Completion Preview mode automatically remaps when showing the +preview, such that the background color of the face(s) matches the +background color at point. + +By default, this option specifies the `completion-preview' face (which +also affects its descendent faces `completion-preview-common' and +`completion-preview-exact') so the completion preview uses the +background color at point. + +This is especially useful when there are other overlays at point that +affect the background color, for example with `hl-line-mode'." + :type '(choice face + (repeat :tag "List of faces" face) + (const :tag "Disable" nil)) + :version "31.1") + (defvar completion-preview-sort-function #'minibuffer--sort-by-length-alpha "Sort function to use for choosing a completion candidate to preview.") @@ -293,6 +319,41 @@ Completion Preview mode avoids updating the preview after these commands.") (defvar completion-preview-overlay-priority nil "Value of the `priority' property for the completion preview overlay.") +(defun completion-preview--bg-color (pos) + "Return background color at POS." + ;; This takes into account face remappings and multiple overlays that + ;; specify the `face' property, unlike `background-color-at-point'. + (catch 'found + (named-let rec ((spec (seq-keep (lambda (ov) (overlay-get ov 'face)) + (overlays-at pos t))) + (trace nil)) + (dolist (face (if (face-list-p spec) spec (list spec))) + (let (cur) + (if (and (setq cur (alist-get face face-remapping-alist)) + (not (memq cur trace))) + (rec cur (cons face trace)) + (cond ((and face (symbolp face)) + (let ((value (face-attribute face :background nil t))) + (unless (member value '(nil "unspecified-bg" unspecified)) + (throw 'found value)))) + ((consp face) + (when-let* ((value (or (cdr (memq 'background-color face)) + (cadr (memq :background face))))) + (throw 'found value))))))) + (unless trace + (save-excursion + (goto-char pos) + (font-lock-ensure (pos-bol) (pos-eol))) + (rec (or (and font-lock-mode + (get-text-property pos 'font-lock-face)) + (get-text-property pos 'face)) + '(nil)) + (rec 'default '(nil)))))) + +(defvar completion-preview--face-remap-cookie-jar nil) + +(declare-function face-remap-remove-relative "face-remap" (cookie)) + (defun completion-preview--make-overlay (pos string) "Make preview overlay showing STRING at POS, or move existing preview there." (if completion-preview--overlay @@ -303,6 +364,13 @@ Completion Preview mode avoids updating the preview after these commands.") (overlay-put completion-preview--overlay 'window (selected-window))) (add-text-properties 0 1 '(cursor 1) string) (overlay-put completion-preview--overlay 'after-string string) + (mapc #'face-remap-remove-relative completion-preview--face-remap-cookie-jar) + (setq completion-preview--face-remap-cookie-jar + (when (and completion-preview-adapt-background-color (< (point-min) pos)) + (mapcar (lambda (face) + (face-remap-add-relative + face `(:background ,(completion-preview--bg-color (1- pos))))) + (ensure-list completion-preview-adapt-background-color)))) completion-preview--overlay) (defsubst completion-preview--get (prop) commit 0edafe0fb6bb3df4fed09eb345b690fbce2c01bb Author: Martin Rudalics Date: Thu Jan 9 09:37:13 2025 +0100 In xt_action_hook don't act on deleted window's scroll bar (Bug#75120) * src/xterm.c (xt_action_hook): Make sure window_being_scrolled is live (Bug#75120). * src/pdumper.c (dump_subr): Update pertinent hash of HASH_Lisp_Subr. diff --git a/src/pdumper.c b/src/pdumper.c index cec950b7bc9..7d6eabb4b15 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2966,7 +2966,7 @@ dump_bool_vector (struct dump_context *ctx, const struct Lisp_Vector *v) static dump_off dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr) { -#if CHECK_STRUCTS && !defined (HASH_Lisp_Subr_20B7443AD7) +#if CHECK_STRUCTS && !defined (HASH_Lisp_Subr_EE5F7351CC) # error "Lisp_Subr changed. See CHECK_STRUCTS comment in config.h." #endif struct Lisp_Subr out; diff --git a/src/xterm.c b/src/xterm.c index 01e3a931ae9..0692abbbb0b 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -15465,7 +15465,7 @@ xt_action_hook (Widget widget, XtPointer client_data, String action_name, if (scroll_bar_p && strcmp (action_name, end_action) == 0 - && WINDOWP (window_being_scrolled)) + && WINDOW_LIVE_P (window_being_scrolled)) { struct window *w; struct scroll_bar *bar;