* Inserting an unicode character
@ 2009-07-17 18:51 Alberto Simões
2009-07-17 19:57 ` Florian Beck
0 siblings, 1 reply; 8+ messages in thread
From: Alberto Simões @ 2009-07-17 18:51 UTC (permalink / raw)
To: help-gnu-emacs
Hello
Is there any way to visit an unicode table from within emacs? Or, for
instance, inserting the caracter using its name.
TIA
Alberto
--
Alberto Simões
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Inserting an unicode character
[not found] <mailman.2710.1247856675.2239.help-gnu-emacs@gnu.org>
@ 2009-07-17 19:05 ` Teemu Likonen
2009-07-17 23:45 ` Xah Lee
1 sibling, 0 replies; 8+ messages in thread
From: Teemu Likonen @ 2009-07-17 19:05 UTC (permalink / raw)
To: help-gnu-emacs
On 2009-07-17 19:51 (+0100), Alberto Simões wrote:
> Is there any way to visit an unicode table from within emacs? Or, for
> instance, inserting the caracter using its name.
Yes, at least in Emacs 23 there is "C-x 8 RET" which let's you insert a
Unicode character by its name or code. Completion works in the
minibuffer so you don't need to remember character's name accurately.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Inserting an unicode character
2009-07-17 18:51 Alberto Simões
@ 2009-07-17 19:57 ` Florian Beck
0 siblings, 0 replies; 8+ messages in thread
From: Florian Beck @ 2009-07-17 19:57 UTC (permalink / raw)
To: help-gnu-emacs
Alberto Simões <hashashin@gmail.com> writes:
> Is there any way to visit an unicode table from within emacs? Or, for
> instance, inserting the caracter using its name.
The emacs sources come with a file called »UnicodeData.txt« (in admin/unidata/). You can do
all kinds of cool things with it. To insert a character by name:
(defvar unicode-character-alist nil)
(defvar unicode-character-names nil)
(defun unicode-get-names ()
(let (unidata)
(with-temp-buffer
(insert-file-contents "/path/to/emacs/admin/unidata/UnicodeData.txt")
(goto-char (point-min))
(while (re-search-forward "^\\(?1:[[:alnum:]]+\\);\\(?2:.*?\\);" nil t)
(add-to-list 'unidata
(cons (downcase (match-string 2)) (string-to-number (match-string 1) 16)))))
(setq unicode-character-names (mapcar 'car unidata))
(setq unicode-character-alist unidata)))
(defun unicode-insert-by-name (name)
(interactive
(list
(progn
(unless unicode-character-names (unicode-get-names))
(completing-read
"Insert unicode character named: "
unicode-character-names nil t))))
(insert (cdr (assoc name unicode-character-alist))))
--
Florian Beck
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Inserting an unicode character
[not found] <mailman.2710.1247856675.2239.help-gnu-emacs@gnu.org>
2009-07-17 19:05 ` Inserting an unicode character Teemu Likonen
@ 2009-07-17 23:45 ` Xah Lee
2009-07-18 16:16 ` Jason Rumney
1 sibling, 1 reply; 8+ messages in thread
From: Xah Lee @ 2009-07-17 23:45 UTC (permalink / raw)
To: help-gnu-emacs
On Jul 17, 11:51 am, Alberto Simões <hashas...@gmail.com> wrote:
> Hello
>
> Is there any way to visit an unicode table from within emacs? Or, for
> instance, inserting the caracter using its name.
don't think it is possible to insert a unicode char by its unicode
name. (Florian gave code for that i guess)
though, there are several ways to easily find and insert unicode chars
you want in emacs, by ascii markup, by your personal frequently used
char set, by particular lang's input methods, by code point, etc.
this page gives some detail.
• Emacs and Unicode Tips
http://xahlee.org/emacs/emacs_n_unicode.html
i think it'd be useful for emacs to have some visual char map that
lets you select or view a category of chars for easy insertion.
(as in OS X's Character Pallette or Windows Character Map)
Shouldn't be diffucult to write one in elisp but as far as i know it
havn't been done.
Xah
∑ http://xahlee.org/
☄
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Inserting an unicode character
2009-07-17 23:45 ` Xah Lee
@ 2009-07-18 16:16 ` Jason Rumney
2009-07-18 17:49 ` Xah Lee
0 siblings, 1 reply; 8+ messages in thread
From: Jason Rumney @ 2009-07-18 16:16 UTC (permalink / raw)
To: help-gnu-emacs
On Jul 18, 7:45 am, Xah Lee <xah...@gmail.com> wrote:
> don't think it is possible to insert a unicode char by its unicode
> name. (Florian gave code for that i guess)
C-x 8 RET gives the following prompt:
Unicode (name or hex):
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Inserting an unicode character
2009-07-18 16:16 ` Jason Rumney
@ 2009-07-18 17:49 ` Xah Lee
2009-07-18 17:55 ` Xah Lee
0 siblings, 1 reply; 8+ messages in thread
From: Xah Lee @ 2009-07-18 17:49 UTC (permalink / raw)
To: help-gnu-emacs
On Jul 18, 9:16 am, Jason Rumney <jasonrum...@gmail.com> wrote:
> On Jul 18, 7:45 am, Xah Lee <xah...@gmail.com> wrote:
>
> > don't think it is possible to insert a unicode char by its unicode
> > name. (Florian gave code for that i guess)
>
> C-x 8 RET gives the following prompt:
>
> Unicode (name or hex):
very nice. thanks.
Xah
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Inserting an unicode character
2009-07-18 17:49 ` Xah Lee
@ 2009-07-18 17:55 ` Xah Lee
2009-07-19 16:20 ` Alberto Simões
0 siblings, 1 reply; 8+ messages in thread
From: Xah Lee @ 2009-07-18 17:55 UTC (permalink / raw)
To: help-gnu-emacs
On Jul 18, 10:49 am, Xah Lee <xah...@gmail.com> wrote:
> On Jul 18, 9:16 am, Jason Rumney <jasonrum...@gmail.com> wrote:
>
> > On Jul 18, 7:45 am, Xah Lee <xah...@gmail.com> wrote:
>
> > > don't think it is possible to insert a unicode char by its unicode
> > > name. (Florian gave code for that i guess)
>
> > C-x 8 RET gives the following prompt:
>
> > Unicode (name or hex):
>
> very nice. thanks.
A emacs 23 feature!
Xah
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Inserting an unicode character
2009-07-18 17:55 ` Xah Lee
@ 2009-07-19 16:20 ` Alberto Simões
0 siblings, 0 replies; 8+ messages in thread
From: Alberto Simões @ 2009-07-19 16:20 UTC (permalink / raw)
To: Xah Lee; +Cc: help-gnu-emacs
On Sat, Jul 18, 2009 at 6:55 PM, Xah Lee<xahlee@gmail.com> wrote:
> On Jul 18, 10:49 am, Xah Lee <xah...@gmail.com> wrote:
>> On Jul 18, 9:16 am, Jason Rumney <jasonrum...@gmail.com> wrote:
>>
>> > On Jul 18, 7:45 am, Xah Lee <xah...@gmail.com> wrote:
>>
>> > > don't think it is possible to insert a unicode char by its unicode
>> > > name. (Florian gave code for that i guess)
>>
>> > C-x 8 RET gives the following prompt:
>>
>> > Unicode (name or hex):
>>
And with fuzzy completion it is just great.
Thanks!
--
Alberto Simões
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-07-19 16:20 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.2710.1247856675.2239.help-gnu-emacs@gnu.org>
2009-07-17 19:05 ` Inserting an unicode character Teemu Likonen
2009-07-17 23:45 ` Xah Lee
2009-07-18 16:16 ` Jason Rumney
2009-07-18 17:49 ` Xah Lee
2009-07-18 17:55 ` Xah Lee
2009-07-19 16:20 ` Alberto Simões
2009-07-17 18:51 Alberto Simões
2009-07-17 19:57 ` Florian Beck
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).