From fbd161c342f13d58461ec78f5414194d976cbb29 Mon Sep 17 00:00:00 2001 From: Tommy Jollyboat Date: Wed, 31 Mar 2021 01:45:43 +0100 Subject: [PATCH] Added defcustom for users to disable autoload cookie. --- lispy.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lispy.el b/lispy.el index 70134b7f..cf268940 100644 --- a/lispy.el +++ b/lispy.el @@ -197,6 +197,11 @@ :group 'lispy) (make-variable-buffer-local 'lispy-no-space) +(defcustom lispy-insert-autoload t + "When non-nil, repeated use of `lispy-comment' in emacs-lisp-mode inserts an autoload cookie." + :type 'boolean + :group 'lispy) + (defcustom lispy-lax-eval t "When non-nil, fix \"unbound variable\" error by setting the it to nil. This is useful when hacking functions with &optional arguments. @@ -3924,7 +3929,8 @@ When SILENT is non-nil, don't issue messages." (when (lispy--in-string-or-comment-p) (lispy--out-backward 1))) ((lispy--in-string-or-comment-p) - (cond ((and (eq major-mode 'emacs-lisp-mode) + (cond ((and lispy-insert-autoload + (eq major-mode 'emacs-lisp-mode) (lispy-after-string-p ";;; ")) (delete-char -1) (insert "###autoload")