From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Shiyuan Newsgroups: gmane.emacs.help Subject: beginner's question:add-hook&AUCTeX Date: Thu, 25 Aug 2011 00:30:29 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=000e0cd1471216cd1e04ab4dba11 X-Trace: dough.gmane.org 1314250249 4580 80.91.229.12 (25 Aug 2011 05:30:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 25 Aug 2011 05:30:49 +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 07:30:45 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 1QwSWa-0001aj-Ln for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Aug 2011 07:30:44 +0200 Original-Received: from localhost ([::1]:37974 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwSWY-0007ze-NM for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Aug 2011 01:30:42 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:37190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwSWS-0007zZ-Kz for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 01:30:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwSWR-0006wO-TB for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 01:30:36 -0400 Original-Received: from mail-pz0-f44.google.com ([209.85.210.44]:33688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwSWR-0006wF-IL for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 01:30:35 -0400 Original-Received: by pzk36 with SMTP id 36so2219504pzk.17 for ; Wed, 24 Aug 2011 22:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=Y2tCtw3GprlKvOjdNvaimCdLDSdlDTi0S9QoxVvaF3I=; b=i02p5ZjatVzKFJVoj2uFpPWfzk8tabauJRgs0gT0p+qFcrouGT/IcP/c9SAqdg0onI LZcRtJIIr0y9W/koXte68VJqg5LIEvS+1qoafCd+wWqxZpm9KMNSUv99MeoDOphhmvkm ikRDImuIs/sEB6Ao9SW2Dpk2EklFwt0QKp8PU= Original-Received: by 10.142.221.6 with SMTP id t6mr3257665wfg.268.1314250229730; Wed, 24 Aug 2011 22:30:29 -0700 (PDT) Original-Received: by 10.142.196.18 with HTTP; Wed, 24 Aug 2011 22:30:29 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.44 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:82053 Archived-At: --000e0cd1471216cd1e04ab4dba11 Content-Type: text/plain; charset=ISO-8859-1 Hi, 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))) However, it has no effect. It seems it's not evaluated at all. Any help is appreciated. Gu. --000e0cd1471216cd1e04ab4dba11 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,
=A0=A0=A0 I want to swap the C-j and C-m key. According to the docu= mentation, AUCTeX will evaluate the LaTeX-mode-hook so I add the following = to my .emacs,

(add-hook 'LaTeX-mode-hook (lambda()
=A0=A0=A0 = =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0 (local-set-key (kbd "C-m") '= reindent-then-newline-and-indent)))
(add-hook 'LaTeX-mode-hook (lambda()
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 = =A0=A0=A0=A0 (local-set-key (kbd "C-j") 'newline)))

Ho= wever, it has no effect. It seems it's not evaluated at all. Any help i= s appreciated.

Gu.
--000e0cd1471216cd1e04ab4dba11--