From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#54804: 29.0.50; zap-to-char: case sensitive for upper-case letter Date: Tue, 17 May 2022 14:34:06 +0200 Message-ID: <874k1onxs1.fsf@gmail.com> References: <87ee27fd1a.fsf@gmail.com> <83bkxaaj45.fsf@gnu.org> <878rs55m81.fsf@gmail.com> <834k2t1cva.fsf@gnu.org> <87ilqdnl8z.fsf@gmail.com> <83bkw4s4ln.fsf@gnu.org> <87fslgnn9h.fsf@gmail.com> <87lev85d36.fsf@gmail.com> <877d6sum2c.fsf@igel.home> <4548a66-c8f8-57de-58db-6241a1f16cc4@gmail.com> <8735hguk0u.fsf@igel.home> <218f952c-747d-c32-5bce-5ad078a51f41@gmail.com> <878rr6oidh.fsf@gmail.com> <83czgind12.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33035"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 54804@debbugs.gnu.org, juri@linkov.net, uyennhi.qm@gmail.com, monnier@iro.umontreal.ca, spwhitton@spwhitton.name To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 17 15:10:00 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqwxc-0008Qg-F3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 May 2022 15:10:00 +0200 Original-Received: from localhost ([::1]:35838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqwxb-0000OK-DD for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 May 2022 09:09:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqwPm-0007Q6-UT for bug-gnu-emacs@gnu.org; Tue, 17 May 2022 08:35:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33881) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nqwPm-0003Ed-Lb for bug-gnu-emacs@gnu.org; Tue, 17 May 2022 08:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nqwPm-0000oV-JB for bug-gnu-emacs@gnu.org; Tue, 17 May 2022 08:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 May 2022 12:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54804 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 54804-submit@debbugs.gnu.org id=B54804.16527908593064 (code B ref 54804); Tue, 17 May 2022 12:35:02 +0000 Original-Received: (at 54804) by debbugs.gnu.org; 17 May 2022 12:34:19 +0000 Original-Received: from localhost ([127.0.0.1]:56011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqwP5-0000nM-Ge for submit@debbugs.gnu.org; Tue, 17 May 2022 08:34:19 -0400 Original-Received: from mail-ed1-f43.google.com ([209.85.208.43]:34354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nqwP0-0000n4-G7 for 54804@debbugs.gnu.org; Tue, 17 May 2022 08:34:18 -0400 Original-Received: by mail-ed1-f43.google.com with SMTP id en5so8101554edb.1 for <54804@debbugs.gnu.org>; Tue, 17 May 2022 05:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=JF05Oh+V0okUNdVYQSZfb7iLV7RWcPVb9U86BOxQTCs=; b=UT7mQqWzqBqkNgd3Z88AMGBHodllLOe1PUZG6zHeUmO7mhy/Urvpf64boNYORcux1e 2Y/3iS6yq8PB7HU6aFN/39PR0hx7vY6Pl35uSjQJY20Xm2c4k83tulTVO04GPPA+V+UL T7A4g59zLaJ4eepmFHVoZYiUzehz4BD6Lk1auRbF/cu4KEmGxNv0N7CJGuvmF+845hcm Szd+Gwgj6jIf193I0uAiWM6CP0XDcbQ0ZI71VGGffAHm5mGyjKlCWY959bofUXNzz419 xlYw4lJPxTIpjmKyTnwl17MlEvfUP47ognsb7N/h+aH0wwROu1sfuA7P7lf7xijxHRkh dfyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=JF05Oh+V0okUNdVYQSZfb7iLV7RWcPVb9U86BOxQTCs=; b=WI4Tq/LphQSQuMh1wcATQWme3dWyCOL3lp4N0YFpgXeRmbzZlid8s2UxI6aYbKcHrZ jz0j4UzdIi45iTnn6ncbsifgORqdodgguPDRxHvL8jnFcTo+s4Cj52gYonEZmf/vouJJ mHf56Hwt4AJqKXGs1FQpGzP6W1v7+410WHHvRaAgV+HyAXSdGvyvvdFIfDaECnladKsT UzGIntRlPok8rOAlIsVNQxy5jvciLZumciBVrPBKFxfAkPtS5VU7wlovnf6EwGZ26HPt Y8aCuVNnKM9ePJRAOhD+Sn1ztQT4cOqaKelRTC5zTlStH9NqYofD6L6RPbH9j9YlZxnm LyEQ== X-Gm-Message-State: AOAM533cJPKSpkIUK2uwq7XBfGW5wm2O9uoRyQvBusU6STnfk0vPZINA Vnb/rdPvSlgQlq7F02CB2jQ= X-Google-Smtp-Source: ABdhPJyvv1ENRQiO9hacCoCjB+xDHWNyGih19jZF4pkIY3wHCphIEOWjoTsuiQNCkCA59DV7YvMVKw== X-Received: by 2002:a50:fe8d:0:b0:42a:b3a4:6ac2 with SMTP id d13-20020a50fe8d000000b0042ab3a46ac2mr9850361edt.131.1652790848515; Tue, 17 May 2022 05:34:08 -0700 (PDT) Original-Received: from eprince ([193.118.249.171]) by smtp.gmail.com with ESMTPSA id cn9-20020a0564020ca900b0042aca5edba7sm749776edb.57.2022.05.17.05.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 05:34:07 -0700 (PDT) In-Reply-To: <83czgind12.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 13 May 2022 09:48:41 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:232436 Archived-At: Eli Zaretskii 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 >> * 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 yo= ur function an extra optional argument whose =E2=80=98interactive=E2=80=99 spe= c specifies non-nil unconditionally ("p" is a good way to do this), or via (not (or executing-kbd-macro noninteractive))."