comparison lisp/finder.el @ 89909:68c22ea6027c

Sync to HEAD
author Kenichi Handa <handa@m17n.org>
date Fri, 16 Apr 2004 12:51:06 +0000
parents 375f2633d815
children 13796b0653c7
comparison
equal deleted inserted replaced
89908:ee1402f7b568 89909:68c22ea6027c
1 ;;; finder.el --- topic & keyword-based code finder 1 ;;; finder.el --- topic & keyword-based code finder
2 2
3 ;; Copyright (C) 1992, 1997, 1998, 1999, 2001 Free Software Foundation, Inc. 3 ;; Copyright (C) 1992,97,98,1999,2001,2004 Free Software Foundation, Inc.
4 4
5 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com> 5 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
6 ;; Created: 16 Jun 1992 6 ;; Created: 16 Jun 1992
7 ;; Version: 1.0 7 ;; Version: 1.0
8 ;; Keywords: help 8 ;; Keywords: help
41 (require 'lisp-mnt) 41 (require 'lisp-mnt)
42 (require 'find-func) ;for find-library(-suffixes) 42 (require 'find-func) ;for find-library(-suffixes)
43 ;; Use `load' rather than `require' so that it doesn't get loaded 43 ;; Use `load' rather than `require' so that it doesn't get loaded
44 ;; during byte-compilation (at which point it might be missing). 44 ;; during byte-compilation (at which point it might be missing).
45 (load "finder-inf" t t) 45 (load "finder-inf" t t)
46
47 (defvar finder-mode-hook nil
48 "*Hook run when function `finder-mode' is called.")
46 49
47 ;; Local variable in finder buffer. 50 ;; Local variable in finder buffer.
48 (defvar finder-headmark) 51 (defvar finder-headmark)
49 52
50 ;; These are supposed to correspond to top-level customization groups, 53 ;; These are supposed to correspond to top-level customization groups,
56 (bib . "code related to the `bib' bibliography processor") 59 (bib . "code related to the `bib' bibliography processor")
57 (c . "support for the C language and related languages") 60 (c . "support for the C language and related languages")
58 (calendar . "calendar and time management support") 61 (calendar . "calendar and time management support")
59 (comm . "communications, networking, remote access to files") 62 (comm . "communications, networking, remote access to files")
60 (convenience . "convenience features for faster editing") 63 (convenience . "convenience features for faster editing")
61 (data . "support editing files of data") 64 (data . "support for editing files of data")
62 (docs . "support for Emacs documentation") 65 (docs . "support for Emacs documentation")
63 (emulations . "emulations of other editors") 66 (emulations . "emulations of other editors")
64 (extensions . "Emacs Lisp language extensions") 67 (extensions . "Emacs Lisp language extensions")
65 (faces . "support for multiple fonts") 68 (faces . "support for multiple fonts")
66 (files . "support for editing and manipulating files") 69 (files . "support for editing and manipulating files")
82 (news . "support for netnews reading and posting") 85 (news . "support for netnews reading and posting")
83 (oop . "support for object-oriented programming") 86 (oop . "support for object-oriented programming")
84 (outlines . "support for hierarchical outlining") 87 (outlines . "support for hierarchical outlining")
85 (processes . "process, subshell, compilation, and job control support") 88 (processes . "process, subshell, compilation, and job control support")
86 (terminals . "support for terminal types") 89 (terminals . "support for terminal types")
87 (tex . "code related to the TeX formatter") 90 (tex . "supporting code for the TeX formatter")
88 (tools . "programming tools") 91 (tools . "programming tools")
89 (unix . "front-ends/assistants for, or emulators of, UNIX features") 92 (unix . "front-ends/assistants for, or emulators of, UNIX-like features")
90 ;; Not a custom group and not currently useful. 93 ;; Not a custom group and not currently useful.
91 ;; (vms . "support code for vms") 94 ;; (vms . "support code for vms")
92 (wp . "word processing") 95 (wp . "word processing")
93 )) 96 ))
94 97
95 (defvar finder-mode-map nil) 98 (defvar finder-mode-map
96 (or finder-mode-map 99 (let ((map (make-sparse-keymap)))
97 (let ((map (make-sparse-keymap))) 100 (define-key map " " 'finder-select)
98 (define-key map " " 'finder-select) 101 (define-key map "f" 'finder-select)
99 (define-key map "f" 'finder-select) 102 (define-key map [mouse-2] 'finder-mouse-select)
100 (define-key map [mouse-2] 'finder-mouse-select) 103 (define-key map "\C-m" 'finder-select)
101 (define-key map "\C-m" 'finder-select) 104 (define-key map "?" 'finder-summary)
102 (define-key map "?" 'finder-summary) 105 (define-key map "q" 'finder-exit)
103 (define-key map "q" 'finder-exit) 106 (define-key map "d" 'finder-list-keywords)
104 (define-key map "d" 'finder-list-keywords) 107 map))
105 (setq finder-mode-map map)))
106 108
107 109
108 ;;; Code for regenerating the keyword list. 110 ;;; Code for regenerating the keyword list.
109 111
110 (defvar finder-package-info nil 112 (defvar finder-package-info nil
277 (let* ((str (lm-commentary (find-library-name file)))) 279 (let* ((str (lm-commentary (find-library-name file))))
278 (if (null str) 280 (if (null str)
279 (error "Can't find any Commentary section")) 281 (error "Can't find any Commentary section"))
280 ;; This used to use *Finder* but that would clobber the 282 ;; This used to use *Finder* but that would clobber the
281 ;; directory of categories. 283 ;; directory of categories.
284 (delete-other-windows)
282 (pop-to-buffer "*Finder-package*") 285 (pop-to-buffer "*Finder-package*")
283 (setq buffer-read-only nil) 286 (setq buffer-read-only nil)
284 (erase-buffer) 287 (erase-buffer)
285 (insert str) 288 (insert str)
286 (goto-char (point-min)) 289 (goto-char (point-min))
330 "Major mode for browsing package documentation. 333 "Major mode for browsing package documentation.
331 \\<finder-mode-map> 334 \\<finder-mode-map>
332 \\[finder-select] more help for the item on the current line 335 \\[finder-select] more help for the item on the current line
333 \\[finder-exit] exit Finder mode and kill the Finder buffer." 336 \\[finder-exit] exit Finder mode and kill the Finder buffer."
334 (interactive) 337 (interactive)
338 (kill-all-local-variables)
335 (use-local-map finder-mode-map) 339 (use-local-map finder-mode-map)
336 (set-syntax-table emacs-lisp-mode-syntax-table) 340 (set-syntax-table emacs-lisp-mode-syntax-table)
337 (setq mode-name "Finder") 341 (setq mode-name "Finder")
338 (setq major-mode 'finder-mode) 342 (setq major-mode 'finder-mode)
339 (make-local-variable 'finder-headmark) 343 (set (make-local-variable 'finder-headmark) nil)
340 (setq finder-headmark nil)) 344 (run-mode-hooks 'finder-mode-hook))
341 345
342 (defun finder-summary () 346 (defun finder-summary ()
343 "Summarize basic Finder commands." 347 "Summarize basic Finder commands."
344 (interactive) 348 (interactive)
345 (message "%s" 349 (message "%s"
360 (kill-buffer "*Finder Category*"))) 364 (kill-buffer "*Finder Category*")))
361 365
362 366
363 (provide 'finder) 367 (provide 'finder)
364 368
369 ;;; arch-tag: ec85ff49-8cb8-41f5-a63f-9131d53ce2c5
365 ;;; finder.el ends here 370 ;;; finder.el ends here