From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tyler Smith Newsgroups: gmane.emacs.help Subject: Re: Adding a sublist to a list on startup Date: Mon, 13 Dec 2010 16:31:32 -0500 Message-ID: <87vd2xnyvf.fsf@guruji.demimonde> References: <87zks9o3bw.fsf@guruji.demimonde> <08AABBED9C6F4D2A9644BD0B620685CD@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1292275933 15216 80.91.229.12 (13 Dec 2010 21:32:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Dec 2010 21:32:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 13 22:32:08 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PSG08-00087g-Ca for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Dec 2010 22:32:08 +0100 Original-Received: from localhost ([127.0.0.1]:38253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSG07-0000ZT-U1 for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Dec 2010 16:32:07 -0500 Original-Received: from [140.186.70.92] (port=35896 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSFzl-0000ZA-5h for help-gnu-emacs@gnu.org; Mon, 13 Dec 2010 16:31:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSFzk-0001Dc-6Y for help-gnu-emacs@gnu.org; Mon, 13 Dec 2010 16:31:45 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:47049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSFzj-0001DW-R9 for help-gnu-emacs@gnu.org; Mon, 13 Dec 2010 16:31:44 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PSFzj-0007uA-7T for help-gnu-emacs@gnu.org; Mon, 13 Dec 2010 22:31:43 +0100 Original-Received: from 157.89.133.51 ([157.89.133.51]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Dec 2010 22:31:43 +0100 Original-Received: from tyler.smith by 157.89.133.51 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Dec 2010 22:31:43 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 44 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 157.89.133.51 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:aQ5SbFPJaKSYfEa7XYeEvgxqVPk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77469 Archived-At: "Drew Adams" 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