From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Shiyuan Newsgroups: gmane.emacs.help Subject: Re:Re:beginner's question: add-hook& AUCTeX Date: Thu, 25 Aug 2011 14:46:35 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=000e0cd29e4cc108bd04ab59af2c X-Trace: dough.gmane.org 1314301608 17288 80.91.229.12 (25 Aug 2011 19:46:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 25 Aug 2011 19:46:48 +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 21:46:44 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 1Qwfsx-0000oA-RR for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Aug 2011 21:46:44 +0200 Original-Received: from localhost ([::1]:50408 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwfsx-0003F8-Am for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Aug 2011 15:46:43 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:52934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwfss-0003Eb-LG for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 15:46:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qwfsr-0000Kc-Cz for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 15:46:38 -0400 Original-Received: from mail-qy0-f176.google.com ([209.85.216.176]:40210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwfsr-0000KX-4W for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 15:46:37 -0400 Original-Received: by qyk7 with SMTP id 7so2131540qyk.0 for ; Thu, 25 Aug 2011 12:46:36 -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=B+3olY8/65Tm1M/fUTlF4b7G6qGgSHJqSIe8DYc0NPI=; b=UzHjCzDll+iS4IOmEMI6kuHrtEyOI85IiLkIlhPZoEhd3GeSzN4BkviCoy1XtiERdt l6+hRLh9HDi/HYUGBmsUdP9WbVKhBiHUO5Wfe7vwP+NT1e3O31SraCu+awHo9dTjcHhb KLpVWzq0tSf6ikBHp0NvZUTK0X04Aoio/vbDI= Original-Received: by 10.142.174.11 with SMTP id w11mr72562wfe.154.1314301595944; Thu, 25 Aug 2011 12:46:35 -0700 (PDT) Original-Received: by 10.142.196.18 with HTTP; Thu, 25 Aug 2011 12:46:35 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.216.176 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:82068 Archived-At: --000e0cd29e4cc108bd04ab59af2c Content-Type: text/plain; charset=ISO-8859-1 Thanks, Tassilo. It turns out that the problem is caused by another line of my .emacs file, which I want to append the load-path, (setq load-path (append (list nil "~/lisp") load-path)) if the "nil" is deleted, it works fine. But I don't understand why adding the current directory to load-path messes up the loading of AUCTeX. I don't have any lisp package s in my current directory. > >>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 > --000e0cd29e4cc108bd04ab59af2c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks, Tassilo.
It turns out that the problem is caused by anothe= r line of my .emacs file,
which I want to append the load-path,
(set= q load-path (append (list nil "~/lisp") load-path))
if the &qu= ot;nil" is deleted, it works fine. But I don't understand why addi= ng the current directory to load-path messes up the loading of AUCTeX. I do= n't have any lisp package s in my current directory.
=A0
=A0
>>Hi Shiyuan,

>> =A0 =A0 I want to swap the C-j and C-m key. According to the docum= entation,
>> 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(local-set-key (kbd "C-m&q= uot;)
>> 'reindent-then-newline-and-
>>indent)))<= br> >> (add-hook 'LaTeX-mode-hook (lambda()
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(local-set-key (kbd "C-j&q= uot;) '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? =A0If 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:<= br> >
>,----[ C-h f latex-mode RET (in emacs -Q)]
>| latex-mode is an interactive compiled Lisp function in `tex-mode.el&#= 39;.
>|
>| (latex-mode)
>|
>| Parent mode: `tex-mode'.
>`----
>
>Bye,
>Tassilo
--000e0cd29e4cc108bd04ab59af2c--