
(byte-code "ÀÁÂ\"ˆÃÁÄÅ#ˆÆÇ!ˆÀÈÉ\"ˆÃÈÊÅ#ˆÆÇ!ˆÈ‡" [setplist actypes::link-to-doc (variable-documentation "Displays online version of a document given by DOC-ID, in other window.
If online version of document is not found in `doc-id-indices', an error is signalled." action (lambda (doc-id) (interactive "sID for document to link to (omit delimiters): ") (let ((rolo-display-buffer (hypb:help-buf-name "Doc ID"))) (cond ((null doc-id-indices) (error "(doc-id-index-entry): You must set the 'doc-id-indices' variable first.")) ((let ((rolo-entry-regexp doc-id-index-entry-regexp)) (= 0 (rolo-grep (funcall doc-id-match doc-id) 1 doc-id-indices nil (quote no-display)))) (error "(doc-id-index-entry): No document index entry found for %s%s%s." doc-id-start doc-id doc-id-end)) (t (save-excursion (set-buffer rolo-display-buffer) (goto-char (point-min)) (message "Searching for document %s%s%s..." doc-id-start doc-id doc-id-end) (if (re-search-forward doc-id-online-regexp nil t) (progn (goto-char (match-beginning 1)) (hbut:act (ibut:at-p)) (message "")) (error "(link-to-doc): No online document version found for %s%s%s." doc-id-start doc-id doc-id-end)))))))) symset:add actypes types run-hooks htype:create-hook ibtypes::doc-id (variable-documentation "Displays an index entry for a site-specific document given its id.
Ids must be delimited by 'doc-id-start' and 'doc-id-end' and must
match the function given by 'doc-id-p'." at-p (and (not (bolp)) (let* ((id-and-pos (hbut:label-p t doc-id-start doc-id-end t)) (id (car id-and-pos))) (if (funcall doc-id-p id) (progn (ibut:label-set id-and-pos) (hact (quote link-to-doc) id))))) to-p nil style nil) ibtypes] 8)

(defvar doc-id-indices (quote nil) "\
List of pathnames in which to search for site-specific document index entries.
Each file must utilize a wrolo record format, with each record start
delimited by 'doc-id-index-entry-regexp'.")

(defun doc-id:help (but) "\
Displays site-specific document index entry given by doc-id BUT, in other window.
Also displays standard Hyperbole help for implicit button BUT." (byte-code "	ÏÐ!ÑÒÓ\"!?ƒ ÔÕ!‚. Ö×Ø\"Ù#U…. ÔÚ$ˆÎ	Ï 
ÛÜ!ˆŠ
qˆÎ‰ˆdbˆÝ
!ˆÞÎ!ˆÎ‰ˆeb)ˆß
!,+‡" [rolo-entry-regexp doc-id-index-entry-regexp rolo-display-buffer doc-id but doc-id-indices doc-id-match doc-id-start doc-id-end index-entry report-buf temp-buffer-show-hook temp-buffer-show-function buffer-read-only nil hypb:help-buf-name "Doc ID" hbut:key-to-label hattr:get lbl-key error "(doc-id-index-entry): You must set the 'doc-id-indices' variable first." 0 rolo-grep funcall 1 "(doc-id-index-entry): No document index entry found for %s%s%s." (lambda (buffer) (setq *smart-key-screen-config* (current-window-configuration))) hbut:report insert-buffer set-buffer-modified-p kill-buffer] 13))

(defvar doc-id-start "[" "\
String which delimits start of a site-specific document id.")

(defvar doc-id-end "]" "\
String which delimits end of a site-specific document id.")

(defvar doc-id-index-entry-regexp "^------+[ 	
]+Title:" "Regexp which matches start of a site-specific document index entry.")

(defvar doc-id-match (function (lambda (doc-id) (concat "ID:[ 	]*\\[" (regexp-quote doc-id) "\\]"))) "\
Function which returns regexp which matches only in DOC-ID's index entry.")

(defvar doc-id-p (function (lambda (str) (and (stringp str) (> (length str) 0) (= 119 (char-syntax (aref str 0))) (string-match "\\`\\w+-[0-9][0-9][0-9]+\\'" str)))) "\
Boolean function to test whether arg 'str' is a doc id or not.")

(defvar doc-id-online-regexp "^Online-Loc:[ 	]*\"\\([^\"]+\\)\"" "\
Regexp whose 1st grouping matches an implicit button which displays an online document within an index entry.")

(provide (quote hib-doc-id))
