Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: edit-command-line problem with emacsclient



On Sep 20,  1:46pm, Peter Vasil wrote:
}
} This is implemented for vim and emacs, however if I set my EDITOR or
} VISUAL to emacsclient, the *emacs* condition gets called which does not
} work for emacsclient. The arguments specidied for emacs work only for
} Emacs but not for emacsclient.

So as I read this, for emacsclient the -eval option is mutually exclusive
with opening a file.

It's been a long time since I used emacsclient.  Does this work?


diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line
index 2c7f34b..bdd7b0b 100644
--- a/Functions/Zle/edit-command-line
+++ b/Functions/Zle/edit-command-line
@@ -17,7 +17,7 @@
   local editor=${${VISUAL:-${EDITOR:-vi}}}
   case $editor in 
     (*vim*) ${=editor} -c "normal! ${byteoffset}go" -- $1;;
-    (*emacs*) ${=editor} $1 -eval "(goto-char ${byteoffset})";;
+    (*emacs*) ${=editor} -eval "(progn (find-alternate-file ${(qqq)1}) (goto-char ${byteoffset}))";;
     (*) ${=editor} $1;;
   esac
 



Messages sorted by: Reverse Date, Date, Thread, Author