From: Hamish <dmishd@gmail.com>
To: sup-devel <sup-devel@rubyforge.org>
Subject: Re: [sup-devel] editing messages outside of sup
Date: Sun, 27 Feb 2011 17:20:55 +0000 [thread overview]
Message-ID: <1298826314-sup-276@whisper> (raw)
In-Reply-To: <1298819507-sup-8138@pruts.nl>
Excerpts from Ico Doornekamp's message of Sun Feb 27 15:31:14 +0000 2011:
> > Hamish, definitely thank you for doing something about this. I
> > actually had a general question about this problem a while back - if
> > it is possible to edit the message independently via the approach you
> > took in this patch, why can't the editor be fired up in a
> > "nonblocking" kind of mode in the first place? Something like a
> > fork()/exec() to start the editor, and then handling SIGCHLD rather
> > than calling a variant of wait() immediately. The SIGCHLD handling
> > could check the return code from the editor, and then update the
> > message sending buffer appropriately.
>
> But in what tty should the forked editor run then? I guess the above
> idea would work for spawning an editor under X, but can not be used when
> running on a (remote) console. I guess the 'vim --remote' solution would
> be feasable, bug I guess this is not simple enough to add as an
> out-of-the-box solution.
Now I've got the basic stuff working, I'd be up for adding to it.
Probably the best way would be to use a hook that could fire up
something using a fork()/exec().
The way I'd see this working is that it would only be useful on a
machine running X (or Wayland, or whatever the Mac GUI is called).
If you have ssh'ed to a remote machine then I don't think there is a
good way to manage this automatically without turning sup into screen
(which I think would be a bad idea), though I wouldn't want to get in
the way of imaginative hooks of course.
Basically I would say that if you want to edit your message outside of
sup on a remote machine (via ssh) you should use screen/tmux in split
mode, or have 2 terminals that ssh to the same server, or something like
that. Opening the file tends to involve typing:
$ vim /tmp/sup
and then pressing tab, so I don't think it's too onerous. And if you
turned on X forwarding and had xsel installed you could just press
<Enter> (to copy the path to the clipboard) and then paste that into the
other terminal.
Anyway, I'll have a think about how best to do a hook for this. I might
end up doing a blocking and a non-blocking variant - the blocking
variant could drop you straight back to reply-mode when it detects the
editor has exited, while the non-blocking mode would make it simpler to
write a hook, but you would have to manually exit async mode once
editing was done.
Hamish
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
next prev parent reply other threads:[~2011-02-27 17:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-20 22:02 Hamish
2011-02-26 19:23 ` Hamish
2011-02-27 1:15 ` Alvaro Herrera
2011-02-27 2:51 ` Roni Choudhury
2011-02-27 15:31 ` Ico Doornekamp
2011-02-27 17:20 ` Hamish [this message]
2011-02-27 19:44 ` Ico Doornekamp
2011-04-04 23:01 ` Hamish
2011-04-05 4:38 ` Ico Doornekamp
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=1298826314-sup-276@whisper \
--to=dmishd@gmail.com \
--cc=sup-devel@rubyforge.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox