diff options
author | Tom Willemsen | 2013-03-31 01:53:06 +0100 |
---|---|---|
committer | Tom Willemsen | 2013-03-31 01:53:06 +0100 |
commit | a416fe4650b0d38f0e37e0d2489c91415a7f966a (patch) | |
tree | 6c5813548f41ef58ffb1a90890406d7d75b904e2 /emacs/init.org | |
parent | 51d121158687a5965ed28ecb4043f85c066a502a (diff) | |
download | dotfiles-a416fe4650b0d38f0e37e0d2489c91415a7f966a.tar.gz dotfiles-a416fe4650b0d38f0e37e0d2489c91415a7f966a.zip |
Emacs: Automatically close ansi-term buffer
Diffstat (limited to 'emacs/init.org')
-rw-r--r-- | emacs/init.org | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/emacs/init.org b/emacs/init.org index 0a72b5c..db69785 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -540,6 +540,18 @@ anyway. (global-set-key (kbd "C-M-z") 'indent-defun) #+END_SRC +Kill the ~*ansi-term*~ buffer (or any term buffer) after the underlying +shell process has finished. When I quit a shell I don't want the +buffer hanging around. + +#+BEGIN_SRC emacs-lisp + (defadvice term-handle-exit (after oni:kill-buffer-after-exit activate) + "Kill the term buffer if the process finished." + (let ((msg (ad-get-arg 1))) + (when (string-equal msg "finished\n") + (kill-buffer (current-buffer))))) +#+END_SRC + #+BEGIN_SRC emacs-lisp (eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) (eval-after-load "smex" '(oni:smex-init)) |