unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how to extend `C-x 8` keymap?
@ 2011-11-07 17:08 Tom Roche
  2011-11-07 17:25 ` Drew Adams
  2011-11-07 18:38 ` Tom Roche
  0 siblings, 2 replies; 5+ messages in thread
From: Tom Roche @ 2011-11-07 17:08 UTC (permalink / raw)
  To: help-gnu-emacs


Apologies if this is a FAQ, but I didn't see it in the GNU Emacs FAQ or while googling (and I have an `info` problem, about which separately):

How can I (presumably in init.el) extend my `C-x 8` keymap? E.g., I want

          to
sequence  produce  as does (currently)
--------  -------  ------------------------------------
C-x 8 d   δ        C-x 8 RET GREEK SMALL LETTER DELTA
C-x 8 D   Δ        C-x 8 RET GREEK CAPITAL LETTER DELTA

Currently those sequences are undefined.

TIA, Tom Roche <Tom_Roche@pobox.com>



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

* RE: how to extend `C-x 8` keymap?
  2011-11-07 17:08 how to extend `C-x 8` keymap? Tom Roche
@ 2011-11-07 17:25 ` Drew Adams
  2011-11-07 18:38 ` Tom Roche
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2011-11-07 17:25 UTC (permalink / raw)
  To: help-gnu-emacs, 'Tom Roche'

> How can I (presumably in init.el) extend my `C-x 8` keymap?
>
> sequence  produce  as does (currently)
> --------  -------  ------------------------------------
> C-x 8 d   d        C-x 8 RET GREEK SMALL LETTER DELTA
> C-x 8 D   ?        C-x 8 RET GREEK CAPITAL LETTER DELTA
> 
> Currently those sequences are undefined.

Try this:

(define-key iso-transl-ctl-x-8-map "d" [?X])
(define-key iso-transl-ctl-x-8-map "D" [?Y])

But instead of X and Y you need to use the actual chars you want. 




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

* Re: how to extend `C-x 8` keymap?
  2011-11-07 17:08 how to extend `C-x 8` keymap? Tom Roche
  2011-11-07 17:25 ` Drew Adams
@ 2011-11-07 18:38 ` Tom Roche
  2011-11-07 18:57   ` Drew Adams
  2011-11-07 20:03   ` Tom Roche
  1 sibling, 2 replies; 5+ messages in thread
From: Tom Roche @ 2011-11-07 18:38 UTC (permalink / raw)
  To: help-gnu-emacs


>> [I want to define the currently-undefined sequences]
>>           to
>> sequence  produce  as does (currently)
>> --------  -------  ------------------------------------
>> C-x 8 d   δ        C-x 8 RET GREEK SMALL LETTER DELTA
>> C-x 8 D   Δ        C-x 8 RET GREEK CAPITAL LETTER DELTA

Drew Adams Mon, 7 Nov 2011 09:25:04 -0800
> (define-key iso-transl-ctl-x-8-map "d" [?X])
> (define-key iso-transl-ctl-x-8-map "D" [?Y])
> [substituting for] X and Y

When I do

init.el
+ (define-key iso-transl-ctl-x-8-map "d" [?δ])
+ (define-key iso-transl-ctl-x-8-map "D" [?Δ])

I get

*Backtrace*
> Debugger entered--Lisp error: (void-variable iso-transl-ctl-x-8-map)

FWIW, I'm running 

$ emacs --version
GNU Emacs 23.3.1

your assistance is appreciated, Tom Roche <Tom_Roche@pobox.com>



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

* RE: how to extend `C-x 8` keymap?
  2011-11-07 18:38 ` Tom Roche
@ 2011-11-07 18:57   ` Drew Adams
  2011-11-07 20:03   ` Tom Roche
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2011-11-07 18:57 UTC (permalink / raw)
  To: help-gnu-emacs, 'Tom Roche'

> + (define-key iso-transl-ctl-x-8-map "d" [?d])
> + (define-key iso-transl-ctl-x-8-map "D" [??])
> 
> I get Debugger entered--Lisp error:
> (void-variable iso-transl-ctl-x-8-map)

Oh, right.

You should be able to do the same thing, but quoting the keymap var (actually, a
function that DTRT):

(define-key 'iso-transl-ctl-x-8-map "d" [?d])
(define-key 'iso-transl-ctl-x-8-map "D" [??])
            ^
            |
            +-- quote mark

If that doesn't work then try this before using the unquoted sexps:

(require 'iso-transl)




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

* Re: how to extend `C-x 8` keymap?
  2011-11-07 18:38 ` Tom Roche
  2011-11-07 18:57   ` Drew Adams
@ 2011-11-07 20:03   ` Tom Roche
  1 sibling, 0 replies; 5+ messages in thread
From: Tom Roche @ 2011-11-07 20:03 UTC (permalink / raw)
  To: help-gnu-emacs


Drew Adams Mon, 7 Nov 2011 10:57:58 -0800
> (define-key 'iso-transl-ctl-x-8-map "d" [?δ])
> (define-key 'iso-transl-ctl-x-8-map "D" [?Δ])
>             ^
>             |
>             +-- quote mark

That was it! Just put that in a file loaded from init.el,
byte-compile-file, restarted emacs. For future use, this is now an
example @

http://www.emacswiki.org/emacs/PrefixKey#toc1

thanks again, Tom Roche <Tom_Roche@pobox.com>



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

end of thread, other threads:[~2011-11-07 20:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07 17:08 how to extend `C-x 8` keymap? Tom Roche
2011-11-07 17:25 ` Drew Adams
2011-11-07 18:38 ` Tom Roche
2011-11-07 18:57   ` Drew Adams
2011-11-07 20:03   ` Tom Roche

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