GNU bug report logs -
#32817
27.0.50; Dotted pair syntax for directory-local variables
Previous Next
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
Message #15 received at 32817 <at> debbugs.gnu.org (full text, mbox):
>> +(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.
My intention was to use this prefix to add the new function
to the add-dir-local-variable* namespace. But I agree that
dir-locals-* is more suitable, so I renamed the function.
>> + (format "(%s)" (mapconcat
>> + (lambda (mode-variable)
>
> "mode-variables" (plural), I think.
Fixed as well.
>> + (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" ?
The mode symbol is "%S" to support string values of a subdirectory like
"src/imported" in the example in (info "(emacs) Directory Variables")
But admittedly add-dir-local-variable doesn't support adding 3 levels
subdirectory-mode-variables anyway, it could be used only to create
an initial subdirectory-variable-value to allow the user adding mode
manually. But for any case I changed the variable symbol "%s" to "%S".
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.