1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-21 22:34:51 -07:00

; Adapt 'elisp-fontify-symbol' to 'cursor-sensor-mode' changes

* lisp/progmodes/elisp-mode.el (elisp-fontify-symbol): Mark
the 'cursor-sensor-functions' property as 'rear-nonsticky',
to adapt to 'cursor-sensor-mode' taking into account
property stickiness since f4a1c00656.  See also bug#80593.
This commit is contained in:
Eshel Yaron 2026-03-19 17:19:18 +01:00
parent e4aa9cfbab
commit 72c262d5d1
No known key found for this signature in database
GPG key ID: EF3EE9CA35D78618

View file

@ -620,11 +620,13 @@ non-nil, also annotate the symbol with `cursor-sensor-functions'."
(elisp--annotate-symbol-with-help-echo role beg end sym)
(put-text-property beg end 'mouse-face `(,face elisp-symbol-at-mouse)))
(when (and id (bound-and-true-p cursor-sensor-mode))
(put-text-property beg (1+ end) 'cursor-sensor-functions
;; Get a fresh list with SYM hardcoded,
;; so that the value is distinguishable
;; from the value in adjacent regions.
(elisp-cursor-sensor beg))))))
(add-text-properties beg (1+ end)
`(cursor-sensor-functions
;; Get a fresh list with BEG hardcoded,
;; so that the value is distinguishable
;; from the value in adjacent regions.
,(elisp-cursor-sensor beg)
rear-nonsticky (cursor-sensor-functions)))))))
(defun elisp-fontify-symbols (end)
"Fontify symbols from point to END according to their role in the code."