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: Tyler Smith
Subject: Re: Adding a sublist to a list on startup
Date: Mon, 13 Dec 2010 16:31:32 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

"Drew Adams" <drew.adams@oracle.com> writes:

>> (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.
>
> I haven't used LaTeX in years (unfortunately), but is it perhaps because the
> last three don't have a dot (.)? 

No, sorry, there are two different lists getting modified there. The
first three pushes add to LaTeX-item-list, which is an alist (thus the
dots). This seems to work as expected. The second group of pushes adds
to LaTeX-environment-list, which is a list of two-element lists (no
dots).

>
> I also wonder why you don't just use Customize to customize `LaTeX-item-list'
> (I'm assuming that it is a user option).  That's what Customize is for: it
> type-checks changes you make.

Two reasons. First, these are not customizable variables, so I can't.

Second, even if I could use customize, trying to figure out how to enter
anything more complex than a string, or selecting a checkbox, is, in my
limited experience, harder than just figuring out the lisp. It took me
forever to understand how to customize the sgml tag alist, for example,
but maybe that's just me.

In any case, I think it would be useful to either extend the built-in
values of these variables, or provide some simple user-accessible way to
modify them. Once I get it to do what I want it to I'll send a
suggestion/patch to the Auctex people.

Cheers,

Tyler




reply via email to

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