]> git.eshelyaron.com Git - emacs.git/commitdiff
Add lexical cookie to new init files
authorMattias EngdegÄrd <mattiase@acm.org>
Thu, 2 May 2024 11:34:22 +0000 (13:34 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 6 May 2024 16:33:56 +0000 (18:33 +0200)
* lisp/cus-edit.el (custom-save-all):
Add lexical cookie if the file is empty.

(cherry picked from commit 2f5c9b31161306b2b4c46c77c351c6ea6a46ff98)

lisp/cus-edit.el

index 32cfef6bae48a1eba6fdf9a75a2aa96cb7131c93..e94c7fa2376e08269486c2db555d4da31e074c64 100644 (file)
@@ -4996,6 +4996,8 @@ if only the first line of the docstring is shown."))
             ;; readably.  (Bug#52554)
             (print-escape-control-characters t))
         (atomic-change-group
+          (when (eobp)
+            (insert ";;; -*- lexical-binding: t -*-\n"))
          (custom-save-variables)
          (custom-save-faces)
           (custom-save-icons)))