GNU bug report logs - #36871
isearch-toggle-case-fold outside of isearch causes unexpected fontification

Previous Next

Package: emacs;

Reported by: "a_subscriber" <a_subscriber <at> mail.ru>

Date: Wed, 31 Jul 2019 08:03:03 UTC

Severity: minor

Tags: confirmed, fixed

Found in version 26.1

Fixed in version 27.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36871 in the body.
You can then email your comments to 36871 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Wed, 31 Jul 2019 08:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "a_subscriber" <a_subscriber <at> mail.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 31 Jul 2019 08:03:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "a_subscriber" <a_subscriber <at> mail.ru>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 26.1; I-search-toggle-csse-fold
Date: Wed, 31 Jul 2019 10:55:45 +0300
[Message part 1 (text/plain, inline)]
--text follows this line--

 

Windows 10:

Steps to reproduce:

 

1. emacs -Q

2. M-x I-search-toggle-case-fold

3. Region is selected

 

But I'm not select any region.

 

 

In GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)

of 2018-05-30 built on CIRROCUMULUS

Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea

Windowing system distributor 'Microsoft Corp.', version 10.0.17763

Recent messages:

Undo!

Quit

Mark set [5 times]

Undo!

Quit

Mark set [3 times]

Undo! [2 times]

Quit

Mark set

Undo!

 

Configured using:

'configure --without-dbus --host=x86_64-w64-mingw32

--without-compress-install 'CFLAGS=-O2 -static -g3''

 

Configured features:

XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB

TOOLKIT_SCROLL_BARS THREADS LCMS2

 

Important settings:

  value of $LANG: ENU

  locale-coding-system: cp1252

 

Major mode: Lisp Interaction

 

Minor modes in effect:

  recentf-mode: t

  projectile-mode: t

  global-magit-file-mode: t

  diff-auto-refine-mode: t

  magit-auto-revert-mode: t

  auto-revert-tail-mode: t

  global-git-commit-mode: t

  async-bytecomp-package-mode: t

  shell-dirtrack-mode: t

  openwith-mode: t

  ido-vertical-mode: t

  ido-ubiquitous-mode: t

  ido-everywhere: t

 delete-selection-mode: t

  cua-mode: t

  show-paren-mode: t

  global-hl-line-mode: t

  electric-pair-mode: t

  tooltip-mode: t

  global-eldoc-mode: t

  eldoc-mode: t

  electric-indent-mode: t

  mouse-wheel-mode: t

  menu-bar-mode: t

  file-name-shadow-mode: t

  global-font-lock-mode: t

  font-lock-mode: t

  blink-cursor-mode: t

  auto-composition-mode: t

  auto-encryption-mode: t

  auto-compression-mode: t

  column-number-mode: t

  line-number-mode: t

  transient-mark-mode: t

 

Load-path shadows:

None found.

 

Features:

