Function: hbut:list

hbut:list is an interactive and byte-compiled function defined in hbut.el.

Signature

(hbut:list &optional FILE LOC-P)

Documentation

Return list of button labels from in FILE or the current buffer.

Remove duplicate labels if optional LOC-P is omitted. With LOC-P, return list of elements (label start end) where start and end are the buffer positions at which the button delimiter begins and ends.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hbut.el
(defun    hbut:list (&optional file loc-p)
  "Return list of button labels from in FILE or the current buffer.
Remove duplicate labels if optional LOC-P is omitted.  With LOC-P, return
list of elements (label start end) where start and end are the buffer
positions at which the button delimiter begins and ends."
  (interactive)
  (setq file (if file
		 (when (file-exists-p file)
		   (find-file-noselect file))
	       (current-buffer)))
  (when file
    (set-buffer file)
    (let ((buts (hbut:map (if loc-p
			      (lambda (lbl start end)
				;; Normalize label spacing
				(list (hbut:key-to-label (hbut:label-to-key lbl))
				      start end))
			    (lambda (lbl _start _end)
			      ;; Normalize label spacing
			      (hbut:key-to-label (hbut:label-to-key lbl)))))))
      (if loc-p buts (when buts (apply #'set:create buts))))))