diff options
author | Stefan Kangas <stefan@marxist.se> | 2022-07-07 02:09:30 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2022-07-07 02:23:30 +0200 |
commit | 7ac9c22636cc2d6c56bf238ca4311924a6ee0cd0 (patch) | |
tree | a96b8e8525400ef9a435422f20b12e08914ed404 /lisp/files-x.el | |
parent | ab9b55d617fe1235548d368e416e07aeb25504b8 (diff) | |
download | emacs-7ac9c22636cc2d6c56bf238ca4311924a6ee0cd0.tar.gz emacs-7ac9c22636cc2d6c56bf238ca4311924a6ee0cd0.tar.bz2 emacs-7ac9c22636cc2d6c56bf238ca4311924a6ee0cd0.zip |
End new .dir-locals.el files with a newline
* lisp/files-x.el (dir-locals-to-string): Add newline at the end of
newly created .dir-locals.el files. This avoids git complaining about
"No newline at end of file".
Diffstat (limited to 'lisp/files-x.el')
-rw-r--r-- | lisp/files-x.el | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lisp/files-x.el b/lisp/files-x.el index 4db6fbd22cc..a89fc26d60b 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -507,19 +507,20 @@ from the MODE alist ignoring the input argument VALUE." (defun dir-locals-to-string (variables) "Output alists of VARIABLES to string in dotted pair notation syntax." - (format "(%s)" (mapconcat - (lambda (mode-variables) - (format "(%S . %s)" - (car mode-variables) - (format "(%s)" (mapconcat - (lambda (variable-value) - (format "(%S . %s)" - (car variable-value) - (string-trim-right - (pp-to-string - (cdr variable-value))))) - (cdr mode-variables) "\n")))) - variables "\n"))) + (format "(%s)\n" + (mapconcat + (lambda (mode-variables) + (format "(%S . %s)" + (car mode-variables) + (format "(%s)" (mapconcat + (lambda (variable-value) + (format "(%S . %s)" + (car variable-value) + (string-trim-right + (pp-to-string + (cdr variable-value))))) + (cdr mode-variables) "\n")))) + variables "\n"))) ;;;###autoload (defun add-dir-local-variable (mode variable value) |