diff lisp/hyper-apropos.el @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents 74fd4e045ea6
children
line wrap: on
line diff
--- a/lisp/hyper-apropos.el	Mon Aug 13 11:19:22 2007 +0200
+++ b/lisp/hyper-apropos.el	Mon Aug 13 11:20:41 2007 +0200
@@ -58,9 +58,9 @@
 ;; Massive changes by Christoph Wedler <wedler@fmi.uni-passau.de>
 ;; Some changes for XEmacs 20.3 by hniksic
 
-;; #### The maintainer is supposed to be stig, but I haven't seen him
+;; ### 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@xemacs.org>.
+;; Niksic <hniksic@srce.hr>.
 
 ;;; Code:
 
@@ -243,22 +243,16 @@
       (setq hyper-apropos-prev-wconfig (current-window-configuration)))
   (if (string= "" regexp)
       (if (get-buffer hyper-apropos-apropos-buf)
-	  (progn
-	    (setq regexp hyper-apropos-last-regexp)
-	    (if toggle-apropos
-		(hyper-apropos-toggle-programming-flag)
-	      (message "Using last search results")))
+	  (if toggle-apropos
+	      (hyper-apropos-toggle-programming-flag)
+	    (message "Using last search results"))
 	(error "Be more specific..."))
     (set-buffer (get-buffer-create hyper-apropos-apropos-buf))
     (setq buffer-read-only nil)
     (erase-buffer)
     (if toggle-apropos
-	(if (local-variable-p 'hyper-apropos-programming-apropos
-			      (current-buffer))
-	    (setq hyper-apropos-programming-apropos
-		  (not hyper-apropos-programming-apropos))
-	  (set (make-local-variable 'hyper-apropos-programming-apropos)
-	       (not (default-value 'hyper-apropos-programming-apropos)))))
+	(set (make-local-variable 'hyper-apropos-programming-apropos)
+	     (not (default-value 'hyper-apropos-programming-apropos))))
     (let ((flist (apropos-internal regexp
 				   (if hyper-apropos-programming-apropos
 				       #'fboundp
@@ -438,9 +432,7 @@
 	(if (and (or (symbolp defn) (symbolp (setq defn (car-safe defn))))
 		 defn
 		 show)
-	    (hyper-apropos-get-doc defn t))
-	(or (memq major-mode '(hyper-apropos-mode hyper-apropos-help-mode))
-	  (setq hyper-apropos-prev-wconfig (current-window-configuration)))))))
+	    (hyper-apropos-get-doc defn t))))))
 
 ;;;###autoload
 (defun hyper-describe-face (symbol &optional this-ref-buffer)
@@ -462,9 +454,10 @@
 			    ": "))
 		  (mapcar #'(lambda (x) (list (symbol-name x)))
 			  (face-list))
-		  nil t nil 'hyper-apropos-face-history
-		  (and v (symbol-name v)))))
-     (list (intern-soft val)
+		  nil t nil 'hyper-apropos-face-history)))
+     (list (if (string= val "")
+	       (progn (push (symbol-name v) hyper-apropos-face-history) v)
+	     (intern-soft val))
 	   current-prefix-arg)))
   (if (null symbol)
       (message "Sorry, nothing to describe.")
@@ -531,10 +524,10 @@
 			 (if v
 			     (format " (default %s): " v)
 			   ": "))
-		 obarray predicate t nil 'variable-history
-		 (and v (symbol-name v)))))
-    (intern-soft val)))
-
+		 obarray predicate t nil 'variable-history)))
+    (if (string= val "")
+	(progn (push (symbol-name v) variable-history) v)
+      (intern-soft val))))
 ;;;###autoload
 (define-obsolete-function-alias
   'hypropos-read-variable-symbol 'hyper-apropos-read-variable-symbol)
@@ -550,9 +543,10 @@
 				     (format "%s (default %s): " prompt fn)
 				   (format "%s: " prompt))
 				 obarray 'fboundp t nil
-				 'function-history
-				 (and fn (symbol-name fn)))))
-    (intern-soft val)))
+				 'function-history)))
+    (if (equal val "")
+	(progn (push (symbol-name fn) function-history) fn)
+      (intern-soft val))))
 
 (defun hyper-apropos-last-help (arg)
   "Go back to the last symbol documented in the *Hyper Help* buffer."
@@ -1085,12 +1079,6 @@
 	       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_")
@@ -1133,6 +1121,11 @@
   (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
@@ -1182,10 +1175,7 @@
 (defun hyper-apropos-customize-variable ()
   (interactive)
   (let ((var (hyper-apropos-this-symbol)))
-    (and
-     (or (and var (boundp var))
-	 (setq var nil))
-     (customize-variable var))))
+    (customize-variable var)))
 
 ;; ---------------------------------------------------------------------- ;;
 
@@ -1207,6 +1197,11 @@
   (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
@@ -1262,7 +1257,11 @@
 (defun hyper-apropos-popup-menu (event)
   (interactive "e")
   (mouse-set-point event)
-  (let* ((sym (hyper-apropos-this-symbol))
+  (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)))))
 	 (notjunk (not (null sym)))
 	 (command-p (if (commandp sym) t))
 	 (variable-p (and sym (boundp sym)))