zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: Zsh Users <zsh-users@zsh.org>
Subject: 'run ahead' execution of script
Date: Tue, 24 Feb 2015 11:18:17 -0800	[thread overview]
Message-ID: <54ECCE79.9050809@eastlink.ca> (raw)

An interesting problem:

   e ) edit $1; echo "Sourcing $1"; source $1; return 0 ;;

... that line from a function does just what it seems, edit a file, then
source it. 'edit' has been various editors over time.  But I just
tried changing 'edit' to 'geany', and something problematic happens:  The
message and the sourcing happen before geany is closed, but *only* if
the editor is already open in another window. zsh
is executing the rest of the line while the editor is still open, as if it
thinks it should 'multitask' there.  It seems logical that it
doesn't close an editor that it didn't open, OTOH there's no point in
sourcing the file before it has been edited.  Can this be prevented?
Again, I don't think that zsh should be expected to behave differently,
however some way of forcing it to wait for the file (if not the entire 
editor)
to be closed in this situation would be useful.  Geany itself
has an '-i' switch that forces a new process, but I'm wondering if zsh
itself can handle that i.e. pause for a process to quit before continuing
even if it didn't start it.  I appreciate that this might be impossible--
a violation of the hierarchy.  It's just a point of interest.


             reply	other threads:[~2015-02-24 19:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 19:18 Ray Andrews [this message]
2015-02-24 19:44 ` Andrew Janke
2015-02-24 21:41   ` Ray Andrews
2015-02-25  2:21     ` Bart Schaefer
2015-02-25  2:46       ` Ray Andrews
2015-02-25  3:26         ` Andrew Janke
2015-02-25  5:09           ` Ray Andrews

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=54ECCE79.9050809@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@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).