(misearch multi-isearch shadow sort mail-extr emacsbug sendmail calc-map

calc-stat calc-vec calc-misc js sgml-mode dom imenu cc-mode cc-fonts

cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs

calc-menu calc-aent tramp-sh tramp tramp-compat tramp-loaddefs trampver

ucs-normalize org-table dired-x vc-git magit-bookmark bookmark pp

org-rmail org-mhe org-irc org-info org-gnus nnir gnus-sum gnus-group

gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc

nnoo parse-time gnus-spec gnus-int gnus-range gnus-win gnus nnheader

org-docview doc-view jka-compr image-mode org-bibtex bibtex org-bbdb

org-w3m org-element avl-tree generator org org-macro org-footnote

org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp

ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint

ob-core ob-eval org-compat org-macs org-loaddefs find-func cal-menu

calendar cal-loaddefs recentf tree-widget yafolding xah-find

visual-regexp uuid calc-comb calc-ext calc calc-loaddefs calc-macs cl

smart-mode-line-light-theme smart-mode-line rich-minority smex

restclient noutline outline projectile subr-x grep compile ibuf-ext

ibuffer ibuffer-loaddefs multiple-cursors mc-hide-unmatched-lines-mode

mc-separate-operations rectangular-region-mode mc-mark-pop mc-mark-more

mc-cycle-cursors mc-edit-lines magit-obsolete magit-blame magit-stash

magit-bisect magit-remote magit-commit magit-sequence magit-notes

magit-worktree magit-tag magit-merge magit-branch magit-reset

magit-collab ghub url-http tls gnutls url-gw nsm url-auth url url-proxy

url-privacy url-expand url-methods url-history url-cookie url-domsuf

url-util mailcap let-alist json map magit-files magit-refs magit-status

magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode

diff-mode magit-core magit-autorevert autorevert filenotify

magit-process magit-margin magit-mode git-commit magit-git magit-section

magit-utils crm magit-popup log-edit easy-mmode message rmc puny

format-spec rfc822 mml mml-sec epa derived epg gnus-util rmail

rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047

rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader pcvs-util

add-log with-editor cl-extra help-mode async-bytecomp async shell

pcomplete comint ansi-color server iedit iedit-lib multiple-cursors-core

advice rect popup openwith ido-vertical-mode ido-completing-read+

memoize s cus-edit wid-edit minibuf-eldef ido-at-point ido

highlight-symbol thingatpt dired-narrow dired-hacks-utils dired

dired-loaddefs dash buffer-move windmove ace-window avy ring delsel

cua-base mm-util mail-prsvr wheatgrass-theme paren hl-line elec-pair

cus-start cus-load finder-inf info edmacro kmacro package easymenu

epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core

cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp

byte-compile cconv cl-loaddefs cl-lib time-date mule-util tooltip eldoc

electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32

ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win

tool-bar dnd fontset image regexp-opt fringe tabulated-list replace

newcomment text-mode elisp-mode lisp-mode prog-mode register page

menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock

font-lock syntax facemenu font-core term/tty-colors frame cl-generic

cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao

korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech

european ethiopic indian cyrillic chinese composite charscript charprop

case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer

cl-preloaded nadvice loaddefs button faces cus-face macroexp files

text-properties overlay sha1 md5 base64 format env code-pages mule

custom widget hashtable-print-readable backquote w32notify w32 lcms2

multi-tty make-network-process emacs)

 

Memory information:

((conses 16 596417 124859)

(symbols 56 48572 0)

(miscs 48 323 498)

(strings 32 135504 4864)

(string-bytes 1 4191037)

(vectors 16 80210)

(vector-slots 8 1804035 97052)

(floats 8 307 380)

(intervals 56 8936 955)

(buffers 992 29))

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Wed, 31 Jul 2019 14:09:02 GMT) Full text and rfc822 format available.

Message #8 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "a_subscriber" <a_subscriber <at> mail.ru>
Cc: 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Wed, 31 Jul 2019 17:07:50 +0300
> From: "a_subscriber" <a_subscriber <at> mail.ru>
> Date: Wed, 31 Jul 2019 10:55:45 +0300
> 
> 1. emacs -Q
> 2. M-x I-search-toggle-case-fold
> 3. Region is selected

I cannot reproduce this on my Windows system.  It isn't Windows 10,
but I very much doubt that could explain the difference.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Wed, 31 Jul 2019 14:12:02 GMT) Full text and rfc822 format available.

Message #11 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: a_subscriber <a_subscriber <at> mail.ru>, 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Wed, 31 Jul 2019 10:11:37 -0400
tags 36871 + unreproducible
quit

Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: "a_subscriber" <a_subscriber <at> mail.ru>
>> Date: Wed, 31 Jul 2019 10:55:45 +0300
>> 
>> 1. emacs -Q
>> 2. M-x I-search-toggle-case-fold
>> 3. Region is selected
>
> I cannot reproduce this on my Windows system.  It isn't Windows 10,
> but I very much doubt that could explain the difference.

Can't reproduce here either, which is Windows 10.  I'm assuming step 2
should read M-x isearch-toggle-case-fold.





Added tag(s) unreproducible. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 31 Jul 2019 14:12:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Wed, 31 Jul 2019 14:57:01 GMT) Full text and rfc822 format available.

Message #16 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: a_subscriber <at> mail.ru, 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Wed, 31 Jul 2019 17:56:13 +0300
> From: Noam Postavsky <npostavs <at> gmail.com>
> Cc: "a_subscriber" <a_subscriber <at> mail.ru>,  36871 <at> debbugs.gnu.org
> Date: Wed, 31 Jul 2019 10:11:37 -0400
> 
> I'm assuming step 2 should read M-x isearch-toggle-case-fold.

Yes, that's what I did as well.

Thanks for testing the recipe.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Wed, 31 Jul 2019 15:36:02 GMT) Full text and rfc822 format available.

Message #19 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Noam Postavsky <npostavs <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: a_subscriber <a_subscriber <at> mail.ru>, 36871 <at> debbugs.gnu.org
Subject: RE: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Wed, 31 Jul 2019 08:34:52 -0700 (PDT)
FWIW, I think this is from this SE.emacs question:

