From: Karl Hasselström Date: Tue, 29 Jan 2008 03:04:57 GMT Subject: [StGit PATCH 4/5] Simplify editor selection logic Message-ID: <20080129030349.926.45486.stgit@yoghurt> In-Reply-To: <20080129030059.926.29897.stgit@yoghurt> Signed-off-by: Karl Hasselström --- There are a few other env variables we might like to look at, like VISUAL. And isn't there a git-specific variable too? stgit/utils.py | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/stgit/utils.py b/stgit/utils.py index 00776b0..43366c9 100644 --- a/stgit/utils.py +++ b/stgit/utils.py @@ -175,12 +175,8 @@ def call_editor(filename): # the editor editor = config.get('stgit.editor') - if editor: - pass - elif 'EDITOR' in os.environ: - editor = os.environ['EDITOR'] - else: - editor = 'vi' + if not editor: + editor = os.environ.get('EDITOR', 'vi') editor += ' %s' % filename out.start('Invoking the editor: "%s"' % editor)