[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggestions for the temporary windows used from the minibuffer

From: Lennart Borgman
Subject: Re: Suggestions for the temporary windows used from the minibuffer
Date: Wed, 10 Aug 2005 01:18:38 +0200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Lennart Borgman wrote:

   +When calling FNAME if the optional parameters X-FUNCTION, X-CHAR
   +and X-DESCRIPTION to the defined function FNAME are given they
I don't understand that text; I am simply lost.  You need to state
it more clearly.

Argh. Just realized that part of this patch does not work. Please forget. I will send a new patch

Instead of my previous flawed (and unnecessary complicated patch) I suggest the attached simple patch to isearh.el. It fixes the following problems (I hope):

1) Add help to the isearch prompt

2) Allows scrolling of the help window

3) Fixes a problem with the stack of commands after fetching a search command from the search command ring

4) Renamed search-ring-update to isearch-ring-update so that it better fits together with isearch.

a) Please test 3, it is quite possible that there are more problems with the stack (or that I broken another execution path). b) 4 of course breaks backward compatibility, but I think in this case it is a small problem. It simplifies for most users if the name matches the package.
Index: isearch.el
RCS file: /cvsroot/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.269
diff -u -r1.269 isearch.el
--- isearch.el  6 Aug 2005 22:13:43 -0000       1.269
+++ isearch.el  9 Aug 2005 23:06:23 -0000
@@ -193,7 +193,7 @@
   "Index in `regexp-search-ring' of last string reused.
 It is nil if none yet.")
-(defcustom search-ring-update nil
+(defcustom isearch-ring-update nil
   "*Non-nil if advancing or retreating in the search ring should cause search.
 Default value, nil, means edit the string instead."
   :type 'boolean
@@ -368,7 +368,8 @@
     ;; Turned off because I find I expect to get the global definition--rms.
     ;; ;; Instead bind C-h to special help command for isearch-mode.
-    ;; (define-key map "\C-h" 'isearch-mode-help)
+    (define-key map "\C-h" 'isearch-mode-help)
+    (define-key map [(f1)] 'isearch-mode-help)
     (define-key map "\M-n" 'isearch-ring-advance)
     (define-key map "\M-p" 'isearch-ring-retreat)
@@ -1147,7 +1148,8 @@
                  (funcall isearch-wrap-function)
                (goto-char (if isearch-forward (point-min) (point-max)))))))
     ;; C-s in reverse or C-r in forward, change direction.
-    (setq isearch-forward (not isearch-forward)))
+    (setq isearch-forward (not isearch-forward)
+         isearch-success t))
   (setq isearch-barrier (point)) ; For subsequent \| if regexp.
@@ -1691,6 +1693,18 @@
          ((eq search-exit-option 'edit)
           (apply 'isearch-unread keylist)
+          ;; Always scroll other window if help buffer
+          ((let ((binding (key-binding key))
+                 other-buffer-is-help)
+             (when (or (eq binding 'scroll-other-window-down)
+                       (eq binding 'scroll-other-window))
+                 (other-window 1)
+                 (setq other-buffer-is-help (equal (buffer-name) "*Help*"))
+                 (other-window -1)
+                 (when other-buffer-is-help
+                   (command-execute binding)
+                   (isearch-update)
+                   t))))
           ;; Handle a scrolling function.
           ((and isearch-allow-scroll
                 (progn (setq key (isearch-reread-key-sequence-naturally 
@@ -1832,13 +1846,14 @@
 (defun isearch-ring-adjust (advance)
   ;; Helper for isearch-ring-advance and isearch-ring-retreat
   (isearch-ring-adjust1 advance)
-  (if search-ring-update
+  ;; Changed because isearch-edit-string calls isearch-push-state
+  ;; but isearch-search does not
+  (if isearch-ring-update
+        (isearch-push-state)
-    (isearch-edit-string)
-    )
-  (isearch-push-state))
+    (isearch-edit-string)))
 (defun isearch-ring-advance ()
   "Advance to the next search string in the ring."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]