Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spacemacs used as GIT_EDITOR doesn't syntax highlight COMMIT_EDITMSG when magit isn't previously loaded #2522

Closed
mkomitee opened this issue Aug 3, 2015 · 10 comments

Comments

@mkomitee
Copy link

mkomitee commented Aug 3, 2015

If you use emacs w/ spacemacs & magit via the git layer and emacsclient as GIT_EDITOR, and commit from a shell without first loading magit (by starting magit-status or something similar), then it won't syntax-highlight the COMMIT_EDITMSG buffer (it stays in FUNDAMENTAL mode) or enable the appropriate maps.

Adding (require 'magit) to dotspacemacs/config fixes the issue, so we probably need to add something else to the use-package stanza for magit in the git layer. I'd submit this as a pull request, but I'm not sure what would need to be added.

mkomitee added a commit to mkomitee/dotfiles that referenced this issue Aug 3, 2015
@syl20bnr syl20bnr added the Git label Aug 3, 2015
@syl20bnr
Copy link
Owner

syl20bnr commented Aug 3, 2015

I think this is fixed in develop thanks to #2293

@mkomitee
Copy link
Author

mkomitee commented Aug 3, 2015

I'm running on develop already. To be clear, it works as GIT_EDITOR if I previously loaded magit by executing magit-status or magit-log (or any other command which causes use-package to require magit), but not if I haven't. BTW, I'm on gitter-chat now if you want to talk.

@StreakyCobra
Copy link
Contributor

@mkomitee I'm using it in this way by having (global-git-commit-mode t) in the user-config of my .spacemacs. Does it work for you?

@synic
Copy link
Contributor

synic commented Nov 17, 2015

@StreakyCobra It doesn't work for me. In my user-config, I have this:

  ;; Enable highlighting of git commit messages when emacs is $EDITOR
  (global-git-commit-mode t)

However, when running git commit -a, the commit message is in Fundamental mode.

System Info

  • OS: darwin
  • Emacs: 24.5.7
  • Spacemacs: 0.105.0
  • Spacemacs branch: develop (rev. 7c160e8)
  • Distribution: spacemacs
  • Layers:
(unscroll auto-completion xkcd emacs-lisp git gtags dash yaml github javascript html markdown extra-langs python ruby org osx python django syntax-checking spell-checking version-control lua colors spacemacs-layouts vimscript
          (c-c++ :variables c-c++-enable-clang-support t)
          (shell :variables shell-default-height 30 shell-default-position 'bottom))

@StreakyCobra
Copy link
Contributor

Weird...

@synic
Copy link
Contributor

synic commented Nov 17, 2015

Oh crap, nevermind. I forgot I was running a daemon that needed reloading. It does indeed work.

@StreakyCobra StreakyCobra self-assigned this Nov 17, 2015
@mkomitee
Copy link
Author

This appears to work for me. Should that be configured by the layer, or should everyone who uses spacemacs/emacs as $EDITOR have to set it themselves?

... if we don't want to have it automatically enabled as the default (so that magit can be loaded as needed to speed up start-up), maybe it can be enabled by a layer configuration variable, or at least documented in the README.org file.

@StreakyCobra
Copy link
Contributor

It should at least be documented :-) An option for this in the git layer would probably be better.

@StreakyCobra
Copy link
Contributor

Fixed in 374e37e

@mkomitee
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants