* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area @ 2016-03-11 19:48 Kaushal Modi 2016-03-11 20:46 ` Kaushal Modi 0 siblings, 1 reply; 33+ messages in thread From: Kaushal Modi @ 2016-03-11 19:48 UTC (permalink / raw) To: 22991, arturmalabarba [-- Attachment #1: Type: text/plain, Size: 931 bytes --] Tested in the latest emacs-25 build as of today. emacs -Q C-u C-s The echo area will show "I-search:". Earlier it used to show "Regexp I-search:" and that made it clear that we are doing regexp search. This change happened after this revert: http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-25&id=b417c5a3b35bf31e66a170529c5aeb34cb3318d0 So it looks like that isearch-message-prefix was bound to search-default-mode being non-nil. I verified that "C-u C-s" shows "Regexp I-search:" fine in emacs 24.5. But that version did not have the search-default-mode. I believe that the clarity of regexp isearch being on/off is missing, especially when C-u C-s DOES do regexp search and still displays "I-search: " in the echo. If I set search-default-mode back to "#'character-fold-to-regexp", this issue is gone. So displaying of "Regexp I-search:" should be decoupled from the character-fold.el library. -- Kaushal Modi [-- Attachment #2: Type: text/html, Size: 1436 bytes --] ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-11 19:48 bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area Kaushal Modi @ 2016-03-11 20:46 ` Kaushal Modi 2016-03-11 20:54 ` Eli Zaretskii 0 siblings, 1 reply; 33+ messages in thread From: Kaushal Modi @ 2016-03-11 20:46 UTC (permalink / raw) To: 22991, Artur Malabarba [-- Attachment #1: Type: text/plain, Size: 1300 bytes --] Hi all, The below patch fixes this bug for me. I simply promoted the priority of isearch-regexp in that cond. I hope I am not overlooking something else by doing so. With that, now C-u C-s shows "Regexp I-search:" when the search of search-default-mode is either nil or character-fold-to-regexp. diff --git a/lisp/isearch.el b/lisp/isearch.el index b8ada2c..47dedfa 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2575,12 +2575,12 @@ isearch--describe-regexp-mode (setq regexp-function #'word-search-regexp)) (let ((description ;; Don't use a description on the default search mode. - (cond ((equal regexp-function search-default-mode) "") + (cond (isearch-regexp "regexp ") + ((equal regexp-function search-default-mode) "") (regexp-function (and (symbolp regexp-function) (or (get regexp-function 'isearch-message-prefix) ""))) - (isearch-regexp "regexp ") ;; We're in literal mode. If the default mode is not ;; literal, then describe it. ((functionp search-default-mode) "literal ")))) Apologies for earlier misunderstanding that this bug had to do with character-fold.el. -- Kaushal Modi [-- Attachment #2: Type: text/html, Size: 1942 bytes --] ^ permalink raw reply related [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-11 20:46 ` Kaushal Modi @ 2016-03-11 20:54 ` Eli Zaretskii 2016-03-11 20:58 ` Kaushal Modi 0 siblings, 1 reply; 33+ messages in thread From: Eli Zaretskii @ 2016-03-11 20:54 UTC (permalink / raw) To: Kaushal Modi; +Cc: arturmalabarba, 22991 > From: Kaushal Modi <kaushal.modi@gmail.com> > Date: Fri, 11 Mar 2016 15:46:29 -0500 > > The below patch fixes this bug for me. > > I simply promoted the priority of isearch-regexp in that cond. > > I hope I am not overlooking something else by doing so. > > With that, now C-u C-s shows "Regexp I-search:" when the search of > search-default-mode is either nil or character-fold-to-regexp. > > > diff --git a/lisp/isearch.el b/lisp/isearch.el > index b8ada2c..47dedfa 100644 > --- a/lisp/isearch.el > +++ b/lisp/isearch.el > @@ -2575,12 +2575,12 @@ isearch--describe-regexp-mode > (setq regexp-function #'word-search-regexp)) > (let ((description > ;; Don't use a description on the default search mode. > - (cond ((equal regexp-function search-default-mode) "") > + (cond (isearch-regexp "regexp ") > + ((equal regexp-function search-default-mode) "") > (regexp-function > (and (symbolp regexp-function) > (or (get regexp-function 'isearch-message-prefix) > ""))) > - (isearch-regexp "regexp ") > ;; We're in literal mode. If the default mode is not > ;; literal, then describe it. > ((functionp search-default-mode) "literal ")))) What if search-default-mode is t, i.e. the default is regexp search? Thanks. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-11 20:54 ` Eli Zaretskii @ 2016-03-11 20:58 ` Kaushal Modi 2016-03-11 21:08 ` Eli Zaretskii 0 siblings, 1 reply; 33+ messages in thread From: Kaushal Modi @ 2016-03-11 20:58 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Artur Malabarba, 22991 [-- Attachment #1: Type: text/plain, Size: 341 bytes --] On Fri, Mar 11, 2016 at 3:54 PM, Eli Zaretskii <eliz@gnu.org> wrote: > What if search-default-mode is t, i.e. the default is regexp search? It works fine in that case too (with this patch). When search-default-mode is set to t, doing just C-s will now begin regexp isearch showing "Regexp I-search:" in the minibuffer. -- Kaushal Modi [-- Attachment #2: Type: text/html, Size: 791 bytes --] ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-11 20:58 ` Kaushal Modi @ 2016-03-11 21:08 ` Eli Zaretskii 2016-03-11 21:22 ` Kaushal Modi 2016-03-11 23:37 ` Michael Heerdegen 0 siblings, 2 replies; 33+ messages in thread From: Eli Zaretskii @ 2016-03-11 21:08 UTC (permalink / raw) To: Kaushal Modi; +Cc: arturmalabarba, 22991 > From: Kaushal Modi <kaushal.modi@gmail.com> > Date: Fri, 11 Mar 2016 15:58:20 -0500 > Cc: 22991@debbugs.gnu.org, Artur Malabarba <arturmalabarba@gmail.com> > > What if search-default-mode is t, i.e. the default is regexp search? > > It works fine in that case too (with this patch). > > When search-default-mode is set to t, doing just C-s will now begin regexp isearch showing "Regexp > I-search:" in the minibuffer. Which I think is wrong, since the default mode shouldn't show anything except "I-search: ". Right? ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-11 21:08 ` Eli Zaretskii @ 2016-03-11 21:22 ` Kaushal Modi 2016-03-11 22:22 ` Artur Malabarba 2016-03-11 23:37 ` Michael Heerdegen 1 sibling, 1 reply; 33+ messages in thread From: Kaushal Modi @ 2016-03-11 21:22 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Artur Malabarba, 22991 [-- Attachment #1: Type: text/plain, Size: 2329 bytes --] > Which I think is wrong, since the default mode shouldn't show anything > except "I-search: ". Right? Even before this patch, that behavior (Displaying "Regexp I-search:" on C-s even when search-default-mode is t) was that way. Because, even when search-default-mode is t, regexp-function still stays nil. So that first cond form condition evals to nil. But I discovered a major issue with my patch. So here's a new one which is less intrusive. I also added explanation for the current priority order in the cond. diff --git a/lisp/isearch.el b/lisp/isearch.el index b8ada2c..7c3d4e3 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2574,16 +2574,23 @@ isearch--describe-regexp-mode (when (eq regexp-function t) (setq regexp-function #'word-search-regexp)) (let ((description - ;; Don't use a description on the default search mode. - (cond ((equal regexp-function search-default-mode) "") - (regexp-function - (and (symbolp regexp-function) - (or (get regexp-function 'isearch-message-prefix) - ""))) - (isearch-regexp "regexp ") - ;; We're in literal mode. If the default mode is not - ;; literal, then describe it. - ((functionp search-default-mode) "literal ")))) + (cond + ;; 1. Don't use a description on the default search mode, + ;; only if the default search mode is non-nil. + ((and search-default-mode + (equal regexp-function search-default-mode)) "") + ;; 2. Use the `isearch-message-prefix' set for + ;; `regexp-function' if available. + (regexp-function + (and (symbolp regexp-function) + (or (get regexp-function 'isearch-message-prefix) + ""))) + ;; 3. Else if `isearch-regexp' is non-nil, set description + ;; to "regexp ". + (isearch-regexp "regexp ") + ;; 4. And finally, if we're in literal mode (AND if default + ;; mode is not literal too), then describe it. + ((functionp search-default-mode) "literal ")))) (if space-before ;; Move space from the end to the beginning. (replace-regexp-in-string "\\(.*\\) \\'" " \\1" description) [-- Attachment #2: Type: text/html, Size: 3209 bytes --] ^ permalink raw reply related [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-11 21:22 ` Kaushal Modi @ 2016-03-11 22:22 ` Artur Malabarba 2016-03-11 22:36 ` Kaushal Modi 0 siblings, 1 reply; 33+ messages in thread From: Artur Malabarba @ 2016-03-11 22:22 UTC (permalink / raw) To: Kaushal; +Cc: 22991 [-- Attachment #1: Type: text/plain, Size: 655 bytes --] On 11 Mar 2016 6:23 pm, "Kaushal Modi" <kaushal.modi@gmail.com> wrote: > > > Which I think is wrong, since the default mode shouldn't show anything > > except "I-search: ". Right? > Even before this patch, that behavior (Displaying "Regexp I-search:" on C-s even when search-default-mode is t) was that way. Because, even when search-default-mode is t, regexp-function still stays nil. So that first cond form condition evals to nil. > > But I discovered a major issue with my patch. So here's a new one which is less intrusive. I also added explanation for the current priority order in the cond. This last patch looks fine to me. 👍 [-- Attachment #2: Type: text/html, Size: 830 bytes --] ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-11 22:22 ` Artur Malabarba @ 2016-03-11 22:36 ` Kaushal Modi 0 siblings, 0 replies; 33+ messages in thread From: Kaushal Modi @ 2016-03-11 22:36 UTC (permalink / raw) To: Artur Malabarba; +Cc: 22991 [-- Attachment #1: Type: text/plain, Size: 3009 bytes --] On Fri, Mar 11, 2016 at 5:22 PM, Artur Malabarba <bruce.connor.am@gmail.com> wrote: > This last patch looks fine to me. 👍 > Thanks. Here's one more shot with fix for that bug that was already there that Eli mentioned. Now if the user has set search-default-mode to t and if they do C-s, the description is still "" (not "regexp "). So the minibuffer would read "I-search: ". Below is the patch created using git format-patch with appropriate commit log. From df1a6e8e9d8227f5c137236a09fda9818c479d0c Mon Sep 17 00:00:00 2001 From: Kaushal Modi <kaushal.modi@gmail.com> Date: Fri, 11 Mar 2016 17:34:50 -0500 Subject: [PATCH] Fix description for regexp searches (bug 22991) * lisp/isearch.el (isearch--describe-regexp-mode): With `search-default-mode' set to nil, if user does C-u C-s, the minibuffer now displays "Regexp I-search: ". But if the user has set `search-default-mode' to t, and then does C-s, the minibuffer now displays "I-search: " because the default search mode is now regexp mode. Comments have been added to explain the priority of conditions in the `cond' form. --- lisp/isearch.el | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index b8ada2c..646a906 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2574,15 +2574,26 @@ isearch--describe-regexp-mode (when (eq regexp-function t) (setq regexp-function #'word-search-regexp)) (let ((description - ;; Don't use a description on the default search mode. - (cond ((equal regexp-function search-default-mode) "") + (cond + ;; 1. Do not use a description on the default search mode, + ;; but only if the default search mode is non-nil. + ((or (and search-default-mode + (equal search-default-mode regexp-function)) + ;; Special case where `search-default-mode' is t + ;; (defaults to regexp searches). + (and (eq search-default-mode t) + (eq search-default-mode isearch-regexp))) "") + ;; 2. Use the `isearch-message-prefix' set for + ;; `regexp-function' if available. (regexp-function (and (symbolp regexp-function) (or (get regexp-function 'isearch-message-prefix) ""))) + ;; 3. Else if `isearch-regexp' is non-nil, set description + ;; to "regexp ". (isearch-regexp "regexp ") - ;; We're in literal mode. If the default mode is not - ;; literal, then describe it. + ;; 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 ")))) (if space-before ;; Move space from the end to the beginning. -- 2.6.0.rc0.24.gec371ff -- Kaushal Modi [-- Attachment #2: Type: text/html, Size: 5652 bytes --] ^ permalink raw reply related [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-11 21:08 ` Eli Zaretskii 2016-03-11 21:22 ` Kaushal Modi @ 2016-03-11 23:37 ` Michael Heerdegen 2016-03-11 23:40 ` Kaushal Modi 2016-03-12 7:29 ` Eli Zaretskii 1 sibling, 2 replies; 33+ messages in thread From: Michael Heerdegen @ 2016-03-11 23:37 UTC (permalink / raw) To: Eli Zaretskii; +Cc: arturmalabarba, 22991, Kaushal Modi Eli Zaretskii <eliz@gnu.org> writes: > Which I think is wrong, since the default mode shouldn't show anything > except "I-search: ". Right? I'm not so sure. I use different defaults in different modes for convenience (symbol search in programming modes, word search in Info, literal search in the rest), and I would soon get confused if the default mode would not be indicated, especially if I change to a different mode and back again etc. Michael. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-11 23:37 ` Michael Heerdegen @ 2016-03-11 23:40 ` Kaushal Modi 2016-03-12 1:11 ` Artur Malabarba 2016-03-12 7:30 ` Eli Zaretskii 2016-03-12 7:29 ` Eli Zaretskii 1 sibling, 2 replies; 33+ messages in thread From: Kaushal Modi @ 2016-03-11 23:40 UTC (permalink / raw) To: Michael Heerdegen; +Cc: arturmalabarba@gmail.com, 22991@debbugs.gnu.org [-- Attachment #1: Type: text/plain, Size: 757 bytes --] In that case, we will have to figure out why this condition was put as a high priority to begin with. (cond ((equal regexp-function search-default-mode) "") On Friday, March 11, 2016, Michael Heerdegen <michael_heerdegen@web.de> wrote: > Eli Zaretskii <eliz@gnu.org <javascript:;>> writes: > > > Which I think is wrong, since the default mode shouldn't show anything > > except "I-search: ". Right? > > I'm not so sure. I use different defaults in different modes for > convenience (symbol search in programming modes, word search in Info, > literal search in the rest), and I would soon get confused if the > default mode would not be indicated, especially if I change to a > different mode and back again etc. > > > Michael. > -- -- Kaushal Modi [-- Attachment #2: Type: text/html, Size: 1247 bytes --] ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-11 23:40 ` Kaushal Modi @ 2016-03-12 1:11 ` Artur Malabarba 2016-03-12 4:56 ` Kaushal Modi 2016-03-12 7:30 ` Eli Zaretskii 1 sibling, 1 reply; 33+ messages in thread From: Artur Malabarba @ 2016-03-12 1:11 UTC (permalink / raw) To: Kaushal; +Cc: Michael Heerdegen, 22991 [-- Attachment #1: Type: text/plain, Size: 395 bytes --] On 11 Mar 2016 8:40 pm, "Kaushal Modi" <kaushal.modi@gmail.com> wrote: > > In that case, we will have to figure out why this condition was put as a high priority to begin with. > > (cond ((equal regexp-function search-default-mode) "") > Because, since char-folding was turned on by default, some people said it was odd that the stock search said "Isearch char fold" instead of just "Isearch". [-- Attachment #2: Type: text/html, Size: 569 bytes --] ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-12 1:11 ` Artur Malabarba @ 2016-03-12 4:56 ` Kaushal Modi 2016-03-12 7:49 ` Eli Zaretskii [not found] ` <<83h9gcgmor.fsf@gnu.org> 0 siblings, 2 replies; 33+ messages in thread From: Kaushal Modi @ 2016-03-12 4:56 UTC (permalink / raw) To: Bruce Connor; +Cc: Michael Heerdegen, 22991 [-- Attachment #1: Type: text/plain, Size: 561 bytes --] Sorry, I just remembered that I was one of the people (or the only one?) who suggested not displaying "Char-fold" prefix. But considering the example that Michael gave, it makes sense to remove that condition from the cond form. I would actually like to see "Regexp I-search:" even if I have set that by default. The result will be a less complex cond statement (will get rid of that "oring of ands" case in my last patch) and clarity as to what's the current isearch mode. What do you guys think? Or should we bring this up on emacs-devel? -- Kaushal Modi [-- Attachment #2: Type: text/html, Size: 683 bytes --] ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-12 4:56 ` Kaushal Modi @ 2016-03-12 7:49 ` Eli Zaretskii 2016-03-12 12:33 ` Michael Heerdegen [not found] ` <<83h9gcgmor.fsf@gnu.org> 1 sibling, 1 reply; 33+ messages in thread From: Eli Zaretskii @ 2016-03-12 7:49 UTC (permalink / raw) To: Kaushal Modi; +Cc: michael_heerdegen, 22991, bruce.connor.am > Date: Fri, 11 Mar 2016 23:56:56 -0500 > From: Kaushal Modi <kaushal.modi@gmail.com> > Cc: 22991@debbugs.gnu.org, Michael Heerdegen <michael_heerdegen@web.de>, > Eli Zaretskii <eliz@gnu.org> > > Sorry, I just remembered that I was one of the people (or the only one?) who suggested not displaying > "Char-fold" prefix. > > But considering the example that Michael gave, it makes sense to remove that condition from the cond form. I > would actually like to see "Regexp I-search:" even if I have set that by default. > > The result will be a less complex cond statement (will get rid of that "oring of ands" case in my last patch) and > clarity as to what's the current isearch mode. > > What do you guys think? Or should we bring this up on emacs-devel? First, such a change would be a change in behavior, so it should go to master, not emacs-25. Second, I don't agree with Michael, so if we want to allow such a different behavior, I will insist on a user option. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-12 7:49 ` Eli Zaretskii @ 2016-03-12 12:33 ` Michael Heerdegen 2016-03-12 12:46 ` Eli Zaretskii 0 siblings, 1 reply; 33+ messages in thread From: Michael Heerdegen @ 2016-03-12 12:33 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 22991, bruce.connor.am, Kaushal Modi Eli Zaretskii <eliz@gnu.org> writes: > Second, I don't agree with Michael, so if we want to allow such a > different behavior, I will insist on a user option. I mean especially, if I end up with the default mode and the literal search mode both show the same prompt, that would not be good. But yes, what I really would like would be to always show the searching mode in the prompt. This is not what you want, obviously. Would it make sense to you to decide what to show in the prompt based on the fact whether `search-default-mode' has a buffer local binding - instead of introducing a new option (which seems a bit of overkill to me)? I.e., if there is a buffer local binding that differs from the global value, do what I want - else, do what you prefer. Michael. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-12 12:33 ` Michael Heerdegen @ 2016-03-12 12:46 ` Eli Zaretskii 2016-03-12 12:51 ` Michael Heerdegen 0 siblings, 1 reply; 33+ messages in thread From: Eli Zaretskii @ 2016-03-12 12:46 UTC (permalink / raw) To: Michael Heerdegen; +Cc: 22991, bruce.connor.am, kaushal.modi > From: Michael Heerdegen <michael_heerdegen@web.de> > Cc: Kaushal Modi <kaushal.modi@gmail.com>, 22991@debbugs.gnu.org, bruce.connor.am@gmail.com > Date: Sat, 12 Mar 2016 13:33:09 +0100 > > Eli Zaretskii <eliz@gnu.org> writes: > > > Second, I don't agree with Michael, so if we want to allow such a > > different behavior, I will insist on a user option. > > I mean especially, if I end up with the default mode and the literal > search mode both show the same prompt, that would not be good. This could only happen if the literal search is the default. If the default is different, a literal search should show some non-empty prefix. > Would it make sense to you to decide what to show in the prompt based on > the fact whether `search-default-mode' has a buffer local binding - > instead of introducing a new option (which seems a bit of overkill to > me)? I.e., if there is a buffer local binding that differs from the > global value, do what I want - else, do what you prefer. I'm not sure I understand how the fact of the binding being local has any relevance to what we show in the prompt. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-12 12:46 ` Eli Zaretskii @ 2016-03-12 12:51 ` Michael Heerdegen 2016-03-12 13:52 ` Artur Malabarba 2016-03-12 16:13 ` Eli Zaretskii 0 siblings, 2 replies; 33+ messages in thread From: Michael Heerdegen @ 2016-03-12 12:51 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 22991, bruce.connor.am, kaushal.modi Eli Zaretskii <eliz@gnu.org> writes: > I'm not sure I understand how the fact of the binding being local has > any relevance to what we show in the prompt. If the default is different in different buffers, the user more likely wants to see the mode in the prompt. So, my suggestion is to show the default in the prompt only when it is not the default default... Michael. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-12 12:51 ` Michael Heerdegen @ 2016-03-12 13:52 ` Artur Malabarba 2016-03-12 14:35 ` Kaushal Modi 2016-03-12 16:13 ` Eli Zaretskii 1 sibling, 1 reply; 33+ messages in thread From: Artur Malabarba @ 2016-03-12 13:52 UTC (permalink / raw) To: Michael Heerdegen; +Cc: 22991, Kaushal [-- Attachment #1: Type: text/plain, Size: 795 bytes --] On 12 Mar 2016 9:51 am, "Michael Heerdegen" <michael_heerdegen@web.de> wrote: > > Eli Zaretskii <eliz@gnu.org> writes: > > > I'm not sure I understand how the fact of the binding being local has > > any relevance to what we show in the prompt. > > If the default is different in different buffers, the user more likely > wants to see the mode in the prompt. So, my suggestion is to show the > default in the prompt only when it is not the default default... > > > Michael. I agree with Michael on this. If the current search-mode is different from the global default, then it should be displayed on the prompt. That could happen if the user switched the mode during a search, or if something changed the variable's buffer-local value. I don't want to add a user option just for this. Cheers [-- Attachment #2: Type: text/html, Size: 1090 bytes --] ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-12 13:52 ` Artur Malabarba @ 2016-03-12 14:35 ` Kaushal Modi 0 siblings, 0 replies; 33+ messages in thread From: Kaushal Modi @ 2016-03-12 14:35 UTC (permalink / raw) To: Bruce Connor; +Cc: Michael Heerdegen, 22991 [-- Attachment #1: Type: text/plain, Size: 490 bytes --] I also think that adding an option just for this is an overkill. It makes sense that removing that cond right now would be a big behavior change and should not be done in emacs-25. Can you guys please review and push the last patch I sent? Below are the 2 fixes: 1. Now C-u C-s shows the Regexp description if the search-default-mode is nil. 2. If regexp search is default, C-s does not show the Regexp description. Let's continue this discussion in emacs-dev. Thanks. -- Kaushal Modi [-- Attachment #2: Type: text/html, Size: 610 bytes --] ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-12 12:51 ` Michael Heerdegen 2016-03-12 13:52 ` Artur Malabarba @ 2016-03-12 16:13 ` Eli Zaretskii 1 sibling, 0 replies; 33+ messages in thread From: Eli Zaretskii @ 2016-03-12 16:13 UTC (permalink / raw) To: Michael Heerdegen; +Cc: 22991, bruce.connor.am, kaushal.modi > From: Michael Heerdegen <michael_heerdegen@web.de> > Cc: kaushal.modi@gmail.com, 22991@debbugs.gnu.org, bruce.connor.am@gmail.com > Date: Sat, 12 Mar 2016 13:51:42 +0100 > > If the default is different in different buffers, the user more likely > wants to see the mode in the prompt. So, my suggestion is to show the > default in the prompt only when it is not the default default... Do many users define buffer-local defaults for isearch? IOW, will such a logic be useful enough to justify its existence? If yes, I don't mind. ^ permalink raw reply [flat|nested] 33+ messages in thread
[parent not found: <<83h9gcgmor.fsf@gnu.org>]
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area [not found] ` <<83h9gcgmor.fsf@gnu.org> @ 2016-03-12 15:14 ` Drew Adams 2016-03-12 16:25 ` Drew Adams 2016-03-12 22:40 ` Juri Linkov 0 siblings, 2 replies; 33+ messages in thread From: Drew Adams @ 2016-03-12 15:14 UTC (permalink / raw) To: Eli Zaretskii, Kaushal Modi; +Cc: michael_heerdegen, 22991, bruce.connor.am > > Sorry, I just remembered that I was one of the people (or the only one?) > > who suggested not displaying "Char-fold" prefix. > > > > But considering the example that Michael gave, it makes sense to remove > > that condition from the cond form. I would actually like to see > > "Regexp I-search:" even if I have set that by default. > > > > The result will be a less complex cond statement (will get rid of that > > "oring of ands" case in my last patch) and clarity as to what's the > > current isearch mode. > > > > What do you guys think? Or should we bring this up on emacs-devel? > > First, such a change would be a change in behavior, so it should go to > master, not emacs-25. > > Second, I don't agree with Michael, so if we want to allow such a > different behavior, I will insist on a user option. 1. I agree with Michael in this case. The prompt should faithfully reflect the current search state/mode - until we find a better way to convey that information. In any case, the prompt should not mislead by reflecting a different search behavior from what is current. 2. Whether this or that behavior is turned on by default should not override that rule that the prompt tells you what the state is. 3. To be more clear, perhaps the non-regexp, non-fold search (including not folding whitespace) should also have a prompt that unambiguously indicates this. It is essentially "literal" search. 4. All of that said, I think that we really need to find some _other way than the prompt_ to indicate, completely, the search state. And then the prompt can perhaps just be something like "Isearch" in all cases. The prompt is not adequate for conveying just what the current search state is. 5. This should be discussed on emacs-devel (again). 6. While waiting for a redesign in this regard and a general decision, the prompt should reflect the default state. If it is super important that beginning users not be frightened by a weird prompt by default, at the outset, then we should turn off char-fold search by default - for now. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-12 15:14 ` Drew Adams @ 2016-03-12 16:25 ` Drew Adams 2016-03-12 22:40 ` Juri Linkov 1 sibling, 0 replies; 33+ messages in thread From: Drew Adams @ 2016-03-12 16:25 UTC (permalink / raw) To: Eli Zaretskii, Kaushal Modi; +Cc: michael_heerdegen, 22991, bruce.connor.am > 4. All of that said, I think that we really need to find > some _other way than the prompt_ to indicate, completely, > the search state. And then the prompt can perhaps just be > something like "Isearch" in all cases. The prompt is not > adequate for conveying just what the current search state is. Something that I think should be available, starting now, is an Isearch key binding that describes the current search state _completely_, much as `C-u C-x =' describes the char at point. This state information should be on prefix key `C-h'. It could be on a new key on that prefix or it could simply be added to `isearch-describe-mode' - the key could be `C-h m'. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-12 15:14 ` Drew Adams 2016-03-12 16:25 ` Drew Adams @ 2016-03-12 22:40 ` Juri Linkov 2016-03-12 23:11 ` Drew Adams 1 sibling, 1 reply; 33+ messages in thread From: Juri Linkov @ 2016-03-12 22:40 UTC (permalink / raw) To: Drew Adams; +Cc: michael_heerdegen, 22991, bruce.connor.am, Kaushal Modi > 1. I agree with Michael in this case. The prompt should > faithfully reflect the current search state/mode - until we > find a better way to convey that information. In any case, > the prompt should not mislead by reflecting a different > search behavior from what is current. Reflecting all current search states might produce overly long default prompts as Character-folding case-folding whitespace-folding I-search: >> 4. All of that said, I think that we really need to find >> some _other way than the prompt_ to indicate, completely, >> the search state. And then the prompt can perhaps just be >> something like "Isearch" in all cases. The prompt is not >> adequate for conveying just what the current search state is. > > Something that I think should be available, starting now, is > an Isearch key binding that describes the current search state > _completely_, much as `C-u C-x =' describes the char at point. > > This state information should be on prefix key `C-h'. It > could be on a new key on that prefix or it could simply be > added to `isearch-describe-mode' - the key could be `C-h m'. Or an option/state (say, ‘isearch-message-verbose’) toggleable with ‘isearch-toggle-message-verbose’ like other states (e.g. ‘isearch-toggle-case-fold’) that will toggle between displaying full/brief state description in the prompt. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-12 22:40 ` Juri Linkov @ 2016-03-12 23:11 ` Drew Adams 2016-03-13 23:40 ` Juri Linkov 0 siblings, 1 reply; 33+ messages in thread From: Drew Adams @ 2016-03-12 23:11 UTC (permalink / raw) To: Juri Linkov; +Cc: michael_heerdegen, 22991, bruce.connor.am, Kaushal Modi > > 1. I agree with Michael in this case. The prompt should > > faithfully reflect the current search state/mode - until we > > find a better way to convey that information. In any case, > > the prompt should not mislead by reflecting a different > > search behavior from what is current. > > Reflecting all current search states might produce overly long > default prompts as > > Character-folding case-folding whitespace-folding I-search: Precisely. The prompt is not the place for such information. It might have sufficed when we had only regexp and literal. But even then it did not express that state of case-folding. And when "lax" whitespace matching was introduced it already led to less clarity. > >> 4. All of that said, I think that we really need to find > >> some _other way than the prompt_ to indicate, completely, > >> the search state. And then the prompt can perhaps just be > >> something like "Isearch" in all cases. The prompt is not > >> adequate for conveying just what the current search state is. > > > > Something that I think should be available, starting now, is > > an Isearch key binding that describes the current search state > > _completely_, much as `C-u C-x =' describes the char at point. > > > > This state information should be on prefix key `C-h'. It > > could be on a new key on that prefix or it could simply be > > added to `isearch-describe-mode' - the key could be `C-h m'. > > Or an option/state (say, ‘isearch-message-verbose’) toggleable > with ‘isearch-toggle-message-verbose’ like other states > (e.g. ‘isearch-toggle-case-fold’) that will toggle between > displaying full/brief state description in the prompt. No. The point is that the prompt is inadequate for showing search state/mode. A more general discussion, and perhaps more imagination, is needed to find one or more good solutions. There was some discussion on emacs-devel already, including suggestions about the mode-line and others, but nothing was decided, and probably there are better suggestions to be invented yet. In the meantime, I suggest we anyway provide complete such information on a help key. This "solution" can remain, regardless of whatother designs might be adopted to provide some such info all of the time (instead of just on demand). IOW, add the complete info to a help command now, in any case. For the rest, open another discussion on emacs-devel. Wrt this bug and the prompt, for now: Either drop any indication of state in the prompt (which might confuse people) or show only what we showed before (regexp vs literal), ignoring indicating char folding, case folding, and whitespace folding. Char folding, in particular, has introduced complication in the traditional Isearch UI. Indicating the current state is just one such complication. Char folding is an area still in the process of definition, which means that it is anyway likely that its effects on the UI are not ready to be understood completely or decided now. So let's be conservative wrt prompt changes etc., for now. Just one opinion. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-12 23:11 ` Drew Adams @ 2016-03-13 23:40 ` Juri Linkov 2016-03-14 0:03 ` Drew Adams 2016-03-14 3:39 ` Eli Zaretskii 0 siblings, 2 replies; 33+ messages in thread From: Juri Linkov @ 2016-03-13 23:40 UTC (permalink / raw) To: Drew Adams; +Cc: michael_heerdegen, 22991, bruce.connor.am, Kaushal Modi > In the meantime, I suggest we anyway provide complete such > information on a help key. This "solution" can remain, > regardless of whatother designs might be adopted to provide > some such info all of the time (instead of just on demand). You mean displaying this information in the *Help* buffer like ‘?’ in query-replace does? > Wrt this bug and the prompt, for now: Either drop any > indication of state in the prompt (which might confuse > people) or show only what we showed before (regexp vs > literal), ignoring indicating char folding, case folding, > and whitespace folding. Right, let's keep the status quo for now, and display only regexp-function statuses in the prompt. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-13 23:40 ` Juri Linkov @ 2016-03-14 0:03 ` Drew Adams 2016-03-14 3:39 ` Eli Zaretskii 1 sibling, 0 replies; 33+ messages in thread From: Drew Adams @ 2016-03-14 0:03 UTC (permalink / raw) To: Juri Linkov; +Cc: michael_heerdegen, 22991, bruce.connor.am, Kaushal Modi > > In the meantime, I suggest we anyway provide complete such > > information on a help key. This "solution" can remain, > > regardless of whatother designs might be adopted to provide > > some such info all of the time (instead of just on demand). > > You mean displaying this information in the *Help* buffer > like ‘?’ in query-replace does? I mean provide it on some help key during Isearch. It could be a new key, just for such state/mode status. Or it could added to the mode help, `C-h m'. Unless it were added to the top of the `C-h m' output, I think probably a separate help key (and separate *Help* content) would be better, so users can easily see all of the state info without scrolling the help window etc. It is important to provide a succinct summary in a few lines, and then follow that by any additional detailed info that might be helpful. Such additional info could give details about the behavior of the different modes, as well as info about how to change among them. Yes, some of that info might repeat some of what is in the `C-h m' output, but that's OK. Another possibility might be to add this info to the regular `C-h m' output, but have a new help key that takes you directly to the part of that output that shows the current modes and explains the possibile modes, i.e., scrolls to that part. That would have the advantage of providing this info in the context of isearch help in general. You might have other ideas about this. My point is mainly that we should provide the info on demand, via a help key, and we should do that now (for Emacs 25.1). The form and details are less important. > > Wrt this bug and the prompt, for now: Either drop any > > indication of state in the prompt (which might confuse > > people) or show only what we showed before (regexp vs > > literal), ignoring indicating char folding, case folding, > > and whitespace folding. > > Right, let's keep the status quo for now, and display > only regexp-function statuses in the prompt. Thank you. But I do think that we should also add the state/mode info to a help key _now_. That info is missing for users, and we are now complicating the possible states by adding char folding. Adding such *Help* info should not be difficult. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-13 23:40 ` Juri Linkov 2016-03-14 0:03 ` Drew Adams @ 2016-03-14 3:39 ` Eli Zaretskii 2016-03-14 13:50 ` Kaushal Modi 1 sibling, 1 reply; 33+ messages in thread From: Eli Zaretskii @ 2016-03-14 3:39 UTC (permalink / raw) To: Juri Linkov; +Cc: michael_heerdegen, 22991, bruce.connor.am, kaushal.modi > From: Juri Linkov <juri@linkov.net> > Cc: Eli Zaretskii <eliz@gnu.org>, Kaushal Modi <kaushal.modi@gmail.com>, michael_heerdegen@web.de, 22991@debbugs.gnu.org, bruce.connor.am@gmail.com > Date: Mon, 14 Mar 2016 01:40:55 +0200 > > > Wrt this bug and the prompt, for now: Either drop any > > indication of state in the prompt (which might confuse > > people) or show only what we showed before (regexp vs > > literal), ignoring indicating char folding, case folding, > > and whitespace folding. > > Right, let's keep the status quo for now, and display > only regexp-function statuses in the prompt. But what is the status quo? This is a discussion of a bug report, remember? Are you saying we should leave the bug in place? ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-14 3:39 ` Eli Zaretskii @ 2016-03-14 13:50 ` Kaushal Modi 2016-03-14 15:29 ` Drew Adams 2016-03-14 16:29 ` Artur Malabarba 0 siblings, 2 replies; 33+ messages in thread From: Kaushal Modi @ 2016-03-14 13:50 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Michael Heerdegen, 22991, Artur Malabarba, Juri Linkov [-- Attachment #1: Type: text/plain, Size: 836 bytes --] Looks like this discussion is going in loops. Summary: (1) I believe that the patch I have fixes the bug I reported and the one Eli pointed out. And it does so without bringing a drastic change to the way the description string is generated. (2) As for an extra binding that shows the complete list of all the active isearch modes, I agree with Drew that it can show a complete picture of what isearch is doing behind the scenes. @Drew: Can you please open it as a new bug report? (3) Put up a proposal with a patch ( probably at https://www.emacswiki.org/emacs/Proposals ) on how we should change the way the descriptions are shown right now. (4) Email emacs-devel that proposal and ask for opinions/corrections/improvements. (5) Based on the consensus, push the resultant code to master branch. So let's focus on step 1 for now :) [-- Attachment #2: Type: text/html, Size: 1262 bytes --] ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-14 13:50 ` Kaushal Modi @ 2016-03-14 15:29 ` Drew Adams 2016-03-14 16:29 ` Artur Malabarba 1 sibling, 0 replies; 33+ messages in thread From: Drew Adams @ 2016-03-14 15:29 UTC (permalink / raw) To: Kaushal Modi, Eli Zaretskii Cc: Michael Heerdegen, 22991, Artur Malabarba, Juri Linkov > (2) As for an extra binding that shows the complete list of all the active > isearch modes, I agree with Drew that it can show a complete picture of > what isearch is doing behind the scenes. @Drew: Can you please open it as > a new bug report? Done: #23010. (Please use plain text, not HTML text, for this list. Thx.) ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-14 13:50 ` Kaushal Modi 2016-03-14 15:29 ` Drew Adams @ 2016-03-14 16:29 ` Artur Malabarba 2016-03-14 18:17 ` Eli Zaretskii 1 sibling, 1 reply; 33+ messages in thread From: Artur Malabarba @ 2016-03-14 16:29 UTC (permalink / raw) To: Kaushal; +Cc: Michael Heerdegen, 22991, Juri Linkov [-- Attachment #1: Type: text/plain, Size: 443 bytes --] On 14 Mar 2016 10:50 am, "Kaushal Modi" <kaushal.modi@gmail.com> wrote: > > Looks like this discussion is going in loops. > > Summary: > > (1) I believe that the patch I have fixes the bug I reported and the one Eli pointed out. And it does so without bringing a drastic change to the way the description string is generated. I can't push for the time being, but I agree with the patch. Eli, if you agree with it too, could you push it? TIA [-- Attachment #2: Type: text/html, Size: 610 bytes --] ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-14 16:29 ` Artur Malabarba @ 2016-03-14 18:17 ` Eli Zaretskii 2016-03-14 18:32 ` Kaushal Modi 0 siblings, 1 reply; 33+ messages in thread From: Eli Zaretskii @ 2016-03-14 18:17 UTC (permalink / raw) To: bruce.connor.am; +Cc: 22991-done, Kaushal > Date: Mon, 14 Mar 2016 13:29:24 -0300 > From: Artur Malabarba <bruce.connor.am@gmail.com> > Cc: 22991@debbugs.gnu.org, Drew Adams <drew.adams@oracle.com>, > Michael Heerdegen <michael_heerdegen@web.de>, Juri Linkov <juri@linkov.net>, Eli Zaretskii <eliz@gnu.org> > > I can't push for the time being, but I agree with the patch. > > Eli, if you agree with it too, could you push it? Pushed. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-14 18:17 ` Eli Zaretskii @ 2016-03-14 18:32 ` Kaushal Modi 0 siblings, 0 replies; 33+ messages in thread From: Kaushal Modi @ 2016-03-14 18:32 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 22991-done, Artur Malabarba [-- Attachment #1: Type: text/plain, Size: 16 bytes --] Thank you guys! [-- Attachment #2: Type: text/html, Size: 68 bytes --] ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-11 23:40 ` Kaushal Modi 2016-03-12 1:11 ` Artur Malabarba @ 2016-03-12 7:30 ` Eli Zaretskii 1 sibling, 0 replies; 33+ messages in thread From: Eli Zaretskii @ 2016-03-12 7:30 UTC (permalink / raw) To: Kaushal Modi; +Cc: michael_heerdegen, arturmalabarba, 22991 > Date: Fri, 11 Mar 2016 18:40:23 -0500 > From: Kaushal Modi <kaushal.modi@gmail.com> > Cc: Eli Zaretskii <eliz@gnu.org>, "arturmalabarba@gmail.com" <arturmalabarba@gmail.com>, > "22991@debbugs.gnu.org" <22991@debbugs.gnu.org> > > In that case, we will have to figure out why this condition was put as a high priority to begin with. > > (cond ((equal regexp-function search-default-mode) "") Clearly, because the intent was not to produce any prefix for the default mode. ^ permalink raw reply [flat|nested] 33+ messages in thread
* bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area 2016-03-11 23:37 ` Michael Heerdegen 2016-03-11 23:40 ` Kaushal Modi @ 2016-03-12 7:29 ` Eli Zaretskii 1 sibling, 0 replies; 33+ messages in thread From: Eli Zaretskii @ 2016-03-12 7:29 UTC (permalink / raw) To: Michael Heerdegen; +Cc: arturmalabarba, 22991, kaushal.modi > From: Michael Heerdegen <michael_heerdegen@web.de> > Cc: Kaushal Modi <kaushal.modi@gmail.com>, arturmalabarba@gmail.com, 22991@debbugs.gnu.org > Date: Sat, 12 Mar 2016 00:37:41 +0100 > > Eli Zaretskii <eliz@gnu.org> writes: > > > Which I think is wrong, since the default mode shouldn't show anything > > except "I-search: ". Right? > > I'm not so sure. I use different defaults in different modes for > convenience (symbol search in programming modes, word search in Info, > literal search in the rest), and I would soon get confused if the > default mode would not be indicated, especially if I change to a > different mode and back again etc. Fair enough, but the code clearly wants to produce the behavior I hinted at. ^ permalink raw reply [flat|nested] 33+ messages in thread
end of thread, other threads:[~2016-03-14 18:32 UTC | newest] Thread overview: 33+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-03-11 19:48 bug#22991: 25.0.92: C-u C-s does not display "Regexp I-search:" in the echo area Kaushal Modi 2016-03-11 20:46 ` Kaushal Modi 2016-03-11 20:54 ` Eli Zaretskii 2016-03-11 20:58 ` Kaushal Modi 2016-03-11 21:08 ` Eli Zaretskii 2016-03-11 21:22 ` Kaushal Modi 2016-03-11 22:22 ` Artur Malabarba 2016-03-11 22:36 ` Kaushal Modi 2016-03-11 23:37 ` Michael Heerdegen 2016-03-11 23:40 ` Kaushal Modi 2016-03-12 1:11 ` Artur Malabarba 2016-03-12 4:56 ` Kaushal Modi 2016-03-12 7:49 ` Eli Zaretskii 2016-03-12 12:33 ` Michael Heerdegen 2016-03-12 12:46 ` Eli Zaretskii 2016-03-12 12:51 ` Michael Heerdegen 2016-03-12 13:52 ` Artur Malabarba 2016-03-12 14:35 ` Kaushal Modi 2016-03-12 16:13 ` Eli Zaretskii [not found] ` <<83h9gcgmor.fsf@gnu.org> 2016-03-12 15:14 ` Drew Adams 2016-03-12 16:25 ` Drew Adams 2016-03-12 22:40 ` Juri Linkov 2016-03-12 23:11 ` Drew Adams 2016-03-13 23:40 ` Juri Linkov 2016-03-14 0:03 ` Drew Adams 2016-03-14 3:39 ` Eli Zaretskii 2016-03-14 13:50 ` Kaushal Modi 2016-03-14 15:29 ` Drew Adams 2016-03-14 16:29 ` Artur Malabarba 2016-03-14 18:17 ` Eli Zaretskii 2016-03-14 18:32 ` Kaushal Modi 2016-03-12 7:30 ` Eli Zaretskii 2016-03-12 7:29 ` Eli Zaretskii
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).