emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/go-mode 0f71cee 083/495: add autoload cookie to gofmt-befo


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 0f71cee 083/495: add autoload cookie to gofmt-before-save
Date: Sat, 7 Aug 2021 09:04:48 -0400 (EDT)

branch: elpa/go-mode
commit 0f71cee088b981d35b0e9d22f1215d16e422fc2c
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>

    add autoload cookie to gofmt-before-save
---
 go-mode.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/go-mode.el b/go-mode.el
index 11eb8ea..750cbe4 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -434,9 +434,13 @@ Replace the current buffer on success; display errors on 
failure."
     (display-buffer errbuf)
     (compilation-mode)))
 
+;;;###autoload
 (defun gofmt-before-save ()
   "Add this to .emacs to run gofmt on the current buffer when saving:
- (add-hook 'before-save-hook 'gofmt-before-save)"
+ (add-hook 'before-save-hook 'gofmt-before-save).
+
+Note that this will cause go-mode to get loaded the first time
+you save any file, kind of defeating the point of autoloading."
 
   (interactive)
   (when (eq major-mode 'go-mode) (gofmt)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]