From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#54804: 29.0.50; zap-to-char: case sensitive for upper-case letter Date: Wed, 11 May 2022 17:00:13 +0200 Message-ID: <87lev85d36.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> 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="33692"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , spwhitton@spwhitton.name, 54804@debbugs.gnu.org, uyennhi.qm@gmail.com To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 11 17:01:26 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 1nonq9-0008cT-G3 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 May 2022 17:01:25 +0200 Original-Received: from localhost ([::1]:60516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nonq8-0007Ys-Ge for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 May 2022 11:01:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nonpm-0007SR-TB for bug-gnu-emacs@gnu.org; Wed, 11 May 2022 11:01:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44205) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nonpm-0003Rt-1T for bug-gnu-emacs@gnu.org; Wed, 11 May 2022 11:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nonpl-0007kM-VT for bug-gnu-emacs@gnu.org; Wed, 11 May 2022 11:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 May 2022 15:01: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.165228122429703 (code B ref 54804); Wed, 11 May 2022 15:01:01 +0000 Original-Received: (at 54804) by debbugs.gnu.org; 11 May 2022 15:00:24 +0000 Original-Received: from localhost ([127.0.0.1]:38101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nonp9-0007j1-Mz for submit@debbugs.gnu.org; Wed, 11 May 2022 11:00:24 -0400 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:33498) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nonp7-0007ii-8S for 54804@debbugs.gnu.org; Wed, 11 May 2022 11:00:21 -0400 Original-Received: by mail-wr1-f52.google.com with SMTP id x18so3460094wrc.0 for <54804@debbugs.gnu.org>; Wed, 11 May 2022 08:00:21 -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 :mime-version:content-transfer-encoding; bh=FrX/PJDQ/QJHzCF/2MNikE1iAeRj1ABcZcH9qaht2WU=; b=NI7T2+PwmYpfHWZQNmpUcL2ugYpBf+YGN9frgIr+ctPTObLNPVtgdhyUNGKOMPfY8h fulQrAid6sQ5aFdrj987s6HqMoMftNHdILgzkdf9PYf54eFiJGh0MxowNQXCPLkURl2C BmiqWvZ4cN1vnhtV6Xk/fHzoDF4U/iyBs51tvUkAbOozOH4CnDsp5+YYJ4AEKODHF7Mp GWv/3onL1nKuVaCmxzyKRQd6mKl6mIR4RcFwDNWRDMPrmIKTAssyaG0vrmmRROVVHAoc 037ZRtXTQgZ1CoERbl4NPyow2s1X3wDObxuF+4P5ysZi6346ospm+6hO6tGgU1rqL0sQ ZN9A== 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:mime-version:content-transfer-encoding; bh=FrX/PJDQ/QJHzCF/2MNikE1iAeRj1ABcZcH9qaht2WU=; b=osEycNX8AtPeYJ5/EDmpCR0anKfurk/b2i2sxsR9LVAKX+PrR8SHszHC8OCa2u38+w b/tYy1GQU/856bNJfh0fcPUrOVgIbIHi1VutBvOytw0hM1RiJkHXlB4c9Qbqy7x5Fdzg U7LJZdrb5YVF/PskJ6BnRsGxUIVXKcWlUMljqZVQrZikb77RnbgqFXnFqlaQx3P2OLG4 13hSutBSNmo0bbNIJFiVQEil+D4tyion8IChXqPv891WN3T3lC7Fh/gg7hs5P7pAEKIo vEcI1JHaN2PoSLzX53gfSbw58VTAFoQFHANb75whLZLBekFiSBKw46AqAEenKXv/yA0e wlHA== X-Gm-Message-State: AOAM530bSTHf3A/eEg8L9xp071AZ1kErh48grxz1NCbqjEut4fncD7F6 0vscU1L7hC56EHvP5oRUEdA= X-Google-Smtp-Source: ABdhPJxy9/O/MtQOBklOJyrvhDNYi2R9GpJ0AYi1lvWCqu1V2/7tEmuRA20jDAqV1bifMFwIfEBHEg== X-Received: by 2002:adf:f90d:0:b0:20c:de32:4d35 with SMTP id b13-20020adff90d000000b0020cde324d35mr2675748wrr.583.1652281214896; Wed, 11 May 2022 08:00:14 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb50:58fa:34f8:3a29:1f3e]) by smtp.gmail.com with ESMTPSA id i3-20020adff303000000b0020c5253d923sm1538877wro.111.2022.05.11.08.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 May 2022 08:00:14 -0700 (PDT) In-Reply-To: <87fslgnn9h.fsf@gmail.com> (Tino Calancha's message of "Wed, 11 May 2022 16:43:06 +0200") 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:231945 Archived-At: >>>>> On Wed, 11 May 2022 16:43:06 +0200, Tino Calancha said: Tino> Eli Zaretskii writes: >>> Is it the following implementation OK for such a function? >>=20 >> Yes, thanks. But please call it char-uppercase-p ("upcase" has the >> meaning of making a character upper-case). Tino> I'd like to add this `char-uppercase-p'. Tino> Once merged, I will finish with the goal of the report. Tino> I appreciate a hand with the documentation part. You=CA=BCre *asking* us to nit-pick? You=CA=BCre a brave person =E2=98=BA= =EF=B8=8F Tino> commit aa270a4b8813ac226a61d8e6919f68e9e4ed0973 Tino> Author: Tino Calancha Tino> Date: Wed May 11 16:34:33 2022 +0200 Tino> char-uppercase-p: New predicate =20=20=20=20 Tino> Return non-nil if its argument is an upper-case unicode chara= cter. =20=20=20=20 Tino> Suggested in Bug#54804. =20=20=20=20 Tino> * lisp/subr.el (char-uppercase-p): New defun. Tino> * etc/NEWS (Lisp Changes in Emacs 29.1): Announce it Tino> * doc/lispref/display.texi (Size of Displayed Text): Document= it. Tino> * test/lisp/subr-tests.el (test-char-uppercase-p): Add a test. Tino> diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi Tino> index 9650d22790..1c32458d62 100644 Tino> --- a/doc/lispref/display.texi Tino> +++ b/doc/lispref/display.texi Tino> @@ -2010,6 +2010,14 @@ Size of Displayed Text Tino> (@pxref{Usual Display}). Tino> @end defun =20 Tino> +@defun char-uppercase-p char Tino> +This function returns non-nil if @var{char} is an uppercase unic= ode Tino> +character. Be aware that if the Unicode tables are not yet avai= lable, Tino> +e.g. during bootstrap, then this function gives the right answer= only Tino> +for @acronym{ASCII} characters; for other characters the function Tino> +unconditionally returns @code{nil}. Tino> +@end defun Tino> + Be active: 'Return non-nil if ...'. So: Return non-@code{nil} if @var{char} is an uppercase character according to Unicode. Be aware that if the Unicode tables are not yet available, e.g. during bootstrap, this gives the correct answer only for @acronym{ASCII} characters; for other characters it always returns @code{nil}. Tino> @defun string-width string &optional from to Tino> This function returns the width in columns of the string @var{st= ring}, Tino> if it were displayed in the current buffer and the selected wind= ow. Tino> diff --git a/etc/NEWS b/etc/NEWS Tino> index 991088a067..57c254bce8 100644 Tino> --- a/etc/NEWS Tino> +++ b/etc/NEWS Tino> @@ -1794,6 +1794,10 @@ value. The byte compiler will now issue a= warning if it encounters Tino> these forms. =20 =20 Tino> ++++ Tino> +*** The new predicate 'char-uppercase-p' returns non-nil if its Tino> +argument its an uppercase unicode character. The header line should fit on one line. So *** New predicate 'char-uppercase-p'. This returns... Tino> + Tino> +++ Tino> *** 'restore-buffer-modified-p' can now alter buffer auto-save s= tate. Tino> With a FLAG value of 'autosaved', it will mark the buffer as hav= ing Tino> diff --git a/lisp/simple.el b/lisp/simple.el Tino> index 89fb0ea97e..525e636ab6 100644 Tino> --- a/lisp/simple.el Tino> +++ b/lisp/simple.el Tino> @@ -6054,6 +6054,14 @@ backward-delete-char-untabify Tino> ;; Avoid warning about delete-backward-char Tino> (with-no-warnings (delete-backward-char n killp)))) =20 Tino> +(defun char-uppercase-p (char) Tino> + "Return non-nil if CHAR is an upper-case unicode character. Tino> +If the Unicode tables are not yet available, e.g. during bootstr= ap, Tino> +then the function restricts to the ASCII character set." I=CA=BCd say 'gives correct answers only for ASCII characters' Robert --=20