unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13698: 24.2; Display script symbol name when calling `describe-char'
@ 2013-02-12 17:30 YE Qianchuan
  2013-02-13  6:09 ` YE Qianchuan
  0 siblings, 1 reply; 3+ messages in thread
From: YE Qianchuan @ 2013-02-12 17:30 UTC (permalink / raw)
  To: 13698

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

Please refer to this thread:
https://lists.gnu.org/archive/html/help-gnu-emacs/2013-02/msg00138.html

Sometimes the script name symbol of a character is more important than
its charset.  For example, you'd like to use `set-fontset-font' to set a
proper font specifying its script as target, rather than specifying its
charset, which usually is unicode.

In addition, as unicode family is a common charset, the "preferred
charset" displayed by `describe-char' seems not quite useful. In
contrast, script makes more sense. For example, script 'han tells me this
is a CJK character and 'greek tells me this is a greek letter, while
charset often tells me nothing.

Therefore, I suggest display the script name symbol as well when calling
`describe-char'. So that we can press [C-u C-x =] to get it.

I also wrote a simple patch for this.

Besides, I hope there is a handy function called
`list-character-scripts', just like `list-character-sets'. It's a really
simple function: just return
(char-table-extra-slot char-script-table 0).
I believe this function will make script name symbols less confuse.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: `describe-char' to display script symbol name as well --]
[-- Type: text/x-patch, Size: 549 bytes --]

diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index b3f7878..6f34a7c 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -574,6 +574,9 @@ relevant to POS."
                         'help-echo
                         "mouse-2, RET: show this character in its character set")
                     str)))
+              ("script"
+               ,(symbol-name
+                 (char-table-range char-script-table char)))
               ("syntax"
                ,(let ((syntax (syntax-after pos)))
                   (with-temp-buffer

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#13698: 24.2; Display script symbol name when calling `describe-char'
  2013-02-12 17:30 bug#13698: 24.2; Display script symbol name when calling `describe-char' YE Qianchuan
@ 2013-02-13  6:09 ` YE Qianchuan
  2013-02-13 14:56   ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: YE Qianchuan @ 2013-02-13  6:09 UTC (permalink / raw)
  To: 13698

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

On 02/13/2013 01:30 AM, YE Qianchuan wrote:
> I also wrote a simple patch for this.
>
I improved this patch.

If a char doesn't belong to any script, now `describe-char' do not show
script entity, rather than display "script: nil".



[-- Attachment #2: describe-char-display-script-v2.patch --]
[-- Type: text/x-patch, Size: 642 bytes --]

diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index b3f7878..e8ce024 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -574,6 +574,10 @@ relevant to POS."
                         'help-echo
                         "mouse-2, RET: show this character in its character set")
                     str)))
+              ,@(let ((script (char-table-range char-script-table char)))
+                  (if script
+                      (list (list "script"
+                                  (symbol-name script)))))
               ("syntax"
                ,(let ((syntax (syntax-after pos)))
                   (with-temp-buffer

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#13698: 24.2; Display script symbol name when calling `describe-char'
  2013-02-13  6:09 ` YE Qianchuan
@ 2013-02-13 14:56   ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2013-02-13 14:56 UTC (permalink / raw)
  To: YE Qianchuan; +Cc: 13698-done

>> I also wrote a simple patch for this.
> I improved this patch.
> If a char doesn't belong to any script, now `describe-char' do not show
> script entity, rather than display "script: nil".

Thank you.  I installed this into trunk so it'll be in Emacs 24.4.
I also replaced char-table-range with aref which works as well here.


        Stefan





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-13 14:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-12 17:30 bug#13698: 24.2; Display script symbol name when calling `describe-char' YE Qianchuan
2013-02-13  6:09 ` YE Qianchuan
2013-02-13 14:56   ` Stefan Monnier

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