From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#10129: Character FOO Date: Sat, 28 Jan 2012 12:34:08 +0200 Message-ID: <83ty3gxgin.fsf@gnu.org> References: <165D22A23B7643CD9563B716D06BDC38@us.oracle.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1327769626 16197 80.91.229.3 (28 Jan 2012 16:53:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 28 Jan 2012 16:53:46 +0000 (UTC) Cc: 10129-done@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 28 17:53:44 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RrBX4-0006of-TK for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Jan 2012 17:53:43 +0100 Original-Received: from localhost ([::1]:38849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rr5ev-00032v-Bq for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Jan 2012 05:37:25 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:36474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rr5er-00032Z-QX for bug-gnu-emacs@gnu.org; Sat, 28 Jan 2012 05:37:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rr5eq-0007y3-6z for bug-gnu-emacs@gnu.org; Sat, 28 Jan 2012 05:37:21 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rr5eq-0007xp-1B for bug-gnu-emacs@gnu.org; Sat, 28 Jan 2012 05:37:20 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Rr5fW-00015D-As for bug-gnu-emacs@gnu.org; Sat, 28 Jan 2012 05:38:02 -0500 Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Jan 2012 10:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 10129 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 10129@debbugs.gnu.org, eliz@gnu.org Original-Received: via spool by 10129-done@debbugs.gnu.org id=D10129.13277470244090 (code D ref 10129); Sat, 28 Jan 2012 10:38:02 +0000 Original-Received: (at 10129-done) by debbugs.gnu.org; 28 Jan 2012 10:37:04 +0000 Original-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 Original-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 Original-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) Original-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) In-reply-to: <165D22A23B7643CD9563B716D06BDC38@us.oracle.com> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:56118 Archived-At: > 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)