magit

概要

magit は Emacs の上で Git の色々な操作ができるやつ。結構使いやすいのでオススメなやつ。

forge を使うと GitHub や GitLab とも連携できてさらに便利、なはず。

インストール

レシピは el-get 本体付属のものをコピーして使ってる。 magit の依存関係に変更があったのでそれに追従するため

ref: https://github.com/mugijiru/.emacs.d/pull/2992

(:name magit
       :website "https://github.com/magit/magit#readme"
       :description "It's Magit! An Emacs mode for Git."
       :type github
       :pkgname "magit/magit"
       :branch "main"
       :minimum-emacs-version "25.1"
       ;; Note: `git-commit' is shipped with `magit' code itself.
       ;; Note: `magit-section' is shipped with `magit' code itself.
       :depends (dash transient with-editor compat seq)
       :info "docs"
       :load-path "lisp/"
       :compile "lisp/"
       ;; Use the Makefile to produce the info manual, el-get can
       ;; handle compilation and autoloads on its own.  Create an
       ;; empty autoloads file because magit.el explicitly checks for
       ;; a file of that name.
       :build `(("make" ,(format "EMACSBIN=%s" el-get-emacs) "docs")
                ("touch" "lisp/magit-autoloads.el"))
       :build/berkeley-unix `(("gmake" ,(format "EMACSBIN=%s" el-get-emacs) "docs")
                              ("touch" "lisp/magit-autoloads.el"))
       ;; assume windows lacks make and makeinfo
       :build/windows-nt (with-temp-file "lisp/magit-autoloads.el" nil))

また依存している with-editorseq のレシピも用意している

(:name with-editor
       :description "Use the Emacsclient as $EDITOR"
       :type github
       :pkgname "magit/with-editor"
       :branch "main"
       :info "docs"
       :load-path "lisp/"
       :compile "lisp/"
       ;; Use the Makefile to produce the info manual, el-get can
       ;; handle compilation and autoloads on its own.
       :build `(("make" ,(format "EMACSBIN=%s" el-get-emacs) "info"))
       :build/berkeley-unix `(("gmake" ,(format "EMACSBIN=%s" el-get-emacs)
                               "info")))
(:name seq
       :description "Sequence manipulation functions"
       :type elpa
       :website "https://elpa.gnu.org/packages/seq.html")

そして el-get-bundle でインストールしている

(el-get-bundle magit)

その他設定

ghub を load-path に入れないとうまくいかなかった時があったので load-path に入れてたり、 orgit を入れていたり

(with-eval-after-load 'magit
  (add-to-list 'load-path (expand-file-name "~/.emacs.d/el-get/ghub/lisp")))

(el-get-bundle orgit)

なお orgit は recipe を自前で用意している

(:name orgit
       :website "https://github.com/magit/orgit"
       :description "Link to Magit buffers from Org documents."
       :type github
       :branch "main"
       :pkgname "magit/orgit"
       :depends (compat magit org-mode))