summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Shepherd <davidshepherd7@gmail.com>2017-03-16 08:42:08 +0000
committerDavid Shepherd <davidshepherd7@gmail.com>2017-03-16 08:47:15 +0000
commit55504592cd0d1b328aaac7d5083f185d1c387b14 (patch)
treecd8d004baaf22017bd717584b4329192e5c2ad2a
parentInitial commit (diff)
downloademacs-terminal-here-55504592cd0d1b328aaac7d5083f185d1c387b14.tar.gz
Initial code
-rw-r--r--terminal-here.el40
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