unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Why can't local-set-key (kbd "n")  in diff-mode ?
@ 2016-11-18  9:31 boyang
  2016-11-19  9:20 ` Alex Kost
  0 siblings, 1 reply; 3+ messages in thread
From: boyang @ 2016-11-18  9:31 UTC (permalink / raw)
  To: help-gnu-emacs

Hi 


Greetings,
I'm a Emacs newbie, when I do the following:
----------------------------------------------------------------------------------------
(add-hook 'diff-mode-hook
                   (lambda ()
                      (local-set-key (kbd "n") 'next-error-no-select)
                      (local-set-key (kbd "p") 'previous-error-no-select)))
----------------------------------------------------------------------------------------

It doesn't work, when I press "n" in "*Diff*", it stills run "diff-hunk-next"
when I "C-h k n", it still shows "diff-hunk-next".  Same also for "p".


But 
1. If I do the same thing in other mode, say "occur-mode-hook", it works in that mode.
2. If I set other key other than "n" in "diff-mode-hook", say "x", it works.


So is there somebody can tell me the reason behind this ?


Thank you


Cheers,
Boyang

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

end of thread, other threads:[~2016-11-19 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-18  9:31 Why can't local-set-key (kbd "n") in diff-mode ? boyang
2016-11-19  9:20 ` Alex Kost
2016-11-19 15:19   ` =?gb18030?B?Ym95YW5n?=

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