
(defconst hypb:help-buf-suffix " Hypb Help*" "\
Suffix attached to all native Hyperbole help buffer names.")

(defun hypb:call-process-p (program infile &optional predicate &rest args) "\
Calls an external PROGRAM with INFILE for input.
If PREDICATE is given, it is evaluated in a buffer with the PROGRAM's
output and the result returned.  If PREDICATE is nil, returns t iff
program has no output or just a 0-valued output.
Rest of ARGS are passed as arguments to PROGRAM." (byte-code "ÈÉ!ÃŠqˆÃ‰ˆÊ ˆËÌÃ&ˆƒ( Í!‚; dÎU†; dÏW…; ÐÑÎÒ\"Ó\"‰ˆÔÃ!ˆÕ!)ˆ	*‡" [buf found buffer-read-only nil program infile args predicate get-buffer-create "*test-output*" erase-buffer apply call-process eval 1 4 string= buffer-substring 2 "0" set-buffer-modified-p kill-buffer] 9))

(defun hypb:chmod (op octal-permissions file) "\
Uses OP and OCTAL-PERMISSIONS integer to set FILE permissions.
OP may be +, -, xor, or default =." (byte-code "	Å=ƒ
 Æ‚ 	Ç=ƒ È‚ 	É=ƒ Ê‚ ËÌÍÎ!Ï!#\")‡" [func op t file octal-permissions + logior - (lambda (p1 p2) (logand (lognot p1) p2)) xor logxor (lambda (p1 p2) p1) set-file-modes funcall hypb:oct-to-int file-modes] 8))

(defun hypb:cmd-key-string (cmd-sym &optional keymap) "\
Returns a single pretty printed key sequence string bound to CMD-SYM.
Global keymap is used unless optional KEYMAP is given." (byte-code "… 9… Æ!ƒ6 ÇÈ	#ÅÉÊ
Ë\"ƒ/ È	ÌÅ#ÍÎ!ÏR‚0 
ÐQ+‚: ÑÒ\"‡" [cmd-sym get-keys keys keymap extend nil fboundp (lambda (cmd-sym keymap) (key-description (where-is-internal cmd-sym keymap (quote first)))) funcall "{" string= "" execute-extended-command " " symbol-name " RTN" "}" error "(hypb:cmd-key-string): Invalid cmd-sym arg: %s."] 10))

(defun hypb:debug nil "\
Loads Hyperbole hbut.el source file and sets debugging traceback flag." (interactive) (byte-code "ÂÃ!†	 ÄÅ!ˆÂÆ!… ÇÈÉÊK\"@@=?†  ÄË!ˆÁ‰‡" [debug-on-error t featurep hinit load "hsite" hbut byte-code nthcdr 3 ebut:create "hbut.el"] 7))

