From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Two problems with directory-local variables Date: Tue, 18 Sep 2018 03:19:51 +0300 Organization: LINKOV.NET Message-ID: <87sh27eizs.fsf@mail.linkov.net> References: <87a7ogzgul.fsf@mbork.pl> <1d2129643cecde529cb9b47e4e015c48@webmail.orcon.net.nz> <87y3c0xh44.fsf@mbork.pl> <87k1njyav9.fsf@mail.linkov.net> <475f19d58094495c2a56d829bb7bbdd5@webmail.orcon.net.nz> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1537231611 20697 195.159.176.226 (18 Sep 2018 00:46:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 18 Sep 2018 00:46:51 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel To: Phil Sainty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 18 02:46:47 2018 Return-path: Envelope-to: ged-emacs-devel@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 1g24AA-0005IR-La for ged-emacs-devel@m.gmane.org; Tue, 18 Sep 2018 02:46:46 +0200 Original-Received: from localhost ([::1]:37920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g24CG-0004bf-TC for ged-emacs-devel@m.gmane.org; Mon, 17 Sep 2018 20:48:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g24BO-0004YF-Fq for emacs-devel@gnu.org; Mon, 17 Sep 2018 20:48:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g245m-0002CD-9T for emacs-devel@gnu.org; Mon, 17 Sep 2018 20:42:17 -0400 Original-Received: from pop.dreamhost.com ([64.90.62.162]:60816 helo=pdx1-sub0-mail-a21.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g245i-00025s-D8 for emacs-devel@gnu.org; Mon, 17 Sep 2018 20:42:12 -0400 Original-Received: from pdx1-sub0-mail-a21.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a21.g.dreamhost.com (Postfix) with ESMTP id 622BC7F15F; Mon, 17 Sep 2018 17:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=vkRmvKCcb5LzGp3uV/nNj6RQ4AQ=; b= q98Gi1zLSi7NcIibAi8ouZKdOBA3ln4jlmDwOC6Rdpcv3t14lJGKlHgA5sus9NrF iX69PlTrk1GcRaVxttVb1DyPmvsluDTzrtBvbt3O8Wu8MCmMdvOjhYqX0UCg5y30 byvtfJjUUBnzx/mYWhHlnWkZrenw7wHrjVUJA3cMp7g= Original-Received: from localhost.linkov.net (m91-129-107-237.cust.tele2.ee [91.129.107.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a21.g.dreamhost.com (Postfix) with ESMTPSA id 87FFF7F15D; Mon, 17 Sep 2018 17:42:04 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a21 X-DH-BACKEND: pdx1-sub0-mail-a21 In-Reply-To: <475f19d58094495c2a56d829bb7bbdd5@webmail.orcon.net.nz> (Phil Sainty's message of "Tue, 18 Sep 2018 12:04:44 +1200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.90.62.162 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229925 Archived-At: >> When I tried [add-dir-local-variable] it correctly added >> ((nil >> (eval message "hello"))) > > On this note, while I don't use the commands myself, I've often wished > that add-dir-local-variable would generate the dotted-pair syntax, > because I've often seen confusion about the syntax of dir-locals arising > from dotted vs non-dotted possibilities, and I feel strongly that the > dotted syntax is the most readable for these files. > > i.e. To my mind, (eval message "hello") is liable to confuse people, > whereas (eval . (message "hello")) is rather clear. > > Of course we wouldn't want this to end up in the file either: > (eval . (message . ("hello" . nil))) > > I guess we'd need some code to only 'dot' the high level elements, > but not the values. > > I don't suppose anything like that already exists? I don't know if something exists that could allow printing dotted syntax for (pp-to-string '(eval message "hello")) In its implementation I see the references to print-escape-newlines and print-quoted, but there is no print-dotted.