unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 54804@debbugs.gnu.org, juri@linkov.net, uyennhi.qm@gmail.com,
	monnier@iro.umontreal.ca, spwhitton@spwhitton.name
Subject: bug#54804: 29.0.50; zap-to-char: case sensitive for upper-case letter
Date: Tue, 17 May 2022 14:34:06 +0200	[thread overview]
Message-ID: <874k1onxs1.fsf@gmail.com> (raw)
In-Reply-To: <83czgind12.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 May 2022 09:48:41 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

I have added Stefan, who suggests using the interactive arg (see
explanation below).
I have also added Juri, who is expert on isearch.

>> From: Tino Calancha <tino.calancha@gmail.com>
>>     * lisp/misc.el (zap-up-to-char): Add an optional arg INTERACTIVE.
>>     Perform a case-sensitive search when INTERACTIVE is non-nil and
>>     CHAR is an upper-case character.
>
> I don't understand why the need for the new INTERACTIVE argument.

> And, as mentioned above, I don't think I understand why we need to do
> this only in interactive calls.  Non-interactive invocations already
> have a way to request case-sensitivity, by let-binding
> case-fold-search, right?

I'll try to explain this.

This is what Emacs does for isearch/search.

If you go to the *scratch* buffer, and you do
C-s T C-s C-s
you only jump on 'T', that is, you skip the 't'. This is regardless
on the `case-fold-search' value.

Calling from Lisp:
(search-forward "T" nil t)
we'll also jump on the 't' if `case-fold-search' is non-nil.

I want the analog behavior for zap-to... commands: automatic
case sensitivity when the char is uppercase.
I want this behavior on interactive calls only, for instance when users
do `M-z'.

How to detect that the users are calling these commands interactively?
I got inspired from this comment found at the docstring of
`called-interactively-p' (Stefan wrote that):

"Instead of using this function, it is cleaner and more reliable to give your
function an extra optional argument whose ‘interactive’ spec specifies
non-nil unconditionally ("p" is a good way to do this), or via
(not (or executing-kbd-macro noninteractive))."






  reply	other threads:[~2022-05-17 12:34 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 22:03 bug#54804: 29.0.50; zap-to-char: case sensitive for upper-case letter Tino Calancha
2022-04-09  6:03 ` Eli Zaretskii
2022-04-16 10:58   ` Tino Calancha
2022-04-16 11:33     ` Eli Zaretskii
2022-05-09 16:17       ` Sean Whitton
2022-05-10 21:14       ` Tino Calancha
2022-05-11 11:15         ` Eli Zaretskii
2022-05-11 14:43           ` Tino Calancha
2022-05-11 14:50             ` Lars Ingebrigtsen
2022-05-11 15:00             ` Robert Pluim
2022-05-11 15:19               ` Tino Calancha
2022-05-11 15:27               ` Andreas Schwab
2022-05-11 15:38                 ` Tino Calancha
2022-05-11 16:11                   ` Andreas Schwab
2022-05-11 16:18                     ` Tino Calancha
2022-05-12 15:55                       ` Tino Calancha
2022-05-13  6:48                         ` Eli Zaretskii
2022-05-17 12:34                           ` Tino Calancha [this message]
2022-05-17 12:41                             ` Eli Zaretskii
2022-05-17 12:51                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-17 12:53                                 ` Tino Calancha
2022-05-17 13:38                                   ` Eli Zaretskii
2022-05-17 14:31                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-17 19:32                             ` Juri Linkov
2022-05-18  7:25                           ` Tino Calancha
2022-05-20 22:59                         ` Sean Whitton
2022-05-21  5:38                           ` Eli Zaretskii
2022-05-21  9:30                             ` Tino Calancha
2022-05-21 18:53                             ` Sean Whitton
2022-05-11 15:57             ` Eli Zaretskii

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=874k1onxs1.fsf@gmail.com \
    --to=tino.calancha@gmail.com \
    --cc=54804@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=juri@linkov.net \
    --cc=monnier@iro.umontreal.ca \
    --cc=spwhitton@spwhitton.name \
    --cc=uyennhi.qm@gmail.com \
    /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).