Function: ibut:delimit

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

Signature

(ibut:delimit START END INSTANCE-FLAG)

Documentation

Delimit implicit button name spanning region START to END in current buffer.

If button is already delimited or delimit fails, return nil, else t. Insert INSTANCE-FLAG after END, before ending delimiter.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hbut.el
(defun    ibut:delimit (start end instance-flag)
  "Delimit implicit button name spanning region START to END in current buffer.
If button is already delimited or delimit fails, return nil, else t.
Insert INSTANCE-FLAG after END, before ending delimiter."
  (goto-char start)
  (when (looking-at (regexp-quote ibut:label-start))
    (forward-char (length ibut:label-start)))
  (unless (ibut:label-p)
    (setq start (move-marker (make-marker) start)
	  end (move-marker (make-marker) end))
    (set-marker-insertion-type end t)
    ;; instance-flag may be 't to indicate don't add an instance number
    (unless (stringp instance-flag)
      (setq instance-flag ""))
    (insert ibut:label-start)
    (goto-char end)
    (insert instance-flag ibut:label-end)
    ;; Insert any comment delimiter before the start marker.
    (set-marker-insertion-type start t)
    (hbut:comment start end)
    (let ((delim-end (point)))
      (unless (looking-at ibut:label-separator-regexp)
	(insert ibut:label-separator))
      (when (fboundp 'hproperty:but-add)
	(hproperty:but-add start end hproperty:ibut-face))
      (goto-char delim-end))
    (move-marker start nil)
    (move-marker end nil)
    t))