Mercurial > emacs
annotate lisp/help.el @ 2314:a47c59ea019b
Don't distribute etc/Old files.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Mon, 22 Mar 1993 14:57:04 +0000 |
parents | ad7b89a430df |
children | 9e7ec92a4fdf |
rev | line source |
---|---|
660
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
444
diff
changeset
|
1 ;;; help.el --- help commands for Emacs |
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
444
diff
changeset
|
2 |
846
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
811
diff
changeset
|
3 ;; Copyright (C) 1985, 1986 Free Software Foundation, Inc. |
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
811
diff
changeset
|
4 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
755
diff
changeset
|
5 ;; Maintainer: FSF |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
807
diff
changeset
|
6 ;; Keywords: help, internal |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
755
diff
changeset
|
7 |
409 | 8 ;; This file is part of GNU Emacs. |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
755
diff
changeset
|
12 ;; the Free Software Foundation; either version 2, or (at your option) |
409 | 13 ;; any later version. |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
23 | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
755
diff
changeset
|
24 ;;; Code: |
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
755
diff
changeset
|
25 |
2312
ad7b89a430df
Don't load help-screen at run time if compiled.
Richard M. Stallman <rms@gnu.org>
parents:
2237
diff
changeset
|
26 ;; Get the macro make-help-screen when this is compiled, |
ad7b89a430df
Don't load help-screen at run time if compiled.
Richard M. Stallman <rms@gnu.org>
parents:
2237
diff
changeset
|
27 ;; or run interpreted, but not when the compiled code is loaded. |
ad7b89a430df
Don't load help-screen at run time if compiled.
Richard M. Stallman <rms@gnu.org>
parents:
2237
diff
changeset
|
28 (eval-when-compile (require 'help-screen)) |
2237
2670a8f6a42e
Teach this to use help-screen.el.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2134
diff
changeset
|
29 |
409 | 30 (defvar help-map (make-sparse-keymap) |
31 "Keymap for characters following the Help key.") | |
32 | |
919 | 33 (define-key global-map (char-to-string help-char) 'help-command) |
409 | 34 (fset 'help-command help-map) |
35 | |
919 | 36 (define-key help-map (char-to-string help-char) 'help-for-help) |
409 | 37 (define-key help-map "?" 'help-for-help) |
38 | |
39 (define-key help-map "\C-c" 'describe-copying) | |
40 (define-key help-map "\C-d" 'describe-distribution) | |
41 (define-key help-map "\C-w" 'describe-no-warranty) | |
42 (define-key help-map "a" 'command-apropos) | |
43 | |
44 (define-key help-map "b" 'describe-bindings) | |
45 | |
46 (define-key help-map "c" 'describe-key-briefly) | |
47 (define-key help-map "k" 'describe-key) | |
48 | |
49 (define-key help-map "d" 'describe-function) | |
50 (define-key help-map "f" 'describe-function) | |
51 | |
52 (define-key help-map "i" 'info) | |
732 | 53 (define-key help-map "\C-f" 'Info-goto-emacs-command-node) |
54 (define-key help-map "\C-k" 'Info-goto-emacs-key-command-node) | |
409 | 55 |
56 (define-key help-map "l" 'view-lossage) | |
57 | |
58 (define-key help-map "m" 'describe-mode) | |
59 | |
60 (define-key help-map "\C-n" 'view-emacs-news) | |
61 (define-key help-map "n" 'view-emacs-news) | |
62 | |
2134
b275e1b50542
Added autoload, binding and menu line for new finder feature (P).
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2079
diff
changeset
|
63 (define-key help-map "p" 'finder-by-keyword) |
b275e1b50542
Added autoload, binding and menu line for new finder feature (P).
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2079
diff
changeset
|
64 (autoload 'finder-by-keyword "finder.el") |
b275e1b50542
Added autoload, binding and menu line for new finder feature (P).
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2079
diff
changeset
|
65 |
409 | 66 (define-key help-map "s" 'describe-syntax) |
67 | |
68 (define-key help-map "t" 'help-with-tutorial) | |
69 | |
70 (define-key help-map "w" 'where-is) | |
71 | |
72 (define-key help-map "v" 'describe-variable) | |
73 | |
74 (defun help-with-tutorial () | |
75 "Select the Emacs learn-by-doing tutorial." | |
76 (interactive) | |
77 (let ((file (expand-file-name "~/TUTORIAL"))) | |
78 (delete-other-windows) | |
79 (if (get-file-buffer file) | |
80 (switch-to-buffer (get-file-buffer file)) | |
81 (switch-to-buffer (create-file-buffer file)) | |
82 (setq buffer-file-name file) | |
83 (setq default-directory (expand-file-name "~/")) | |
755 | 84 (setq buffer-auto-save-file-name nil) |
444 | 85 (insert-file-contents (expand-file-name "TUTORIAL" data-directory)) |
409 | 86 (goto-char (point-min)) |
87 (search-forward "\n<<") | |
88 (beginning-of-line) | |
89 (delete-region (point) (progn (end-of-line) (point))) | |
90 (newline (- (window-height (selected-window)) | |
91 (count-lines (point-min) (point)) | |
92 6)) | |
93 (goto-char (point-min)) | |
94 (set-buffer-modified-p nil)))) | |
95 | |
96 (defun describe-key-briefly (key) | |
97 "Print the name of the function KEY invokes. KEY is a string." | |
98 (interactive "kDescribe key briefly: ") | |
99 (let ((defn (key-binding key))) | |
100 (if (or (null defn) (integerp defn)) | |
101 (message "%s is undefined" (key-description key)) | |
102 (message "%s runs the command %s" | |
103 (key-description key) | |
104 (if (symbolp defn) defn (prin1-to-string defn)))))) | |
105 | |
106 (defun print-help-return-message (&optional function) | |
107 "Display or return message saying how to restore windows after help command. | |
108 Computes a message and applies the optional argument FUNCTION to it. | |
109 If FUNCTION is nil, applies `message' to it, thus printing it." | |
110 (and (not (get-buffer-window standard-output)) | |
111 (funcall (or function 'message) | |
112 (concat | |
113 (substitute-command-keys | |
114 (if (one-window-p t) | |
115 (if pop-up-windows | |
116 "Type \\[delete-other-windows] to remove help window." | |
117 "Type \\[switch-to-buffer] RET to remove help window.") | |
118 "Type \\[switch-to-buffer-other-window] RET to restore the other window.")) | |
119 (substitute-command-keys | |
120 " \\[scroll-other-window] to scroll the help."))))) | |
121 | |
122 (defun describe-key (key) | |
123 "Display documentation of the function invoked by KEY. KEY is a string." | |
124 (interactive "kDescribe key: ") | |
125 (let ((defn (key-binding key))) | |
126 (if (or (null defn) (integerp defn)) | |
127 (message "%s is undefined" (key-description key)) | |
128 (with-output-to-temp-buffer "*Help*" | |
129 (prin1 defn) | |
130 (princ ":\n") | |
131 (if (documentation defn) | |
132 (princ (documentation defn)) | |
133 (princ "not documented")) | |
134 (print-help-return-message))))) | |
135 | |
136 (defun describe-mode (&optional minor) | |
137 "Display documentation of current major mode. | |
138 If optional MINOR is non-nil (or prefix argument is given if interactive), | |
139 display documentation of active minor modes as well. | |
140 For this to work correctly for a minor mode, the mode's indicator variable | |
141 (listed in `minor-mode-alist') must also be a function whose documentation | |
142 describes the minor mode." | |
143 (interactive) | |
144 (with-output-to-temp-buffer "*Help*" | |
145 (princ mode-name) | |
146 (princ " Mode:\n") | |
147 (princ (documentation major-mode)) | |
148 (let ((minor-modes minor-mode-alist) | |
149 (locals (buffer-local-variables))) | |
150 (while minor-modes | |
151 (let* ((minor-mode (car (car minor-modes))) | |
152 (indicator (car (cdr (car minor-modes)))) | |
153 (local-binding (assq minor-mode locals))) | |
154 ;; Document a minor mode if it is listed in minor-mode-alist, | |
155 ;; bound locally in this buffer, non-nil, and has a function | |
156 ;; definition. | |
157 (if (and local-binding | |
158 (cdr local-binding) | |
159 (fboundp minor-mode)) | |
160 (progn | |
161 (princ (format "\n\n\n%s minor mode (indicator%s):\n" | |
162 minor-mode indicator)) | |
163 (princ (documentation minor-mode))))) | |
164 (setq minor-modes (cdr minor-modes)))) | |
165 (print-help-return-message))) | |
166 | |
167 ;; So keyboard macro definitions are documented correctly | |
168 (fset 'defining-kbd-macro (symbol-function 'start-kbd-macro)) | |
169 | |
170 (defun describe-distribution () | |
171 "Display info on how to obtain the latest version of GNU Emacs." | |
172 (interactive) | |
173 (find-file-read-only | |
444 | 174 (expand-file-name "DISTRIB" data-directory))) |
409 | 175 |
176 (defun describe-copying () | |
177 "Display info on how you may redistribute copies of GNU Emacs." | |
178 (interactive) | |
179 (find-file-read-only | |
444 | 180 (expand-file-name "COPYING" data-directory)) |
409 | 181 (goto-char (point-min))) |
182 | |
183 (defun describe-no-warranty () | |
184 "Display info on all the kinds of warranty Emacs does NOT have." | |
185 (interactive) | |
186 (describe-copying) | |
187 (let (case-fold-search) | |
188 (search-forward "NO WARRANTY") | |
189 (recenter 0))) | |
190 | |
191 (defun view-emacs-news () | |
192 "Display info on recent changes to Emacs." | |
193 (interactive) | |
444 | 194 (find-file-read-only (expand-file-name "NEWS" data-directory))) |
409 | 195 |
196 (defun view-lossage () | |
197 "Display last 100 input keystrokes." | |
198 (interactive) | |
199 (with-output-to-temp-buffer "*Help*" | |
200 (princ (key-description (recent-keys))) | |
201 (save-excursion | |
202 (set-buffer standard-output) | |
203 (goto-char (point-min)) | |
204 (while (progn (move-to-column 50) (not (eobp))) | |
205 (search-forward " " nil t) | |
206 (insert "\n"))) | |
207 (print-help-return-message))) | |
208 | |
2237
2670a8f6a42e
Teach this to use help-screen.el.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2134
diff
changeset
|
209 (make-help-screen help-for-help |
2670a8f6a42e
Teach this to use help-screen.el.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2134
diff
changeset
|
210 "A B C F I K L M N P S T V W C-c C-d C-n C-w. Type \\[help-for-help] again for more help: " |
917
d09aafad0e95
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
878
diff
changeset
|
211 "You have typed \\[help-for-help], the help character. Type a Help option: |
409 | 212 |
213 A command-apropos. Give a substring, and see a list of commands | |
214 (functions interactively callable) that contain | |
215 that substring. See also the apropos command. | |
216 B describe-bindings. Display table of all key bindings. | |
217 C describe-key-briefly. Type a command key sequence; | |
218 it prints the function name that sequence runs. | |
219 F describe-function. Type a function name and get documentation of it. | |
220 I info. The info documentation reader. | |
221 K describe-key. Type a command key sequence; | |
222 it displays the full documentation. | |
223 L view-lossage. Shows last 100 characters you typed. | |
224 M describe-mode. Print documentation of current major mode, | |
225 which describes the commands peculiar to it. | |
226 N view-emacs-news. Shows emacs news file. | |
2134
b275e1b50542
Added autoload, binding and menu line for new finder feature (P).
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2079
diff
changeset
|
227 P finder-by-keyword. Find packages matching a given topic keyword. |
409 | 228 S describe-syntax. Display contents of syntax table, plus explanations |
229 T help-with-tutorial. Select the Emacs learn-by-doing tutorial. | |
230 V describe-variable. Type name of a variable; | |
231 it displays the variable's documentation and value. | |
232 W where-is. Type command name; it prints which keystrokes | |
233 invoke that command. | |
234 C-c print Emacs copying permission (General Public License). | |
235 C-d print Emacs ordering information. | |
236 C-n print news of recent Emacs changes. | |
237 C-w print information on absence of warranty for GNU Emacs." | |
2237
2670a8f6a42e
Teach this to use help-screen.el.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2134
diff
changeset
|
238 help-map) |
409 | 239 |
240 ;; Return a function which is called by the list containing point. | |
241 ;; If that gives no function, return a function whose name is around point. | |
242 ;; If that doesn't give a function, return nil. | |
243 (defun function-called-at-point () | |
244 (or (condition-case () | |
245 (save-excursion | |
246 (save-restriction | |
247 (narrow-to-region (max (point-min) (- (point) 1000)) (point-max)) | |
248 (backward-up-list 1) | |
249 (forward-char 1) | |
250 (let (obj) | |
251 (setq obj (read (current-buffer))) | |
252 (and (symbolp obj) (fboundp obj) obj)))) | |
253 (error nil)) | |
254 (condition-case () | |
255 (save-excursion | |
256 (forward-sexp -1) | |
257 (skip-chars-forward "'") | |
258 (let ((obj (read (current-buffer)))) | |
259 (and (symbolp obj) (fboundp obj) obj))) | |
260 (error nil)))) | |
261 | |
262 (defun describe-function (function) | |
263 "Display the full documentation of FUNCTION (a symbol)." | |
264 (interactive | |
265 (let ((fn (function-called-at-point)) | |
266 (enable-recursive-minibuffers t) | |
267 val) | |
268 (setq val (completing-read (if fn | |
269 (format "Describe function (default %s): " fn) | |
270 "Describe function: ") | |
271 obarray 'fboundp t)) | |
272 (list (if (equal val "") | |
273 fn (intern val))))) | |
274 (with-output-to-temp-buffer "*Help*" | |
275 (prin1 function) | |
276 (princ ": ") | |
277 (let* ((def (symbol-function function)) | |
278 (beg (if (commandp def) "an interactive " "a "))) | |
279 (princ (cond ((stringp def) "a keyboard macro.") | |
280 ((subrp def) | |
281 (concat beg "built-in function.")) | |
1821
04fb1d3d6992
JimB's changes since January 18th
Jim Blandy <jimb@redhat.com>
parents:
1467
diff
changeset
|
282 ((byte-code-function-p def) |
409 | 283 (concat beg "compiled Lisp function.")) |
284 ((symbolp def) | |
285 (format "alias for `%s'." def)) | |
286 ((eq (car-safe def) 'lambda) | |
287 (concat beg "Lisp function.")) | |
288 ((eq (car-safe def) 'macro) | |
289 "a Lisp macro.") | |
290 ((eq (car-safe def) 'mocklisp) | |
291 "a mocklisp function.") | |
292 ((eq (car-safe def) 'autoload) | |
1467
8d8c91b563ee
(describe-function): Print `an autoloaded', not `a ...'.
Richard M. Stallman <rms@gnu.org>
parents:
919
diff
changeset
|
293 (format "%s autoloaded Lisp %s." |
8d8c91b563ee
(describe-function): Print `an autoloaded', not `a ...'.
Richard M. Stallman <rms@gnu.org>
parents:
919
diff
changeset
|
294 (if (commandp def) "an interactive" "an") |
409 | 295 (if (nth 4 def) "macro" "function") |
878
5b1c5b4286e7
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
296 ;;; Including the file name made this line too long. |
5b1c5b4286e7
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
297 ;;; (nth 1 def) |
5b1c5b4286e7
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
846
diff
changeset
|
298 )) |
409 | 299 (t ""))) |
1889
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
300 (terpri) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
301 (if (documentation function) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
302 (princ (documentation function)) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
303 (princ "not documented")) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
304 (cond ((byte-code-function-p def) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
305 (save-excursion |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
306 (set-buffer standard-output) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
307 (or (eq (char-after (1- (point-max))) ?\n) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
308 (terpri))) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
309 (terpri) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
310 (princ (car (append def nil)))) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
311 ((eq (car-safe def) 'lambda) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
312 (save-excursion |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
313 (set-buffer standard-output) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
314 (or (eq (char-after (1- (point-max))) ?\n) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
315 (terpri))) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
316 (terpri) |
1ed971f67bfd
(describe-function): Print the arglist if the function is bytecode or a list.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
317 (princ (nth 1 def))))) |
409 | 318 (print-help-return-message) |
319 ;; Return the text we displayed. | |
320 (save-excursion (set-buffer standard-output) (buffer-string)))) | |
321 | |
322 (defun variable-at-point () | |
323 (condition-case () | |
324 (save-excursion | |
325 (forward-sexp -1) | |
326 (skip-chars-forward "'") | |
327 (let ((obj (read (current-buffer)))) | |
328 (and (symbolp obj) (boundp obj) obj))) | |
329 (error nil))) | |
330 | |
331 (defun describe-variable (variable) | |
332 "Display the full documentation of VARIABLE (a symbol). | |
333 Returns the documentation as a string, also." | |
334 (interactive | |
335 (let ((v (variable-at-point)) | |
336 (enable-recursive-minibuffers t) | |
337 val) | |
338 (setq val (completing-read (if v | |
339 (format "Describe variable (default %s): " v) | |
340 "Describe variable: ") | |
341 obarray 'boundp t)) | |
342 (list (if (equal val "") | |
343 v (intern val))))) | |
344 (with-output-to-temp-buffer "*Help*" | |
345 (prin1 variable) | |
346 (princ "'s value is ") | |
347 (if (not (boundp variable)) | |
348 (princ "void.") | |
349 (prin1 (symbol-value variable))) | |
350 (terpri) (terpri) | |
351 (princ "Documentation:") | |
352 (terpri) | |
353 (let ((doc (documentation-property variable 'variable-documentation))) | |
354 (if doc | |
355 (princ (substitute-command-keys doc)) | |
356 (princ "not documented as a variable."))) | |
357 (print-help-return-message) | |
358 ;; Return the text we displayed. | |
359 (save-excursion (set-buffer standard-output) (buffer-string)))) | |
360 | |
361 (defun command-apropos (string) | |
362 "Like apropos but lists only symbols that are names of commands | |
363 \(interactively callable functions). Argument REGEXP is a regular expression | |
364 that is matched against command symbol names. Returns list of symbols and | |
365 documentation found." | |
366 (interactive "sCommand apropos (regexp): ") | |
367 (let ((message | |
368 (let ((standard-output (get-buffer-create "*Help*"))) | |
369 (print-help-return-message 'identity)))) | |
2079
51012c0f1227
(command-apropos): Print echo area message iff found symbols.
Richard M. Stallman <rms@gnu.org>
parents:
1889
diff
changeset
|
370 (if (apropos string t 'commandp) |
51012c0f1227
(command-apropos): Print echo area message iff found symbols.
Richard M. Stallman <rms@gnu.org>
parents:
1889
diff
changeset
|
371 (and message (message message))))) |
409 | 372 |
373 (defun locate-library (library &optional nosuffix) | |
374 "Show the full path name of Emacs library LIBRARY. | |
375 This command searches the directories in `load-path' like `M-x load-library' | |
376 to find the file that `M-x load-library RET LIBRARY RET' would load. | |
377 Optional second arg NOSUFFIX non-nil means don't add suffixes `.elc' or `.el' | |
378 to the specified name LIBRARY (a la calling `load' instead of `load-library')." | |
379 (interactive "sLocate library: ") | |
380 (catch 'answer | |
381 (mapcar | |
382 '(lambda (dir) | |
383 (mapcar | |
384 '(lambda (suf) | |
385 (let ((try (expand-file-name (concat library suf) dir))) | |
386 (and (file-readable-p try) | |
387 (null (file-directory-p try)) | |
388 (progn | |
389 (message "Library is file %s" try) | |
390 (throw 'answer try))))) | |
391 (if nosuffix '("") '(".elc" ".el" "")))) | |
392 load-path) | |
393 (message "No library %s in search path" library) | |
394 nil)) | |
660
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
444
diff
changeset
|
395 |
08eb386dd0f3
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
444
diff
changeset
|
396 ;;; help.el ends here |