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: Adding a sublist to a list on startup Date: Mon, 13 Dec 2010 14:55:15 -0500 Message-ID: <87zks9o3bw.fsf@guruji.demimonde> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1292270170 16978 80.91.229.12 (13 Dec 2010 19:56:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Dec 2010 19:56:10 +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 20:56:05 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 1PSEVA-0005NF-SM for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Dec 2010 20:56:05 +0100 Original-Received: from localhost ([127.0.0.1]:52118 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSEVA-0005ud-Cb for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Dec 2010 14:56:04 -0500 Original-Received: from [140.186.70.92] (port=44016 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSEUj-0005t0-B1 for help-gnu-emacs@gnu.org; Mon, 13 Dec 2010 14:55:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSEUi-0006bw-2C for help-gnu-emacs@gnu.org; Mon, 13 Dec 2010 14:55:37 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:40280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSEUh-0006bY-Rj for help-gnu-emacs@gnu.org; Mon, 13 Dec 2010 14:55:36 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PSEUb-00056M-P7 for help-gnu-emacs@gnu.org; Mon, 13 Dec 2010 20:55:29 +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 20:55:29 +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 20:55:29 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 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:TWq4A//plPYR2BuhMN/NlLqB2S4= 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:77464 Archived-At: 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. Help? Thanks, Tyler