
(defvar hbmap:filename "HYPB" "\
*Filename used for quick access button files.")

(defun hbmap:dir-add (dir-name &optional no-save) "\
Adds DIR-NAME to map of all directories in which user has written buttons.
Returns t iff DIR-NAME is not already in map, nil if it is, and some
other value when cannot read or write map.
Optional NO-SAVE disables saving of the map after an add." (byte-code "ÂÃÄ	$‡" [dir-name no-save hbmap:dir-operate (lambda (dir) (not (hbmap:dir-member dir))) (progn (prin1 (list dir-name) buf) (terpri buf))] 5))

(defun hbmap:dir-list nil "\
Returns list of all directories in which user has written buttons." (byte-code "ŠÄ	!… Å	!?ƒ Â‚ Æ	!Â…, qˆebˆÇÈ!ˆÂÉÊ�ˆ*)‡" [buf hbmap:dir-filename nil dirs file-exists-p file-readable-p find-file-noselect forward-line 1 (byte-code "Áp!@B‰… Âˆ‚  ‡" [dirs read nil] 3) ((error (byte-code "À‡" [t] 1)))] 7))

(defun hbmap:dir-remove (dir-name &optional no-save) "\
Removes DIR-NAME from map of all dirs in which user has written buttons.
Returns t iff DIR-NAME is in the map and is successfully removed, nil if it
is not, and some other value when the map is not readable or writable.
Optional NO-SAVE disables saving of the map after a removal." (byte-code "ÂÃÄ	$‡" [dir-name no-save hbmap:dir-operate hbmap:dir-member (delete-region (point) (progn (forward-line 1) (point)))] 5))

(defun hbmap:dir-member (dir-name) "\
Returns 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." (byte-code "pÇ
!…
 È
!Ä	…? 	qˆÉ ˆÊbˆËÌÍQÄÆ#ƒ/ Î ˆÆ‰‚< ÊbˆÏÊ!ÐU†< Ñcˆqˆ+‡" [obuf buf hbmap:dir-filename rtn nil dir-name t file-exists-p find-file-noselect widen 1 search-forward "
(\"" "\"" beginning-of-line forward-line 0 "
"] 8))

(defun hbmap:dir-operate (pred dir-name form &optional no-save) "\
If PRED called on DIR-NAME is non-nil, evaluates FORM.
Returns t if PRED evaluation is successful and nil when not, except when
hbmap is not readable or writable, in which case returns a symbol indicating
the error.  Optional NO-SAVE disables saving of the map after operation." (byte-code "ŠÊ	!… Ë	!?ƒ Â‚ Ì	!ƒH qˆÍ\"…E Â‰ˆÎ!ˆƒ6 È‚E Ï	!ƒD Ð ˆÈ‚E Ñ‚I Ò))‡" [buf hbmap:dir-filename nil pred dir-name buffer-read-only form no-save t buffer-file-name file-exists-p file-readable-p find-file-noselect funcall eval file-writable-p save-buffer hbmap-not-writable hbmap-not-readable] 8))

(defvar hbmap:dir-user "~/.hyperb/" "\
Per user directory in which to store top level Hyperbole map data.
Must end with a directory separator.
Hyperbole will try to create it whenever 'hyperb:init' is called.")

(defvar hbmap:dir-filename (expand-file-name "HBMAP" hbmap:dir-user) "\
Name of a file that lists all dirs to which a user has written buttons.
See also 'hbmap:dir-user'.
If you change its value, you will be unable to search for buttons created by
others who use a different value!")

(provide (quote hbmap))
