From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.bugs Subject: bug#16035: 24.3.50; Custom isearch broken on trunk (e.g. change-log-mode) Date: Thu, 5 Dec 2013 16:33:17 +0100 Message-ID: References: <87vbz5zcxv.fsf@mail.jurta.org> <87mwkgay9s.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d0442879eb104c204eccb3f56 X-Trace: ger.gmane.org 1386257657 27046 80.91.229.3 (5 Dec 2013 15:34:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Dec 2013 15:34:17 +0000 (UTC) Cc: 16035@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 05 16:34:18 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VoawT-0000hN-4l for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Dec 2013 16:34:17 +0100 Original-Received: from localhost ([::1]:54103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoawS-0006kH-OE for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Dec 2013 10:34:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoawK-0006iZ-SS for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2013 10:34:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoawF-00023W-0G for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2013 10:34:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoawE-00023S-SA for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2013 10:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VoawE-0007Ko-Ew for bug-gnu-emacs@gnu.org; Thu, 05 Dec 2013 10:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Anders Lindgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Dec 2013 15:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16035 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16035-submit@debbugs.gnu.org id=B16035.138625760228143 (code B ref 16035); Thu, 05 Dec 2013 15:34:02 +0000 Original-Received: (at 16035) by debbugs.gnu.org; 5 Dec 2013 15:33:22 +0000 Original-Received: from localhost ([127.0.0.1]:60052 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VoavZ-0007Jr-AE for submit@debbugs.gnu.org; Thu, 05 Dec 2013 10:33:21 -0500 Original-Received: from mail-wi0-f169.google.com ([209.85.212.169]:60851) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VoavW-0007Ji-Nm for 16035@debbugs.gnu.org; Thu, 05 Dec 2013 10:33:19 -0500 Original-Received: by mail-wi0-f169.google.com with SMTP id hn6so1036107wib.2 for <16035@debbugs.gnu.org>; Thu, 05 Dec 2013 07:33:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QTecj/F29OopyjHHiPI+rLUHs8gPfZoK68YPDZMqNjE=; b=VU63hrm+fit2he5y8evq4YJ3QCtM5RLVfm3WhErOcam6UotGaaLJY/QKJycIR5tlkP bz8/Z1ZOSbcSoW+sJCrESTPSwlZ+bizMR7ClFcBeKTdB4zfs0I9PxQ0+NYscet/FrPis bd1UKpsJC1TXQcJ47vpRabojm9tJ3KLbeonbHKQlxsqZPcPNjqWgLgZ5z3QFODgKAVCm PSGsHwPht4xXeSKOwPFx8ANHvikgUfDvf97SFeecX/mqds5aCHbRKOWBgijZqjwG/jSd lv4205AwZyf+ZtvcM7w3eGdHGV6VplOCYLQgFUZyvzX3Ze3KtR9p/bHJw+qX1Ow6LUip eLAw== X-Received: by 10.180.101.230 with SMTP id fj6mr12405380wib.58.1386257597922; Thu, 05 Dec 2013 07:33:17 -0800 (PST) Original-Received: by 10.216.223.140 with HTTP; Thu, 5 Dec 2013 07:33:17 -0800 (PST) In-Reply-To: <87mwkgay9s.fsf@mail.jurta.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:81439 Archived-At: --f46d0442879eb104c204eccb3f56 Content-Type: text/plain; charset=ISO-8859-1 Juri, Both problems seems to be fixed! (I tested the latest isearch.el, add added your patch, on Emacs bzr version 115300 (newer versions don't run on OS X due to some font-related issue).) Thanks a lot, both of you! -- Anders On Thu, Dec 5, 2013 at 2:20 AM, Juri Linkov wrote: > >> I tried you solution and it works perfectly! Just make sure to save the > >> keymap after the call to "(run-hooks 'isearch-mode-hook)", as this is > where > >> packages like "folding" installs its keymap. > > > > Great to hear. Juri, can you do that for me? > > I tested this patch, and it seems to fix the second case reported > by Anders. If the patch is correct then I could install it. > > >> While looking around the isearch code, I came up with a theory why > >> multi-buffer search in change-log-mode no longer works. isearch adds its > >> hook to the LOCAL pre-command-hook. As change-log-mode search change > buffer > >> and the hook is not installed in the new buffer, the user can't exit > >> isearch. > > > > Sounds right, as well. Juri, can you take care of that while you're at > it? > > I already installed the fix for this case a day ago in revno:115368 > Anders, can you try this fix? Only the first case that you reported > has been fixed and installed, and the second case fixed by this patch > will be installed soon too. > > === modified file 'lisp/isearch.el' > --- lisp/isearch.el 2013-12-04 00:12:02 +0000 > +++ lisp/isearch.el 2013-12-05 01:18:56 +0000 > @@ -637,6 +637,8 @@ (defvar isearch-input-method-function ni > ;; isearch is invoked. > (defvar isearch-input-method-local-p nil) > > +(defvar isearch-saved-overriding-local-map nil) > + > ;; Minor-mode-alist changes - kind of redundant with the > ;; echo area, but if isearching in multiple windows, it can be useful. > > @@ -904,6 +906,7 @@ (defun isearch-mode (forward &optional r > > (setq overriding-terminal-local-map isearch-mode-map) > (run-hooks 'isearch-mode-hook) > + (setq isearch-saved-overriding-local-map overriding-terminal-local-map) > > ;; Pushing the initial state used to be before running > isearch-mode-hook, > ;; but a hook might set `isearch-push-state-function' used in > @@ -2235,7 +2238,7 @@ (defun isearch-pre-command-hook () > (cond > ;; Don't exit Isearch if we're in the middle of some > ;; set-temporary-overlay-map thingy like universal-argument--mode. > - ((not (eq overriding-terminal-local-map isearch-mode-map))) > + ((not (eq overriding-terminal-local-map > isearch-saved-overriding-local-map))) > ;; Don't exit Isearch for isearch key bindings. > ((commandp (lookup-key isearch-mode-map key nil))) > ;; Optionally edit the search string instead of exiting. > > --f46d0442879eb104c204eccb3f56 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Juri,

