This commit was generated by cvs2svn to compensate for changes in r1077,
[chise/xemacs-chise.git.1] / lisp / hyper-apropos.el
index 2839b73..af739d8 100644 (file)
@@ -60,7 +60,7 @@
 
 ;; ### The maintainer is supposed to be stig, but I haven't seen him
 ;; around for ages.  The real maintainer for the moment is Hrvoje
-;; Niksic <hniksic@srce.hr>.
+;; Niksic <hniksic@xemacs.org>.
 
 ;;; Code:
 
@@ -211,7 +211,7 @@ This map inherits from `hyper-apropos-help-map.'")
 
 (defvar hyper-apropos-mode-hook nil
   "*User function run after hyper-apropos mode initialization.  Usage:
-\(setq hyper-apropos-mode-hook '(lambda () ... your init forms ...)).")
+\(add-hook 'hyper-apropos-mode-hook #'(lambda () ... your init forms ...)).")
 
 ;; ---------------------------------------------------------------------- ;;
 
@@ -380,7 +380,7 @@ General Commands:
 
 ;; ---------------------------------------------------------------------- ;;
 
-;; similar to `describe-key-briefly', copied from prim/help.el by CW
+;; similar to `describe-key-briefly', copied from help.el by CW
 
 ;;;###autoload
 (defun hyper-describe-key (key)
@@ -452,7 +452,7 @@ See also `hyper-apropos' and `hyper-describe-function'."
                          (if v
                              (format " (default %s): " v)
                            ": "))
-                 (mapcar (function (lambda (x) (list (symbol-name x))))
+                 (mapcar #'(lambda (x) (list (symbol-name x)))
                          (face-list))
                  nil t nil 'hyper-apropos-face-history)))
      (list (if (string= val "")
@@ -481,6 +481,7 @@ See also `hyper-apropos' and `hyper-describe-function'."
        (setq hyper-apropos-prev-wconfig (current-window-configuration)))
     (hyper-apropos-get-doc symbol t nil this-ref-buffer)))
 
+;;;###autoload
 (defun hyper-where-is (symbol)
   "Print message listing key sequences that invoke specified command."
   (interactive (list (hyper-apropos-read-function-symbol "Where is function")))
@@ -885,14 +886,13 @@ See also `hyper-apropos' and `hyper-describe-function'."
             (progn
               (setq ok t)
               (copy-face symbol 'hyper-apropos-temp-face 'global)
-              (mapcar (function
-                       (lambda (property)
-                         (setq symtype (face-property-instance symbol
-                                                               property))
-                         (if symtype
-                             (set-face-property 'hyper-apropos-temp-face
-                                                property
-                                                symtype))))
+              (mapcar #'(lambda (property)
+                          (setq symtype (face-property-instance symbol
+                                                                property))
+                          (if symtype
+                              (set-face-property 'hyper-apropos-temp-face
+                                                 property
+                                                 symtype)))
                       built-in-face-specifiers)
               (setq font (cons (face-property-instance symbol 'font nil 0 t)
                                (face-property-instance symbol 'font))
@@ -1079,6 +1079,12 @@ Deletes lines which match PATTERN."
               nil
             (forward-char 3)
             (read (point-marker))))
+         ((and
+           (eq major-mode 'hyper-apropos-help-mode)
+           (> (point) (point-min)))
+          (save-excursion
+            (goto-char (point-min))
+            (hyper-apropos-this-symbol)))
          (t
           (let* ((st (progn
                        (skip-syntax-backward "w_")
@@ -1121,11 +1127,6 @@ Deletes lines which match PATTERN."
   (interactive
    (let ((var (hyper-apropos-this-symbol)))
      (or (and var (boundp var))
-        (and (setq var (and (eq major-mode 'hyper-apropos-help-mode)
-                            (save-excursion
-                              (goto-char (point-min))
-                              (hyper-apropos-this-symbol))))
-             (boundp var))
         (setq var nil))
      (list var (hyper-apropos-read-variable-value var))))
   (and var
@@ -1175,7 +1176,10 @@ Deletes lines which match PATTERN."
 (defun hyper-apropos-customize-variable ()
   (interactive)
   (let ((var (hyper-apropos-this-symbol)))
-    (customize-variable var)))
+    (and
+     (or (and var (boundp var))
+        (setq var nil))
+     (customize-variable var))))
 
 ;; ---------------------------------------------------------------------- ;;
 
@@ -1197,11 +1201,6 @@ window.  (See also `find-function'.)"
   (interactive
    (let ((fn (hyper-apropos-this-symbol)))
      (or (fboundp fn)
-        (and (setq fn (and (eq major-mode 'hyper-apropos-help-mode)
-                           (save-excursion
-                             (goto-char (point-min))
-                             (hyper-apropos-this-symbol))))
-             (fboundp fn))
         (setq fn nil))
      (list fn)))
   (if fn
@@ -1257,11 +1256,7 @@ window.  (See also `find-function'.)"
 (defun hyper-apropos-popup-menu (event)
   (interactive "e")
   (mouse-set-point event)
-  (let* ((sym (or (hyper-apropos-this-symbol)
-                 (and (eq major-mode 'hyper-apropos-help-mode)
-                      (save-excursion
-                        (goto-char (point-min))
-                        (hyper-apropos-this-symbol)))))
+  (let* ((sym (hyper-apropos-this-symbol))
         (notjunk (not (null sym)))
         (command-p (if (commandp sym) t))
         (variable-p (and sym (boundp sym)))