From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: beginner's question:add-hook&AUCTeX Date: Thu, 25 Aug 2011 08:35:13 +0200 Message-ID: <87mxeyxala.fsf@thinkpad.tsdh.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1314254153 24579 80.91.229.12 (25 Aug 2011 06:35:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 25 Aug 2011 06:35:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 25 08:35:46 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QwTXV-0007yt-7L for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Aug 2011 08:35:45 +0200 Original-Received: from localhost ([::1]:40042 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwTXU-000519-NT for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Aug 2011 02:35:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:35773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwTXQ-00050h-0n for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 02:35:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwTXO-0002SV-H4 for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 02:35:39 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:40775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwTXO-0002SN-8R for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 02:35:38 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QwTXG-0007rd-G1 for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 08:35:30 +0200 Original-Received: from tsdh.uni-koblenz.de ([141.26.67.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Aug 2011 08:35:30 +0200 Original-Received: from tassilo by tsdh.uni-koblenz.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 Aug 2011 08:35:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 45 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: tsdh.uni-koblenz.de User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:YiAQImav+IEmE6CbHllKNz7rb6U= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:82056 Archived-At: Shiyuan writes: Hi Shiyuan, > I want to swap the C-j and C-m key. According to the documentation, > AUCTeX will evaluate the LaTeX-mode-hook so I add the following to my > .emacs, > > (add-hook 'LaTeX-mode-hook (lambda() > (local-set-key (kbd "C-m") > 'reindent-then-newline-and-indent))) > (add-hook 'LaTeX-mode-hook (lambda() > (local-set-key (kbd "C-j") 'newline))) Looks good, I'd say. > However, it has no effect. It seems it's not evaluated at all. Are you sure that AUCTeX is really loaded? If it is, then the output of C-h f latex-mode RET is: ,----[ C-h f latex-mode RET ] | latex-mode is an alias for `TeX-latex-mode' in `tex-site.el'. | | (latex-mode) | | Major mode in AUCTeX for editing LaTeX files. | See info under AUCTeX for full documentation. | | [...] `---- If AUCTeX is not loaded, then the standard emacs latex-mode (that doesn't define/use LaTeX-mode-hook) is used producing this output: ,----[ C-h f latex-mode RET (in emacs -Q)] | latex-mode is an interactive compiled Lisp function in `tex-mode.el'. | | (latex-mode) | | Parent mode: `tex-mode'. `---- Bye, Tassilo