From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs Subject: bug#23038: 25.0.92; M-% from isearch broken (error in isearch--describe-regexp-mode) Date: Thu, 17 Mar 2016 10:25:51 -0400 Message-ID: References: <87r3f98agb.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013a04a8b84fbe052e3f6a3b X-Trace: ger.gmane.org 1458224844 19267 80.91.229.3 (17 Mar 2016 14:27:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Mar 2016 14:27:24 +0000 (UTC) To: Michael Heerdegen , 23038@debbugs.gnu.org, Eli Zaretskii , Artur Malabarba Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 17 15:27:15 2016 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 1agYtO-0003vB-Bi for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Mar 2016 15:27:14 +0100 Original-Received: from localhost ([::1]:35316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agYtN-0003PP-Hg for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 Mar 2016 10:27:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agYtG-0003LK-F4 for bug-gnu-emacs@gnu.org; Thu, 17 Mar 2016 10:27:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agYtC-0006c2-DP for bug-gnu-emacs@gnu.org; Thu, 17 Mar 2016 10:27:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agYtC-0006by-9h for bug-gnu-emacs@gnu.org; Thu, 17 Mar 2016 10:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1agYtC-0007vv-0a for bug-gnu-emacs@gnu.org; Thu, 17 Mar 2016 10:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Mar 2016 14:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23038 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23038-submit@debbugs.gnu.org id=B23038.145822479930464 (code B ref 23038); Thu, 17 Mar 2016 14:27:01 +0000 Original-Received: (at 23038) by debbugs.gnu.org; 17 Mar 2016 14:26:39 +0000 Original-Received: from localhost ([127.0.0.1]:51166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agYso-0007vI-Ql for submit@debbugs.gnu.org; Thu, 17 Mar 2016 10:26:39 -0400 Original-Received: from mail-ob0-f173.google.com ([209.85.214.173]:33005) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agYsn-0007v4-C0 for 23038@debbugs.gnu.org; Thu, 17 Mar 2016 10:26:37 -0400 Original-Received: by mail-ob0-f173.google.com with SMTP id fz5so85949603obc.0 for <23038@debbugs.gnu.org>; Thu, 17 Mar 2016 07:26:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=0AjvwOzgkOeKy+xUCr238R6H47emDJFeLraug2F04rE=; b=rJKncyjbsa42N2clrW5xHqUwQ29OImito5ArTrNzqmF08BPznfv78Tp9qa2DSikWUV OKBxh36ykvHdIp+Km1274iuxakt2Lz7C9Hg8cKC93c2brzU2A/62IBEhHFpj1aFtEYHm Vdbm+oQZZx2I9p8Ig+LsDLqFv2WHAaMsuAZcX5gpBSnmj5A0Bq+dnzvtKXiVx1nqVV/q jTzD2+SWULRslI8WX77d3Ci4SmpRHfC9KS05MzwgA7fP5SFLYXK7DenZyXMIIXbpm8D7 HK/NyqDEb4c12j49dYITOdlv3QrzdNEBnpuTWGFWErhhDqUpnjwmwLMxNqjcsiyqwcQB ncpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=0AjvwOzgkOeKy+xUCr238R6H47emDJFeLraug2F04rE=; b=dEdDeykhxvjS0m8fYdd+KbZCMdcBns/CYO9S1Za2rdpkQWo6BTa9wprpooBK4T0LiV /gjOwfL4yMgXND4jw4EA1DG3rbDTypWVin83s+72n4x0pXHTmfXuT0WV2CBgB/d85wKt sgLyuIua8E+GdXK7jFJ2nGFqe6qSm9kL/Yc0A6H5gBCeeLpV1lIT64xdoZOpPFgwC8KS 1zMbTmGG8OIsJHW626TRZt2cLFFNSjJzZO2EKHhqRZwe0PKJkofU7knEEo5nyfkw1t2n lG8lvUmng212id0NfyHlvu//rAyoHjcau6meGlIB0XOcu3W0CapJa/l+O3JVpVUnCd/a Sgbw== X-Gm-Message-State: AD7BkJKxftpwFs1nSC3eQQ6CZTezAdTXD7DMqXYlEHwwbObCySJFefeX5wnwtjEdH9Hai7DNFDzpzk0svs+OXw== X-Received: by 10.60.60.3 with SMTP id d3mr6190775oer.24.1458224791828; Thu, 17 Mar 2016 07:26:31 -0700 (PDT) Original-Received: by 10.202.172.198 with HTTP; Thu, 17 Mar 2016 07:25:51 -0700 (PDT) In-Reply-To: <87r3f98agb.fsf@web.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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:114995 Archived-At: --089e013a04a8b84fbe052e3f6a3b Content-Type: text/plain; charset=UTF-8 Hi Michael, I believe that the bug was already there but I can try fixing it (below patch is my first attempt). This bug got revealed because when you do "C-s C-w M-%", the space-before argument is set to t for the isearch--describe-regexp-mode. The let-bound var description value was staying nil as both search-default-mode and regexp-function are nil. The bug probably did not reveal earlier because we had search-default-mode set to a non-nil value by default. The error simply tells that (replace-regexp-in-string "\\(.*\\) \\'" " \\1" description) is seeing description as a non-string value (nil). Below patch sets the default case for the cond (which we should technically anyways be doing). By default the description var is set to an empty string "" instead of nil. As description is anyways supposed to be a string, I think that this patch should not hurt. I would let you and others evaluate this proposed fix. diff --git a/lisp/isearch.el b/lisp/isearch.el index 988503e..9b8a0f0 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2594,7 +2594,8 @@ isearch--describe-regexp-mode (isearch-regexp "regexp ") ;; 4. And finally, if we're in literal mode (and if the ;; default mode is also not literal), describe it. - ((functionp search-default-mode) "literal ")))) + ((functionp search-default-mode) "literal ") + (t "")))) (if space-before ;; Move space from the end to the beginning. (replace-regexp-in-string "\\(.*\\) \\'" " \\1" description) --089e013a04a8b84fbe052e3f6a3b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Michael,

