Browse files

git-commit-auto-mode-enable: don't call on load and autoload

This is a somewhat controversial issue.  Some think that simply loading
or autoloading a library should prepare its modes for use.  Others like
me think that users should have to do that explicitly.  It might be a
bit annoying that an additional step is required to use the library and
its modes - it would be more annoying to have to do something *not* to
use it.

The argument "But why would they install it if they did not want to use
it?" does not apply it - Magit does force Melpa users to install it,
even though `magit-log-edit' could be used instead.  Magit has to ensure
one of the commit modes is installed and does so by making the preferred
one a dependency.  `package does not support optional dependencies or
even dependency alternatives.
  • Loading branch information...
1 parent c0f85b6 commit eff561236e01102232a1c2bb4a1840175ead1368 @tarsius tarsius committed Oct 29, 2013
Showing with 13 additions and 3 deletions.
  1. +13 −3 git-commit-mode.el
@@ -29,6 +29,19 @@
;; A major mode for editing Git commit messages.
+;;;; Activation
+;; The variable `auto-mode-alist' has to be explicitly extended, by
+;; adding this to your init file.
+;; (require 'git-commit-mode) ; unless autoloaded
+;; (git-commit-auto-mode-enable)
+;; Loading `magit' takes care of this, so if you use that, you can
+;; skip the above. Unless you also have `magit-log-edit' installed,
+;; in which case `magit' assumes you want to use that instead of this
+;; library.
;;;; Formatting
;; Highlight the formatting of git commit messages and indicate errors according
@@ -643,9 +656,6 @@ basic structure of and errors in git commit messages."
(setq auto-mode-alist
(delete (cons p 'git-commit-mode) 'auto-mode-alist))))
(provide 'git-commit-mode)
;; Local Variables:
;; indent-tabs-mode: nil

0 comments on commit eff5612

Please sign in to comment.