From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Add file-locals and dir-locals Date: Fri, 17 Jul 2009 12:43:07 +0300 Organization: JURTA Message-ID: <87d47z3584.fsf@mail.jurta.org> References: <20090712144137.GB2524@muc.de> <87hbxhony6.fsf@stupidchicken.com> <20090712180623.GA1009@muc.de> <4A5A2BE1.3050206@harpegolden.net> <87ab34p0o4.fsf_-_@mail.jurta.org> <4A602EF9.9070306@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1247831357 18646 80.91.229.12 (17 Jul 2009 11:49:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jul 2009 11:49:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 17 13:49:10 2009 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 1MRlw2-0000yd-PD for ged-emacs-devel@m.gmane.org; Fri, 17 Jul 2009 13:49:07 +0200 Original-Received: from localhost ([127.0.0.1]:60686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRlw1-0006oH-Uo for ged-emacs-devel@m.gmane.org; Fri, 17 Jul 2009 07:49:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRlv4-00069y-Kg for emacs-devel@gnu.org; Fri, 17 Jul 2009 07:48:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRluz-00069G-9P for emacs-devel@gnu.org; Fri, 17 Jul 2009 07:48:05 -0400 Original-Received: from [199.232.76.173] (port=55351 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRluy-00068y-Th for emacs-devel@gnu.org; Fri, 17 Jul 2009 07:48:00 -0400 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:33030 helo=mx2.starman.ee) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MRluy-0000pM-Fn for emacs-devel@gnu.org; Fri, 17 Jul 2009 07:48:00 -0400 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.55.177.cable.starman.ee [82.131.55.177]) by mx2.starman.ee (Postfix) with ESMTP id 0A8273F40FB; Fri, 17 Jul 2009 14:47:52 +0300 (EEST) In-Reply-To: <4A602EF9.9070306@gmx.at> (martin rudalics's message of "Fri, 17 Jul 2009 09:57:45 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:112610 Archived-At: >> `add-file-local-variable' adds file-local variable with its value to the >> Local Variables list. `add-dir-local-variable' adds directory-local >> variable with its value and mode to the .dir-locals.el file. Based on >> this implementation another commands could be added later that will >> move file-local variables to .dir-locals.el and vice versa. > > Sometimes we also want to replace the old value of a local variable with > a new one here. So maybe functions like `set-file-local-variable' and > `set-dir-local-variable' seem more appropriate. Actually a function `add-file-local-variable' posted already replaces the existing old value with a new one. I think to have one function is better than two (to add and to replace) because from the user's point of view when the user wants to add a variable we should not require from the user to check whether this variable already exists in the Local Variables list. Since `add-file-local-variable' does both "add" and "replace" operations it makes sense to rename it to `set-file-local-variable'. But isn't "set" rather connotes with an operation that reads a variable's value and sets it to the variable with setq? -- Juri Linkov http://www.jurta.org/emacs/