|
From: | Juri Linkov |
Subject: | Re: Add file-locals and dir-locals |
Date: | Fri, 17 Jul 2009 12:43:07 +0300 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) |
>> `add-file-local-variable' adds file-local variable with its value to the >> Local Variables list. `add-dir-local-variable' adds directory-local >> variable with its value and mode to the .dir-locals.el file. Based on >> this implementation another commands could be added later that will >> move file-local variables to .dir-locals.el and vice versa. > > Sometimes we also want to replace the old value of a local variable with > a new one here. So maybe functions like `set-file-local-variable' and > `set-dir-local-variable' seem more appropriate. Actually a function `add-file-local-variable' posted already replaces the existing old value with a new one. I think to have one function is better than two (to add and to replace) because from the user's point of view when the user wants to add a variable we should not require from the user to check whether this variable already exists in the Local Variables list. Since `add-file-local-variable' does both "add" and "replace" operations it makes sense to rename it to `set-file-local-variable'. But isn't "set" rather connotes with an operation that reads a variable's value and sets it to the variable with setq? -- Juri Linkov http://www.jurta.org/emacs/
[Prev in Thread] | Current Thread | [Next in Thread] |