From cb95ebdb711ea087cee920b2d53d4f4eaac8f7f8 Mon Sep 17 00:00:00 2001 From: Arnaud Legrand Date: Tue, 24 Jul 2018 18:33:39 +0200 Subject: [PATCH] Use magit if available !! --- module2/ressources/emacs_orgmode.org | 4 +++- module2/ressources/rr_org/init.el | 4 ++++ module2/ressources/rr_org/init.org | 8 ++++++++ module2/ressources/rr_org/journal.org | 3 +++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/module2/ressources/emacs_orgmode.org b/module2/ressources/emacs_orgmode.org index 7c231f2..bc28645 100644 --- a/module2/ressources/emacs_orgmode.org +++ b/module2/ressources/emacs_orgmode.org @@ -234,7 +234,9 @@ official webpage: http://company-mode.github.io/ it on a daily basis but you should definitely understand what git does behind the scene beforehand. If you feel this would be useful for you, you should follow the instructions from here: -https://www.emacswiki.org/emacs/Magit +https://www.emacswiki.org/emacs/Magit. If you installed the previous +"/reproducible research/" emacs configuration, you can easily invoke +magit by using ~C-x g~. ** Other resources - [[https://orgmode.org/orgguide.pdf][The compact Org-mode Guide]] - [[https://github.com/dfeich/org-babel-examples][Many examples illustrating the use of different languages in org-mode]] diff --git a/module2/ressources/rr_org/init.el b/module2/ressources/rr_org/init.el index 619e502..ec13381 100644 --- a/module2/ressources/rr_org/init.el +++ b/module2/ressources/rr_org/init.el @@ -78,6 +78,10 @@ (global-set-key [f5] '(lambda () (interactive) (revert-buffer nil t nil))) +(global-set-key (kbd "C-x g") 'magit-status) +(global-set-key (kbd "C-x M-g") 'magit-dispatch-popup) +;; (global-magit-file-mode 1) + (defun auto-fill-mode-on () (TeX-PDF-mode 1)) (add-hook 'tex-mode-hook 'TeX-PDF-mode-on) (add-hook 'latex-mode-hook 'TeX-PDF-mode-on) diff --git a/module2/ressources/rr_org/init.org b/module2/ressources/rr_org/init.org index 9e26437..36c4884 100644 --- a/module2/ressources/rr_org/init.org +++ b/module2/ressources/rr_org/init.org @@ -144,6 +144,14 @@ my other shortcuts (e.g., the ones for spelling a region). #+begin_src emacs-lisp :tangle init.el (global-set-key [f5] '(lambda () (interactive) (revert-buffer nil t nil))) #+end_src +** Invoke magit (for git) :WEB: +From http://magit.vc/manual/magit.pdf + +#+begin_src emacs-lisp :tangle init.el +(global-set-key (kbd "C-x g") 'magit-status) +(global-set-key (kbd "C-x M-g") 'magit-dispatch-popup) +;; (global-magit-file-mode 1) +#+end_src * Small fixes for LaTeX: ** PDF with LaTeX by default :ARNAUD: #+begin_src emacs-lisp :tangle init.el diff --git a/module2/ressources/rr_org/journal.org b/module2/ressources/rr_org/journal.org index 64d4825..4104ff1 100644 --- a/module2/ressources/rr_org/journal.org +++ b/module2/ressources/rr_org/journal.org @@ -40,6 +40,9 @@ shortcuts. This can be changed from the Options menu. - =C-x C-h= get the list of emacs shortcuts - =C-c C-h= get the list of emacs shortcuts considering the mode you are currently using (e.g., C, Lisp, org, ...) + - With the "/reproducible research/" emacs configuration, ~C-x g~ allows + you to invoke [[https://magit.vc/][Magit]] (provided you installed it beforehand!) which + is a nice git interface for Emacs. There are a bunch of cheatsheets also available out there (e.g., [[http://www.shortcutworld.com/en/linux/Emacs_23.2.1.html][this one for emacs]] and [[http://orgmode.org/orgcard.txt][this one for org-mode]] or this [[http://sachachua.com/blog/wp-content/uploads/2013/05/How-to-Learn-Emacs-v2-Large.png][graphical one]]). ***** Org-mode -- 2.18.1