From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 27 Jul 2009 21:19:39 -0400 Message-ID: <3aaafc130907271819y4c153150j7b2310e93a0d621@mail.gmail.com> From: "J.R. Mauro" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] Using Acme as an external Editor Topicbox-Message-UUID: 2f81a8fa-ead5-11e9-9d60-3106f5b1d025 On Mon, Jul 27, 2009 at 2:22 PM, Russ Cox wrote: > On Mon, Jul 27, 2009 at 11:06 AM, Tim Newsham wrote: >>> Is there some idiom or method for using Acme as an external editor to s= ome >>> other program? Say I want to use it as the editor that is spawned when = I do >>> a CVS commit to a system; how would I do this, or can this even be done= ? I'm >>> using plan9ports, but I don't know how much of this question relates to >>> what. >> >> I was playing with this exact problem recently. There's an easy way to s= end >> a file to acme for editing -- the plumber. =A0There's a downside, it doe= sn't >> wait for the editor to save or complete. =A0So.. you could plumb the fil= e and >> then wait for a save to happen, somehow, or you can write another progra= m >> that forces a new acme window with the contents of the file and waits fo= r it >> to either Put or Del. =A0I wrote a small program to do this recently (se= e the >> thread: http://9fans.net/archive/2009/06/290) which was a bit hacky, but >> worked. =A0I solicited some feedback on some questions and got some good >> advice from Russ (http://9fans.net/archive/2009/06/292) but havent yet g= one >> back and applied it. > > I don't think you need to be that fancy. > Lorenzo Bolla already pointed out E in this thread, > and it exists exactly for this purpose. > > http://swtch.com/plan9port/man/man1/sam.html > (description of E is at the end) > > Russ > > One caveat about E: if you're paranoid like I am and save your file many times while editing, E will not be terribly friendly until you train yourself to save only when finished. (This is not a criticism of E, it is merely a warning to people with my kind of idiosyncrasies)