all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* having trouble adding a key to an existing mode-map
@ 2013-12-18 17:31 gottlieb
  2013-12-18 17:38 ` Jambunathan K
  0 siblings, 1 reply; 4+ messages in thread
From: gottlieb @ 2013-12-18 17:31 UTC (permalink / raw)
  To: help-gnu-emacs

My actual goal is to bind C-c t when in nroff mode to my command
ajg-preview-troff.  To isolate any of my code I have tried

emacs -Q -nw
(require 'nroff-mode)
(define-key nroff-mode-map "t" 'dired)
nroff-mode-map

The result is
 (keymap (116 . dired) ...)

But 116 is not "t"; it is down.

Where is my error?
thanks,
allan



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

* Re: having trouble adding a key to an existing mode-map
  2013-12-18 17:31 having trouble adding a key to an existing mode-map gottlieb
@ 2013-12-18 17:38 ` Jambunathan K
  2013-12-18 17:51   ` Drew Adams
  0 siblings, 1 reply; 4+ messages in thread
From: Jambunathan K @ 2013-12-18 17:38 UTC (permalink / raw)
  To: gottlieb; +Cc: help-gnu-emacs

gottlieb@nyu.edu writes:

> But 116 is not "t"; it is down.

But 116 (decimal) is t.

http://en.wikipedia.org/wiki/Ascii_table





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

* RE: having trouble adding a key to an existing mode-map
  2013-12-18 17:38 ` Jambunathan K
@ 2013-12-18 17:51   ` Drew Adams
  0 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2013-12-18 17:51 UTC (permalink / raw)
  To: Jambunathan K, gottlieb; +Cc: help-gnu-emacs

> > But 116 is not "t"; it is down.
> But 116 (decimal) is t.

(IOW, 116 is the character `t'.  In Emacs Lisp, characters are natural numbers- but not all natural numbers are characters.)

Using `C-h v' to view a keymap is not very user-friendly.

A better way is to load `help-fns+.el' and then use `C-h M-k',
which is command `describe-keymap'.  It prompts you for the
keymap symbol - in this case, `nroff-mode-map', and then lists
the keys bound in that map, in a human-readable way.

http://www.emacswiki.org/emacs/download/help-fns%2b.el



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

* Re: having trouble adding a key to an existing mode-map
       [not found] <mailman.9600.1387387898.10748.help-gnu-emacs@gnu.org>
@ 2013-12-18 21:31 ` Emanuel Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Emanuel Berg @ 2013-12-18 21:31 UTC (permalink / raw)
  To: help-gnu-emacs

gottlieb@nyu.edu writes:

> My actual goal is to bind C-c t when in nroff mode to
> my command ajg-preview-troff.  To isolate any of my
> code I have tried
>
> emacs -Q -nw (require 'nroff-mode) (define-key
> nroff-mode-map "t" 'dired) nroff-mode-map
>
> The result is (keymap (116 . dired) ...)
>
> But 116 is not "t"; it is down.
>
> Where is my error?  thanks, allan
>

Just 't' or 'C-c t'? What I can see both works:

(require 'nroff-mode)
(define-key nroff-mode-map "t" (lambda () (interactive)
(message "t pressed")))
(define-key nroff-mode-map "\C-ct" (lambda () (interactive)
(message "C-c t pressed")))
(nroff-mode) ; then try t or C-c t

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


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

end of thread, other threads:[~2013-12-18 21:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-18 17:31 having trouble adding a key to an existing mode-map gottlieb
2013-12-18 17:38 ` Jambunathan K
2013-12-18 17:51   ` Drew Adams
     [not found] <mailman.9600.1387387898.10748.help-gnu-emacs@gnu.org>
2013-12-18 21:31 ` Emanuel Berg

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.