From 438d51182fb3994127170d46fbf5d37cf1318ad9 Mon Sep 17 00:00:00 2001 From: Max Regan Date: Sun, 12 Jul 2020 12:56:39 -0700 Subject: [PATCH] emacs: make emacs/EDITOR work --- .emacs.d/init.org | 5 ----- .mgr_config/.bashrc | 12 +++++++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.emacs.d/init.org b/.emacs.d/init.org index e0ee35c..1802fc0 100644 --- a/.emacs.d/init.org +++ b/.emacs.d/init.org @@ -229,11 +229,6 @@ Install magit, the emacs porcelain for git. #+BEGIN_SRC emacs-lisp (use-package magit :custom (magit-bury-buffer-function 'magit-mode-quit-window)) - - (use-package with-editor - :init (add-hook 'shell-mode-hook 'with-editor-export-editor) - (add-hook 'term-exec-hook 'with-editor-export-editor) - (add-hook 'eshell-mode-hook 'with-editor-export-editor)) #+END_SRC *** Terminals (=multi-Term=) diff --git a/.mgr_config/.bashrc b/.mgr_config/.bashrc index e8e4524..faebaa0 100644 --- a/.mgr_config/.bashrc +++ b/.mgr_config/.bashrc @@ -7,7 +7,17 @@ noerr() { } alias gh='git-home' -alias emacs='emacsclient -a="" -c' alias highlight='grep -U999999 --color=always' export PATH=$PATH:$HOME/.mgr_config/bin + +if [[ -z "$INSIDE_EMACS" ]]; then + EMACS="emacsclient -a="" -c" + alias emacs="$EMACS" +else + EMACS="emacsclient" + alias emacs="$EMACS -n" +fi + +export EDITOR="$EMACS" +export VISUAL="$EMACS"