diff options
| -rw-r--r-- | terminal-here.el | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/terminal-here.el b/terminal-here.el new file mode 100644 index 0000000..ae4d1d1 --- /dev/null +++ b/terminal-here.el @@ -0,0 +1,40 @@ +;;; terminal-here.el --- Run an external terminal in current directory -*- lexical-binding: t; -*- + +;; Copyright (C) 2015 Free Software Foundation, Inc. + +;; Author: David Shepherd <davidshepherd7@gmail.com> +;; Version: 0.1 +;; Package-Requires: (TODO) +;; Keywords: TODO +;; URL: https://github.com/davidshepherd7/terminal-here + + +;;; Commentary: + +;; TODO + + +;;; Code: + + +(defcustom terminal-here-terminal-command + "x-terminal-emulator" + "Terminal binary, or list of (binary arg1 arg2 ...)" + :group 'terminal-here + :type '(list string)) + + +(defun terminal-here-cwd () + "Launch a terminal in the working directory of the current buffer" + (interactive) + (let ((terminal-command (if (listp terminal-here-terminal-command) (car terminal-here-terminal-command) terminal-here-terminal-command)) + (terminal-arguments (if (listp terminal-here-terminal-command) (cdr terminal-here-terminal-command) '()))) + (apply #'start-process + terminal-command nil terminal-command + terminal-arguments))) + + +(provide 'terminal-here) + + +;;; terminal-here.el ends here |