I believe that the bug wa= s already there but I can try fixing it (below patch is my first attempt).= =C2=A0

This bug got revealed because when you do "C-s C-w M-%", the spa= ce-before argument is set to t for the isearch--describe-regexp-mode.
=

The let-bou= nd var description value was staying nil as both search-default-mode and re= gexp-function are nil. The bug probably did not reveal earlier because we h= ad search-default-mode set to a non-nil value by default.

The error simply tell= s that=C2=A0

(replace-regexp-in-string "\\(.*\\) \\'" " \\1&qu= ot; description)

is seeing description as a non-string value (nil).

Below patch s= ets the default case for the cond (which we should technically anyways be d= oing). By default the description var is set to an empty string ""= ; instead of nil. As description is anyways supposed to be a string, I thin= k that this patch should not hurt.

I would let you and others evaluate this propo= sed fix.

diff --git a/lisp/isearch.el b/lisp/isearch.e= l
index 988503e..9b8a0f0 100644
--- a/lisp/isearch.el
= +++ b/lisp/isearch.el
@@ -2594,7 +2594,8 @@= isearch--describe-regexp-mode
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(isearch-regexp "regexp ")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; 4. And= finally, if we're in literal mode (and if the
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; =C2=A0 =C2=A0default mo= de is also not literal), describe it.
- =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ((functionp search-default-mo= de) "literal "))))
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0((functionp search-default-mode) "literal &quo= t;)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(t = ""))))
=C2=A0 =C2=A0 =C2=A0(if sp= ace-before
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0;; Move space from the end to the beginning.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(replace-regexp-in-string "\\(.= *\\) \\'" " \\1" description)

=

--089e013a04a8b84fbe052e3f6a3b--