summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2013-10-21 11:56:08 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2013-10-21 12:11:55 +0100
commit81658678266fe314c9bf30476caf0cce40fb836d (patch)
treefd29532c58892a60e59f9542872cafc7567a25eb
parentba512e4d56b67b173c5e554fa5a8c4fbcd26c93c (diff)
downloadjt-81658678266fe314c9bf30476caf0cce40fb836d.tar.gz
Support different editors
-rwxr-xr-xjt11
1 files changed, 10 insertions, 1 deletions
diff --git a/jt b/jt
index 556cf55..da86ac5 100755
--- a/jt
+++ b/jt
@@ -63,6 +63,13 @@ class JournalTool(cliapp.Application):
'add entries to git automatically',
default=True)
+ self.settings.string(
+ ['editor'],
+ 'editor to launch for journal entries. Must include %s to '
+ 'indicate where the filename goes',
+ default='sensible-editor %s')
+
+
def cmd_new(self, args):
'''Create a new journal entry draft.'''
@@ -107,7 +114,9 @@ class JournalTool(cliapp.Application):
return os.path.join(self.settings['source'], subdir)
def edit_file(self, pathname):
- subprocess.check_call(['sensible-editor', pathname])
+ safe_pathname = cliapp.shell_quote(pathname)
+ cmdline = ['sh', '-c', self.settings['editor'] % pathname]
+ self.runcmd(cmdline)
def cmd_list(self, args):
'''List journal entry drafts.'''