From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.help Subject: Re: beginner's question: add-hook& AUCTeX Date: Fri, 26 Aug 2011 01:27:17 +0530 Message-ID: <81vctlqn6q.fsf@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1314302312 21737 80.91.229.12 (25 Aug 2011 19:58:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 25 Aug 2011 19:58:32 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Shiyuan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 25 21:58:27 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 1Qwg4G-0006QY-6o for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Aug 2011 21:58:24 +0200 Original-Received: from localhost ([::1]:53781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwg4F-0008NB-Ef for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Aug 2011 15:58:23 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:43017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwg4B-0008Mp-17 for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 15:58:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qwg4A-0002xB-4V for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 15:58:19 -0400 Original-Received: from mail-qy0-f176.google.com ([209.85.216.176]:47741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwg4A-0002x7-0j for help-gnu-emacs@gnu.org; Thu, 25 Aug 2011 15:58:18 -0400 Original-Received: by qyk7 with SMTP id 7so2143644qyk.0 for ; Thu, 25 Aug 2011 12:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=jiklejtNLXcaHfKQeexST97vx9WZp4u11DshNSrw/mc=; b=H5Fnlj59VKhEXVdATzti7wsOEMVZN7cafPNkyKACMevVDSJi8zYUm9OgZSnBwEvcB8 ZhXLxFa5M5ZDReAlDjSR//hRYoOI9lBJlxyvg31fizUbp2lLAxrYxiyhKvnP9x0Zzs8x JoKMv9YoxmPKjogStleHlALyZDSICumCJE1GU= Original-Received: by 10.142.218.11 with SMTP id q11mr85117wfg.54.1314302297195; Thu, 25 Aug 2011 12:58:17 -0700 (PDT) Original-Received: from JAMBU-NETBOOK ([115.241.42.152]) by mx.google.com with ESMTPS id x6sm1069254pba.5.2011.08.25.12.58.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 25 Aug 2011 12:58:16 -0700 (PDT) In-Reply-To: (Shiyuan's message of "Thu, 25 Aug 2011 14:46:35 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt) 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:82069 Archived-At: Shiyuan writes: > 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. Just making a guess here: 'current directory' is really a shifting-sand. It is the directory whichever happens to be current when the Emacs searches the load-path. Now you really have no control over that do you. You can have some insight in to load-path related issues by doing a=20 M-x locate-library RET whatever-library RET I haven't seen the parent thread so what I say maynot be of much help. Atleast you will have another tool in your armour. > > >>Hi Shiyuan, >=20=20=20=20 > >> =C2=A0 =C2=A0 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() > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(loc= al-set-key (kbd "C-m") > >> 'reindent-then-newline-and- > >>indent))) > >> (add-hook 'LaTeX-mode-hook (lambda() > >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(loc= al-set-key (kbd "C-j") 'newline))) >=20=20=20=20 > >Looks good, I'd say. >=20=20=20=20 > >> However, it has no effect. It seems it's not evaluated at all. >=20=20=20=20 > >Are you sure that AUCTeX is really loaded? =C2=A0If it is, then the > output of > >C-h f latex-mode RET is: >=20=20=20=20 > >,----[ 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. > >| > >| [...] > >`---- >=20=20=20=20 > >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 > > > --=20