From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.bugs Subject: bug#54804: 29.0.50; zap-to-char: case sensitive for upper-case letter Date: Mon, 09 May 2022 09:17:13 -0700 Message-ID: <87pmkmsmt2.fsf@athena.silentflame.com> References: <87ee27fd1a.fsf@gmail.com> <83bkxaaj45.fsf@gnu.org> <878rs55m81.fsf@gmail.com> <834k2t1cva.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31639"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.36 Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 54804@debbugs.gnu.org, Eli Zaretskii , uyennhi.qm@gmail.com To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 09 18:18:24 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 1no65V-0007uG-0g for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 May 2022 18:18:23 +0200 Original-Received: from localhost ([::1]:40956 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no65T-0007Cy-HQ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 09 May 2022 12:18:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no65D-0007BR-Ig for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 12:18:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37128) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1no65C-0005xW-0p for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 12:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1no65B-0007Ys-Sk for bug-gnu-emacs@gnu.org; Mon, 09 May 2022 12:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sean Whitton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 May 2022 16:18:01 +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.165211304229010 (code B ref 54804); Mon, 09 May 2022 16:18:01 +0000 Original-Received: (at 54804) by debbugs.gnu.org; 9 May 2022 16:17:22 +0000 Original-Received: from localhost ([127.0.0.1]:59258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no64Y-0007Xq-0V for submit@debbugs.gnu.org; Mon, 09 May 2022 12:17:22 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:58079) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1no64W-0007Xd-CT for 54804@debbugs.gnu.org; Mon, 09 May 2022 12:17:20 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 4FD2A5C019F; Mon, 9 May 2022 12:17:15 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 09 May 2022 12:17:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1652113035; x=1652199435; bh=b+ MbTMkX6Jwpk190zWrf2nNuagHd/4wSz1rf5IV1K28=; b=L8EiNBxTf8AQaDhk8W HM0sVyo3F2/DdvzaSLYu3M2E1nnsMswCCGXO50JSwE3Sqd02mk9Ax3bB1qW6So8D TTLfWoOZuNwLIn8Uko7GxkSWDCThW9H6kmXYbSQ0t0yV/mq1TwXWp57gdI1a9ojT h18YAmxXG1BXb3BRkyJjvX1bFcWufohu7FepfVjOrsHiuwmUTOGlKDHVXtw6NMny gb1G5LW/M8aXFxHEW8yoSxMBrsxbWf17bjUGvP4lrY49ks8PrEAQ/lXuUd/+nHYR ryQg+nvTIX+1wMPF8asalIe7ZPmKEtf9GTaaetX5QDNnPs9BeLzv5KoRWaFxiEMm uHIA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1652113035; x= 1652199435; bh=b+MbTMkX6Jwpk190zWrf2nNuagHd/4wSz1rf5IV1K28=; b=w a/syl1iu1gWF/MiY7bqVUA8mwtg62chhQqVnD1UhK1tWPFKp7VUoO4wPfu01geSS 43T1YGZwTqXPCSSjutN1eadyD7ucTu+4n9CLeCkTxUQQWGZkySN16+aPcGnKhbpU xVYUhJ1LvtA6257eAZMqWn/NbvcpWb5YWgEZzGKLx6bKgei1pt4cCaRfR8/UnZbb rjoo+3SgaKwfpFzYa4xi2WvbMdX9ikP0HYl8IVzflf22K2LX3uriBKYkGxgT1bp8 L4S6Y5HOSUAmgmy43NNcAuFgCNeVllMQr1qEEZHHUHSNJxSQozIG5vQBWzFCZkeN 4PYw0VmumDKNxbDYthPBA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeelgdelkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufgjfhgffffkgggtsehttddttddtredtnecuhfhrohhmpefuvggrnhcu hghhihhtthhonhcuoehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgeqne cuggftrfgrthhtvghrnhepvdejtedtieetjeegjeekgffghedtkeeltdeftdetkefgueek fedtudfhteeljeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgv X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 May 2022 12:17:14 -0400 (EDT) Original-Received: by athena.silentflame.com (Postfix, from userid 1000) id 8E62C1B8942; Mon, 9 May 2022 16:17:13 +0000 (UTC) In-Reply-To: <834k2t1cva.fsf@gnu.org> 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:231763 Archived-At: Hello Tino, Any progress on this? I would like this functionality. Thanks. On Sat 16 Apr 2022 at 02:33pm +03, Eli Zaretskii wrote: >> From: Tino Calancha >> Cc: 54804@debbugs.gnu.org, uyennhi.qm@gmail.com >> Date: Sat, 16 Apr 2022 12:58:06 +0200 >> >> Eli Zaretskii writes: >> >> > but why does the implementation have to be so complicated? >> > Isn't this just about turning off case-fold-search while searching for >> > the character? What am I missing? >> >> The patch is moving the shared code in zap-to/zap-up-to in a >> helper function. This has 2 motivations: >> - reduce the code duplication. >> - define these two related functions close each other. >> - separate the logic of the function to calculate the region to kill. >> >> If you prefer, we can keep the functions in their current >> locations (simple.el/misc.el) with a patch like this one: > > What I'd prefer is to have a single function (in subr.el) that > determines whether a character is an upper- or lower-case, and then > use that function in a simple condition in these two commands. > > The function to check whether a character is upper-case doesn't have > to make a string from the character and then use the "heavy artillery" > of string-match-p, it could instead use something like > > (characterp (get-char-code-property CHAR 'uppercase)) > > (But beware of the situation where the Unicode tables are not yet > available during bootstrap -- in those cases the function should IMO > punt and return nil no matter what the character is, or maybe support > just the ASCII characters. To test whether the 'uppercase table is > available, see if unicode-property-table-internal returns non-nil.) > >> + ;; Avoid "obsolete" warnings for translation-table-for-input. >> + (with-no-warnings >> + (if (char-table-p translation-table-for-input) >> + (setq char (or (aref translation-table-for-input char) char)))) > > translation-table-for-input is obsolete for a reason, so adding it to > a new function is not something we want to do. If anything, we should > remove it from the old function. > > > -- Sean Whitton