Skip to content

Commit abd72d8

Browse files
authored
emacs: add lexical-binding: t to files, generated by emacs.pkgs.withPackages (#388407)
2 parents 51f812d + c96d13f commit abd72d8

File tree

1 file changed

+5
-1
lines changed
  • pkgs/applications/editors/emacs/build-support

1 file changed

+5
-1
lines changed

pkgs/applications/editors/emacs/build-support/wrapper.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ runCommand (lib.appendToName "with-packages" emacs).name
164164
# buffer.
165165
rm -f $siteStart $siteStartByteCompiled $subdirs $subdirsByteCompiled
166166
cat >"$siteStart" <<EOF
167+
;;; -*- lexical-binding: t -*-
167168
(let ((inhibit-message t))
168169
(load "$emacs/share/emacs/site-lisp/site-start"))
169170
;; "$out/share/emacs/site-lisp" is added to load-path in wrapper.sh
@@ -175,11 +176,14 @@ runCommand (lib.appendToName "with-packages" emacs).name
175176
EOF
176177
177178
# Generate a subdirs.el that statically adds all subdirectories to load-path.
179+
cat >"$subdirs" <<EOF
180+
;;; -*- lexical-binding: t -*-
181+
EOF
178182
$emacs/bin/emacs \
179183
--batch \
180184
--load ${./mk-wrapper-subdirs.el} \
181185
--eval "(prin1 (macroexpand-1 '(mk-subdirs-expr \"$out/share/emacs/site-lisp\")))" \
182-
> "$subdirs"
186+
>> "$subdirs"
183187
184188
# Byte-compiling improves start-up time only slightly, but costs nothing.
185189
$emacs/bin/emacs --batch -f batch-byte-compile "$siteStart" "$subdirs"

0 commit comments

Comments
 (0)