unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: boyang <wangoer@qq.com>
To: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Why can't local-set-key (kbd "n")  in diff-mode ?
Date: Fri, 18 Nov 2016 17:31:53 +0800	[thread overview]
Message-ID: <tencent_6AA3205E02D723E33C153E6B@qq.com> (raw)

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

             reply	other threads:[~2016-11-18  9:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18  9:31 boyang [this message]
2016-11-19  9:20 ` Why can't local-set-key (kbd "n") in diff-mode ? Alex Kost
2016-11-19 15:19   ` =?gb18030?B?Ym95YW5n?=

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_6AA3205E02D723E33C153E6B@qq.com \
    --to=wangoer@qq.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).