unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Romain FRANCOISE <romain@orebokech.com>
Subject: Re: how to show ascii number of a character
Date: Sun, 12 Jan 2003 20:19:50 +0100	[thread overview]
Message-ID: <87of6mmazt.fsf@orebokech.com> (raw)
In-Reply-To: m1adi68ar4.fsf@localhost.localdomain

Zimmen Gnauh <yah00204052@yahoo.com> 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 <romain@orebokech.com> | I know, you love the song but
it's a miracle -- http://orebokech.com/ | not the singer.

  reply	other threads:[~2003-01-12 19:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-12 18:40 how to show ascii number of a character Zimmen Gnauh
2003-01-12 19:19 ` Romain FRANCOISE [this message]
2003-01-12 22:33   ` Pascal Bourguignon
2003-01-13  5:52 ` Janusz S. Bień
2003-01-16  4:55 ` Rikard Bosnjakovic

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=87of6mmazt.fsf@orebokech.com \
    --to=romain@orebokech.com \
    /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.
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).