Function: describe-text-properties

describe-text-properties is an autoloaded, interactive and byte-compiled function defined in descr-text.el.gz.

Signature

(describe-text-properties POS &optional OUTPUT-BUFFER BUFFER)

Documentation

Describe widgets, buttons, overlays, and text properties at POS.

POS is taken to be in BUFFER or in current buffer if nil. Interactively, describe them for the character after point. If optional second argument OUTPUT-BUFFER is non-nil, insert the output into that buffer, and don't initialize or clear it otherwise.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/descr-text.el.gz
;;;###autoload
(defun describe-text-properties (pos &optional output-buffer buffer)
  "Describe widgets, buttons, overlays, and text properties at POS.
POS is taken to be in BUFFER or in current buffer if nil.
Interactively, describe them for the character after point.
If optional second argument OUTPUT-BUFFER is non-nil,
insert the output into that buffer, and don't initialize or clear it
otherwise."
  (interactive "d")
  (let ((src-buf (current-buffer)))
    (if buffer (set-buffer buffer) (setq buffer (current-buffer)))
  (if (>= pos (point-max))
      (error "No character follows specified position"))
  (if output-buffer
      (describe-text-properties-1 pos output-buffer)
    (if (not (or (text-properties-at pos) (overlays-at pos)))
	(message "This is plain text.")
        (with-temp-buffer
	    (setq output-buffer (current-buffer))
	    (insert "Text content at position " (format "%d" pos) ":\n\n")
          (set-buffer buffer)
          (describe-text-properties-1 pos output-buffer)
          (set-buffer src-buf)
          (help-setup-xref (list 'describe-text-properties pos nil buffer)
                           (called-interactively-p 'interactive))
          (with-help-window (help-buffer)
            (with-current-buffer standard-output
              (buffer-swap-text output-buffer)
              (goto-char (point-min)))))))))