https://emacs.stackexchange.com/q/51921/105

OP said it repros using `emacs -Q'.  I suggested
a bug report with a step-by-step recipe to repro.

Maybe there's some info missing from the bug report?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Wed, 31 Jul 2019 15:46:01 GMT) Full text and rfc822 format available.

Message #22 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: "a_subscriber" <a_subscriber <at> mail.ru>
To: "'Eli Zaretskii'" <eliz <at> gnu.org>, "'Noam Postavsky'" <npostavs <at> gmail.com>
Cc: 36871 <at> debbugs.gnu.org
Subject: RE: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Wed, 31 Jul 2019 17:59:31 +0300
Yes, should be:

M-x isearch-toggle-case-fold

-----Original Message-----
From: Eli Zaretskii <eliz <at> gnu.org> 
Sent: Wednesday, July 31, 2019 17:56
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: a_subscriber <at> mail.ru; 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold

> From: Noam Postavsky <npostavs <at> gmail.com>
> Cc: "a_subscriber" <a_subscriber <at> mail.ru>,  36871 <at> debbugs.gnu.org
> Date: Wed, 31 Jul 2019 10:11:37 -0400
> 
> I'm assuming step 2 should read M-x isearch-toggle-case-fold.

Yes, that's what I did as well.

Thanks for testing the recipe.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Wed, 31 Jul 2019 15:46:02 GMT) Full text and rfc822 format available.

Message #25 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: "a_subscriber" <a_subscriber <at> mail.ru>
To: "'Eli Zaretskii'" <eliz <at> gnu.org>, "'Noam Postavsky'" <npostavs <at> gmail.com>
Cc: 36871 <at> debbugs.gnu.org
Subject: RE: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Wed, 31 Jul 2019 18:17:20 +0300
[Message part 1 (text/plain, inline)]
Windows 10, Emacs 26.1
Here steps of reproduce:

1. Start emacs -Q
2. Input some text (see step1.jpg)
3. M-x isearch-toggle-case-fold   (see step2.jpg)
4. C-s (isearch) HELLO  (see step3.jpg)
5. C-g
6. M-x isearch-toggle-case-fold
7. and see result on step4.jpg








-----Original Message-----
From: Eli Zaretskii <eliz <at> gnu.org> 
Sent: Wednesday, July 31, 2019 17:56
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: a_subscriber <at> mail.ru; 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold

> From: Noam Postavsky <npostavs <at> gmail.com>
> Cc: "a_subscriber" <a_subscriber <at> mail.ru>,  36871 <at> debbugs.gnu.org
> Date: Wed, 31 Jul 2019 10:11:37 -0400
> 
> I'm assuming step 2 should read M-x isearch-toggle-case-fold.

Yes, that's what I did as well.

Thanks for testing the recipe.
[step1.jpg (image/jpeg, attachment)]
[step2.jpg (image/jpeg, attachment)]
[step3.jpg (image/jpeg, attachment)]
[step4.jpg (image/jpeg, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Thu, 01 Aug 2019 00:06:02 GMT) Full text and rfc822 format available.

Message #28 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: "a_subscriber" <a_subscriber <at> mail.ru>
Cc: 'Eli Zaretskii' <eliz <at> gnu.org>, 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Wed, 31 Jul 2019 20:05:36 -0400
retitle 36871 isearch-toggle-case-fold outside of isearch causes unexpected fontification
tags 36871 = confirmed
severity 36871 minor
quit

"a_subscriber" <a_subscriber <at> mail.ru> writes:

> 1. Start emacs -Q
> 2. Input some text (see step1.jpg)
> 3. M-x isearch-toggle-case-fold   (see step2.jpg)
> 4. C-s (isearch) HELLO  (see step3.jpg)
> 5. C-g
> 6. M-x isearch-toggle-case-fold
> 7. and see result on step4.jpg

Ah, it's not the region, it's highlighting from a not-quite-activated
isearch.  The problem is that isearch-toggle-case-fold wasn't really
expected to be called outside of isearch.  I think throwing an error in
this case makes sense (I tried also just avoiding the call to
isearch-update when isearch-mode is nil which does avoid the OP's
problem, but the actual toggling part doesn't work).

--- i/lisp/isearch.el
+++ w/lisp/isearch.el
@@ -1971,6 +1971,8 @@ isearch-define-mode-toggle
          ,(format "Toggle %s searching on or off.%s" mode
                   (if docstring (concat "\n" docstring) ""))
          (interactive)
+         (unless isearch-mode
+           (user-error "isearch not active"))
          ,@(when function
              `((setq isearch-regexp-function
                      (unless (eq isearch-regexp-function #',function)





Changed bug title to 'isearch-toggle-case-fold outside of isearch causes unexpected fontification' from '26.1; I-search-toggle-csse-fold' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 01 Aug 2019 00:06:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed; removed tag(s) unreproducible. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 01 Aug 2019 00:06:02 GMT) Full text and rfc822 format available.

Severity set to 'minor' from 'normal' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 01 Aug 2019 00:06:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Thu, 01 Aug 2019 11:14:01 GMT) Full text and rfc822 format available.

Message #37 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: "a_subscriber" <a_subscriber <at> mail.ru>
To: "'Noam Postavsky'" <npostavs <at> gmail.com>
Cc: 'Eli Zaretskii' <eliz <at> gnu.org>, 36871 <at> debbugs.gnu.org
Subject: RE: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Thu, 1 Aug 2019 14:13:28 +0300
So, is this e bug?
It will be fix in future version of Emacs?

-----Original Message-----
From: Noam Postavsky <npostavs <at> gmail.com> 
Sent: Thursday, August 1, 2019 03:06
To: a_subscriber <a_subscriber <at> mail.ru>
Cc: 'Eli Zaretskii' <eliz <at> gnu.org>; 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold

retitle 36871 isearch-toggle-case-fold outside of isearch causes unexpected
fontification tags 36871 = confirmed severity 36871 minor quit

"a_subscriber" <a_subscriber <at> mail.ru> writes:

> 1. Start emacs -Q
> 2. Input some text (see step1.jpg)
> 3. M-x isearch-toggle-case-fold   (see step2.jpg)
> 4. C-s (isearch) HELLO  (see step3.jpg) 5. C-g 6. M-x 
> isearch-toggle-case-fold 7. and see result on step4.jpg

Ah, it's not the region, it's highlighting from a not-quite-activated
isearch.  The problem is that isearch-toggle-case-fold wasn't really
expected to be called outside of isearch.  I think throwing an error in this
case makes sense (I tried also just avoiding the call to isearch-update when
isearch-mode is nil which does avoid the OP's problem, but the actual
toggling part doesn't work).

--- i/lisp/isearch.el
+++ w/lisp/isearch.el
@@ -1971,6 +1971,8 @@ isearch-define-mode-toggle
          ,(format "Toggle %s searching on or off.%s" mode
                   (if docstring (concat "\n" docstring) ""))
          (interactive)
+         (unless isearch-mode
+           (user-error "isearch not active"))
          ,@(when function
              `((setq isearch-regexp-function
                      (unless (eq isearch-regexp-function #',function)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Fri, 02 Aug 2019 06:37:02 GMT) Full text and rfc822 format available.

Message #40 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "a_subscriber" <a_subscriber <at> mail.ru>
Cc: npostavs <at> gmail.com, 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Fri, 02 Aug 2019 09:36:06 +0300
> From: "a_subscriber" <a_subscriber <at> mail.ru>
> Cc: "'Eli Zaretskii'" <eliz <at> gnu.org>,
> 	<36871 <at> debbugs.gnu.org>
> Date: Thu, 1 Aug 2019 14:13:28 +0300
> 
> So, is this e bug?
> It will be fix in future version of Emacs?

Yes and yes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Sat, 03 Aug 2019 02:55:01 GMT) Full text and rfc822 format available.

Message #43 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: a_subscriber <a_subscriber <at> mail.ru>, 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Fri, 02 Aug 2019 22:54:01 -0400
Eli Zaretskii <eliz <at> gnu.org> writes:

>> So, is this e bug?
>> It will be fix in future version of Emacs?
>
> Yes and yes.

Regarding fixing it, do you think signaling a user-error is the right
thing?  I've now found out that to actually toggle case folding outside
of isearch, the user needs to set case-fold-search, not
isearch-case-fold-search.  That probably doesn't belong in
isearch-toggle-case-fold.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Sat, 03 Aug 2019 07:01:02 GMT) Full text and rfc822 format available.

Message #46 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: a_subscriber <at> mail.ru, 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Sat, 03 Aug 2019 10:00:16 +0300
> From: Noam Postavsky <npostavs <at> gmail.com>
> Cc: "a_subscriber" <a_subscriber <at> mail.ru>,  36871 <at> debbugs.gnu.org
> Date: Fri, 02 Aug 2019 22:54:01 -0400
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> So, is this e bug?
> >> It will be fix in future version of Emacs?
> >
> > Yes and yes.
> 
> Regarding fixing it, do you think signaling a user-error is the right
> thing?

It could very well be, if it doesn't disrupt any legitimate use cases.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Sat, 03 Aug 2019 21:42:03 GMT) Full text and rfc822 format available.

Message #49 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: a_subscriber <a_subscriber <at> mail.ru>, 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Sun, 04 Aug 2019 00:05:41 +0300
> I think throwing an error in this case makes sense (I tried also just
> avoiding the call to isearch-update when isearch-mode is nil which
> does avoid the OP's problem, but the actual toggling part doesn't work).

Shouldn't toggling commands activate isearch-mode?
I mean in a way like how isearch-forward calls isearch-mode.

Maybe after activation also to repeat the last isearch
(like what isearch-repeat does when isearch-string is empty,
it uses isearch-last-case-fold-search), but I'm not so sure
about this part.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Sun, 04 Aug 2019 20:50:03 GMT) Full text and rfc822 format available.

Message #52 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: a_subscriber <a_subscriber <at> mail.ru>, 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Sun, 04 Aug 2019 23:46:51 +0300
[Message part 1 (text/plain, inline)]
> Shouldn't toggling commands activate isearch-mode?

I meant the same guarding like in isearch-yank-kill:

[isearch-define-mode-toggle-guard.patch (text/x-diff, inline)]
diff --git a/lisp/isearch.el b/lisp/isearch.el
index dddd8ca473..8b35b5b517 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1971,6 +1971,7 @@ isearch-define-mode-toggle
          ,(format "Toggle %s searching on or off.%s" mode
                   (if docstring (concat "\n" docstring) ""))
          (interactive)
+         (unless isearch-mode (isearch-mode t))
          ,@(when function
              `((setq isearch-regexp-function
                      (unless (eq isearch-regexp-function #',function)

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Sun, 04 Aug 2019 20:55:01 GMT) Full text and rfc822 format available.

Message #55 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: a_subscriber <a_subscriber <at> mail.ru>, 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Sun, 04 Aug 2019 16:53:57 -0400
Juri Linkov <juri <at> linkov.net> writes:

>> Shouldn't toggling commands activate isearch-mode?
>
> I meant the same guarding like in isearch-yank-kill:

> @@ -1971,6 +1971,7 @@ isearch-define-mode-toggle
>           ,(format "Toggle %s searching on or off.%s" mode
>                    (if docstring (concat "\n" docstring) ""))
>           (interactive)
> +         (unless isearch-mode (isearch-mode t))

+1 from me, I like this better than throwing an error.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36871; Package emacs. (Mon, 05 Aug 2019 20:41:01 GMT) Full text and rfc822 format available.

Message #58 received at 36871 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: a_subscriber <a_subscriber <at> mail.ru>, 36871 <at> debbugs.gnu.org
Subject: Re: bug#36871: 26.1; I-search-toggle-csse-fold
Date: Mon, 05 Aug 2019 23:39:58 +0300
tags 36871 + fixed
close 36871 27.0.50
quit

>>> Shouldn't toggling commands activate isearch-mode?
>>
>> I meant the same guarding like in isearch-yank-kill:
>
>> @@ -1971,6 +1971,7 @@ isearch-define-mode-toggle
>>           ,(format "Toggle %s searching on or off.%s" mode
>>                    (if docstring (concat "\n" docstring) ""))
>>           (interactive)
>> +         (unless isearch-mode (isearch-mode t))
>
> +1 from me, I like this better than throwing an error.

So I pushed to master.  Now an additional interesting question:
it seems that now some global isearch-activating commands are
obsolete, e.g. currently ‘M-s w’ runs the command isearch-forward-word.
Now it could be rebound to ‘isearch-toggle-word’, i.e.

the current

  (define-key search-map "w" 'isearch-forward-word)

could be replaced with

  (define-key search-map "w" 'isearch-toggle-word)




Added tag(s) fixed. Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Mon, 05 Aug 2019 20:41:04 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.0.50, send any further explanations to 36871 <at> debbugs.gnu.org and "a_subscriber" <a_subscriber <at> mail.ru> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Mon, 05 Aug 2019 20:41:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 03 Sep 2019 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 294 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.