From 2685e9ad83f6b36f563e5538ca55abd1ea3b491d Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 27 Feb 2015 23:29:46 +0900 Subject: [PATCH] emacs.el: my-term: Call with prefix argument to create new buffer --- emacs.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/emacs.el b/emacs.el index aaac50a..7fbcd29 100644 --- a/emacs.el +++ b/emacs.el @@ -2272,9 +2272,11 @@ This function accept no argument and return newly created buffer of terminal.") (defun my-term (&optional arg) "Open terminal buffer and return that buffer. -ARG is ignored." + +If ARG is given or called with prefix argument, create new buffer." (interactive "P") - (if (and my-term + (if (and (not arg) + my-term (buffer-name my-term)) (pop-to-buffer my-term) (setq my-term @@ -2292,7 +2294,7 @@ ARG is ignored." ;; (multi-term) ;; (ansi-term shell-file-name))))) -(setq my-term-function 'eshell) +(setq my-term-function (lambda () (eshell t))) ;;(define-key my-prefix-map (kbd "C-s") 'my-term) (define-key ctl-x-map "i" 'my-term)