Function: hbmap:dir-member

hbmap:dir-member is a byte-compiled function defined in hbmap.el.

Signature

(hbmap:dir-member DIR-NAME)

Documentation

Return t iff DIR-NAME is a member of user's Hyperbole map, else nil.

If t, point is left at the start of the matching map entry. If nil, point is left in a position appropriate for insertion of a new entry.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hbmap.el
(defun hbmap:dir-member (dir-name)
  "Return t iff DIR-NAME is a member of user's Hyperbole map, else nil.
If t, point is left at the start of the matching map entry.  If nil,
point is left in a position appropriate for insertion of a new entry."
  (let ((obuf (current-buffer))
	(buf (and (file-exists-p hbmap:dir-filename)
		  (find-file-noselect hbmap:dir-filename)))
	rtn)
    (if buf
	(progn (set-buffer buf) (widen) (goto-char 1)
	       (if (search-forward (concat "\n(\"" dir-name "\"") nil t)
		   (progn (beginning-of-line) (setq rtn t))
		 (goto-char 1)
		 (or (= (forward-line 1) 0) (insert "\n")))
	       (set-buffer obuf)))
    rtn))