Function: describe-property-list

describe-property-list is a byte-compiled function defined in descr-text.el.gz.

Signature

(describe-property-list PROPERTIES)

Documentation

Insert a description of PROPERTIES in the current buffer.

PROPERTIES should be a list of overlay or text properties. The category, face and font-lock-face properties are made into help buttons that call describe-text-category or describe-face when pushed.

Source Code

;; Defined in /usr/src/emacs/lisp/descr-text.el.gz
(defun describe-property-list (properties)
  "Insert a description of PROPERTIES in the current buffer.
PROPERTIES should be a list of overlay or text properties.
The `category', `face' and `font-lock-face' properties are made
into help buttons that call `describe-text-category' or
`describe-face' when pushed."
  ;; Sort the properties by the size of their value.
  (dolist (elt (sort (let (ret)
		       (while properties
			 (push (list (pop properties) (pop properties)) ret))
		       ret)
		     (lambda (a b) (string< (prin1-to-string (nth 0 a) t)
					    (prin1-to-string (nth 0 b) t)))))
    (let ((key (nth 0 elt))
	  (value (nth 1 elt)))
      (insert (format "  %-20s "
                      (propertize (symbol-name key)
                                  'face 'help-argument-name)))
      (cond ((eq key 'category)
	     (insert-text-button
	      (symbol-name value)
	      'action (lambda (&rest _ignore)
                        (describe-text-category value))
	      'follow-link t
	      'help-echo "mouse-2, RET: describe this category"))
            ((memq key '(face font-lock-face mouse-face))
	     (insert-text-button
	      (format "%S" value)
	      'type 'help-face 'help-args (list value)))
	    (t
	     (describe-text-sexp value))))
    (insert "\n")))