]> code.delx.au - gnu-emacs/blobdiff - lisp/finder.el
(cvs-diff-backup-extractor): Return full-path for file.
[gnu-emacs] / lisp / finder.el
index f686d0f1bf6eaa7168f4257a142d4a65df94712a..73ff65f8fa98b0c044dd0d07e7bc97417b55e7d3 100644 (file)
 ;; Local variable in finder buffer.
 (defvar finder-headmark)
 
+;; These are supposed to correspond to top-level customization groups,
+;; says rms.
 (defvar finder-known-keywords
   '(
     (abbrev    . "abbreviation handling, typing shortcuts, macros")
+    ;; Too specific:
     (bib       . "code related to the `bib' bibliography processor")
     (c         . "support for the C language and related languages")
     (calendar  . "calendar and time management support")
@@ -57,6 +60,7 @@
     (emulations        . "emulations of other editors")
     (extensions        . "Emacs Lisp language extensions")
     (faces     . "support for multiple fonts")
+    (files      . "support for editing and manipulating files")
     (frames     . "support for Emacs frames and window systems")
     (games     . "games, jokes and amusements")
     (hardware  . "support for interfacing with exotic hardware")
@@ -80,7 +84,8 @@
     (tex       . "code related to the TeX formatter")
     (tools     . "programming tools")
     (unix      . "front-ends/assistants for, or emulators of, UNIX features")
-    (vms       . "support code for vms")
+;; Not a custom group and not currently useful.
+;;    (vms     . "support code for vms")
     (wp                . "word processing")
     ))
 
@@ -157,7 +162,15 @@ no arguments compiles from `load-path'."
                    )))
            (directory-files (or d ".")))))
        (or dirs load-path))
-      (insert "))\n\n(provide 'finder-inf)\n\n;;; finder-inf.el ends here\n")
+      (insert "))\n
+\(provide 'finder-inf)
+
+;;; Local Variables:
+;;; version-control: never
+;;; no-byte-compile: t
+;;; no-update-autoloads: t
+;;; End:
+;;; finder-inf.el ends here\n")
       (kill-buffer "*finder-scratch*")
       (eval-current-buffer) ;; So we get the new keyword list immediately
       (basic-save-buffer))))
@@ -175,14 +188,27 @@ no arguments compiles from `load-path'."
   (move-to-column column t)
   (apply 'insert strings))
 
+(defvar finder-help-echo nil)
+
 (defun finder-mouse-face-on-line ()
-  "Put a `mouse-face' property on the previous line."
+  "Put `mouse-face' and `help-echo' properties on the previous line."
   (save-excursion
     (previous-line 1)
-    (put-text-property (save-excursion (beginning-of-line) (point))
-                      (progn (end-of-line) (point))
-                      'mouse-face 'highlight)))
-
+    (unless finder-help-echo
+      (setq finder-help-echo
+           (let* ((keys1 (where-is-internal 'finder-select
+                                            finder-mode-map))
+                  (keys (nconc (where-is-internal
+                                'finder-mouse-select finder-mode-map)
+                               keys1)))
+             (concat (mapconcat 'key-description keys ", ")
+                     ": select item"))))
+    (add-text-properties
+     (line-beginning-position) (line-end-position)
+     '(mouse-face highlight
+                 help-echo finder-help-echo))))
+
+;;;###autoload
 (defun finder-list-keywords ()
   "Display descriptions of the keywords in the Finder buffer."
   (interactive)
@@ -192,7 +218,7 @@ no arguments compiles from `load-path'."
     (finder-mode)
     (setq buffer-read-only nil)
     (erase-buffer)
-    (mapcar
+    (mapc
      (lambda (assoc)
        (let ((keyword (car assoc)))
         (insert (symbol-name keyword))
@@ -215,7 +241,7 @@ no arguments compiles from `load-path'."
     (insert
      "The following packages match the keyword `" key "':\n\n")
     (setq finder-headmark (point))
-    (mapcar
+    (mapc
      (lambda (x)
        (if (memq id (car (cdr (cdr x))))
           (progn
@@ -240,6 +266,7 @@ Try compressed versions if jka-compr is in use."
             ;; last resort for MS-DOG et al
             (locate-library (concat library "z"))))))
 
+;;;###autoload
 (defun finder-commentary (file)
   "Display FILE's commentary section.
 FILE should be in a form suitable for passing to `locate-library'."
@@ -264,6 +291,7 @@ FILE should be in a form suitable for passing to `locate-library'."
     (setq buffer-read-only t)
     (set-buffer-modified-p nil)
     (shrink-window-if-larger-than-buffer)
+    (finder-mode)
     (finder-summary)))
 
 (defun finder-current-item ()
@@ -289,6 +317,7 @@ FILE should be in a form suitable for passing to `locate-library'."
     (goto-char (posn-point (event-start event)))
     (finder-select)))
 
+;;;###autoload
 (defun finder-by-keyword ()
   "Find packages matching a given keyword."
   (interactive)
@@ -327,6 +356,7 @@ finder directory, \\[finder-exit] = quit, \\[finder-summary] = help")))
   (and (get-buffer "*Finder Category*")
        (kill-buffer "*Finder Category*")))
 
+\f
 (provide 'finder)
 
 ;;; finder.el ends here