Function: button-at

button-at is a byte-compiled function defined in button.el.gz.

Signature

(button-at POS)

Documentation

Return the button at position POS in the current buffer, or nil.

If the button at POS is a text property button, the return value is a marker pointing to POS.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/button.el.gz
;;; Finding buttons in a buffer

(defun button-at (pos)
  "Return the button at position POS in the current buffer, or nil.
If the button at POS is a text property button, the return value
is a marker pointing to POS."
  (let ((button (get-char-property pos 'button)))
    (and button (get-char-property pos 'category)
         (if (overlayp button)
             button
           ;; Must be a text-property button;
           ;; return a marker pointing to it.
           (copy-marker pos t)))))