* Find all the name and alias corresponding to a codepoint in Emacs. @ 2022-03-12 2:54 Hongyi Zhao 2022-03-12 4:00 ` Emanuel Berg via Users list for the GNU Emacs text editor 2022-03-12 6:30 ` Eli Zaretskii 0 siblings, 2 replies; 13+ messages in thread From: Hongyi Zhao @ 2022-03-12 2:54 UTC (permalink / raw) To: help-gnu-emacs Say, for back-tick or grave accent ( ` ) symbol, I want to let Emacs give me all of its name and alias, but the `M-x describe-char ` can only give the following information: name: GRAVE ACCENT old-name: SPACING GRAVE So, I want to know if it's possible to find all the name and alias corresponding to a codepoint in Emacs. Regards -- Assoc. Prof. Hongsheng Zhao <hongyi.zhao@gmail.com> Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Find all the name and alias corresponding to a codepoint in Emacs. 2022-03-12 2:54 Find all the name and alias corresponding to a codepoint in Emacs Hongyi Zhao @ 2022-03-12 4:00 ` Emanuel Berg via Users list for the GNU Emacs text editor 2022-03-12 6:30 ` Eli Zaretskii 1 sibling, 0 replies; 13+ messages in thread From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2022-03-12 4:00 UTC (permalink / raw) To: help-gnu-emacs Hongyi Zhao wrote: > Say, for back-tick or grave accent ( ` ) symbol, I want to > let Emacs give me all of its name and alias, but the `M-x > describe-char ` can only give the following information: > > name: GRAVE ACCENT > old-name: SPACING GRAVE I'd say use `backquote' in Lisp settings (indeed, even an Elisp function) ... for everything else, use the (new) name. > So, I want to know if it's possible to find all the name and > alias corresponding to a codepoint in Emacs. Uhm, what other aliases would that be? And if any, where are they stored in Emacs? BTW, check this out: ;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/char.el (defun what-char (&optional pos) (interactive "P") (let*((position (or (and (numberp pos) pos) (point) )) (kill pos) (char (char-after position)) ) (when char (let*((name (get-char-code-property char 'name)) (old-name (get-char-code-property char 'old-name)) (msg (if (and name old-name) (format "%s (old: %s)" name old-name) (or name old-name) )) (msg-dc (when (stringp msg) (downcase msg))) ) (when msg-dc (prog1 msg-dc (when kill (kill-new msg-dc)) (message "%s (at point: %d)" msg-dc position) )))))) ;; (what-char) ; "space" ;; (what-char 754) ; "right parenthesis (old: closing parenthesis)" ;; C-u 754 M-x what-char RET ; same, but also killed ;; C-u M-x what-char RET* (C-y) ; asterisk is yanked ;; M-x what-char RET ; line feed (lf) (at point: 1034) -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Find all the name and alias corresponding to a codepoint in Emacs. 2022-03-12 2:54 Find all the name and alias corresponding to a codepoint in Emacs Hongyi Zhao 2022-03-12 4:00 ` Emanuel Berg via Users list for the GNU Emacs text editor @ 2022-03-12 6:30 ` Eli Zaretskii 2022-03-12 8:43 ` Hongyi Zhao 1 sibling, 1 reply; 13+ messages in thread From: Eli Zaretskii @ 2022-03-12 6:30 UTC (permalink / raw) To: help-gnu-emacs > From: Hongyi Zhao <hongyi.zhao@gmail.com> > Date: Sat, 12 Mar 2022 10:54:49 +0800 > > Say, for back-tick or grave accent ( ` ) symbol, I want to let Emacs > give me all of its name and alias, but the `M-x describe-char ` can > only give the following information: > > name: GRAVE ACCENT > old-name: SPACING GRAVE > > So, I want to know if it's possible to find all the name and alias > corresponding to a codepoint in Emacs. Right next to the "Character code properties:" heading in the buffer shown by describe-char, there's a button whose title is "customize what to show". If you click it or press RET on it, you will be shown a buffer where you customize what character properties to display. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Find all the name and alias corresponding to a codepoint in Emacs. 2022-03-12 6:30 ` Eli Zaretskii @ 2022-03-12 8:43 ` Hongyi Zhao 2022-03-12 8:55 ` Hongyi Zhao 0 siblings, 1 reply; 13+ messages in thread From: Hongyi Zhao @ 2022-03-12 8:43 UTC (permalink / raw) To: Eli Zaretskii; +Cc: help-gnu-emacs [-- Attachment #1: Type: text/plain, Size: 878 bytes --] On Sat, Mar 12, 2022 at 2:31 PM Eli Zaretskii <eliz@gnu.org> wrote: > > > From: Hongyi Zhao <hongyi.zhao@gmail.com> > > Date: Sat, 12 Mar 2022 10:54:49 +0800 > > > > Say, for back-tick or grave accent ( ` ) symbol, I want to let Emacs > > give me all of its name and alias, but the `M-x describe-char ` can > > only give the following information: > > > > name: GRAVE ACCENT > > old-name: SPACING GRAVE > > > > So, I want to know if it's possible to find all the name and alias > > corresponding to a codepoint in Emacs. > > Right next to the "Character code properties:" heading in the buffer > shown by describe-char, there's a button whose title is "customize > what to show". If you click it or press RET on it, you will be shown > a buffer where you customize what character properties to display. Thank you. I see, as shown in the attachment. Best regards, Hongyi [-- Attachment #2: image.png --] [-- Type: image/png, Size: 136314 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Find all the name and alias corresponding to a codepoint in Emacs. 2022-03-12 8:43 ` Hongyi Zhao @ 2022-03-12 8:55 ` Hongyi Zhao 2022-03-12 9:35 ` Eli Zaretskii 0 siblings, 1 reply; 13+ messages in thread From: Hongyi Zhao @ 2022-03-12 8:55 UTC (permalink / raw) To: Eli Zaretskii; +Cc: help-gnu-emacs On Sat, Mar 12, 2022 at 4:43 PM Hongyi Zhao <hongyi.zhao@gmail.com> wrote: > > On Sat, Mar 12, 2022 at 2:31 PM Eli Zaretskii <eliz@gnu.org> wrote: > > > > > From: Hongyi Zhao <hongyi.zhao@gmail.com> > > > Date: Sat, 12 Mar 2022 10:54:49 +0800 > > > > > > Say, for back-tick or grave accent ( ` ) symbol, I want to let Emacs > > > give me all of its name and alias, but the `M-x describe-char ` can > > > only give the following information: > > > > > > name: GRAVE ACCENT > > > old-name: SPACING GRAVE > > > > > > So, I want to know if it's possible to find all the name and alias > > > corresponding to a codepoint in Emacs. > > > > Right next to the "Character code properties:" heading in the buffer > > shown by describe-char, there's a button whose title is "customize > > what to show". If you click it or press RET on it, you will be shown > > a buffer where you customize what character properties to display. > > Thank you. I see, as shown in the attachment. Now, I've enabled all the properties defined in "Describe Char Unidata List": (setq describe-char-unidata-list '(name old-name general-category canonical-combining-class bidi-class decomposition decimal-digit-value digit-value numeric-value mirrored iso-10646-comment uppercase lowercase titlecase) ) But `M-x describe-char ` still gives the following information: ``` position: 1 of 1 (0%), column: 0 character: ` (displayed as `) (codepoint 96, #o140, #x60) charset: ascii (ASCII (ISO646 IRV)) code point in charset: 0x60 script: latin syntax: ' which means: prefix category: .:Base, a:ASCII, l:Latin, r:Roman to input: type "C-x 8 RET 60" or "C-x 8 RET GRAVE ACCENT" buffer code: #x60 file code: #x60 (encoded by coding system utf-8-unix) display: by this font (glyph code): ftcrhb:-PfEd-DejaVuSansMono Nerd Font Mono-regular-normal-normal-*-20-*-*-*-m-0-iso10646-1 (#x43) Character code properties: customize what to show name: GRAVE ACCENT old-name: SPACING GRAVE general-category: Sk (Symbol, Modifier) canonical-combining-class: 0 (Spacing, split, enclosing, reordrant, and Tibetan subjoined) bidi-class: ON (Other Neutrals) decomposition: (96) ('`') mirrored: N There are 3 overlays here: From 1 to 1 face highlight From 1 to 1 face highlight From 1 to 1 face highlight There are text properties here: fontified t wrap-prefix " " ws-butler-chg chg [back] ``` Best regards, Hongyi ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Find all the name and alias corresponding to a codepoint in Emacs. 2022-03-12 8:55 ` Hongyi Zhao @ 2022-03-12 9:35 ` Eli Zaretskii 2022-03-12 11:20 ` Hongyi Zhao 0 siblings, 1 reply; 13+ messages in thread From: Eli Zaretskii @ 2022-03-12 9:35 UTC (permalink / raw) To: help-gnu-emacs > From: Hongyi Zhao <hongyi.zhao@gmail.com> > Date: Sat, 12 Mar 2022 16:55:26 +0800 > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org> > > Now, I've enabled all the properties defined in "Describe Char Unidata List": > > (setq describe-char-unidata-list > '(name old-name general-category canonical-combining-class > bidi-class decomposition decimal-digit-value digit-value numeric-value > mirrored iso-10646-comment uppercase lowercase titlecase) > ) > > > But `M-x describe-char ` still gives the following information: > > ``` > position: 1 of 1 (0%), column: 0 > character: ` (displayed as `) (codepoint 96, #o140, #x60) > charset: ascii (ASCII (ISO646 IRV)) > code point in charset: 0x60 > script: latin > syntax: ' which means: prefix > category: .:Base, a:ASCII, l:Latin, r:Roman > to input: type "C-x 8 RET 60" or "C-x 8 RET GRAVE ACCENT" > buffer code: #x60 > file code: #x60 (encoded by coding system utf-8-unix) > display: by this font (glyph code): > ftcrhb:-PfEd-DejaVuSansMono Nerd Font > Mono-regular-normal-normal-*-20-*-*-*-m-0-iso10646-1 (#x43) > > Character code properties: customize what to show > name: GRAVE ACCENT > old-name: SPACING GRAVE > general-category: Sk (Symbol, Modifier) > canonical-combining-class: 0 (Spacing, split, enclosing, reordrant, > and Tibetan subjoined) > bidi-class: ON (Other Neutrals) > decomposition: (96) ('`') > mirrored: N Why is that a problem? The properties that aren't shown are all nil, so they are not interesting. Emacs shows to you all the properties whose values are useful. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Find all the name and alias corresponding to a codepoint in Emacs. 2022-03-12 9:35 ` Eli Zaretskii @ 2022-03-12 11:20 ` Hongyi Zhao 2022-03-12 11:40 ` Eli Zaretskii 0 siblings, 1 reply; 13+ messages in thread From: Hongyi Zhao @ 2022-03-12 11:20 UTC (permalink / raw) To: Eli Zaretskii; +Cc: help-gnu-emacs On Sat, Mar 12, 2022 at 5:36 PM Eli Zaretskii <eliz@gnu.org> wrote: > > > From: Hongyi Zhao <hongyi.zhao@gmail.com> > > Date: Sat, 12 Mar 2022 16:55:26 +0800 > > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org> > > > > Now, I've enabled all the properties defined in "Describe Char Unidata List": > > > > (setq describe-char-unidata-list > > '(name old-name general-category canonical-combining-class > > bidi-class decomposition decimal-digit-value digit-value numeric-value > > mirrored iso-10646-comment uppercase lowercase titlecase) > > ) > > > > > > But `M-x describe-char ` still gives the following information: > > > > ``` > > position: 1 of 1 (0%), column: 0 > > character: ` (displayed as `) (codepoint 96, #o140, #x60) > > charset: ascii (ASCII (ISO646 IRV)) > > code point in charset: 0x60 > > script: latin > > syntax: ' which means: prefix > > category: .:Base, a:ASCII, l:Latin, r:Roman > > to input: type "C-x 8 RET 60" or "C-x 8 RET GRAVE ACCENT" > > buffer code: #x60 > > file code: #x60 (encoded by coding system utf-8-unix) > > display: by this font (glyph code): > > ftcrhb:-PfEd-DejaVuSansMono Nerd Font > > Mono-regular-normal-normal-*-20-*-*-*-m-0-iso10646-1 (#x43) > > > > Character code properties: customize what to show > > name: GRAVE ACCENT > > old-name: SPACING GRAVE > > general-category: Sk (Symbol, Modifier) > > canonical-combining-class: 0 (Spacing, split, enclosing, reordrant, > > and Tibetan subjoined) > > bidi-class: ON (Other Neutrals) > > decomposition: (96) ('`') > > mirrored: N > > Why is that a problem? The "grave accent" is also named as "backtick" or "backquote", and I hope to see all these names in Emacs. > The properties that aren't shown are all nil, > so they are not interesting. Emacs shows to you all the properties > whose values are useful. Thank you for your explanation. Best, Hongyi ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Find all the name and alias corresponding to a codepoint in Emacs. 2022-03-12 11:20 ` Hongyi Zhao @ 2022-03-12 11:40 ` Eli Zaretskii 2022-03-12 11:57 ` Hongyi Zhao 2022-03-20 16:01 ` Felix Dietrich 0 siblings, 2 replies; 13+ messages in thread From: Eli Zaretskii @ 2022-03-12 11:40 UTC (permalink / raw) To: help-gnu-emacs > From: Hongyi Zhao <hongyi.zhao@gmail.com> > Date: Sat, 12 Mar 2022 19:20:11 +0800 > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org> > > > > Character code properties: customize what to show > > > name: GRAVE ACCENT > > > old-name: SPACING GRAVE > > > general-category: Sk (Symbol, Modifier) > > > canonical-combining-class: 0 (Spacing, split, enclosing, reordrant, > > > and Tibetan subjoined) > > > bidi-class: ON (Other Neutrals) > > > decomposition: (96) ('`') > > > mirrored: N > > > > Why is that a problem? > > The "grave accent" is also named as "backtick" or "backquote", and I > hope to see all these names in Emacs. We only show the Unicode data, and it has only "SPACING GRAVE" as an alternative name. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Find all the name and alias corresponding to a codepoint in Emacs. 2022-03-12 11:40 ` Eli Zaretskii @ 2022-03-12 11:57 ` Hongyi Zhao 2022-03-20 16:01 ` Felix Dietrich 1 sibling, 0 replies; 13+ messages in thread From: Hongyi Zhao @ 2022-03-12 11:57 UTC (permalink / raw) To: Eli Zaretskii; +Cc: help-gnu-emacs On Sat, Mar 12, 2022 at 7:40 PM Eli Zaretskii <eliz@gnu.org> wrote: > > > From: Hongyi Zhao <hongyi.zhao@gmail.com> > > Date: Sat, 12 Mar 2022 19:20:11 +0800 > > Cc: help-gnu-emacs <help-gnu-emacs@gnu.org> > > > > > > Character code properties: customize what to show > > > > name: GRAVE ACCENT > > > > old-name: SPACING GRAVE > > > > general-category: Sk (Symbol, Modifier) > > > > canonical-combining-class: 0 (Spacing, split, enclosing, reordrant, > > > > and Tibetan subjoined) > > > > bidi-class: ON (Other Neutrals) > > > > decomposition: (96) ('`') > > > > mirrored: N > > > > > > Why is that a problem? > > > > The "grave accent" is also named as "backtick" or "backquote", and I > > hope to see all these names in Emacs. > > We only show the Unicode data, and it has only "SPACING GRAVE" as an > alternative name. Thank you for your explanation. I see. HZ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Find all the name and alias corresponding to a codepoint in Emacs. 2022-03-12 11:40 ` Eli Zaretskii 2022-03-12 11:57 ` Hongyi Zhao @ 2022-03-20 16:01 ` Felix Dietrich 2022-03-20 16:55 ` tomas 2022-03-21 1:12 ` Hongyi Zhao 1 sibling, 2 replies; 13+ messages in thread From: Felix Dietrich @ 2022-03-20 16:01 UTC (permalink / raw) To: help-gnu-emacs [-- Attachment #1: Type: text/plain, Size: 1287 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> From: Hongyi Zhao <hongyi.zhao@gmail.com> >> Date: Sat, 12 Mar 2022 19:20:11 +0800 >> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org> >> >> > > Character code properties: customize what to show >> > > name: GRAVE ACCENT >> > > old-name: SPACING GRAVE >> > > general-category: Sk (Symbol, Modifier) >> > > canonical-combining-class: 0 (Spacing, split, enclosing, reordrant, >> > > and Tibetan subjoined) >> > > bidi-class: ON (Other Neutrals) >> > > decomposition: (96) ('`') >> > > mirrored: N >> > >> > Why is that a problem? >> >> The "grave accent" is also named as "backtick" or "backquote", and I >> hope to see all these names in Emacs. > > We only show the Unicode data, and it has only "SPACING GRAVE" as an > alternative name. A somewhat harebrained idea of mine queries Wikidata for aliases stored there. Use the command ‘wd-char-aliases-show’ to display a list of aliases for the character under the cursor. This sketch has no comments or docstrings, nor does it check for errors. The query is slow and might very well not be entirely correct. (I do not have much of an understanding of SPARQL and Wikidata.) Maybe it can still be of use to you – or of interest as a curiosity. [-- Attachment #2: Emacs Lisp code to search character aliases on Wikidata --] [-- Type: application/emacs-lisp, Size: 1672 bytes --] [-- Attachment #3: Type: text/plain, Size: 21 bytes --] -- Felix Dietrich ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Find all the name and alias corresponding to a codepoint in Emacs. 2022-03-20 16:01 ` Felix Dietrich @ 2022-03-20 16:55 ` tomas 2022-03-21 1:12 ` Hongyi Zhao 1 sibling, 0 replies; 13+ messages in thread From: tomas @ 2022-03-20 16:55 UTC (permalink / raw) To: help-gnu-emacs [-- Attachment #1: Type: text/plain, Size: 258 bytes --] On Sun, Mar 20, 2022 at 05:01:28PM +0100, Felix Dietrich wrote: [...] > A somewhat harebrained idea of mine queries Wikidata for aliases stored > there. Nice :) Thanks for this snippet: it tickles the appetite to play around! Cheers -- t [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 195 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Find all the name and alias corresponding to a codepoint in Emacs. 2022-03-20 16:01 ` Felix Dietrich 2022-03-20 16:55 ` tomas @ 2022-03-21 1:12 ` Hongyi Zhao 2022-03-21 1:33 ` Emanuel Berg via Users list for the GNU Emacs text editor 1 sibling, 1 reply; 13+ messages in thread From: Hongyi Zhao @ 2022-03-21 1:12 UTC (permalink / raw) To: Felix Dietrich; +Cc: help-gnu-emacs On Mon, Mar 21, 2022 at 12:14 AM Felix Dietrich <felix.dietrich@sperrhaken.name> wrote: > > Eli Zaretskii <eliz@gnu.org> writes: > > >> From: Hongyi Zhao <hongyi.zhao@gmail.com> > >> Date: Sat, 12 Mar 2022 19:20:11 +0800 > >> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org> > >> > >> > > Character code properties: customize what to show > >> > > name: GRAVE ACCENT > >> > > old-name: SPACING GRAVE > >> > > general-category: Sk (Symbol, Modifier) > >> > > canonical-combining-class: 0 (Spacing, split, enclosing, reordrant, > >> > > and Tibetan subjoined) > >> > > bidi-class: ON (Other Neutrals) > >> > > decomposition: (96) ('`') > >> > > mirrored: N > >> > > >> > Why is that a problem? > >> > >> The "grave accent" is also named as "backtick" or "backquote", and I > >> hope to see all these names in Emacs. > > > > We only show the Unicode data, and it has only "SPACING GRAVE" as an > > alternative name. > > A somewhat harebrained idea of mine queries Wikidata for aliases stored > there. Use the command ‘wd-char-aliases-show’ to display a list of > aliases for the character under the cursor. This sketch has no comments > or docstrings, nor does it check for errors. The query is slow and > might very well not be entirely correct. (I do not have much of an > understanding of SPARQL and Wikidata.) Maybe it can still be of use to > you – or of interest as a curiosity. Nice. It gives the following query result for "`" discussed here: varia grave accent typewritten backtick bareia backquote backtick grave Best, HZ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Find all the name and alias corresponding to a codepoint in Emacs. 2022-03-21 1:12 ` Hongyi Zhao @ 2022-03-21 1:33 ` Emanuel Berg via Users list for the GNU Emacs text editor 0 siblings, 0 replies; 13+ messages in thread From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2022-03-21 1:33 UTC (permalink / raw) To: help-gnu-emacs Hongyi Zhao wrote: > Nice. It gives the following query result for "`" discussed > here: > > varia > grave accent > typewritten backtick > bareia > qbackquote > backtick > grave Well, it is "backquote" (`backquote') in the Emacs world ... -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2022-03-21 1:33 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-03-12 2:54 Find all the name and alias corresponding to a codepoint in Emacs Hongyi Zhao 2022-03-12 4:00 ` Emanuel Berg via Users list for the GNU Emacs text editor 2022-03-12 6:30 ` Eli Zaretskii 2022-03-12 8:43 ` Hongyi Zhao 2022-03-12 8:55 ` Hongyi Zhao 2022-03-12 9:35 ` Eli Zaretskii 2022-03-12 11:20 ` Hongyi Zhao 2022-03-12 11:40 ` Eli Zaretskii 2022-03-12 11:57 ` Hongyi Zhao 2022-03-20 16:01 ` Felix Dietrich 2022-03-20 16:55 ` tomas 2022-03-21 1:12 ` Hongyi Zhao 2022-03-21 1:33 ` Emanuel Berg via Users list for the GNU Emacs text editor
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).