Skip to content

Commit ddc1626

Browse files
committed
Suppress lexical binding related warnings
* mime-view.el (mime-save-situation-examples): Add file variables including lexical-binding to situation-examples file. Cf. [wl-en:07350]
1 parent 03bd143 commit ddc1626

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

mime-view.el

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -500,10 +500,17 @@ mother-buffer."
500500
print-length print-level)
501501
(when file
502502
(with-temp-buffer
503-
(insert ";;; " (file-name-nondirectory file) "\n")
504-
(insert "\n;; This file is generated automatically by "
505-
mime-view-version "\n\n")
506-
(insert ";;; Code:\n\n")
503+
(setq buffer-file-coding-system
504+
(or mime-situation-examples-file-coding-system
505+
buffer-file-coding-system))
506+
(insert ";;; " (file-name-nondirectory file)
507+
" -*- mode: emacs-lisp; coding: "
508+
(symbol-name
509+
(coding-system-base buffer-file-coding-system))
510+
"; lexical-binding: nil; -*-\n"
511+
"\n;; This file is generated automatically by "
512+
mime-view-version "\n\n"
513+
";;; Code:\n\n")
507514
(if mime-preview-situation-example-list
508515
(pp `(setq mime-preview-situation-example-list
509516
',mime-preview-situation-example-list)
@@ -515,8 +522,6 @@ mother-buffer."
515522
(insert "\n;;; "
516523
(file-name-nondirectory file)
517524
" ends here.\n")
518-
(setq buffer-file-coding-system
519-
mime-situation-examples-file-coding-system)
520525
(setq buffer-file-name file)
521526
(save-buffer))))))
522527

0 commit comments

Comments
 (0)