GNU bug report logs - #20522
25.0.50; `C-u C-x =' output, `to input' field

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Thu, 7 May 2015 00:04:01 UTC

Severity: wishlist

Tags: patch

Found in version 25.0.50

Fixed in version 25.1

Done: Ivan Shmakov <ivan <at> siamics.net>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 20522 <at> debbugs.gnu.org (full text, mbox):

From: Ivan Shmakov <ivan <at> siamics.net>
To: 20522 <at> debbugs.gnu.org
Subject: Re: bug#20522: 25.0.50; ‘C-u C-x
 =’ output, ‘to input’ field 
Date: Thu, 07 May 2015 15:15:32 +0000
[Message part 1 (text/plain, inline)]
>>>>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>>>> From: Ivan Shmakov  Date: Thu, 07 May 2015 07:10:23 +0000

 >> + (format
 >> +  "type \"C-x 8 RET %04x\" or \"C-x 8 RET %s\""

 >                       ^^^^ I see no need to tell users to type at
 > least 4 hex digits: "C-x 8 RET" accepts even one digit.  So I think
 > we should use %x here.

 >> +  char (get-char-code-property char 'name)))))))

 > Not every Unicode codepoint has a name, so get-char-code-property
 > could return nil.  E. g., try with any codepoint between zero and
 > #x1f, inclusive.  When that happens, we should try 'old-name'
 > instead, and if that returns nil as well (try #x99, for example), I
 > think the "by name" part should be omitted from the output of
 > describe-char.

	(I’ve suspected something like that, but didn’t check.)

	Please consider the revised patch MIMEd.

	* lisp/descr-text.el (describe-char): Show the exact C-x 8 RET
	invocation instead of a template.  (Bug#20522)

	It was also requested in bug#20499 that a specific C-x 8
	(iso-transl) sequence is shown.  Yet I believe that deserves a
	separate patch.

-- 
FSF associate member #7257  http://am-1.org/~ivan/      … 3013 B6A0 230E 334A
[Message part 2 (text/diff, inline)]
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -618,7 +618,14 @@ defun describe-char (pos &optional buffer)
                                    'help-args '(,current-input-method))
 				 "input method")
 			 (list
-			  "type \"C-x 8 RET HEX-CODEPOINT\" or \"C-x 8 RET NAME\"")))))
+                          (let ((name
+                                 (or (get-char-code-property char 'name)
+                                     (get-char-code-property char 'old-name))))
+                            (if name
+                                (format
+                                 "type \"C-x 8 RET %x\" or \"C-x 8 RET %s\""
+                                 char name)
+                              (format "type \"C-x 8 RET %x\"" char))))))))
               ("buffer code"
                ,(if multibyte-p
                     (encoded-string-description

This bug report was last modified 10 years and 33 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.