1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-30 00:51:50 -08:00

Add shortdoc for text properties

* lisp/emacs-lisp/shortdoc.el (text-properties): New shortdoc.

e for your changes. Lines starting
This commit is contained in:
Stefan Kangas 2021-09-28 20:45:08 +02:00
parent ccb35fb8fb
commit 7cc6e1dda7

View file

@ -1158,6 +1158,49 @@ There can be any number of :example/:result elements."
(sqrt
:eval (sqrt -1)))
(define-short-documentation-group text-properties
"Examining Text Properties"
(get-text-property
:eval (get-text-property 0 'foo (propertize "x" 'foo t)))
(get-char-property
:eval (get-char-property 0 'foo (propertize "x" 'foo t)))
(get-pos-property
:eval (get-pos-property 0 'foo (propertize "x" 'foo t)))
(get-char-property-and-overlay
:eval (get-char-property-and-overlay 0 'foo (propertize "x" 'foo t)))
(text-properties-at
:eval (text-properties-at (point)))
"Changing Text Properties"
(put-text-property
:eval (let ((s "abc")) (put-text-property 0 1 'foo t s) s)
:no-eval (put-text-property (point) (1+ (point)) 'face 'error))
(add-text-properties
:no-eval (add-text-properties (point) (1+ (point)) '(face error)))
(remove-text-properties
:no-eval (remove-text-properties (point) (1+ (point)) '(face nil)))
(remove-list-of-text-properties
:no-eval (remove-list-of-text-properties (point) (1+ (point)) '(face font-lock-face)))
(set-text-properties
:no-eval (set-text-properties (point) (1+ (point)) '(face error)))
(add-face-text-property
(add-face-text-property START END '(:foreground "green")))
(propertize
:eval (propertize "foo" 'face 'italic 'mouse-face 'bold-italic))
"Searching for Text Properties"
(next-property-change
:no-eval (next-property-change (point) (current-buffer)))
(previous-property-change
:no-eval (previous-property-change (point) (current-buffer)))
(next-single-property-change
:no-eval (next-single-property-change (point) 'face (current-buffer)))
(previous-single-property-change
:no-eval (previous-single-property-change (point) 'face (current-buffer)))
;; TODO: There are some more that could be added here.
(text-property-search-forward
:no-eval (text-property-search-forward 'face nil t))
(text-property-search-backward
:no-eval (text-property-search-backward 'face nil t)))
;;;###autoload
(defun shortdoc-display-group (group &optional function)
"Pop to a buffer with short documentation summary for functions in GROUP.