[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit ece2cb8 1/2: git-commit-setup: Enable mode afte
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit ece2cb8 1/2: git-commit-setup: Enable mode after setting local variables |
Date: |
Mon, 20 Sep 2021 09:57:36 -0400 (EDT) |
branch: elpa/git-commit
commit ece2cb84dd31aa967ef37a0d8bc2293c1c52db87
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
git-commit-setup: Enable mode after setting local variables
Otherwise all non-permanent variables would get reset.
---
lisp/git-commit.el | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/lisp/git-commit.el b/lisp/git-commit.el
index 6064ce8..3d08144 100644
--- a/lisp/git-commit.el
+++ b/lisp/git-commit.el
@@ -500,6 +500,17 @@ to recover older messages")
;; That library declares this functions without loading
;; magit-process.el, which defines it.
(require 'magit-process nil t))
+ (when git-commit-major-mode
+ (let ((auto-mode-alist (list (cons (concat "\\`"
+ (regexp-quote buffer-file-name)
+ "\\'")
+ git-commit-major-mode)))
+ ;; The major-mode hook might want to consult these minor
+ ;; modes, while the minor-mode hooks might want to consider
+ ;; the major mode.
+ (git-commit-mode t)
+ (with-editor-mode t))
+ (normal-mode t)))
;; Pretend that git-commit-mode is a major-mode,
;; so that directory-local settings can be used.
(let ((default-directory
@@ -516,17 +527,6 @@ to recover older messages")
(major-mode 'git-commit-mode)) ; trick dir-locals-collect-variables
(hack-dir-local-variables)
(hack-local-variables-apply)))
- (when git-commit-major-mode
- (let ((auto-mode-alist (list (cons (concat "\\`"
- (regexp-quote buffer-file-name)
- "\\'")
- git-commit-major-mode)))
- ;; The major-mode hook might want to consult these minor
- ;; modes, while the minor-mode hooks might want to consider
- ;; the major mode.
- (git-commit-mode t)
- (with-editor-mode t))
- (normal-mode t)))
;; Show our own message using our hook.
(setq with-editor-show-usage nil)
(setq with-editor-usage-message git-commit-usage-message)