unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Getting a key's read syntax as a string
@ 2015-03-28  2:22 John Mastro
  2015-03-28  4:50 ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: John Mastro @ 2015-03-28  2:22 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

Hello Emacsers,

Is there a programmatic way to get a string representing a
key-with-modifier's read syntax, given its integer value?

Perhaps more clearly, I'm looking for something that would work like
this:

    (key-read-syntax ?\C-a) ;=> "?\C-a" or "C-a"
    (key-read-syntax ?\M-f) ;=> "?\M-f" or "M-f"

I checked the manual but didn't come across anything.

Thanks

-- 
john



^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Getting a key's read syntax as a string
  2015-03-28  2:22 Getting a key's read syntax as a string John Mastro
@ 2015-03-28  4:50 ` Drew Adams
  2015-03-28 20:05   ` John Mastro
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2015-03-28  4:50 UTC (permalink / raw)
  To: John Mastro, help-gnu-emacs

> Is there a programmatic way to get a string representing a
> key-with-modifier's read syntax, given its integer value?
> 
> Perhaps more clearly, I'm looking for something that would work like
> this:
>     (key-read-syntax ?\C-a) ;=> "?\C-a" or "C-a"
>     (key-read-syntax ?\M-f) ;=> "?\M-f" or "M-f"
> I checked the manual but didn't come across anything.

Not sure what you're asking, but does `single-key-description' or
`key-description' fit?

(single-key-description ?\C-a) ;=> "C-a"
etc.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Getting a key's read syntax as a string
  2015-03-28  4:50 ` Drew Adams
@ 2015-03-28 20:05   ` John Mastro
  0 siblings, 0 replies; 3+ messages in thread
From: John Mastro @ 2015-03-28 20:05 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

Drew Adams <drew.adams@oracle.com> wrote:
> Not sure what you're asking, but does `single-key-description' or
> `key-description' fit?

Indeed, I didn't explain myself well. But `single-key-description' is
exactly what I was looking for, so it worked out in the end - thanks!

-- 
john



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-28 20:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-28  2:22 Getting a key's read syntax as a string John Mastro
2015-03-28  4:50 ` Drew Adams
2015-03-28 20:05   ` John Mastro

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).