From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: How to bind isearch-repeat-forward to F3 in a certain mode only? Date: Mon, 27 Jul 2015 23:43:33 +0200 Message-ID: <87mvyh6zui.fsf@web.de> References: <87zj2mr0t3.fsf@mbork.pl> <87pp3hyaxb.fsf@web.de> <87zj2htid3.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1438033461 15995 80.91.229.3 (27 Jul 2015 21:44:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Jul 2015 21:44:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 27 23:44:11 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZJqBt-0002QC-VM for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Jul 2015 23:44:10 +0200 Original-Received: from localhost ([::1]:55642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJqBt-0005jk-H4 for geh-help-gnu-emacs@m.gmane.org; Mon, 27 Jul 2015 17:44:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJqBj-0005jO-FH for help-gnu-emacs@gnu.org; Mon, 27 Jul 2015 17:44:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJqBg-00021j-9c for help-gnu-emacs@gnu.org; Mon, 27 Jul 2015 17:43:59 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:42482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJqBg-00021J-2K for help-gnu-emacs@gnu.org; Mon, 27 Jul 2015 17:43:56 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZJqBc-0002CU-NO for help-gnu-emacs@gnu.org; Mon, 27 Jul 2015 23:43:52 +0200 Original-Received: from ip-90-186-230-93.web.vodafone.de ([90.186.230.93]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jul 2015 23:43:52 +0200 Original-Received: from michael_heerdegen by ip-90-186-230-93.web.vodafone.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 27 Jul 2015 23:43:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 38 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-90-186-230-93.web.vodafone.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:vbdi6kftIrf6DyHMMO1k6dV6gDM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106039 Archived-At: Marcin Borkowski writes: > So, what is [F3] exactly and how it differs from [f3]? The key is represented by the symbol `f3' in Emacs, that's it. I think it's by convention because all event basic types are represented by lower case symbols. Unlike in Common Lisp, in Emacs Lisp symbol names are case sensitive. That (kbd "") doesn't return what could be expected is not nice, OTOH it's just consistent. > > (setq-local isearch-mode-map (copy-keymap isearch-mode-map)) > > (define-key isearch-mode-map [f3] #'isearch-repeat-forward) > > > > You can do that in your `my-mode-hook' of course. > > Do I get it right that I should be careful to execute those lines > exactly once per each buffer in my-mode? That would not harm (would it?), though avoiding it would be cleaner. > Is there any reason to put in in the hook and not in the command which > will create that buffer and enter that mode? No. If the bindings are not directly related to your mode, you should not put it into its hook. But be careful: changing the major mode in any buffer kills all buffer local variable bindings. Regards, Michael.