(defvar finder-known-keywords
'(
(abbrev . "abbreviation handling, typing shortcuts, macros")
- (bib . "code related to the bib(1) bibliography processor")
+ (bib . "code related to the `bib' bibliography processor")
(c . "C and C++ language support")
(calendar . "calendar and time management support")
(comm . "communications, networking, remote access to files")
+ (data . "support editing files of data")
(docs . "support for Emacs documentation")
(emulations . "emulations of other editors")
(extensions . "Emacs Lisp language extensions")
+ (faces . "support for multiple fonts")
(games . "games, jokes and amusements")
(hardware . "support for interfacing with exotic hardware")
(help . "support for on-line help systems")
(local . "code local to your site")
(maint . "maintenance aids for the Emacs development group")
(mail . "modes for electronic-mail handling")
+ (matching . "various sorts of searching and matching")
+ (mouse . "mouse support")
(news . "support for netnews reading and posting")
(processes . "process, subshell, compilation, and job control support")
(terminals . "support for terminal types")
))
(defvar finder-mode-map nil)
-;(if finder-mode-map
-; nil
- (setq finder-mode-map (make-sparse-keymap))
- (define-key finder-mode-map " " 'finder-select)
- (define-key finder-mode-map "?" 'finder-summary)
- (define-key finder-mode-map "q" 'finder-exit)
- (define-key finder-mode-map "f" 'finder-list-keywords)
-; )
+(or finder-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map " " 'finder-select)
+ (define-key map "f" 'finder-select)
+ (define-key map "\C-m" 'finder-select)
+ (define-key map "?" 'finder-summary)
+ (define-key map "q" 'finder-exit)
+ (define-key map "d" 'finder-list-keywords)
+ (setq finder-mode-map map)))
+
;;; Code for regenerating the keyword list.
(if keywords (format "(%s)" keywords) "nil")
")\n")
(subst-char-in-region keystart (point) ?, ? )
- (let ((end (point)))
- (goto-char keystart)
- (while (search-forward "i14n" end t)
- (replace-match "i18n"))
- (goto-char end)))
+ )
)))
(directory-files (or d ".")))
))
(shrink-window-if-larger-than-buffer)
(finder-summary)))
+;; Search for a file named FILE the same way `load' would search.
+(defun finder-find-library (file)
+ (if (file-name-absolute-p file)
+ file
+ (let ((dirs load-path)
+ found)
+ (while (and dirs (not found))
+ (if (file-exists-p (expand-file-name (concat file ".el") (car dirs)))
+ (setq found (expand-file-name file (car dirs)))
+ (if (file-exists-p (expand-file-name file (car dirs)))
+ (setq found (expand-file-name file (car dirs)))))
+ (setq dirs (cdr dirs)))
+ found)))
+
(defun finder-commentary (file)
(interactive)
- (let* ((str (lm-commentary file)))
+ (let* ((str (lm-commentary (finder-find-library file))))
(if (null str)
- (error "Can't find any Commentary section."))
+ (error "Can't find any Commentary section"))
(pop-to-buffer "*Finder*")
(setq buffer-read-only nil)
(erase-buffer)
"Major mode for browsing package documentation.
\\<finder-mode-map>
\\[finder-select] more help for the item on the current line
-\\[finder-exit] exit Finder mode and fill the Finder buffer.
+\\[finder-exit] exit Finder mode and kill the Finder buffer.
"
(interactive)
(pop-to-buffer "*Finder*")
(interactive)
(message
(substitute-command-keys
- "\\<finder-mode-map>\\[finder-select] = select, \\[finder-list-keywords] = back to finder, \\[finder-exit] = quit, \\[finder-summary] = help")))
+ "\\<finder-mode-map>\\[finder-select] = select, \\[finder-list-keywords] = to finder directory, \\[finder-exit] = quit, \\[finder-summary] = help")))
(defun finder-exit ()
"Exit Finder mode and kill the buffer"