all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Q on shell-mode-map
@ 2006-07-22 18:11 Drew Adams
  2006-07-22 18:15 ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2006-07-22 18:11 UTC (permalink / raw)


I have a question on shell-mode-map. Maybe I'm reading the code in shell.el
wrong, and I'm also not real clear on how keymaps work with
define-derived-mode.

What I'd like to do is bind a key in comint-mode-map, and have it also bound
in, say shell-mode-map (and the other modes derived from comint-mode), that
is, for subsequent uses of shell-mode.

It looks like shell-mode-map is defined at load time, however, based on
comint-mode-map, so it wouldn't pick up my later addition of a key binding
to comint-mode-map. Am I missing something here?

Could someone please explain this to me, and let me know the right way to do
what I want to do? Thx. Sending to emacs-devel instead of help-gnu-emacs, in
the off chance that shell.el should be changed to pick up the
comint-mode-map when shell-mode is run.

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

* RE: Q on shell-mode-map
  2006-07-22 18:11 Q on shell-mode-map Drew Adams
@ 2006-07-22 18:15 ` Drew Adams
  2006-07-22 18:40   ` Drew Adams
  2006-07-22 23:15   ` Johan Bockgård
  0 siblings, 2 replies; 5+ messages in thread
From: Drew Adams @ 2006-07-22 18:15 UTC (permalink / raw)


    I have a question on shell-mode-map. Maybe I'm reading the code
    in shell.el wrong, and I'm also not real clear on how keymaps
    work with define-derived-mode.

    What I'd like to do is bind a key in comint-mode-map, and have
    it also bound in, say shell-mode-map (and the other modes
    derived from comint-mode), that is, for subsequent uses of shell-mode.

    It looks like shell-mode-map is defined at load time, however,
    based on comint-mode-map, so it wouldn't pick up my later
    addition of a key binding to comint-mode-map. Am I missing
    something here?

    Could someone please explain this to me, and let me know the
    right way to do what I want to do? Thx. Sending to emacs-devel
    instead of help-gnu-emacs, in the off chance that shell.el
    should be changed to pick up the comint-mode-map when
    shell-mode is run.

Well, I see now that the nconc should make it so that shell-mode-map shares
a tail with comint-mode-map, so I guess it should work OK. However, it
doesn't seem to. Guess I'll have to test my code some more...

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

* RE: Q on shell-mode-map
  2006-07-22 18:15 ` Drew Adams
@ 2006-07-22 18:40   ` Drew Adams
  2006-07-22 23:15   ` Johan Bockgård
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2006-07-22 18:40 UTC (permalink / raw)


My bad - please ignore. I had a minor mode map that was shadowing the major
mode binding.

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

* Re: Q on shell-mode-map
  2006-07-22 18:15 ` Drew Adams
  2006-07-22 18:40   ` Drew Adams
@ 2006-07-22 23:15   ` Johan Bockgård
  2006-07-22 23:23     ` Drew Adams
  1 sibling, 1 reply; 5+ messages in thread
From: Johan Bockgård @ 2006-07-22 23:15 UTC (permalink / raw)


"Drew Adams" <drew.adams@oracle.com> writes:

> Well, I see now that the nconc should make it so that shell-mode-map
> shares a tail with comint-mode-map

Drew is referring to this line in shell.el:

    (setq shell-mode-map (nconc (make-sparse-keymap) comint-mode-map))

The manual says

    The proper way to construct a keymap with a parent is to use
    `set-keymap-parent'; if you have code that directly constructs a
    keymap with a parent, please convert the program to use
    `set-keymap-parent' instead.

so maybe that should be cleaned up.

-- 
Johan Bockgård

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

* RE: Q on shell-mode-map
  2006-07-22 23:15   ` Johan Bockgård
@ 2006-07-22 23:23     ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2006-07-22 23:23 UTC (permalink / raw)


    > Well, I see now that the nconc should make it so that shell-mode-map
    > shares a tail with comint-mode-map
    
    Drew is referring to this line in shell.el:
    
        (setq shell-mode-map (nconc (make-sparse-keymap) comint-mode-map))
    
    The manual says
    
        The proper way to construct a keymap with a parent is to use
        `set-keymap-parent'; if you have code that directly constructs a
        keymap with a parent, please convert the program to use
        `set-keymap-parent' instead.
    
    so maybe that should be cleaned up.
    
Ah, good catch.
    

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

end of thread, other threads:[~2006-07-22 23:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-22 18:11 Q on shell-mode-map Drew Adams
2006-07-22 18:15 ` Drew Adams
2006-07-22 18:40   ` Drew Adams
2006-07-22 23:15   ` Johan Bockgård
2006-07-22 23:23     ` Drew Adams

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.