From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#32817: 27.0.50; Dotted pair syntax for directory-local variables Date: Wed, 26 Sep 2018 00:10:06 +1200 Message-ID: <87fa2b5f-48b3-703b-9b0b-43dc454759b8@orcon.net.nz> References: <87bm8nolge.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1537877413 30890 195.159.176.226 (25 Sep 2018 12:10:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Sep 2018 12:10:13 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 To: Juri Linkov , 32817@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 25 14:10:08 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4mAK-0007vx-Eg for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Sep 2018 14:10:08 +0200 Original-Received: from localhost ([::1]:52793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4mCR-00055x-4U for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Sep 2018 08:12:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4mBI-0004X3-Lw for bug-gnu-emacs@gnu.org; Tue, 25 Sep 2018 08:11:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4mBC-0006Aw-PW for bug-gnu-emacs@gnu.org; Tue, 25 Sep 2018 08:11:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48666) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g4mBC-0006AL-Gc for bug-gnu-emacs@gnu.org; Tue, 25 Sep 2018 08:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g4mBC-0006PF-4j for bug-gnu-emacs@gnu.org; Tue, 25 Sep 2018 08:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Sep 2018 12:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32817 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 32817-submit@debbugs.gnu.org id=B32817.153787742224570 (code B ref 32817); Tue, 25 Sep 2018 12:11:02 +0000 Original-Received: (at 32817) by debbugs.gnu.org; 25 Sep 2018 12:10:22 +0000 Original-Received: from localhost ([127.0.0.1]:52924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4mAY-0006OE-1R for submit@debbugs.gnu.org; Tue, 25 Sep 2018 08:10:22 -0400 Original-Received: from smtp-4.orcon.net.nz ([60.234.4.59]:52006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g4mAV-0006O0-QX for 32817@debbugs.gnu.org; Tue, 25 Sep 2018 08:10:21 -0400 Original-Received: from [150.107.172.53] (port=11898 helo=[192.168.20.103]) by smtp-4.orcon.net.nz with esmtpa (Exim 4.86_2) (envelope-from ) id 1g4mAJ-00049y-B1; Wed, 26 Sep 2018 00:10:16 +1200 In-Reply-To: <87bm8nolge.fsf@mail.linkov.net> Content-Language: en-GB X-GeoIP: NZ X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150649 Archived-At: Hi Juri, On 24/09/18 11:14, Juri Linkov wrote: > As indicated in https://lists.gnu.org/archive/html/emacs-devel/2018-09/msg00817.html > the current syntax is confusing. > > This patch fixes add-dir-local-variable to output syntax corresponding > to examples in (info "(emacs) Directory Variables"): Thanks for implementing this. > +(defun add-dir-local-variables-to-string (variables) `add-dir-local-variables-to-string' is quite a confusing name. It makes it sound like the dir-local variables will be added to a string (which doesn't make a lot of sense), when it's actually formatting all of the dir-locals *as* a string. This is on account of the "add-" prefix, which I think is unnecessary -- the functionality isn't really tied to `add-dir-local-variable'; it would work regardless of where its argument came from. `dir-locals-to-string' seems a better name to me, and is consistent with other dir-locals-* functions. I think it should also have a docstring. > + (format "(%s)" (mapconcat > + (lambda (mode-variable) "mode-variables" (plural), I think. > + (format "(%S . %s)" > + (car mode-variable) > + (format "(%s)" (mapconcat > + (lambda (variable-value) > + (format "(%s . %S)" > + (car variable-value) Why is the variable symbol "%s" when the mode symbol was "%S" ? > + (cdr variable-value))) > + (cdr mode-variable) "\n")))) > + variables "\n"))) regards, -Phil