Function: hbut:source

hbut:source is a byte-compiled function defined in hbut.el.

Signature

(hbut:source &optional FULL-FLAG)

Documentation

Return Hyperbole source buffer or file given at point.

If a file, always return a full path if optional FULL-FLAG is non-nil. Caller must have successfully searched for hbut:source-prefix prior to calling this.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hbut.el
(defun    hbut:source (&optional full-flag)
  "Return Hyperbole source buffer or file given at point.
If a file, always return a full path if optional FULL-FLAG is non-nil.
Caller must have successfully searched for `hbut:source-prefix' prior
to calling this."
  (save-excursion
    (goto-char (match-end 0))
    (cond ((looking-at "#<buffer \"?\\([^\n\"]+\\)\"?>")
	   (get-buffer (match-string 1)))
	  ((looking-at "\".+\"")
	   (let* ((file (buffer-substring-no-properties
			 (1+ (match-beginning 0))
			 (1- (match-end 0))))
		  (absolute (file-name-absolute-p file)))
	     (if (and full-flag (not absolute))
		 (expand-file-name file default-directory)
	       file))))))