Function: generate-lisp-file-trailer
generate-lisp-file-trailer is a byte-compiled function defined in
generate-lisp-file.el.gz.
Signature
(generate-lisp-file-trailer FILE &key VERSION INHIBIT-PROVIDE (CODING 'utf-8-emacs-unix) AUTOLOADS COMPILE PROVIDE INHIBIT-NATIVE-COMPILE)
Documentation
Insert a standard trailer for FILE.
By default, this trailer inhibits version control, byte
compilation, updating autoloads, and uses a utf-8-emacs-unix
coding system. These can be inhibited by providing non-nil
values to the VERSION, AUTOLOADS, COMPILE and NATIVE-COMPILE
keyword arguments.
CODING defaults to utf-8-emacs-unix. Use a nil value to
inhibit generating this setting, or a coding system value to use
that.
If PROVIDE is non-nil, use that in the provide statement
instead of using FILE as the basis.
If standard-output is bound to a buffer, insert in that buffer.
If no, insert at point in the current buffer.
If INHITBIT-NATIVE-COMPILE is non-nil, add a cookie to inhibit native compilation. (By default, a file will be native-compiled if it's also byte-compiled).
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/generate-lisp-file.el.gz
(cl-defun generate-lisp-file-trailer (file &key version inhibit-provide
(coding 'utf-8-emacs-unix) autoloads
compile provide inhibit-native-compile)
"Insert a standard trailer for FILE.
By default, this trailer inhibits version control, byte
compilation, updating autoloads, and uses a `utf-8-emacs-unix'
coding system. These can be inhibited by providing non-nil
values to the VERSION, AUTOLOADS, COMPILE and NATIVE-COMPILE
keyword arguments.
CODING defaults to `utf-8-emacs-unix'. Use a nil value to
inhibit generating this setting, or a coding system value to use
that.
If PROVIDE is non-nil, use that in the `provide' statement
instead of using FILE as the basis.
If `standard-output' is bound to a buffer, insert in that buffer.
If no, insert at point in the current buffer.
If INHITBIT-NATIVE-COMPILE is non-nil, add a cookie to inhibit
native compilation. (By default, a file will be native-compiled
if it's also byte-compiled)."
(with-current-buffer (if (bufferp standard-output)
standard-output
(current-buffer))
(ensure-empty-lines 1)
(unless inhibit-provide
(insert (format "(provide '%s)\n\n"
(or provide
(file-name-sans-extension
(file-name-nondirectory file))))))
;; Some of the strings below are chopped into bits to inhibit
;; automatic scanning tools from thinking that they are actual
;; directives.
(insert ";; Local " "Variables:\n")
(unless version
(insert ";; version-control: never\n"))
(unless compile
(insert ";; no-byte-" "compile: t\n"))
(unless autoloads
(insert ";; no-update-autoloads: t\n"))
(when inhibit-native-compile
(insert ";; no-native-" "compile: t\n"))
(when coding
(insert (format ";; coding: %s\n"
(if (eq coding t)
'utf-8-emacs-unix
coding))))
(insert
";; End:\n\n"
";;; " (file-name-nondirectory file) " ends here\n")))