aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-11-24 20:10:14 +0100
committerLars Ingebrigtsen2021-11-24 20:10:17 +0100
commite99bf271587399650a6d52beea4c8f1340d66689 (patch)
tree16f46a84fd7d0e62c1ffbb2fcc7fab8003dde9ed
parent833a42fbcf78ec99b84a98dd6bc7c2eea6eeaef6 (diff)
downloademacs-e99bf271587399650a6d52beea4c8f1340d66689.tar.gz
emacs-e99bf271587399650a6d52beea4c8f1340d66689.zip
Remove APPEND argument from add-display-text-property
* doc/lispref/display.texi (Display Property): Update doc. * lisp/emacs-lisp/subr-x.el (add-display-text-property): Remove the append argument -- it's nonsensical.
-rw-r--r--doc/lispref/display.texi5
-rw-r--r--lisp/emacs-lisp/subr-x.el13
2 files changed, 6 insertions, 12 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 7204581e407..6742f0ea2d5 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -4904,7 +4904,7 @@ with @code{get-char-property}, for instance (@pxref{Examining
4904Properties}). 4904Properties}).
4905@end defun 4905@end defun
4906 4906
4907@defun add-display-text-property start end prop value &optional append object 4907@defun add-display-text-property start end prop value &optional object
4908Add @code{display} property @var{prop} of @var{value} to the text from 4908Add @code{display} property @var{prop} of @var{value} to the text from
4909@var{start} to @var{end}. 4909@var{start} to @var{end}.
4910 4910
@@ -4922,9 +4922,6 @@ After doing this, the region from 2 to 4 will have the @code{raise}
4922the region from 8 to 12 will only have the @code{raise} @code{display} 4922the region from 8 to 12 will only have the @code{raise} @code{display}
4923property. 4923property.
4924 4924
4925If @var{append} is non-@code{nil}, append to the list of display
4926properties; otherwise prepend.
4927
4928If @var{object} is non-@code{nil}, it should be a string or a buffer. 4925If @var{object} is non-@code{nil}, it should be a string or a buffer.
4929If @code{nil}, this defaults to the current buffer. 4926If @code{nil}, this defaults to the current buffer.
4930@end defun 4927@end defun
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index 3ec880f8b8f..b53245b9b5f 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -471,14 +471,11 @@ This takes into account combining characters and grapheme clusters."
471 471
472;;;###autoload 472;;;###autoload
473(defun add-display-text-property (start end prop value 473(defun add-display-text-property (start end prop value
474 &optional append object) 474 &optional object)
475 "Add display property PROP with VALUE to the text from START to END. 475 "Add display property PROP with VALUE to the text from START to END.
476If any text in the region has a non-nil `display' property, those 476If any text in the region has a non-nil `display' property, those
477properties are retained. 477properties are retained.
478 478
479If APPEND is non-nil, append to the list of display properties;
480otherwise prepend.
481
482If OBJECT is non-nil, it should be a string or a buffer. If nil, 479If OBJECT is non-nil, it should be a string or a buffer. If nil,
483this defaults to the current buffer." 480this defaults to the current buffer."
484 (let ((sub-start start) 481 (let ((sub-start start)
@@ -504,10 +501,10 @@ this defaults to the current buffer."
504 (list disp)) 501 (list disp))
505 (t 502 (t
506 disp))) 503 disp)))
507 (setq disp 504 ;; Remove any old instances.
508 (if append 505 (when-let ((old (assoc prop disp)))
509 (append disp (list (list prop value))) 506 (setq disp (delete old disp)))
510 (append (list (list prop value)) disp))) 507 (setq disp (cons (list prop value) disp))
511 (when vector 508 (when vector
512 (setq disp (seq-into disp 'vector))) 509 (setq disp (seq-into disp 'vector)))
513 ;; Finally update the range. 510 ;; Finally update the range.