(defun hypb:domain-name nil "\
Returns current Internet domain name with '@' prepended or nil if none." (byte-code "ÄÅÆ!† ÅÇ!	… ÈÉÃÊ#
… ËÌ
\"†6 Å!…6 Í!…6 ÈÎÃÏÐÄ%‰…< Ñ
P+‡" [src dname-cmd dname nil "/etc/resolv.conf" file-exists-p "/usr/bin/domainname" "/bin/domainname" hypb:call-process-p "domainname" (substring (buffer-string) 0 -1) string-match "\\." file-readable-p "grep" (progn (goto-char (point-min)) (if (looking-at "domain[ 	]+\\([^ 	
]+\\)") (buffer-substring (match-beginning 1) (match-end 1)))) "^domain[ 	]" "@"] 12))

(defun hypb:error (&rest args) "\
Signals an error typically to be caught by 'hui:menu'." (byte-code "ÂÃ	\"ÄÅÆ#ˆÅ!)‡" [msg args apply format put error error-message] 5))

(defun hypb:functionp (thing) "\
Returns t if THING is a function, nil otherwise." (byte-code "9ƒ Ã!‚= Ä!†= ÃÅ!… Å!†& ÃÆ!…& Æ!†= :ƒ< @Ç=…9 A@<‚= Â‡" [thing t nil fboundp subrp byte-code-function-p compiled-function-p lambda] 8))

(defun hypb:function-copy (func-symbol) "\
Copies FUNC-SYMBOL's body for overloading.  Returns copy of body." (byte-code "Ã!ƒ; K	<ƒ Ä	!‚7 Å	!ƒ! ÆÇ\"‚7 ÃÈ!ƒ3 ÉÈÊËÌ	\"!\"‚7 ÆÍ	\")‚? ÆÎ\"‡" [func-symbol func t fboundp copy-sequence subrp error "(hypb:function-copy): `%s' is a primitive; can't copy body." make-byte-code apply nreverse hypb:map-vector (lambda (arg) (if (sequencep arg) (copy-sequence arg) arg)) "(hypb:function-copy): Can't copy function body: %s" "(hypb:function-copy): `%s' symbol is not bound to a function."] 12))

(defun hypb:function-symbol-replace (func-sym sym-to-replace replace-with-sym) "\
Replaces in body of FUNC-SYM SYM-TO-REPLACE with REPLACE-WITH-SYM.
All occurrences within lists are replaced.  Returns body of modified FUNC-SYM." (byte-code "	KÄÄ<ƒ ÈÄÉÊ\"\"@‰‚& ËHÌ!…$ ‰ˆ
ƒ_ 
GSÄ‰ˆ?…; ÍY…[ 
H‰=ƒQ 
I‚W ÄS‰ˆ‚3 )‚c ÎÏ\"ˆ+‡" [body func-sym arg-vector arg nil i sym-to-replace replace-with-sym delq mapcar (lambda (elt) (byte-code "<… ÂÃ8‰!… 	‡" [elt arg-vector vectorp 2] 3)) 2 vectorp 0 hypb:map-sublists (lambda (atom list) (byte-code "	=…+ Ã
… …* @=ƒ\" Ç\"ˆÆ‰‚& A‰ˆ‚ )‡" [atom sym-to-replace again t list replace-with-sym nil setcar] 4))] 7))

(defun hypb:help-buf-name (&optional prefix) "\
Returns a Hyperbole help buffer name for current buffer.
With optional PREFIX string, uses it rather than buffer name." (byte-code "	† Ã ÄÅ\"ƒ ÃÆ!!‚ Ç
Q)‡" [bn prefix hypb:help-buf-suffix buffer-name string-match " Hypb " generate-new-buffer "*"] 7))

(defun hypb:map-sublists (func list) "\
Applies FUNC to every atom found at any level of LIST.
FUNC must take two arguments, an atom and a list in which the atom is found.
Returns values from applications of FUNC as a list with the same
structure as LIST.  FUNC is therefore normally used just for its side-effects." (mapcar (quote (lambda (elt) (byte-code "Ã!ƒ Ä	
#‚ Å	\"‡" [elt func list atom funcall hypb:map-sublists] 5)))))

(defun hypb:map-vector (func object) "\
Returns list of results of application of FUNC to each element of OBJECT.
OBJECT should be a vector or byte-code object." (byte-code "Å!† ÆÇ!… Ç!† ÆÈ!… È!?…\" ÉÊ!ˆGËÌ
	W…A Í
H\"B
T‰ˆ‚* ˆÎ!+‡" [object end i result func vectorp fboundp byte-code-function-p compiled-function-p error "(hypb:map-vector): Second argument must be a vector or byte-code object." 0 nil funcall nreverse] 11))

(defun hypb:replace-match-string (regexp str newtext &optional literal) "\
Replaces all matches for REGEXP in STR with NEWTEXT str.
Optional LITERAL non-nil means do a literal replacement.
Otherwise treat \\ in NEWTEXT string as special:
  & means substitute original matched text,
  N means substitute match for (...) number N,
  \\\\ means insert one \\.
NEWTEXT may instead be a function of one argument, the string to replace in,
that returns a replacement string." (byte-code ";?…
 ËÌ\"ˆ	;† Í	!ƒ Â‚ ËÎ	\"ˆÏÐÂÂÂÑ#‰…g ÒÐ!OÍ	!ƒR Ó	\"‚` 	ƒ[ 	‚` ÔÕ	Ï#Q‰ˆ‚+ ˆÂOP-‡" [str newtext nil rtn-str start special match prev-start regexp literal t error "(hypb:replace-match-string): 2nd arg must be a string: %s" hypb:functionp "(hypb:replace-match-string): 3nd arg must be a string or func: %s" "" 0 string-match match-end funcall mapconcat (lambda (c) (byte-code "ƒW Á‰ˆ
Å=ƒ Æ‚T 
Ç=ƒ# ÈÉ!ÊÉ!O‚T 
ËY…, 
ÌXƒQ 
ËÍ G\\Vƒ@ ÎÏ
\"‚N 
ËZ‰ˆÈ
!Ê
!O‚T Ð
!‚h 
Å=ƒe Ä‰ˆÁ‚h Ð
!‡" [special nil c str t 92 "\\" 38 match-beginning 0 match-end 48 57 match-data error "(hypb:replace-match-string) Invalid match num: %c" char-to-string] 9))] 14))

(defun hypb:screen-line (&optional pos-or-marker) "\
Returns screen line number of optional POS-OR-MARKER or current point.
Signals error if POS-OR-MARKER position is not visible on screen.
Line numbers start from 0 at screen top." (byte-code "† `‰ˆÆ!?ƒ Ç ‚5 ÈÉ!!Ê
\"ƒ% 
‚4 É!ËÄÌÍÎÅ!\"\"@))	?†@ Ê	\"?ƒJ ÏÐ\"‚L Ñ‹)‡" [pos-or-marker wind w mbuf nil t markerp selected-window get-buffer-window marker-buffer pos-visible-in-window-p delq mapcar (lambda (w) (byte-code "Ã	!=… Ä
	\"… 	‡" [mbuf w pos-or-marker window-buffer pos-visible-in-window-p] 4)) hypb:window-list error "(hypb:screen-line): Buffer point %s is not on screen." ((byte-code "ŠÂ!ˆ	bˆÃÄ 8ÅÆ!n… m?ƒ `T‚ `\"S\\)‡" [wind pos-or-marker select-window 1 window-edges count-lines window-start] 7))] 13))

(defun hypb:supercite-p nil "\
Returns non-nil iff the Emacs add-on supercite package is in use." (byte-code "ÁÀ!… Â=† <… Â>‡" [mail-yank-hooks boundp sc-cite-original] 3))

(if hyperb:lemacs-p (defun hypb:window-list (&optional mini) "Returns a list of Lisp window objects for all Emacs windows.
Optional first arg MINI t means include the minibuffer window
in the list, even if it is not active.  If MINI is neither t
nor nil it means to not count the minibuffer window even if it is active." (byte-code "ÇÈÉ ÁÂ#Â#ÁBÇÂ#=?…7 ÊÁB\"‰ˆÇÂ#‰ˆ‚ ˆ,‡" [first-window nil t mini windows current-cons w next-window previous-window selected-window setcdr] 10)) (defun hypb:window-list (&optional mini) "Returns a list of Lisp window objects for all Emacs windows.
Optional first arg MINI t means include the minibuffer window
in the list, even if it is not active.  If MINI is neither t
nor nil it means to not count the minibuffer window even if it is active." (byte-code "ÆÇÈ !	\"ÃB
Æ	\"=?…- ÉÃB\"‰ˆÆ	\"‰ˆ‚ ˆ
,‡" [first-window mini windows nil current-cons w next-window previous-window selected-window setcdr] 9)))

(defun hypb:oct-to-int (oct-num) "\
Returns octal integer OCTAL-NUM converted to a decimal integer." (byte-code "Ã	!ÄÅÆ\"… ÇÈÉ\"!ˆÊËÌ#ˆ
*‡" [oct-str oct-num dec-num int-to-string 0 string-match "[^0-7]" error format "(hypb:oct-to-int): Bad octal number: %s" mapconcat (lambda (o) (setq dec-num (+ (* dec-num 8) (if (and (>= o 48) (<= o 55)) (- o 48))))) ""] 8))

(provide (quote hypb))
