diff options
author | Eli Zaretskii <eliz@gnu.org> | 2022-12-06 14:41:36 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2022-12-06 14:41:36 +0200 |
commit | 70a2eb4a0b315c3e66ab89508c9c62ca8b84ef29 (patch) | |
tree | 2d25b0f36981cec7fd4b39db33c5bff06b39af2b /lisp/emacs-lisp/subr-x.el | |
parent | d58d1dd48ac7ae0f0b1a7d129c8a27b4a016d1ca (diff) | |
download | emacs-70a2eb4a0b315c3e66ab89508c9c62ca8b84ef29.tar.gz |
Fix 'add-display-text-property' when OBJECT is non-nil
* lisp/emacs-lisp/subr-x.el (add-display-text-property): Fix the
case where OBJECT is not nil. (Bug#59857)
* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x-test-add-display-text-property): Add test for this case.
Diffstat (limited to 'lisp/emacs-lisp/subr-x.el')
-rw-r--r-- | lisp/emacs-lisp/subr-x.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el index 18087bc937f..0486baba83c 100644 --- a/lisp/emacs-lisp/subr-x.el +++ b/lisp/emacs-lisp/subr-x.el @@ -370,7 +370,8 @@ this defaults to the current buffer." (min end (point-max))))) (if (not (setq disp (get-text-property sub-start 'display object))) ;; No old properties in this range. - (put-text-property sub-start sub-end 'display (list prop value)) + (put-text-property sub-start sub-end 'display (list prop value) + object) ;; We have old properties. (let ((vector nil)) ;; Make disp into a list. @@ -390,7 +391,7 @@ this defaults to the current buffer." (when vector (setq disp (seq-into disp 'vector))) ;; Finally update the range. - (put-text-property sub-start sub-end 'display disp))) + (put-text-property sub-start sub-end 'display disp object))) (setq sub-start sub-end)))) ;;;###autoload |