From: Stefan Kangas Date: Thu, 7 Jul 2022 00:09:30 +0000 (+0200) Subject: End new .dir-locals.el files with a newline X-Git-Tag: emacs-29.0.90~1447^2~1134 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7ac9c22636cc2d6c56bf238ca4311924a6ee0cd0;p=emacs.git 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". --- 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)