Both problems seems to be fixed!<= br>

(I tested the latest isearch.el, add added you= r patch, on Emacs bzr version 115300 (newer versions don't run on OS X = due to some font-related issue).)

Thanks a lot, both of you!

=A0= =A0 -- Anders


On Thu, Dec 5, 2013 at 2:20 AM, Juri Linkov = <juri@jurta.org&= gt; wrote:
>> I tried you solut= ion and it works perfectly! Just make sure to save the
>> keymap after the call to "(run-hooks 'isearch-mode-hook)&= quot;, as this is where
>> packages like "folding" installs its keymap.
>
> Great to hear. =A0Juri, can you do that for me?

I tested this patch, and it seems to fix the second case reported
by Anders. =A0If the patch is correct then I could install it.

>> While looking around the isearch code, I came up with a theory why=
>> multi-buffer search in change-log-mode no longer works. isearch ad= ds its
>> hook to the LOCAL pre-command-hook. As change-log-mode search chan= ge buffer
>> and the hook is not installed in the new buffer, the user can'= t exit
>> isearch.
>
> Sounds right, as well. =A0Juri, can you take care of that while you= 9;re at it?

I already installed the fix for this case a day ago in revno:115368 Anders, can you try this fix? Only the first case that you reported
has been fixed and installed, and the second case fixed by this patch
will be installed soon too.

=3D=3D=3D modified file 'lisp/isearch.el'
--- lisp/isearch.el =A0 =A0 2013-12-04 00:12:02 +0000
+++ lisp/isearch.el =A0 =A0 2013-12-05 01:18:56 +0000
@@ -637,6 +637,8 @@ (defvar isearch-input-method-function ni
=A0;; isearch is invoked.
=A0(defvar isearch-input-method-local-p nil)

+(defvar isearch-saved-overriding-local-map nil)
+
=A0;; Minor-mode-alist changes - kind of redundant with the
=A0;; echo area, but if isearching in multiple windows, it can be useful.
@@ -904,6 +906,7 @@ (defun isearch-mode (forward &optional r

=A0 =A0(setq overriding-terminal-local-map isearch-mode-map)
=A0 =A0(run-hooks 'isearch-mode-hook)
+ =A0(setq isearch-saved-overriding-local-map overriding-terminal-local-map= )

=A0 =A0;; Pushing the initial state used to be before running isearch-mode-= hook,
=A0 =A0;; but a hook might set `isearch-push-state-function' used in @@ -2235,7 +2238,7 @@ (defun isearch-pre-command-hook ()
=A0 =A0 =A0(cond
=A0 =A0 =A0 ;; Don't exit Isearch if we're in the middle of some =A0 =A0 =A0 ;; set-temporary-overlay-map thingy like universal-argument--mo= de.
- =A0 =A0 ((not (eq overriding-terminal-local-map isearch-mode-map)))
+ =A0 =A0 ((not (eq overriding-terminal-local-map isearch-saved-overriding-= local-map)))
=A0 =A0 =A0 ;; Don't exit Isearch for isearch key bindings.
=A0 =A0 =A0 ((commandp (lookup-key isearch-mode-map key nil)))
=A0 =A0 =A0 ;; Optionally edit the search string instead of exiting.


--f46d0442879eb104c204eccb3f56--