unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>,
	23038@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
	Artur Malabarba <arturmalabarba@gmail.com>
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	[thread overview]
Message-ID: <CAFyQvY2ynb0bkV+ZtS4gJPTRy=qWAWXbZz1euQwb2Q4dcHXHug@mail.gmail.com> (raw)
In-Reply-To: <87r3f98agb.fsf@web.de>

[-- Attachment #1: Type: text/plain, Size: 1562 bytes --]

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)

[-- Attachment #2: Type: text/html, Size: 2832 bytes --]

  reply	other threads:[~2016-03-17 14:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17 14:07 bug#23038: 25.0.92; M-% from isearch broken (error in isearch--describe-regexp-mode) Michael Heerdegen
2016-03-17 14:25 ` Kaushal Modi [this message]
2016-03-18  3:53   ` Artur Malabarba
2016-03-18 14:58     ` Kaushal Modi
2016-03-18 15:08       ` Michael Heerdegen
2016-03-18 15:14         ` Kaushal Modi
2016-03-18 16:07         ` Stephen Berman
2016-03-18 16:15           ` Kaushal Modi
2016-03-18 16:29             ` Michael Heerdegen
2016-03-18 16:36               ` Michael Heerdegen
2016-03-18 16:39                 ` Kaushal Modi
2016-03-18 21:15                   ` Stephen Berman
2016-03-18 21:21                     ` Michael Heerdegen
2016-03-20 15:38                   ` Michael Heerdegen
2016-03-20 15:42                     ` Kaushal Modi
2016-03-20 23:47                       ` Michael Heerdegen
2016-03-21  0:09                         ` Michael Heerdegen
2016-03-21  0:25                           ` Kaushal Modi
2016-03-21  0:29                             ` Michael Heerdegen
2016-03-21  2:41                               ` Kaushal Modi
2016-03-22  0:14                             ` Michael Heerdegen
2016-03-22  0:38                               ` Kaushal Modi
2016-03-21 10:03                         ` Andreas Schwab

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAFyQvY2ynb0bkV+ZtS4gJPTRy=qWAWXbZz1euQwb2Q4dcHXHug@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=23038@debbugs.gnu.org \
    --cc=arturmalabarba@gmail.com \
    --cc=eliz@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).