]> code.delx.au - gnu-emacs/blobdiff - lisp/help.el
(mail-extr-safe-move-sexp): Make sure this doesn't
[gnu-emacs] / lisp / help.el
index 67f8bb099eaee758c24e21cdf923aaf336dead41..97887b1c81c453191210229878efa353027156db 100644 (file)
@@ -97,7 +97,9 @@
        ;;
        ;; The symbol itself.
        (list (concat "\\`\\(" name-char "+\\)\\(\\(:\\)\\|\\('\\)\\)")
-            '(1 font-lock-function-name-face))
+            '(1 (if (match-beginning 3)
+                    font-lock-function-name-face
+                  font-lock-variable-name-face)))
        ;;
        ;; Words inside `' which tend to be symbol names.
        (list (concat "`\\(" sym-char sym-char "+\\)'")
        (list (concat "\\<:" sym-char "+\\>") 0 'font-lock-reference-face t))))
   "Default expressions to highlight in Help mode.")
 
-(defun help-fontify-buffer-function ()
-  ;; This function's symbol is bound to font-lock-fontify-buffer-function.
-  (let ((font-lock-fontify-region-function 'font-lock-default-fontify-region))
-    ;; Fontify as normal.
-    (font-lock-default-fontify-buffer)
-    ;; Prevent Font Lock mode from kicking in.
-    (setq font-lock-fontified t)))
-
 (defun help-mode ()
   "Major mode for viewing help text.
 Entry to this mode runs the normal hook `help-mode-hook'.
@@ -126,11 +120,7 @@ Commands:
   (setq mode-name "Help")
   (setq major-mode 'help-mode)
   (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults
-       '(help-font-lock-keywords nil nil nil nil
-         (font-lock-inhibit-thing-lock . (lazy-lock-mode))
-         (font-lock-fontify-region-function . ignore)
-         (font-lock-fontify-buffer-function . help-fontify-buffer-function)))
+  (setq font-lock-defaults '(help-font-lock-keywords))
   (view-mode)
   (run-hooks 'help-mode-hook))
 
@@ -676,12 +666,15 @@ Argument is a command definition, usually a symbol with a function definition."
       (message "%s is not on any key" definition)))
   nil)
 
-(defun locate-library (library &optional nosuffix)
-  "Show the full path name of Emacs library LIBRARY.
+(defun locate-library (library &optional nosuffix path)
+  "Show the precise file name of Emacs library LIBRARY.
 This command searches the directories in `load-path' like `M-x load-library'
 to find the file that `M-x load-library RET LIBRARY RET' would load.
 Optional second arg NOSUFFIX non-nil means don't add suffixes `.elc' or `.el'
-to the specified name LIBRARY (a la calling `load' instead of `load-library')."
+to the specified name LIBRARY.
+
+If the optional third arg PATH is specified, that list of directories
+is used instead of `load-path'."
   (interactive "sLocate library: ")
   (catch 'answer
     (mapcar
@@ -694,8 +687,22 @@ to the specified name LIBRARY (a la calling `load' instead of `load-library')."
                   (progn
                     (message "Library is file %s" try)
                     (throw 'answer try)))))
-        (if nosuffix '("") '(".elc" ".el" ""))))
-     load-path)
+        (if nosuffix
+            '("")
+          (let ((basic '(".elc" ".el" ""))
+                (compressed '(".Z" ".gz" "")))
+            ;; If autocompression mode is on,
+            ;; consider all combinations of library suffixes
+            ;; and compression suffixes.
+            (if (rassq 'jka-compr-handler file-name-handler-alist)
+                (apply 'nconc
+                       (mapcar '(lambda (compelt)
+                                  (mapcar '(lambda (baselt)
+                                             (concat baselt compelt))
+                                          basic))
+                               compressed))
+              basic)))))
+     (or path load-path))
     (message "No library %s in search path" library)
     nil))