GNU bug report logs -
#66663
30.0.50; Allow dir locals file selection in *-dir-local-variable functions
Previous Next
Reported by: Mauro Aranda <maurooaranda <at> gmail.com>
Date: Sat, 21 Oct 2023 12:10:02 UTC
Severity: wishlist
Tags: patch
Fixed in version 30.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #25 received at 66663 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On 21/10/23 15:21, Juri Linkov wrote:
>> +(defun read-dir-locals-file ()
>> + "Read a dir-locals filename using completion.
>> +Intended to be used in the `interactive' spec of
`add-dir-local-variable',
>> +`delete-dir-local-variable' and `copy-file-locals-to-dir-locals'.
>> +
>> +Returns the filename, expanded."
>> + (expand-file-name
>> + (read-file-name "File" nil nil
>
> The prompt needs a colon.
Fixed.
>> + (lambda (fname)
>> + (member (file-name-nondirectory fname)
>> + (list dir-locals-file
>> + (replace-regexp-in-string
>> + ".el$" "-2.el" dir-locals-file))))
>> + dir-locals-file)))
>
> This needs to be run in the project's root directory
> where the dir-locals file is saved. Probably it's not easy
> to find the root without using project.el. But when one of the
> files already exists (either .dir-locals.el or .dir-locals-2.el),
> then better to use the directory of the existing file by default.
In this new patch, I went for using it if already available and we
couldn't find an existing file by other means.
[0001-Allow-specifying-the-dir-locals-file-to-edit-Bug-666.patch (text/x-patch, attachment)]
This bug report was last modified 1 year and 210 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.