GNU bug report logs - #32817
27.0.50; Dotted pair syntax for directory-local variables

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 23 Sep 2018 23:17:01 UTC

Severity: normal

Tags: fixed

Found in version 27.0.50

Fixed in version 27.1

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Juri Linkov <juri <at> linkov.net>, 32817 <at> debbugs.gnu.org
Subject: bug#32817: 27.0.50; Dotted pair syntax for directory-local variables
Date: Wed, 26 Sep 2018 00:10:06 +1200
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




This bug report was last modified 6 years and 243 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.