unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David.Kastrup@t-online.de (David Kastrup)
Cc: emacs-devel@gnu.org
Subject: Re: Printing elisp char literals
Date: 26 May 2003 22:49:22 +0200	[thread overview]
Message-ID: <x57k8dtovh.fsf@lola.goethe.zz> (raw)
In-Reply-To: <200305262027.h4QKRtlO001787@rum.cs.yale.edu>

"Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu> writes:

> Let's say I have an integer.  How can I check whether it's a char ?
> `char-valid-p' is only part of the answer, because I'd like to know
> if the integer is a char-with-modifiers also.  The best I could come
> up with right now is:
> 
>    (char-valid-p (logand char ?\x3fffff))
> 
> Is the mask available somewhere or do I simply have to hardcode it
> like that ?
> 
> Furthermore, in order to print this integer in a form like ?\C-a,
> what should I do ?  The best I could come up with is:
> 
>     (let ((s (single-key-description char)))
>       (while (string-match "\\`\\(\\\\[MCAHSs]-\\)*\\(\\)[MCAHSs]-." s)
>         (setq s (replace-match "\\" t t s 2)))
>       (concat "?" s))

IIRC, XEmacs has sort of an opaque character representation type, so
it might be worth borrowing an idea or two from them in this regard
before reinventing the wheel.  Stephen, any idea of whether something
might apply here?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2003-05-26 20:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-26 20:27 Printing elisp char literals Stefan Monnier
2003-05-26 20:49 ` David Kastrup [this message]
2003-05-27 10:39   ` Stephen J. Turnbull
2003-05-27  0:02 ` Miles' patch still fixes xfaces.c Robert J. Chassell
2003-05-27 22:40   ` Richard Stallman
2003-05-28  0:46     ` Robert J. Chassell
2003-05-31 19:52       ` Richard Stallman
2003-05-31 21:43         ` Robert J. Chassell

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=x57k8dtovh.fsf@lola.goethe.zz \
    --to=david.kastrup@t-online.de \
    --cc=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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.
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).