annotate lisp/finder.el @ 19860:c17fd465ea95 libc-970911 libc-970912 libc-970913 libc-970914 libc-970915 libc-970916 libc-970917 libc-970918 libc-970919 libc-970920 libc-970921 libc-970922 libc-970923 libc-970924 libc-970925 libc-970926 libc-970927 libc-970928 libc-970929 libc-970930 libc-971001 libc-971018 libc-971019 libc-971020 libc-971021 libc-971022 libc-971023 libc-971024 libc-971025 libc-971026 libc-971027 libc-971028 libc-971029 libc-971030 libc-971031 libc-971101 libc-971102 libc-971103 libc-971104 libc-971105 libc-971106 libc-971107 libc-971108 libc-971109 libc-971110 libc-971111 libc-971112 libc-971113 libc-971114 libc-971115 libc-971116 libc-971117 libc-971118 libc-971120 libc-971121 libc-971122 libc-971123 libc-971124 libc-971125 libc-971126 libc-971127 libc-971128 libc-971129 libc-971130 libc-971201 libc-971203 libc-971204 libc-971205 libc-971206 libc-971207 libc-971208 libc-971209 libc-971210 libc-971211 libc-971212 libc-971213 libc-971214 libc-971217 libc-971218 libc-971219 libc-971220 libc-971221 libc-971222 libc-971223 libc-971224 libc-971225 libc-971226 libc-971227 libc-971228 libc-971229 libc-971230 libc-971231 libc-980103 libc-980104 libc-980105 libc-980106 libc-980107 libc-980108 libc-980109 libc-980110 libc-980111 libc-980112 libc-980114 libc-980115 libc-980116 libc-980117 libc-980118 libc-980119 libc-980120 libc-980121 libc-980122 libc-980123 libc-980124 libc-980125 libc-980126 libc-980127 libc-980128

