From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Adding a sublist to a list on startup Date: Tue, 14 Dec 2010 21:18:25 -0700 Message-ID: References: <87zks9o3bw.fsf@guruji.demimonde> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1292386738 25014 80.91.229.12 (15 Dec 2010 04:18:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 15 Dec 2010 04:18:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 15 05:18:54 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 1PSipK-0001Za-5w for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Dec 2010 05:18:54 +0100 Original-Received: from localhost ([127.0.0.1]:45827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSipJ-0006X9-IR for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Dec 2010 23:18:53 -0500 Original-Received: from [140.186.70.92] (port=50947 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSioz-0006Wu-Bh for help-gnu-emacs@gnu.org; Tue, 14 Dec 2010 23:18:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSiox-00009v-Kb for help-gnu-emacs@gnu.org; Tue, 14 Dec 2010 23:18:33 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:49667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSiow-00009Y-Uh for help-gnu-emacs@gnu.org; Tue, 14 Dec 2010 23:18:31 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PSiov-0001OP-Fc for help-gnu-emacs@gnu.org; Wed, 15 Dec 2010 05:18:29 +0100 Original-Received: from c-24-8-96-241.hsd1.co.comcast.net ([24.8.96.241]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Dec 2010 05:18:29 +0100 Original-Received: from kevin.d.rodgers by c-24-8-96-241.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Dec 2010 05:18:29 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 50 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-24-8-96-241.hsd1.co.comcast.net 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 In-Reply-To: <87zks9o3bw.fsf@guruji.demimonde> 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:77513 Archived-At: 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