annotate lisp/hyperbole/hib-doc-id.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children 4103f0995bd7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;!emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; FILE: hib-doc-id.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Implicit button type for document id index entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; USAGE: GNU Emacs Lisp Library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; KEYWORDS: docs, extensions, hypermedia
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; AUTHOR: Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; ORG: Motorola, Inc., PWDG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; ORIG-DATE: 30-Sep-92 at 19:39:59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; LAST-MOD: 14-Apr-95 at 15:58:21 by Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; This file is part of Hyperbole.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; Available for use and distribution under the same terms as GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; Copyright (C) 1992-1995, Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; Developed with support from Motorola Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; DESCRIPTION:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; TO USE:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; Pressing the Action Key on a doc id such as, [Emacs-001],
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;; displays the online version of the document, if any. Pressing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; Assist Key on it displays its document index entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; TO INSTALL:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; Set the value of 'doc-id-indices' before using the 'doc-id'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; implicit button type defined herein or you will get an error telling you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; to do so. See the documentation for 'doc-id-indices'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; You must explicitly load this package in order to use it, since
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; Hyperbole does not load it by default.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; At this site, we use doc ids of the form, [Emacs-001], delimited by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; brackets, starting with a subject name, followed by a -, followed by a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; multi-digit numeric identifier.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;; Typically an index entry should have links to all available forms of its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;; document, e.g. online, printed, source. Below is the index entry form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; we use. The default variable settings herein work with our formats. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;; you prefer different ones, you must change all of the variable values.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;; --------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;; Title: ID: []
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;; Email-To:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;; Distribution:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;; Abstract:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;; References:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;; Author:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;; Copyright:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;; Keywords:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ;; Online-Format:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;; Online-Loc: ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;; Printed-Format:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;; Printed-Loc: Local Library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;; Printable-Loc: ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ;; Source-Format:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;; Source-Loc: ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;; Date:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;; Version:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;; Version-Changes:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;; --------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ;; DESCRIP-END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ;;; Public implicit button types
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ;;; Displays a documentation index entry given an ID.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (defact link-to-doc (doc-id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 "Displays online version of a document given by DOC-ID (no delimiters), in other window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 If online version of document is not found in `doc-id-indices', an error is signalled."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (interactive "sID for document to link to (omit delimiters): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (let ((rolo-display-buffer (hypb:help-buf-name "Doc ID"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (delim-doc-id (concat doc-id-start doc-id doc-id-end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (cond ((null doc-id-indices)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (error "(doc-id-index-entry): You must set the 'doc-id-indices' variable first."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ((let ((rolo-entry-regexp doc-id-index-entry-regexp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (= 0 (rolo-grep (funcall doc-id-match doc-id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 1 doc-id-indices nil 'no-display)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (error "(doc-id-index-entry): %s not found in document index."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 delim-doc-id))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ;; Matching index entry has been put into 'rolo-display-buffer'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (t (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (set-buffer rolo-display-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (message "Searching for document %s..." delim-doc-id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (if (re-search-forward doc-id-online-regexp nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (goto-char (match-beginning 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (let ((doc-path (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (match-beginning 1) (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (ibut (ibut:at-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (if ibut
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (progn (hbut:act ibut)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (message "Displaying %s." delim-doc-id))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (error "(link-to-doc): %s invalid online location: %s"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 delim-doc-id doc-path))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (error "(link-to-doc): %s is unavailable in online form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 delim-doc-id)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (defib doc-id ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 "Displays an index entry for a site-specific document given its id.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 Ids must be delimited by 'doc-id-start' and 'doc-id-end' and must
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 match the function given by 'doc-id-p'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (and (not (bolp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (let* ((id-and-pos (hbut:label-p t doc-id-start doc-id-end t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (id (car id-and-pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (if (funcall doc-id-p id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (progn (ibut:label-set id-and-pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (hact 'link-to-doc id))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ;;; Displays a doc from SW Process Tree (Motorola Paging Products Specific)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (if (file-exists-p "/proj/process/ppg/")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (defib ppg-sw-process ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 "Display a Paging Products software process document from document id at point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (let ((path (hpath:at-p nil t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (if (and path (string-match "/.+%s.+%s" path))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (progn (require 'sw-process)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (ibut:label-set path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (setq path (format path ppg-sw-process-file-format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ppg-sw-process-file-suffix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (if (file-exists-p path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (hact 'link-to-file path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (if (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 "^Source-Loc:[ \t]*\"\\([^\"]+\\)\"" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (goto-char (match-beginning 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (let ((path-but (ibut:at-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (if path-but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (hbut:act path-but)))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 ;;; Public variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (defvar doc-id-indices '()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 "List of pathnames in which to search for site-specific document index entries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 Each file must utilize a wrolo record format, with each record start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 delimited by 'doc-id-index-entry-regexp'.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ;;; Private functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (defun doc-id:help (but)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 "Displays site-specific document index entry given by doc-id BUT, in other window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 Also displays standard Hyperbole help for implicit button BUT."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (let ((rolo-entry-regexp doc-id-index-entry-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (rolo-display-buffer (hypb:help-buf-name "Doc ID"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (doc-id (hbut:key-to-label (hattr:get but 'lbl-key))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (cond ((null doc-id-indices)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (error "(doc-id-index-entry): You must set the 'doc-id-indices' variable first."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ((= 0 (rolo-grep (funcall doc-id-match doc-id) 1 doc-id-indices))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 "(doc-id-index-entry): No document index entry found for %s%s%s."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 doc-id-start doc-id doc-id-end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (let* ((report-buf (hypb:help-buf-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (temp-buffer-show-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (lambda (buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (setq *hkey-wconfig*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (current-window-configuration)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (let ((wind (get-buffer-create buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (setq minibuffer-scroll-window wind))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (temp-buffer-show-function temp-buffer-show-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (hbut:report but)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (set-buffer rolo-display-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (setq buffer-read-only nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (insert-buffer report-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (set-buffer-modified-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (setq buffer-read-only nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (goto-char (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (kill-buffer report-buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 ;;; Private variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (defvar doc-id-start "["
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 "String which delimits start of a site-specific document id.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (defvar doc-id-end "]"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 "String which delimits end of a site-specific document id.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (defvar doc-id-index-entry-regexp "^------+[ \t\n]+Title:"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 "Regexp which matches start of a site-specific document index entry.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (defvar doc-id-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (function (lambda (doc-id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (concat "ID:[ \t]*\\[" (regexp-quote doc-id) "\\]")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 "Function which returns regexp which matches only in DOC-ID's index entry.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (defvar doc-id-p (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (lambda (str)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (and (stringp str)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (> (length str) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (= ?w (char-syntax (aref str 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (string-match "\\`\\w+-[0-9][0-9][0-9]+\\'" str))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 "Boolean function to test whether arg 'str' is a doc id or not.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (defvar doc-id-online-regexp "^Online-Loc:[ \t]*\"\\([^\"]+\\)\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 "Regexp whose 1st grouping matches an implicit button which displays an online document within an index entry.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (provide 'hib-doc-id)