typos.
author Jeff Law <law@redhat.com>
date Wed, 10 Sep 1997 21:16:20 +0000
parents 0ffc25f09344
children 09bc233eb018
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
1 ;;; finder.el --- topic & keyword-based code finder
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
2
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
3 ;; Copyright (C) 1992 Free Software Foundation, Inc.
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
4
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
5 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
6 ;; Created: 16 Jun 1992
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
7 ;; Version: 1.0
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
8 ;; Keywords: help
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
9
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
11
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
12244
ac7375e60931 Update GPL to version 2.
Karl Heuer <kwzh@gnu.org>
parents: 11488
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
15 ;; any later version.
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
16
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
20 ;; GNU General Public License for more details.
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
21
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13580
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13580
diff changeset
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13580
diff changeset
25 ;; Boston, MA 02111-1307, USA.
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
26
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
27 ;;; Commentary:
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
28
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
29 ;; This mode uses the Keywords library header to provide code-finding
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
30 ;; services by keyword.
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
31 ;;
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
32 ;; Things to do:
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
33 ;; 1. Support multiple keywords per search. This could be extremely hairy;
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
34 ;; there doesn't seem to be any way to get completing-read to exit on
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
35 ;; an EOL with no substring pending, which is what we'd want to end the loop.
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
36 ;; 2. Search by string in synopsis line?
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
37 ;; 3. Function to check finder-package-info for unknown keywords.
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
38
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
39 ;;; Code:
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
40
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
41 (require 'lisp-mnt)
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
42 (require 'finder-inf)
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
43
2996
358fe58ae153 (finder-known-keywords): Use i18n, not i14n.
Richard M. Stallman <rms@gnu.org>
parents: 2716
diff changeset
44 ;; Local variable in finder buffer.
358fe58ae153 (finder-known-keywords): Use i18n, not i14n.
Richard M. Stallman <rms@gnu.org>
parents: 2716
diff changeset
45 (defvar finder-headmark)
358fe58ae153 (finder-known-keywords): Use i18n, not i14n.
Richard M. Stallman <rms@gnu.org>
parents: 2716
diff changeset
46
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
47 (defvar finder-known-keywords
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
48 '(
2270
a74fc62a3a1f Typo fix.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2247
diff changeset
49 (abbrev . "abbreviation handling, typing shortcuts, macros")
5141
3efae588d663 (finder-known-keywords): Add data, faces, mouse, matching.
Richard M. Stallman <rms@gnu.org>
parents: 3708
diff changeset
50 (bib . "code related to the `bib' bibliography processor")
11470
2958364d4d99 (finder-known-keywords): Generalize `c' keyword.
Richard M. Stallman <rms@gnu.org>
parents: 11454
diff changeset
51 (c . "support for the C language and related languages")
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
52 (calendar . "calendar and time management support")
2247
2c7997f249eb Add or correct keywords
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2228
diff changeset
53 (comm . "communications, networking, remote access to files")
5141
3efae588d663 (finder-known-keywords): Add data, faces, mouse, matching.
Richard M. Stallman <rms@gnu.org>
parents: 3708
diff changeset
54 (data . "support editing files of data")
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
55 (docs . "support for Emacs documentation")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
56 (emulations . "emulations of other editors")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
57 (extensions . "Emacs Lisp language extensions")
5141
3efae588d663 (finder-known-keywords): Add data, faces, mouse, matching.
Richard M. Stallman <rms@gnu.org>
parents: 3708
diff changeset
58 (faces . "support for multiple fonts")
11454
d9ec5322d181 (finder-known-keywords):
Richard M. Stallman <rms@gnu.org>
parents: 9200
diff changeset
59 (frames . "support for Emacs frames and window systems")
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
60 (games . "games, jokes and amusements")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
61 (hardware . "support for interfacing with exotic hardware")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
62 (help . "support for on-line help systems")
11454
d9ec5322d181 (finder-known-keywords):
Richard M. Stallman <rms@gnu.org>
parents: 9200
diff changeset
63 (hypermedia . "support for links between text or other media types")
2996
358fe58ae153 (finder-known-keywords): Use i18n, not i14n.
Richard M. Stallman <rms@gnu.org>
parents: 2716
diff changeset
64 (i18n . "internationalization and alternate character-set support")
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
65 (internal . "code for Emacs internals, build process, defaults")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
66 (languages . "specialized modes for editing programming languages")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
67 (lisp . "Lisp support, including Emacs Lisp")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
68 (local . "code local to your site")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
69 (maint . "maintenance aids for the Emacs development group")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
70 (mail . "modes for electronic-mail handling")
5141
3efae588d663 (finder-known-keywords): Add data, faces, mouse, matching.
Richard M. Stallman <rms@gnu.org>
parents: 3708
diff changeset
71 (matching . "various sorts of searching and matching")
3efae588d663 (finder-known-keywords): Add data, faces, mouse, matching.
Richard M. Stallman <rms@gnu.org>
parents: 3708
diff changeset
72 (mouse . "mouse support")
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
73 (news . "support for netnews reading and posting")
11454
d9ec5322d181 (finder-known-keywords):
Richard M. Stallman <rms@gnu.org>
parents: 9200
diff changeset
74 (oop . "support for object-oriented programming")
d9ec5322d181 (finder-known-keywords):
Richard M. Stallman <rms@gnu.org>
parents: 9200
diff changeset
75 (outlines . "support for hierarchical outlining")
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
76 (processes . "process, subshell, compilation, and job control support")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
77 (terminals . "support for terminal types")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
78 (tex . "code related to the TeX formatter")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
79 (tools . "programming tools")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
80 (unix . "front-ends/assistants for, or emulators of, UNIX features")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
81 (vms . "support code for vms")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
82 (wp . "word processing")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
83 ))
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
84
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
85 (defvar finder-mode-map nil)
9200
e48652e64736 (finder-mode-map): Change key bindings:
Richard M. Stallman <rms@gnu.org>
parents: 7943
diff changeset
86 (or finder-mode-map
e48652e64736 (finder-mode-map): Change key bindings:
Richard M. Stallman <rms@gnu.org>
parents: 7943
diff changeset
87 (let ((map (make-sparse-keymap)))
e48652e64736 (finder-mode-map): Change key bindings:
Richard M. Stallman <rms@gnu.org>
parents: 7943
diff changeset
88 (define-key map " " 'finder-select)
e48652e64736 (finder-mode-map): Change key bindings:
Richard M. Stallman <rms@gnu.org>
parents: 7943
diff changeset
89 (define-key map "f" 'finder-select)
e48652e64736 (finder-mode-map): Change key bindings:
Richard M. Stallman <rms@gnu.org>
parents: 7943
diff changeset
90 (define-key map "\C-m" 'finder-select)
e48652e64736 (finder-mode-map): Change key bindings:
Richard M. Stallman <rms@gnu.org>
parents: 7943
diff changeset
91 (define-key map "?" 'finder-summary)
e48652e64736 (finder-mode-map): Change key bindings:
Richard M. Stallman <rms@gnu.org>
parents: 7943
diff changeset
92 (define-key map "q" 'finder-exit)
e48652e64736 (finder-mode-map): Change key bindings:
Richard M. Stallman <rms@gnu.org>
parents: 7943
diff changeset
93 (define-key map "d" 'finder-list-keywords)
e48652e64736 (finder-mode-map): Change key bindings:
Richard M. Stallman <rms@gnu.org>
parents: 7943
diff changeset
94 (setq finder-mode-map map)))
e48652e64736 (finder-mode-map): Change key bindings:
Richard M. Stallman <rms@gnu.org>
parents: 7943
diff changeset
95
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
96
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
97 ;;; Code for regenerating the keyword list.
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
98
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
99 (defvar finder-package-info nil
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
100 "Assoc list mapping file names to description & keyword lists.")
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
101
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
102 (defun finder-compile-keywords (&rest dirs)
2996
358fe58ae153 (finder-known-keywords): Use i18n, not i14n.
Richard M. Stallman <rms@gnu.org>
parents: 2716
diff changeset
103 "Regenerate the keywords association list into the file `finder-inf.el'.
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
104 Optional arguments are a list of Emacs Lisp directories to compile from; no
1475
2596132752ff Doc fix.
Christopher Zaborsky <rogue@erratum.com>
parents: 928
diff changeset
105 arguments compiles from `load-path'."
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
106 (save-excursion
2228
d40154ca6354 (finder-compile-keywords) Treat nil in a path argument as $PWD.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 1475
diff changeset
107 (let ((processed nil))
d40154ca6354 (finder-compile-keywords) Treat nil in a path argument as $PWD.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 1475
diff changeset
108 (find-file "finder-inf.el")
d40154ca6354 (finder-compile-keywords) Treat nil in a path argument as $PWD.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 1475
diff changeset
109 (erase-buffer)
2247
2c7997f249eb Add or correct keywords
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2228
diff changeset
110 (insert ";;; finder-inf.el --- keyword-to-package mapping\n")
2c7997f249eb Add or correct keywords
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2228
diff changeset
111 (insert ";; Keywords: help\n")
2457
3d2f74e16e54 Added or corrected documentation headers
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2271
diff changeset
112 (insert ";;; Commentary:\n")
3d2f74e16e54 Added or corrected documentation headers
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2271
diff changeset
113 (insert ";; Don't edit this file. It's generated by finder.el\n\n")
3d2f74e16e54 Added or corrected documentation headers
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2271
diff changeset
114 (insert ";;; Code:\n")
2228
d40154ca6354 (finder-compile-keywords) Treat nil in a path argument as $PWD.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 1475
diff changeset
115 (insert "\n(setq finder-package-info '(\n")
d40154ca6354 (finder-compile-keywords) Treat nil in a path argument as $PWD.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 1475
diff changeset
116 (mapcar
14599
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
117 (lambda (d)
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
118 (mapcar
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
119 (lambda (f)
19169
0ffc25f09344 (finder-compile-keywords): Don't process file names that start with `.'.
Richard M. Stallman <rms@gnu.org>
parents: 18687
diff changeset
120 (if (and (string-match "^[^=.].*\\.el$" f)
14599
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
121 (not (member f processed)))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
122 (let (summary keystart keywords)
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
123 (setq processed (cons f processed))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
124 (save-excursion
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
125 (set-buffer (get-buffer-create "*finder-scratch*"))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
126 (buffer-disable-undo (current-buffer))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
127 (erase-buffer)
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
128 (insert-file-contents
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
129 (concat (file-name-as-directory (or d ".")) f))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
130 (setq summary (lm-synopsis))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
131 (setq keywords (lm-keywords)))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
132 (insert
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
133 (format " (\"%s\"\n " f))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
134 (prin1 summary (current-buffer))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
135 (insert
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
136 "\n ")
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
137 (setq keystart (point))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
138 (insert
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
139 (if keywords (format "(%s)" keywords) "nil")
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
140 ")\n")
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
141 (subst-char-in-region keystart (point) ?, ? )
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
142 )))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
143 (directory-files (or d "."))))
2228
d40154ca6354 (finder-compile-keywords) Treat nil in a path argument as $PWD.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 1475
diff changeset
144 (or dirs load-path))
2457
3d2f74e16e54 Added or corrected documentation headers
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2271
diff changeset
145 (insert "))\n\n(provide 'finder-inf)\n\n;;; finder-inf.el ends here\n")
2228
d40154ca6354 (finder-compile-keywords) Treat nil in a path argument as $PWD.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 1475
diff changeset
146 (kill-buffer "*finder-scratch*")
2271
026941de1886 Make sure that when new keywords are compiled, we see them
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2270
diff changeset
147 (eval-current-buffer) ;; So we get the new keyword list immediately
14599
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
148 (basic-save-buffer))))
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
149
14669
6feeb4e59815 (finder-compile-keywords-make-dist): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14599
diff changeset
150 (defun finder-compile-keywords-make-dist ()
6feeb4e59815 (finder-compile-keywords-make-dist): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14599
diff changeset
151 "Regenerate `finder-inf.el' for the Emacs distribution."
17745
ae0f1e4a63be (finder-compile-keywords-make-dist):
Richard M. Stallman <rms@gnu.org>
parents: 14669
diff changeset
152 (apply 'finder-compile-keywords command-line-args-left)
ae0f1e4a63be (finder-compile-keywords-make-dist):
Richard M. Stallman <rms@gnu.org>
parents: 14669
diff changeset
153 (kill-emacs))
14669
6feeb4e59815 (finder-compile-keywords-make-dist): New function.
Richard M. Stallman <rms@gnu.org>
parents: 14599
diff changeset
154
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
155 ;;; Now the retrieval code
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
156
14599
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
157 (defun finder-insert-at-column (column &rest strings)
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
158 "Insert list of STRINGS, at column COLUMN."
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
159 (if (> (current-column) column) (insert "\n"))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
160 (move-to-column column)
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
161 (let ((col (current-column)))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
162 (if (< col column)
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
163 (indent-to column)
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
164 (if (and (/= col column)
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
165 (= (preceding-char) ?\t))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
166 (let (indent-tabs-mode)
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
167 (delete-char -1)
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
168 (indent-to col)
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
169 (move-to-column column)))))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
170 (apply 'insert strings))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
171
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
172 (defun finder-list-keywords ()
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
173 "Display descriptions of the keywords in the Finder buffer."
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
174 (interactive)
18226
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
175 (if (get-buffer "*Finder*")
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
176 (pop-to-buffer "*Finder*")
18284
21a40db838e2 (finder-list-keywords): Create *Finder* buffer if nec.
Richard M. Stallman <rms@gnu.org>
parents: 18226
diff changeset
177 (pop-to-buffer (set-buffer (get-buffer-create "*Finder*")))
18226
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
178 (finder-mode)
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
179 (setq buffer-read-only nil)
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
180 (erase-buffer)
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
181 (mapcar
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
182 (lambda (assoc)
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
183 (let ((keyword (car assoc)))
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
184 (insert (symbol-name keyword))
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
185 (finder-insert-at-column 14 (concat (cdr assoc) "\n"))
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
186 (cons (symbol-name keyword) keyword)))
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
187 finder-known-keywords)
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
188 (goto-char (point-min))
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
189 (setq finder-headmark (point))
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
190 (setq buffer-read-only t)
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
191 (set-buffer-modified-p nil)
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
192 (balance-windows)
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
193 (finder-summary)))
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
194
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
195 (defun finder-list-matches (key)
18687
3854a35dffd8 (finder-list-matches): Create *Finder Category* buffer.
Richard M. Stallman <rms@gnu.org>
parents: 18284
diff changeset
196 (pop-to-buffer (set-buffer (get-buffer-create "*Finder Category*")))
18226
37ff8dfff53b (finder-mode): Don't switch buffers or change text here.
Richard M. Stallman <rms@gnu.org>
parents: 17745
diff changeset
197 (finder-mode)
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
198 (setq buffer-read-only nil)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
199 (erase-buffer)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
200 (let ((id (intern key)))
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
201 (insert
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
202 "The following packages match the keyword `" key "':\n\n")
2996
358fe58ae153 (finder-known-keywords): Use i18n, not i14n.
Richard M. Stallman <rms@gnu.org>
parents: 2716
diff changeset
203 (setq finder-headmark (point))
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
204 (mapcar
14599
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
205 (lambda (x)
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
206 (if (memq id (car (cdr (cdr x))))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
207 (progn
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
208 (insert (car x))
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
209 (finder-insert-at-column 16 (concat (car (cdr x)) "\n")))))
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
210 finder-package-info)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
211 (goto-char (point-min))
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
212 (forward-line)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
213 (setq buffer-read-only t)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
214 (set-buffer-modified-p nil)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
215 (shrink-window-if-larger-than-buffer)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
216 (finder-summary)))
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
217
3708
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
218 ;; Search for a file named FILE the same way `load' would search.
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
219 (defun finder-find-library (file)
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
220 (if (file-name-absolute-p file)
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
221 file
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
222 (let ((dirs load-path)
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
223 found)
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
224 (while (and dirs (not found))
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
225 (if (file-exists-p (expand-file-name (concat file ".el") (car dirs)))
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
226 (setq found (expand-file-name file (car dirs)))
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
227 (if (file-exists-p (expand-file-name file (car dirs)))
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
228 (setq found (expand-file-name file (car dirs)))))
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
229 (setq dirs (cdr dirs)))
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
230 found)))
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
231
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
232 (defun finder-commentary (file)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
233 (interactive)
3708
e2cbba9f0ea3 (finder-find-library): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3013
diff changeset
234 (let* ((str (lm-commentary (finder-find-library file))))
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
235 (if (null str)
7943
8053544ffe30 (finder-commentary): Fix error message syntax.
Richard M. Stallman <rms@gnu.org>
parents: 5848
diff changeset
236 (error "Can't find any Commentary section"))
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
237 (pop-to-buffer "*Finder*")
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
238 (setq buffer-read-only nil)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
239 (erase-buffer)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
240 (insert str)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
241 (goto-char (point-min))
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
242 (delete-blank-lines)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
243 (goto-char (point-max))
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
244 (delete-blank-lines)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
245 (goto-char (point-min))
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
246 (while (re-search-forward "^;+ ?" nil t)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
247 (replace-match "" nil nil))
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
248 (goto-char (point-min))
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
249 (setq buffer-read-only t)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
250 (set-buffer-modified-p nil)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
251 (shrink-window-if-larger-than-buffer)
14599
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
252 (finder-summary)))
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
253
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
254 (defun finder-current-item ()
2996
358fe58ae153 (finder-known-keywords): Use i18n, not i14n.
Richard M. Stallman <rms@gnu.org>
parents: 2716
diff changeset
255 (if (and finder-headmark (< (point) finder-headmark))
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
256 (error "No keyword or filename on this line")
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
257 (save-excursion
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
258 (beginning-of-line)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
259 (current-word))))
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
260
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
261 (defun finder-select ()
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
262 (interactive)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
263 (let ((key (finder-current-item)))
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
264 (if (string-match "\\.el$" key)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
265 (finder-commentary key)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
266 (finder-list-matches key))))
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
267
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
268 (defun finder-by-keyword ()
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
269 "Find packages matching a given keyword."
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
270 (interactive)
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
271 (finder-list-keywords))
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
272
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
273 (defun finder-mode ()
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
274 "Major mode for browsing package documentation.
2716
acd678e58602 * finder.el: Bind finder-exit to 'q', not 'x'; the former is the
Jim Blandy <jimb@redhat.com>
parents: 2527
diff changeset
275 \\<finder-mode-map>
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
276 \\[finder-select] more help for the item on the current line
5848
07a4626166d4 (finder-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 5141
diff changeset
277 \\[finder-exit] exit Finder mode and kill the Finder buffer.
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
278 "
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
279 (interactive)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
280 (use-local-map finder-mode-map)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
281 (set-syntax-table emacs-lisp-mode-syntax-table)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
282 (setq mode-name "Finder")
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
283 (setq major-mode 'finder-mode)
2996
358fe58ae153 (finder-known-keywords): Use i18n, not i14n.
Richard M. Stallman <rms@gnu.org>
parents: 2716
diff changeset
284 (make-local-variable 'finder-headmark)
14599
1de3a922cfe0 Removed (require 'picture).
Erik Naggum <erik@naggum.no>
parents: 14313
diff changeset
285 (setq finder-headmark nil))
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
286
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
287 (defun finder-summary ()
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
288 "Summarize basic Finder commands."
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
289 (interactive)
14313
8e13f59d2c19 (finder-summary): Pass proper format string to message.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
290 (message "%s"
2716
acd678e58602 * finder.el: Bind finder-exit to 'q', not 'x'; the former is the
Jim Blandy <jimb@redhat.com>
parents: 2527
diff changeset
291 (substitute-command-keys
9200
e48652e64736 (finder-mode-map): Change key bindings:
Richard M. Stallman <rms@gnu.org>
parents: 7943
diff changeset
292 "\\<finder-mode-map>\\[finder-select] = select, \\[finder-list-keywords] = to finder directory, \\[finder-exit] = quit, \\[finder-summary] = help")))
2527
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
293
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
294 (defun finder-exit ()
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
295 "Exit Finder mode and kill the buffer"
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
296 (interactive)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
297 (delete-window)
93015b63b041 Rewritten. The Finder is now a major mode with the ability to browse
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2502
diff changeset
298 (kill-buffer "*Finder*"))
867
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
299
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
300 (provide 'finder)
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
301
f120dd3a71b0 Initial revision
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
diff changeset
302 ;;; finder.el ends here