all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Dani Moncayo <dmoncayo@gmail.com>
Cc: 9185@debbugs.gnu.org
Subject: bug#9185: 24.0.50; "C-s M-p" does not bring the tip of the search ring
Date: Wed, 24 Aug 2011 18:44:19 +0300	[thread overview]
Message-ID: <87ei0aizl8.fsf@mail.jurta.org> (raw)
In-Reply-To: <CAH8Pv0heX6_V64hN6+tJLjM5WNQixWLziWjhvt9_tOKaSjCWsA@mail.gmail.com> (Dani Moncayo's message of "Wed, 24 Aug 2011 16:23:24 +0200")

> But I've found another use-case that seems to need a fix too:
> 0. C-s a <RET> C-s b <RET> C-s c <RET>
> 1. C-s C-s     --> "c" is selected, OK.
> 2. M-p <RET>   --> "b" is selected, OK.
> 3. M-p         --> Now "c" (the previous used entry) should have been
> selected, but I see that "b" (the current entry) remains selected
> instead.

This is a separate problem caused when exiting from the minibuffer in
`isearch-edit-string' by `read-from-minibuffer' (i.e. step 2
`M-p <RET>' above) adds a new element "b" to the history (search ring).

I agree that `isearch-edit-string' should not update the search ring.
It should be updated only by `isearch-update-ring' in `isearch-done'.
So e.g. `C-s C-s M-e RET C-g' or `C-s M-p RET C-g' should keep the
search ring unchanged.  Note also that `isearch-done' with the arg
NOPUSH=t already tries to take care of not updating the search ring,
but unsuccessfully.  It requires the following patch for the complete fix:

Using parent branch file:///home/work/emacs/bzr/emacs/http-trunk/
=== modified file 'lisp/isearch.el'
--- lisp/isearch.el	2011-07-15 13:33:07 +0000
+++ lisp/isearch.el	2011-08-24 15:43:01 +0000
@@ -1152,9 +1161,14 @@ (defun isearch-edit-string ()
 
 	  (unwind-protect
 	      (let* ((message-log-max nil)
+		     ;; Protect the global search ring from updating
+		     ;; by read-from-minibuffer.  It should be updated only
+		     ;; by isearch-update-ring in isearch-done.
+		     (search-ring search-ring)
+		     (regexp-search-ring regexp-search-ring)
 		     ;; Binding minibuffer-history-symbol to nil is a work-around
 		     ;; for some incompatibility with gmhist.
 		     (minibuffer-history-symbol))
 		(setq isearch-new-string
                       (read-from-minibuffer
                        (isearch-message-prefix nil nil isearch-nonincremental)
		        (cons isearch-string (1+ (isearch-fail-pos)))
                        minibuffer-local-isearch-map nil
                        (if isearch-regexp
 			   (cons 'regexp-search-ring





  reply	other threads:[~2011-08-24 15:44 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-28  8:12 bug#9185: 24.0.50; "C-s M-p" does not bring the tip of the search ring Dani Moncayo
2011-07-28  8:18 ` Dani Moncayo
2011-07-28  8:20   ` Deniz Dogan
2011-07-28  8:43     ` Dani Moncayo
2011-07-28  8:50       ` Deniz Dogan
2011-07-28  9:08         ` Dani Moncayo
2011-07-28  9:11           ` Deniz Dogan
2011-07-28  9:17             ` Dani Moncayo
2011-07-28  9:11         ` Andreas Schwab
2011-07-28  9:29 ` Juri Linkov
2011-07-28  9:50   ` Juri Linkov
2011-07-28 10:05     ` Dani Moncayo
2011-07-28 11:13       ` Andreas Schwab
2011-07-28 11:32         ` Dani Moncayo
2011-07-28 11:44           ` Juri Linkov
2011-07-30  8:52           ` Juri Linkov
2011-08-10 19:03             ` Dani Moncayo
2011-08-13 15:24             ` Stefan Monnier
2011-08-14 11:14               ` Dani Moncayo
2011-08-14 12:36                 ` Stefan Monnier
2011-08-14 14:47                   ` Dani Moncayo
2011-08-21 17:56                     ` Dani Moncayo
2011-08-21 18:35                       ` Juri Linkov
2011-08-21 19:24                         ` Dani Moncayo
2011-08-22 11:06                           ` Juri Linkov
2011-08-22 12:09                             ` Dani Moncayo
2011-08-22 21:34                               ` Stefan Monnier
2011-08-23  9:52                                 ` Juri Linkov
2011-08-23 18:40                                   ` Stefan Monnier
2011-08-24  9:41                                     ` Juri Linkov
2011-08-24 14:23                                     ` Dani Moncayo
2011-08-24 15:44                                       ` Juri Linkov [this message]
2011-08-24 16:18                                         ` Dani Moncayo
2011-08-24 18:28                                           ` Juri Linkov
2011-08-24 23:21                                             ` Dani Moncayo
2011-08-24 23:54                                               ` Dani Moncayo
2011-08-25  9:01                                                 ` Juri Linkov
2011-08-25 10:10                                                   ` Dani Moncayo
2011-11-19 19:59                                         ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ei0aizl8.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=9185@debbugs.gnu.org \
    --cc=dmoncayo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.