help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding a sublist to a list on startup


From: Kevin Rodgers
Subject: Re: Adding a sublist to a list on startup
Date: Tue, 14 Dec 2010 21:18:25 -0700
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7

On 12/13/10 12:55 PM, Tyler Smith wrote:
Hi,

I need to customize the variable LaTeX-environment-list in Auctex. To
get the behaviour I want, I have included the following in my .emacs:

(defun my-LaTeX-hook ()
   (push '("choices" . LaTeX-insert-choice) LaTeX-item-list)
   (push '("parts" . LaTeX-insert-part) LaTeX-item-list)
   (push '("questions" . LaTeX-insert-question) LaTeX-item-list)
   (push '("choices" LaTeX-env-item) LaTeX-environment-list)
   (push '("questions" LaTeX-env-item) LaTeX-environment-list)
   (push '("parts" LaTeX-env-item) LaTeX-environment-list))

(add-hook 'LaTeX-mode-hook 'my-LaTeX-hook)

However, the last three push commands aren't doing what I expect. If I
evaluate them from a buffer that is in Auctex/LaTeX mode, the value of
LaTeX-environment-list contains:

Value:
(("abstract")
  ("array" LaTeX-env-array)
  ("center")
  ("choices" LaTeX-env-item)
;; Extra lines snipped
  ("verse"))

However, my hook doesn't work properly - it gives me this instead:

Value:
((LaTeX-env-item)
  ("abstract")
  ("array" LaTeX-env-array)
  ("center")
  ("choices")
;; Extra lines snipped
  ("verse"))

So the two-element list I'm trying to add to LaTeX-environment-list is
getting split into two atoms, each added as a separate list. I guess I'm
modifying something at the wrong time, but I'm not sure exactly what.

Are you sure that's the version of my-LaTeX-hook that's being executed?
(It could be redefined by something loaded later, or perhaps you've got
a compiled version of .emacs that is being loaded instead.)

--
Kevin Rodgers
Denver, Colorado, USA




reply via email to

[Prev in Thread] Current Thread [Next in Thread]