From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#16035: 24.3.50; Custom isearch broken on trunk (e.g. change-log-mode) Date: Thu, 05 Dec 2013 03:20:03 +0200 Organization: JURTA Message-ID: <87mwkgay9s.fsf@mail.jurta.org> References: <87vbz5zcxv.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1386206757 24329 80.91.229.3 (5 Dec 2013 01:25:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Dec 2013 01:25:57 +0000 (UTC) Cc: 16035@debbugs.gnu.org, Anders Lindgren To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 05 02:26:02 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 1VoNhY-00031j-Vi for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Dec 2013 02:26:02 +0100 Original-Received: from localhost ([::1]:51277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoNhY-0004bq-GE for geb-bug-gnu-emacs@m.gmane.org; Wed, 04 Dec 2013 20:26:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoNgi-0004Ai-K4 for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2013 20:25:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoNgc-0002uc-Dj for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2013 20:25:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoNgc-0002tt-Ah for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2013 20:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VoNgb-0000VL-KV for bug-gnu-emacs@gnu.org; Wed, 04 Dec 2013 20:25:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Dec 2013 01:25:01 +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.13862066941920 (code B ref 16035); Thu, 05 Dec 2013 01:25:01 +0000 Original-Received: (at 16035) by debbugs.gnu.org; 5 Dec 2013 01:24:54 +0000 Original-Received: from localhost ([127.0.0.1]:58631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VoNgT-0000Uu-VW for submit@debbugs.gnu.org; Wed, 04 Dec 2013 20:24:54 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:58937 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VoNgQ-0000Uf-Hx for 16035@debbugs.gnu.org; Wed, 04 Dec 2013 20:24:51 -0500 Original-Received: from localhost.jurta.org (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 9EBBA258B9E935; Wed, 4 Dec 2013 17:24:48 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Wed, 04 Dec 2013 12:57:38 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) 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:81409 Archived-At: >> 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.