all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.