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

parent mode for magit-log-edit-mode #424

Closed
cinsk opened this issue Jun 5, 2012 · 6 comments
Closed

parent mode for magit-log-edit-mode #424

cinsk opened this issue Jun 5, 2012 · 6 comments
Labels
enhancement New feature or request

Comments

@cinsk
Copy link
Contributor

cinsk commented Jun 5, 2012

Since github uses markdown markup for commit message, it would be interesting if the magit-log-edit-mode could syntax highlight for the markdown syntax.

The easiest way would be change the parent mode for magit-log-edit-mode to markdown-mode, however it will be bad decision because not all users uses markdown-mode.

I cannot provide clean solution for this, but will you kindly consider to support to use XXX mode as the parent mode for magit-log-edit-mode, or to provide clean solution for this?

Thank you.

@cinsk
Copy link
Contributor Author

cinsk commented Jun 5, 2012

My initial idea is to create advice function for magit-log-edit to replace text-mode into markdown-mode. But I failed since markdown-mode also uses text-mode. :(

    (defadvice magit-log-edit (around cinsk/magit-log-edit-markdown 
                                      (&optional arg))
      (interactive)
      (flet ((text-mode () (markdown-mode)))
        ad-do-it))

@DarwinAwardWinner
Copy link
Contributor

You would have to do something like this:

(if (require 'markdown-mode nil t)
    (define-derived-mode magit-log-edit-mode markdown-mode "Magit Log Edit")
  (define-derived-mode magit-log-edit-mode text-mode "Magit Log Edit"
    ;; Recognize changelog-style paragraphs
    (set (make-local-variable 'paragraph-start)
         (concat paragraph-start "\\|*\\|("))))

@monsanto
Copy link
Contributor

No discussion on this one for a while. Here is another idea: could we make log-edit a minor mode?

@tarsius
Copy link
Member

tarsius commented Jun 23, 2013

@lunaryorn does git-commit-mode support something like this.

@Others see https://github.com/lunaryorn/git-modes

@swsnr
Copy link
Contributor

swsnr commented Jun 24, 2013

@tarsius Git Commit Mode will not derive from Markdown Mode. Git commit messages are no Markdown generally.

However, I might refactor parts of Git Commit Mode into a minor mode, or find some other means of interacting with Markdown Mode, if there is need. Please open a corresponding issue in the Git Modes repository.

@tarsius
Copy link
Member

tarsius commented Jun 24, 2013

@lunaryorn I agree that git-commit-mode should not derive from markdown-mode. Turning git-commit-mode into a minor mode or something along that line seems like an interesting idea though.

I won't add such a feature to magit's own commit (log-edit) mode, it should stay simple. Please use git-commit-mode and take the discussion to magit/git-modes#17.

@tarsius tarsius closed this as completed Jun 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants