From unknown Fri Aug 15 12:53:10 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#10129 <10129@debbugs.gnu.org> To: bug#10129 <10129@debbugs.gnu.org> Subject: Status: 24.0.91; [PATCH] `C-u C-x =' should show position info Reply-To: bug#10129 <10129@debbugs.gnu.org> Date: Fri, 15 Aug 2025 19:53:10 +0000 retitle 10129 24.0.91; [PATCH] `C-u C-x =3D' should show position info reassign 10129 emacs submitter 10129 "Drew Adams" severity 10129 normal tag 10129 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 24 13:52:19 2011 Received: (at submit) by debbugs.gnu.org; 24 Nov 2011 18:52:19 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTePD-0005PT-Jg for submit@debbugs.gnu.org; Thu, 24 Nov 2011 13:52:19 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RTePC-0005PN-8k for submit@debbugs.gnu.org; Thu, 24 Nov 2011 13:52:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTeNh-00029U-25 for submit@debbugs.gnu.org; Thu, 24 Nov 2011 13:50:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,GAPPY_SUBJECT, MIME_QP_LONG_LINE,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:50888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTeNh-00029Q-0Z for submit@debbugs.gnu.org; Thu, 24 Nov 2011 13:50:45 -0500 Received: from eggs.gnu.org ([140.186.70.92]:35529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTeNg-0000kH-5q for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2011 13:50:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTeNe-000292-Vd for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2011 13:50:44 -0500 Received: from rcsinet15.oracle.com ([148.87.113.117]:61016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTeNe-00028r-MR for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2011 13:50:42 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pAOIoeAV022698 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 24 Nov 2011 18:50:41 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id pAOIoeAN015057 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 24 Nov 2011 18:50:40 GMT Received: from abhmt101.oracle.com (abhmt101.oracle.com [141.146.116.53]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id pAOIoYBx003481 for ; Thu, 24 Nov 2011 12:50:34 -0600 Received: from dradamslap1 (/10.159.44.13) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 24 Nov 2011 10:50:34 -0800 From: "Drew Adams" To: Subject: 24.0.91; [PATCH] `C-u C-x =' should show position info Date: Thu, 24 Nov 2011 10:50:36 -0800 Message-ID: <22A8A640F96C48BB9443544BA5128BF8@us.oracle.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0090_01CCAA96.E6A26340" X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acyq2fQ7e9yGP52bT66oBo7bQOk2zg== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.4ECE9201.011A,ss=1,re=0.594,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) This is a multi-part message in MIME format. ------=_NextPart_000_0090_01CCAA96.E6A26340 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit `C-x =' shows information about the current position, including its relation to the buffer size, its column, the region limits, and horizontal scroll amount. That position info is missing from the *Help* display for `C-u C-x ='. It is only shown in the message, which is ephemeral and can easily be overwritten. The attached patch remedies this by including the position information in *Help*. The patch also updates the doc string accordingly (and corrects improper grammar such as "Is POS is taken..."). In GNU Emacs 24.0.91.1 (i386-mingw-nt5.1.2600) of 2011-11-21 on MARVIN Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.6) --no-opt --cflags -ID:/devel/emacs/libs/libXpm-3.5.8/include -ID:/devel/emacs/libs/libXpm-3.5.8/src -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include -ID:/devel/emacs/libs/giflib-4.1.4-1/include -ID:/devel/emacs/libs/jpeg-6b-4/include -ID:/devel/emacs/libs/tiff-3.8.2-1/include -ID:/devel/emacs/libs/gnutls-2.10.1/include --ldflags -LD:/devel/emacs/libs/gnutls-2.10.1/lib' ------=_NextPart_000_0090_01CCAA96.E6A26340 Content-Type: application/octet-stream; name="descr-text-2011-11-24a.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="descr-text-2011-11-24a.patch" diff -c -w descr-text-patched.el descr-text.el=0A= *** descr-text-patched.el Thu Nov 24 10:42:16 2011=0A= --- descr-text.el Thu Nov 24 10:39:32 2011=0A= ***************=0A= *** 376,393 ****=0A= =0A= ;;;###autoload=0A= (defun describe-char (pos &optional buffer)=0A= ! "Describe position POS (interactively, point) and the char after POS.=0A= ! POS is taken to be in BUFFER, or the current buffer if BUFFER is nil.=0A= ! The information is displayed in buffer `*Help*'.=0A= ! =0A= ! The position information includes POS; the total size of BUFFER; the=0A= ! region limits, if narrowed; the column number; and the horizontal=0A= ! scroll amount, if horizontally scrolled.=0A= ! =0A= ! The character information includes the character code; charset and=0A= ! code points in it; syntax; category; how the character is encoded in a=0A= ! file; character composition information (if relevant); and relevant=0A= ! widgets, buttons, overlays, and text properties."=0A= (interactive "d")=0A= (unless (buffer-live-p buffer) (setq buffer (current-buffer)))=0A= (let ((src-buf (current-buffer)))=0A= --- 376,387 ----=0A= =0A= ;;;###autoload=0A= (defun describe-char (pos &optional buffer)=0A= ! "Describe the character after POS (interactively, the character = after point).=0A= ! Is POS is taken to be in buffer BUFFER or current buffer if nil.=0A= ! The information includes character code, charset and code points in it,=0A= ! syntax, category, how the character is encoded in a file,=0A= ! character composition information (if relevant),=0A= ! as well as widgets, buttons, overlays, and text properties."=0A= (interactive "d")=0A= (unless (buffer-live-p buffer) (setq buffer (current-buffer)))=0A= (let ((src-buf (current-buffer)))=0A= ***************=0A= *** 503,527 ****=0A= (setq composition nil)))=0A= =0A= (setq item-list=0A= ! `(("position"=0A= ! ,(let* ((beg (point-min))=0A= ! (end (point-max))=0A= ! (total (buffer-size))=0A= ! (percent (if (> total 50000) ; Avoid overflow = multiplying by 100=0A= ! (/ (+ (/ total 200) (1- pos)) = (max (/ total 100) 1))=0A= ! (/ (+ (/ total 2) (* 100 (1- pos))) = (max total 1))))=0A= ! (hscroll (if (=3D (window-hscroll) 0)=0A= ! ""=0A= ! (format ", Hscroll: %d" = (window-hscroll))))=0A= ! (col (current-column)))=0A= ! (if (or (/=3D beg 1) (/=3D end (1+ total)))=0A= ! (format "%d of %d (%d%%), column: %d%s, = region: %d-%d"=0A= ! pos total percent col hscroll beg = end)=0A= ! (if (=3D pos end)=0A= ! (format "%d of %d (EOB), column: %d%s" pos = total col hscroll)=0A= ! (format "%d of %d (%d%%), column: %d%s"=0A= ! pos total percent col hscroll)))))=0A= ! ("character"=0A= ,(format "%s (%d, #o%o, #x%x)"=0A= (apply 'propertize char-description=0A= (text-properties-at pos))=0A= --- 497,503 ----=0A= (setq composition nil)))=0A= =0A= (setq item-list=0A= ! `(("character"=0A= ,(format "%s (%d, #o%o, #x%x)"=0A= (apply 'propertize char-description=0A= (text-properties-at pos))=0A= =0A= Diff finished. Thu Nov 24 10:43:41 2011=0A= ------=_NextPart_000_0090_01CCAA96.E6A26340-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 05:37:04 2012 Received: (at 10129-done) by debbugs.gnu.org; 28 Jan 2012 10:37:04 +0000 Received: from localhost ([127.0.0.1]:47541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rr5eZ-00013v-Nn for submit@debbugs.gnu.org; Sat, 28 Jan 2012 05:37:04 -0500 Received: from mtaout23.012.net.il ([80.179.55.175]:55915) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rr5eW-00013R-V6 for 10129-done@debbugs.gnu.org; Sat, 28 Jan 2012 05:37:02 -0500 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LYI00I007ZY4600@a-mtaout23.012.net.il> for 10129-done@debbugs.gnu.org; Sat, 28 Jan 2012 12:36:11 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.228.102.195]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LYI00I5S84A4900@a-mtaout23.012.net.il>; Sat, 28 Jan 2012 12:36:11 +0200 (IST) Date: Sat, 28 Jan 2012 12:34:08 +0200 From: Eli Zaretskii Subject: Re: Character FOO In-reply-to: <165D22A23B7643CD9563B716D06BDC38@us.oracle.com> X-012-Sender: halo1@inter.net.il To: Drew Adams Message-id: <83ty3gxgin.fsf@gnu.org> References: <165D22A23B7643CD9563B716D06BDC38@us.oracle.com> X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 10129-done Cc: 10129-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -0.5 (/) > From: "Drew Adams" > Cc: > Date: Wed, 25 Jan 2012 08:58:21 -0800 > > Why not apply this patch as well, while you're at it: > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10129 Done. I modified your patch slightly, mainly to make it more consistent with what "C-x =" displays. I also updated the doc string to bring it in line with what is in fact displayed. The actual patch I committed is below. Note that your patch was backwards; please in the future use diff -c OLD NEW not the other way around. Thanks. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-01-28 09:52:24 +0000 +++ lisp/ChangeLog 2012-01-28 10:27:28 +0000 @@ -1,3 +1,11 @@ +2012-01-28 Drew Adams + + * descr-text.el (describe-char): Show information about POS, in + addition to information about the character at POS. Improve and + update the doc string. Change "code point" to "code point in + charset", to avoid confusion with the character's Unicode code + point shown above that. (Bug#10129) + 2012-01-28 Eli Zaretskii * descr-text.el (describe-char): Show the raw character, not only === modified file 'lisp/descr-text.el' --- lisp/descr-text.el 2012-01-28 09:52:24 +0000 +++ lisp/descr-text.el 2012-01-28 10:27:28 +0000 @@ -376,12 +376,21 @@ This function is semi-obsolete. Use `ge ;;;###autoload (defun describe-char (pos &optional buffer) - "Describe the character after POS (interactively, the character after point). -Is POS is taken to be in buffer BUFFER or current buffer if nil. -The information includes character code, charset and code points in it, -syntax, category, how the character is encoded in a file, -character composition information (if relevant), -as well as widgets, buttons, overlays, and text properties." + "Describe position POS (interactively, point) and the char after POS. +POS is taken to be in BUFFER, or the current buffer if BUFFER is nil. +The information is displayed in buffer `*Help*'. + +The position information includes POS; the total size of BUFFER; the +region limits, if narrowed; the column number; and the horizontal +scroll amount, if the buffer is horizontally scrolled. + +The character information includes the character code; charset and +code points in it; syntax; category; how the character is encoded in +BUFFER and in BUFFER's file; character composition information (if +relevant); the font and font glyphs used to display the character; +the character's canonical name and other properties defined by the +Unicode Data Base; and widgets, buttons, overlays, and text properties +relevant to POS." (interactive "d") (unless (buffer-live-p buffer) (setq buffer (current-buffer))) (let ((src-buf (current-buffer))) @@ -511,7 +520,25 @@ as well as widgets, buttons, overlays, a (setq composition nil))) (setq item-list - `(("character" + `(("position" + ,(let* ((beg (point-min)) + (end (point-max)) + (total (buffer-size)) + (percent (if (> total 50000) ; Avoid overflow multiplying by 100 + (/ (+ (/ total 200) (1- pos)) (max (/ total 100) 1)) + (/ (+ (/ total 2) (* 100 (1- pos))) (max total 1)))) + (hscroll (if (= (window-hscroll) 0) + "" + (format ", Hscroll: %d" (window-hscroll)))) + (col (current-column))) + (if (or (/= beg 1) (/= end (1+ total))) + (format "%d of %d (%d%%), restriction: <%d-%d>, column: %d%s" + pos total percent col beg end hscroll) + (if (= pos end) + (format "%d of %d (EOB), column: %d%s" pos total col hscroll) + (format "%d of %d (%d%%), column: %d%s" + pos total percent col hscroll))))) + ("character" ,(format "%s (displayed as %s) (codepoint %d, #o%o, #x%x)" char-description (apply 'propertize char-description @@ -522,7 +549,7 @@ as well as widgets, buttons, overlays, a ,(symbol-name charset) 'type 'help-character-set 'help-args '(,charset)) ,(format "(%s)" (charset-description charset))) - ("code point" + ("code point in charset" ,(let ((str (if (integerp code) (format (if (< code 256) "0x%02X" "0x%04X") code) From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 28 05:58:34 2012 Received: (at 10129) by debbugs.gnu.org; 28 Jan 2012 10:58:34 +0000 Received: from localhost ([127.0.0.1]:47568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rr5zN-0002Kh-VB for submit@debbugs.gnu.org; Sat, 28 Jan 2012 05:58:34 -0500 Received: from mtaout21.012.net.il ([80.179.55.169]:48893) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Rr5zL-0002KS-P9 for 10129@debbugs.gnu.org; Sat, 28 Jan 2012 05:58:32 -0500 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LYI00J008V1XA00@a-mtaout21.012.net.il> for 10129@debbugs.gnu.org; Sat, 28 Jan 2012 12:57:42 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.228.102.195]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LYI00JNF945OY70@a-mtaout21.012.net.il> for 10129@debbugs.gnu.org; Sat, 28 Jan 2012 12:57:42 +0200 (IST) Date: Sat, 28 Jan 2012 12:55:40 +0200 From: Eli Zaretskii Subject: Re: bug#10129: Character FOO In-reply-to: <83ty3gxgin.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: 10129@debbugs.gnu.org Message-id: <83pqe4xfir.fsf@gnu.org> References: <165D22A23B7643CD9563B716D06BDC38@us.oracle.com> <83ty3gxgin.fsf@gnu.org> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 10129 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 28 Jan 2012 12:34:08 +0200 > From: Eli Zaretskii > Cc: 10129-done@debbugs.gnu.org > > > From: "Drew Adams" > > Cc: > > Date: Wed, 25 Jan 2012 08:58:21 -0800 > > > > Why not apply this patch as well, while you're at it: > > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10129 > > Done. Forgot to tell: the change is in revision 106975 on the trunk. From unknown Fri Aug 15 12:53:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 25 Feb 2012 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator