Permalink
Browse files

Unset ALTERNATE_EDITOR before invoking emacsclient

When ALTERNATE_EDITOR environment variable is set and emacs server is
not found, emacsclient executes the editor specified by the variable.
This is not what we want, because this editor might not be emacs.
Therefore, we unset the variable before invoking emacsclient.

Conflicts:

	perl/new_org.pm
  • Loading branch information...
1 parent f0a8cd6 commit ab7c3d5c852affd6faa1b5bb34e30677764cad2a @wentasah wentasah committed Aug 3, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 perl/new_org.pm
View
@@ -20,7 +20,7 @@ sub run_func_in_emacs($$;$) {
if (!defined $args) { $args = ""; }
# WARNING: possible security hole
$args =~ s/'/'\\''/g;
- my $argstring = qq/emacsclient -s org-ikiwiki-compiler --eval '(ikiwiki-org-$func "$tn1" "$tn2" $args)'/;
+ my $argstring = qq/unset ALTERNATE_EDITOR; emacsclient -s org-ikiwiki-compiler --eval '(ikiwiki-org-$func "$tn1" "$tn2" $args)'/;
system($argstring);
# Wait for emacs to finish
my @ret = <$tf2>;
@@ -30,7 +30,7 @@ sub run_func_in_emacs($$;$) {
}
sub import {
- system("emacsclient -s org-ikiwiki-compiler --eval nil");
+ system("unset ALTERNATE_EDITOR; emacsclient -s org-ikiwiki-compiler --eval nil");
if ($? != 0) {
system("emacs --daemon --eval \"(progn (require 'ikiwiki-org-plugin) (setq server-name \\\"org-ikiwiki-compiler\\\") (server-start))\"");
if ($? != 0) {

0 comments on commit ab7c3d5

Please sign in to comment.