From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: add-list local value Date: Wed, 12 Mar 2008 09:51:11 -0400 Message-ID: References: <47D729CB.2060105@gmail.com> <47D73D5B.4070502@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205329901 695 80.91.229.12 (12 Mar 2008 13:51:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Mar 2008 13:51:41 +0000 (UTC) Cc: Emacs Devel To: "Lennart Borgman \(gmail\)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 12 14:52:04 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JZRN3-00058V-D5 for ged-emacs-devel@m.gmane.org; Wed, 12 Mar 2008 14:51:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZRMU-0001W0-Nc for ged-emacs-devel@m.gmane.org; Wed, 12 Mar 2008 09:51:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JZRMQ-0001VZ-Mu for emacs-devel@gnu.org; Wed, 12 Mar 2008 09:51:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JZRMP-0001VI-2J for emacs-devel@gnu.org; Wed, 12 Mar 2008 09:51:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZRMO-0001VF-R0 for emacs-devel@gnu.org; Wed, 12 Mar 2008 09:51:12 -0400 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JZRMO-0005UA-OT for emacs-devel@gnu.org; Wed, 12 Mar 2008 09:51:12 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkkFAOB810fO+JwVUGdsb2JhbACQaAEBJxKXDoEG X-IronPort-AV: E=Sophos;i="4.25,488,1199682000"; d="scan'208";a="15918497" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 12 Mar 2008 09:51:11 -0400 Original-Received: from pastel.home ([206.248.156.21]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id SQL56211; Wed, 12 Mar 2008 09:51:11 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 43DEE7F05; Wed, 12 Mar 2008 09:51:11 -0400 (EDT) In-Reply-To: <47D73D5B.4070502@gmail.com> (Lennart Borgman's message of "Wed, 12 Mar 2008 03:18:03 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:92278 Archived-At: >>> Wouldn't it be practical to allow add-list to add to the buffer local value, >>> like add-hook allows? At least I need it ... >> >> It makes sense for add-hook because buffer-local values of hook include >> a special entry t which means "run the global value of this hook". >> >> For lists, it doesn't make much sense I believe. Either the list is >> global or it's local. If it's local, just make it local with >> make-local-variable. > And if I have a local value and want to add to the global value with > add-to-list? A good reason why add-to-list is a bad function. You can use (require 'cl) (pushnew (default-value ')) or (setq-default (cons (default-value '))) or (unless (member (default-value ')) (setq-default (cons (default-value ')))) -- Stefan