zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Peter Vasil <mailing_lists@petervasil.net>, zsh-workers@zsh.org
Subject: Re: edit-command-line problem with emacsclient
Date: Sun, 20 Sep 2015 08:32:02 -0700	[thread overview]
Message-ID: <150920083202.ZM31587@torch.brasslantern.com> (raw)
In-Reply-To: <55FE9C92.7030203@petervasil.net>

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
 


  reply	other threads:[~2015-09-20 15:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-20 11:46 Peter Vasil
2015-09-20 15:32 ` Bart Schaefer [this message]
     [not found]   ` <55FF3CE5.9070604@petervasil.net>
2015-09-21  4:06     ` Bart Schaefer
     [not found]       ` <56004B05.9000703@petervasil.net>
     [not found]         ` <150921120017.ZM426@torch.brasslantern.com>
2015-09-21 19:09           ` Peter Vasil
2015-09-21 21:16 ` Daniel Shahaf
2015-09-21 22:31   ` Bart Schaefer
2015-09-22  7:10     ` Peter Vasil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150920083202.ZM31587@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=mailing_lists@petervasil.net \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).