unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Why can't unset C-j in help mode like other modes?
@ 2008-12-15 21:22 seberino
  2008-12-15 22:12 ` Drew Adams
       [not found] ` <mailman.2828.1229379156.26697.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: seberino @ 2008-12-15 21:22 UTC (permalink / raw)
  To: help-gnu-emacs

I successfully unset C-j in other modes but the same trick doesn't
work in help mode?!? Why is that?...

(add-hook 'help-mode-hook  (lambda () (define-key help-mode-map
                                                                   [?
\C-j] nil)))

Chris


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

* RE: Why can't unset C-j in help mode like other modes?
  2008-12-15 21:22 Why can't unset C-j in help mode like other modes? seberino
@ 2008-12-15 22:12 ` Drew Adams
       [not found] ` <mailman.2828.1229379156.26697.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Drew Adams @ 2008-12-15 22:12 UTC (permalink / raw)
  To: seberino, help-gnu-emacs

> I successfully unset C-j in other modes but the same trick doesn't
> work in help mode?!? Why is that?...
> 
> (add-hook 'help-mode-hook
>           (lambda () (define-key help-mode-map [?\C-j] nil)))

In *Help*, do `C-h k C-j'. You'll see this:

,----
| C-j runs the command View-scroll-line-forward
|   which is an interactive compiled Lisp function in `view.el'.
| It is bound to RET, C-j.
`----

Or do `C-h m' and look for LFD (which is `C-j'). You'll see that it is not
listed in the description of Help mode. You'll find it under the description of
View minor mode:

,----
| RET, LFD  scroll forward one line.  With prefix scroll forward prefix line(s).
`----

IOW, the `C-j' binding is not in help-mode-map; it is in view-mode-map.





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

* Re: Why can't unset C-j in help mode like other modes?
       [not found] ` <mailman.2828.1229379156.26697.help-gnu-emacs@gnu.org>
@ 2008-12-17 12:28   ` Xah Lee
  0 siblings, 0 replies; 3+ messages in thread
From: Xah Lee @ 2008-12-17 12:28 UTC (permalink / raw)
  To: help-gnu-emacs

On Dec 15, 2:12 pm, "Drew Adams" <drew.ad...@oracle.com> wrote:
> > I successfully unset C-j in other modes but the same trick doesn't
> > work in help mode?!? Why is that?...
>
> > (add-hook 'help-mode-hook
> >           (lambda () (define-key help-mode-map [?\C-j] nil)))
>
> In *Help*, do `C-h k C-j'. You'll see this:
>
> ,----
> | C-j runs the command View-scroll-line-forward
> |   which is an interactive compiled Lisp function in `view.el'.
> | It is bound to RET, C-j.
> `----
>
> Or do `C-h m' and look for LFD (which is `C-j'). You'll see that it is not
> listed in the description of Help mode. You'll find it under the description of
> View minor mode:
>
> ,----
> | RET, LFD  scroll forward one line.  With prefix scroll forward prefix line(s).
> `----
>
> IOW, the `C-j' binding is not in help-mode-map; it is in view-mode-map.

Adding to what Drew said...

Emacs does not have a mechanically enforced relation of mode name and
its key map name. So, xyz-mode's keymap can be anything. By
convention, it's usually “-map” appended to the value of “major-mode”.
“shell” is a example of exceptions to this. It uses comint-mode-map.

in practice, to find the map used in a major mode, you just look at
the source code and search for “-map”. The mode may be derived from
other mode, so you will look at the parent mode's source code. Also, a
mode may share keymap used by other modes.

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-17 12:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-15 21:22 Why can't unset C-j in help mode like other modes? seberino
2008-12-15 22:12 ` Drew Adams
     [not found] ` <mailman.2828.1229379156.26697.help-gnu-emacs@gnu.org>
2008-12-17 12:28   ` Xah Lee

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