unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: help-gnu-emacs@gnu.org
Subject: Re: beginner's question:add-hook&AUCTeX
Date: Thu, 25 Aug 2011 08:35:13 +0200	[thread overview]
Message-ID: <87mxeyxala.fsf@thinkpad.tsdh.de> (raw)
In-Reply-To: CAOm4EMvC5coShRp7bEmJhj6UzidwHgyszGUZ1Box6ti2=8b_aA@mail.gmail.com

Shiyuan <gshy2014@gmail.com> 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




  reply	other threads:[~2011-08-25  6:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25  5:30 beginner's question:add-hook&AUCTeX Shiyuan
2011-08-25  6:35 ` Tassilo Horn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-25 19:46 Re:Re:beginner's question: add-hook& AUCTeX Shiyuan
2011-08-25 19:57 ` beginner's " Jambunathan K
2011-08-26 14:53 ` Tassilo Horn
2011-08-26 16:42 beginner's question:add-hook&AUCTeX PJ Weisberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxeyxala.fsf@thinkpad.tsdh.de \
    --to=tassilo@member.fsf.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).