annotate lisp/hyperbole/hibtypes.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: hibtypes.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Hyperbole System Implicit Button Types.
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: 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: Brown U.
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: 19-Sep-91 at 20:45:31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; LAST-MOD: 3-Nov-95 at 22:49:12 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 ;;; Other required Elisp libraries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 (require 'hactypes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;; Public implicit button types
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 (run-hooks 'hibtypes:begin-load-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; Follows URLs by invoking a browser.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (require 'hsys-w3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;;; Handles internal references within an annotated bibliography, delimiters=[]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (defib annot-bib ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 "Displays annotated bibliography entries referenced internally.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 References must be delimited by square brackets, must begin with a word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 constituent character, and must not be in buffers whose names begin with a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ' ' or '*' character or which do not have an attached file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (and (not (bolp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (let ((chr (aref (buffer-name) 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (not (or (= chr ? ) (= chr ?*))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (let* ((ref-and-pos (hbut:label-p t "[" "]" t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (ref (car ref-and-pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (and ref (= ?w (char-syntax (aref ref 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (progn (ibut:label-set ref-and-pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (hact 'annot-bib ref))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;;; Summarizes an Internet rfc for random access browsing by section.
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 (defib rfc-toc ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 "Summarizes contents of an Internet rfc from anywhere within rfc buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 Each line in summary may be selected to jump to section."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (toc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (opoint (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (if (and (string-match "rfc" (buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (progn (setq toc (search-forward "Table of Contents" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (re-search-forward "^[ \t]*1.0?[ \t]+[^ \t\n]" nil t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (and toc 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (progn (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (ibut:label-set (buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (hact 'rfc-toc (buffer-name) opoint))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (goto-char opoint)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;;; Jumps to C/C++ source line associated with Cscope C analyzer output line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (defib cscope ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 "Jumps to C/C++ source line associated with Cscope C analyzer output line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 Requires pre-loading of the cscope.el Lisp library available from the Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 Lisp archives and the commercial cscope program available from UNIX System
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 Laboratories. Otherwise, does nothing."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (and (boundp 'cscope:bname-prefix) ;; (featurep 'cscope)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (stringp cscope:bname-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (string-match (regexp-quote cscope:bname-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (= (match-beginning 0) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (looking-at cscope-output-line-regexp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (let (start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (skip-chars-backward "^\n\^M")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (setq start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (skip-chars-forward "^\n\^M")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (setq end (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (ibut:label-set (buffer-substring start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (hact 'cscope-interpret-output-line))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ;;; Makes README table of contents entries jump to associated sections.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (defib text-toc ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 "Jumps to the text file section referenced by a table of contents entry at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 File name must contain README and there must be a `Table of Contents' or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 `Contents' label on a line by itself (it may begin with an asterisk),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 preceding the table of contents. Each toc entry must begin with some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 whitespace followed by one or more asterisk characters. Each file section
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 name line must start with one or more asterisk characters at the very
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 beginning of the line."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (let (section)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (if (and (string-match "README" (buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (if (looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 "[ \t]+\\*+[ \t]+\\(.*[^ \t]\\)[ \t]*$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (setq section (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (match-end 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (progn (ibut:label-set section (match-beginning 1) (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (save-excursion (re-search-backward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 "^\\**[ \t]*\\(Table of \\)Contents[ \t]*$"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 nil t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (hact 'text-toc section))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ;;; Makes directory summaries into file list menus.
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 (defib dir-summary ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 "Detects filename buttons in files named \"MANIFEST\" or \"DIR\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 Displays selected files. Each file name must be at the beginning of the line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 or may be preceded by some semicolons and must be followed by one or more
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 spaces and then another non-space, non-parenthesis, non-brace character."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (if buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (let ((file (file-name-nondirectory buffer-file-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 entry start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (if (or (string= file "DIR") (string= file "MANIFEST"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (if (looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 "\\(;+[ \t]*\\)?\\([^(){}* \t\n]+\\)[ \t]+[^(){}* \t\n]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (setq entry (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (match-beginning 2) (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 start (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 end (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (if (file-exists-p entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (progn (ibut:label-set entry start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (hact 'link-to-file entry))))))))))
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 ;;; Executes or documents command bindings of brace delimited key sequences.
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 (require 'hib-kbd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 ;;; Makes Internet RFC references retrieve the RFC.
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 (defib rfc ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 "Retrieves and displays an Internet rfc referenced at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 Requires ange-ftp or efs when needed for remote retrievals. The following
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 formats are recognized: RFC822, rfc-822, and RFC 822. The 'hpath:rfc'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 variable specifies the location from which to retrieve RFCs."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (rfc-num nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (and (not (memq major-mode '(dired-mode monkey-mode)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (boundp 'hpath:rfc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (stringp hpath:rfc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (skip-chars-backward "-rRfFcC0-9")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (if (looking-at "rfc[- ]?\\([0-9]+\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (setq rfc-num
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (match-beginning 1) (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (ibut:label-set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (buffer-substring (match-beginning 0) (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ;; Ensure ange-ftp is available for retrieving a remote
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ;; RFC, if need be.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (if (string-match "^/.+:" hpath:rfc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ;; This is a remote path.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (hpath:ange-ftp-available-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 ;; local path
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (hact 'link-to-rfc rfc-num))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 ;;; Makes Hyperbole mail addresses output Hyperbole envir info.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (defib hyp-address ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 "Turns a Hyperbole e-mail list address into an implicit button which inserts Hyperbole environment information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 Useful when sending mail to a Hyperbole mail list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 See also the documentation for `actypes::hyp-config'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (if (memq major-mode (list hmail:composer hnews:composer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (let ((addr (find-tag-default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (cond ((set:member addr (list "hyperbole" "hyperbole@hub.ucsb.edu"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (hact 'hyp-config))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ((set:member addr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (list "hyperbole-request"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 "hyperbole-request@hub.ucsb.edu"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (hact 'hyp-request))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 ;;; Makes source entries in Hyperbole reports selectable.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (defib hyp-source ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 "Turns source location entries in Hyperbole reports into buttons that jump to the associated location."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (if (looking-at hbut:source-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (let ((src (hbut:source)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (if src
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (progn (if (not (stringp src)) (setq src (prin1-to-string src)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (ibut:label-set src (point) (progn (end-of-line) (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (hact 'hyp-source src)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 ;;; Shows man page associated with a man apropos entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (defib man-apropos ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 "Makes man apropos entries display associated man pages when selected."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (let ((nm "[^ \t\n!@,][^ \t\n,]*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 topic)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (and (looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 "^\\(\\*[ \t]+[!@]\\)?\\(" nm "[ \t]*,[ \t]*\\)*\\(" nm "\\)[ \t]*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 "\\(([-0-9a-zA-z]+)\\)\\(::\\)?[ \t]+-[ \t]+[^ \t\n]"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (setq topic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (concat (buffer-substring (match-beginning 3) (match-end 3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (buffer-substring (match-beginning 4) (match-end 4))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (ibut:label-set topic (match-beginning 3) (match-end 4))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (hact 'man-show topic)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 ;;; Follows links to Hyperbole outliner cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (if hyperb:kotl-p (require 'klink))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 ;;; Displays files and directories when double quoted pathname is activated.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (defib pathname ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 "Makes a delimited, valid pathname display the path entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 Also works for delimited and non-delimited ange-ftp and efs pathnames.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 See `hpath:at-p' function documentation for possible delimiters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 See `hpath:suffixes' variable documentation for suffixes that are added to or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 removed from pathname when searching for a valid match.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 See `hpath:find' function documentation and `hpath:display-alist' and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 `hpath:find-alist' variable documentation for special file display options."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (let ((path (hpath:at-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (if path
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (progn (ibut:label-set path)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (hact 'link-to-file path)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 ;;; Jumps to source line associated with debugger stack frame or breakpoint
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 ;;; lines. Supports gdb, dbx, and xdb.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (defib debugger-source ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 "Jumps to source line associated with debugger stack frame or breakpoint lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 This works with gdb, dbx, and xdb. Such lines are recognized in any buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (cond ((looking-at ".+ \\(at\\|file\\) \\([^ :]+\\):\\([0-9]+\\)\\.?$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 ;; GDB
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (let* ((file (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (match-end 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (line-num (buffer-substring (match-beginning 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (match-end 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (but-label (concat file ":" line-num)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (setq line-num (string-to-int line-num))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (ibut:label-set but-label)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (hact 'link-to-file-line file line-num)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 ((looking-at ".+ (file=[^\"\n]+\"\\([^\"\n]+\\)\", line=\\([0-9]+\\),")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 ;; XEmacs assertion failure
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (let* ((file (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (line-num (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (match-end 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (but-label (concat file ":" line-num)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (setq line-num (string-to-int line-num))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (ibut:label-set but-label)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (hact 'link-to-file-line file line-num)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 ((looking-at ".+ line \\([0-9]+\\) in \"\\([^\"]+\\)\"$")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 ;; New DBX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (let* ((file (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (match-end 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (line-num (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (but-label (concat file ":" line-num)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (setq line-num (string-to-int line-num))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (ibut:label-set but-label)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (hact 'link-to-file-line file line-num)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 ((or (looking-at ".+ \\[\"\\([^\"]+\\)\":\\([0-9]+\\),") ;; Old DBX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (looking-at ".+ \\[\\([^: ]+\\): \\([0-9]+\\)\\]")) ;; HP-UX xdb
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (let* ((file (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (line-num (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (match-end 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (but-label (concat file ":" line-num)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (setq line-num (string-to-int line-num))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (ibut:label-set but-label)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (hact 'link-to-file-line file line-num))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 ;;; Jumps to source line associated with grep or compilation error messages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 ;;; With credit to Michael Lipp and Mike Williams for the idea.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (defib grep-msg ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 "Jumps to line associated with grep or compilation error msgs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 Messages are recognized in any buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 (if (equal (buffer-name) "*compilation*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (require 'compile)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 ;; Make sure we have a parsed error-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (if (eq compilation-error-list t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (progn (compilation-forget-errors)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 (setq compilation-parsing-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (if (not compilation-error-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (set-buffer-modified-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 ;; Emacs V19 incompatibly adds two non-optional arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 ;; over V18.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (compilation-parse-errors nil nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (error (compilation-parse-errors)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 ;; Locate and parse grep messages found in any buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (if (or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 ;; UNIX C compiler and Introl 68HC11 C compiler errors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (looking-at "\\([^ \t\n\^M:]+\\): ?\\([0-9]+\\)[ :]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 ;; BSO/Tasking 68HC08 C compiler errors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (looking-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 "[a-zA-Z 0-9]+: \\([^ \t\n\^M]+\\) line \\([0-9]+\\)[ \t]*:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 ;; UNIX Lint errors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (looking-at "[^:]+: \\([^ \t\n\^M:]+\\): line \\([0-9]+\\):")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 ;; SparcWorks C compiler errors (ends with :)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 ;; IBM AIX xlc C compiler errors (ends with .)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (looking-at "\"\\([^\"]+\\)\", line \\([0-9]+\\)[:.]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 ;; Introl as11 assembler errors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (looking-at " \\*+ \\([^ \t\n\^M]+\\) - \\([0-9]+\\) ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 ;; perl5: ... at file.c line 10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (looking-at ".+ at \\([^ \t\n]+\\) line +\\([0-9]+\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (let* ((file (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (line-num (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (match-end 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (but-label (concat file ":" line-num))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (source-loc (hbut:key-src t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (if (stringp source-loc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (setq file (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 file (file-name-directory source-loc))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (setq line-num (string-to-int line-num))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (ibut:label-set but-label)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (hact 'link-to-file-line file line-num))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 ;;; Jumps to source of Emacs Lisp V19 byte-compiler error messages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (defib elisp-compiler-msg ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 "Jumps to source code for definition associated with byte-compiler error message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 Works when activated anywhere within an error line."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (if (or (equal (buffer-name) "*Compile-Log*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (equal (buffer-name) "*compilation*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (and (re-search-backward "^[^ \t\n\r]" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (looking-at "While compiling"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (let (src buffer-p label)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (and (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (re-search-backward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 "^While compiling [^\t\n]+ in \\(file\\|buffer\\) \\([^ \n]+\\):$"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (setq buffer-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (equal (buffer-substring (match-beginning 1) (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 "buffer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 src (buffer-substring (match-beginning 2) (match-end 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (re-search-backward "^While compiling \\([^ \n]+\\)\\(:$\\| \\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (setq label (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (match-beginning 1) (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (ibut:label-set label (match-beginning 1) (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 ;; Remove prefix generated by actype and ibtype definitions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (setq label (hypb:replace-match-string "[^:]+::" label "" t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (hact 'link-to-regexp-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (concat "^\(def[a-z \t]+" (regexp-quote label)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 "[ \t\n\(]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 1 src buffer-p))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 ;;; Jumps to source associated with a line of output from 'patch'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (defib patch-msg ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 "Jumps to source code associated with output from the 'patch' program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 Patch applies diffs to source code."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (if (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (looking-at "Patching \\|Hunk "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (let ((opoint (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (file) line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (cond ((looking-at "Hunk .+ at \\([0-9]+\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (setq line (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (match-end 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 (ibut:label-set line (match-beginning 1) (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (if (re-search-backward "^Patching file \\(\\S +\\)" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (setq file (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (match-end 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 ((looking-at "Patching file \\(\\S +\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (setq file (buffer-substring (match-beginning 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 line "1")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 (ibut:label-set file (match-beginning 1) (match-end 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (goto-char opoint)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (if (null file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (setq line (string-to-int line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (hact 'link-to-file-line file line)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 ;;; Composes mail, in another window, to the e-mail address at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 (defib mail-address ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 "If on an e-mail address in a specific buffer type, mail to that address in another window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 Applies to the rolodex match buffer, any buffer attached to a file in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 'rolo-file-list', or any buffer with \"mail\" or \"rolo\" (case-insensitive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 within its name."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (if (or (and (let ((case-fold-search t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (string-match "mail\\|rolo" (buffer-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 ;; Don't want this to trigger in a mail/news summary buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (not (or (hmail:lister-p) (hnews:lister-p))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 (if (boundp 'rolo-display-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (equal (buffer-name) rolo-display-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (and buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (boundp 'rolo-file-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (set:member (current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (mapcar 'get-file-buffer rolo-file-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (let ((address (mail-address-at-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (if address
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (ibut:label-set address (match-beginning 1) (match-end 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (hact 'mail-other-window nil address))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (defconst mail-address-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 "\\([_a-zA-Z][-_a-zA-Z0-9.!@+%]*@[-_a-zA-Z0-9.!@+%]+\\.[a-zA-Z][-_a-zA-Z][-_a-zA-Z]?\\|[a-zA-Z][-_a-zA-Z0-9.!+%]+@[-_a-zA-Z0-9@]+\\)\\($\\|[^a-zA-Z0-9.!@%]\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 "Regexp with group 1 matching an Internet email address.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 (defun mail-address-at-p ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 "Return e-mail address, a string, that point is within or nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (skip-chars-backward "^ \t\n\^M\"\'(){}[];<>|")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (if (looking-at mail-address-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (buffer-substring (match-beginning 1) (match-end 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 ;;; Displays Info nodes when double quoted "(file)node" button is activated.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (defib Info-node ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 "Makes \"(file)node\" buttons display the associated Info node."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (let* ((node-ref-and-pos (hbut:label-p t "\"" "\"" t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (node-ref (hpath:is-p (car node-ref-and-pos) nil t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (and node-ref (string-match "([^\)]+)" node-ref)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 (ibut:label-set node-ref-and-pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (hact 'link-to-Info-node node-ref))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 ;;; Inserts completion into minibuffer or other window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 ;;; ========================================================================
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (defib completion ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 "Inserts completion at point into minibuffer or other window."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (let ((completion (hargs:completion t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (and completion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (ibut:label-set completion)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (hact 'completion))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (run-hooks 'hibtypes:end-load-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (provide 'hibtypes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501