unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ivan Shmakov <ivan@siamics.net>
To: 20522@debbugs.gnu.org
Subject: bug#20522: 25.0.50; ‘C-u C-x =’ output, ‘to input’ field
Date: Thu, 07 May 2015 15:15:32 +0000	[thread overview]
Message-ID: <874mnoju5n.fsf_-_@violet.siamics.net> (raw)
In-Reply-To: <838ud0qwe9.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 07 May 2015 17:45:18 +0300")

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

>>>>> Eli Zaretskii <eliz@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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/diff, Size: 872 bytes --]

--- 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

  reply	other threads:[~2015-05-07 15:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07  0:03 bug#20522: 25.0.50; `C-u C-x =' output, `to input' field Drew Adams
2015-05-07  7:10 ` bug#20522: 25.0.50; ‘C-u C-x =’ output, ‘to input’ field Ivan Shmakov
2015-05-07 14:45   ` Eli Zaretskii
2015-05-07 15:15     ` Ivan Shmakov [this message]
2015-05-07 15:37       ` Eli Zaretskii
2015-05-27 22:30         ` Ivan Shmakov
2015-05-07 15:55   ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874mnoju5n.fsf_-_@violet.siamics.net \
    --to=ivan@siamics.net \
    --cc=20522@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).