help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to show ascii number of a character


From: Romain FRANCOISE
Subject: Re: how to show ascii number of a character
Date: Sun, 12 Jan 2003 20:19:50 +0100
User-agent: Gnus/5.090012 (Oort Gnus v0.12) Emacs/21.3.50 (i686-pc-linux-gnu)

Zimmen Gnauh <address@hidden> writes:

>    Is there any emacs function that can show a the ascii number of a
> character? i.e. you enter a character, and it shows a number. For
> example, enter character D, it will show 68, or in octal, binary or
> other forms. 

Add this to your ~/.emacs:

(defun zg-char-to-ascii ()
  "Show the ASCII number of a character."
  (interactive)
  (message (number-to-string
            (aref (read-from-minibuffer "Type a character: ") 0))))

... and do M-x zg-char-to-ascii.

Cheers,

-- 
Romain FRANCOISE <address@hidden> | I know, you love the song but
it's a miracle -- http://orebokech.com/ | not the singer.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]