* [9fans] easier refreshing of acme wins @ 2015-03-26 16:02 Mathieu Lonjaret 2015-03-26 16:34 ` Bakul Shah 2015-04-09 8:02 ` yy 0 siblings, 2 replies; 11+ messages in thread From: Mathieu Lonjaret @ 2015-03-26 16:02 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs Hi, I work with many git branches, often affecting the same files. And I also happen to jump from one to the other quite frequently. There could be a problem with my workflow, but let's pretend there isn't. When one of said files is already open in acme, the win won't automatically refresh it and that's ok, I certainly wouldn't want that anyway, because I don't always to refresh them all. However, I find it a bit tedious that I have to write (or paste) myself the Get tag for each of the wins I want to refresh. To the point that I'm thinking of hardcoding the Get tag as one of the "permanent" tags for a win. Before I do that, does anyone have a better solution to suggest? The best would be that the Get tag gets automatically added to the tag bar whenever the files are changed (by git checkout, or other). p9p acme btw. Thanks, Mathieu ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] easier refreshing of acme wins 2015-03-26 16:02 [9fans] easier refreshing of acme wins Mathieu Lonjaret @ 2015-03-26 16:34 ` Bakul Shah 2015-03-26 18:49 ` Paul Lalonde 2015-04-09 8:02 ` yy 1 sibling, 1 reply; 11+ messages in thread From: Bakul Shah @ 2015-03-26 16:34 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs What if you watch all tag lines and when a git controlled file is opened in a window, you the watch file for changes and when it changes put something in a new window that you can just select and middle click? > On Mar 26, 2015, at 9:02 AM, Mathieu Lonjaret <mathieu.lonjaret@gmail.com> wrote: > > Hi, > > I work with many git branches, often affecting the same files. And I > also happen to jump from one to the other quite frequently. There > could be a problem with my workflow, but let's pretend there isn't. > > When one of said files is already open in acme, the win won't > automatically refresh it and that's ok, I certainly wouldn't want that > anyway, because I don't always to refresh them all. > > However, I find it a bit tedious that I have to write (or paste) > myself the Get tag for each of the wins I want to refresh. To the > point that I'm thinking of hardcoding the Get tag as one of the > "permanent" tags for a win. > > Before I do that, does anyone have a better solution to suggest? The > best would be that the Get tag gets automatically added to the tag bar > whenever the files are changed (by git checkout, or other). > > p9p acme btw. > > Thanks, > Mathieu > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] easier refreshing of acme wins 2015-03-26 16:34 ` Bakul Shah @ 2015-03-26 18:49 ` Paul Lalonde 2015-03-26 22:05 ` Bakul Shah 0 siblings, 1 reply; 11+ messages in thread From: Paul Lalonde @ 2015-03-26 18:49 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs [-- Attachment #1: Type: text/plain, Size: 1991 bytes --] The feature direction I'd like when working with Git is for the window of a git-changed file to become un-editable. This would require adding the idea of a un-editable window, which is probably a bad idea. Meanwhile I use the script below to generate X commands to reload changed windows. If I had a little more gumption (and less fear) I'd pipe the last output to make acme execute the Edits. #!/bin/bash cd `git rev-parse --git-dir`/.. git diff --name-only HEAD~ | sed s+^+`pwd`/+ | sort > /tmp/foobar 9p read acme/index | awk '{print $6}' | sort | comm -12 - /tmp/foobar | sed 's+\(.*\)+Edit X=\1=,r+' On Thu, Mar 26, 2015 at 9:36 AM Bakul Shah <bakul@bitblocks.com> wrote: > What if you watch all tag lines and when a git controlled file is opened > in a window, you the watch file for changes and when it changes put > something in a new window that you can just select and middle click? > > > On Mar 26, 2015, at 9:02 AM, Mathieu Lonjaret < > mathieu.lonjaret@gmail.com> wrote: > > > > Hi, > > > > I work with many git branches, often affecting the same files. And I > > also happen to jump from one to the other quite frequently. There > > could be a problem with my workflow, but let's pretend there isn't. > > > > When one of said files is already open in acme, the win won't > > automatically refresh it and that's ok, I certainly wouldn't want that > > anyway, because I don't always to refresh them all. > > > > However, I find it a bit tedious that I have to write (or paste) > > myself the Get tag for each of the wins I want to refresh. To the > > point that I'm thinking of hardcoding the Get tag as one of the > > "permanent" tags for a win. > > > > Before I do that, does anyone have a better solution to suggest? The > > best would be that the Get tag gets automatically added to the tag bar > > whenever the files are changed (by git checkout, or other). > > > > p9p acme btw. > > > > Thanks, > > Mathieu > > > > [-- Attachment #2: Type: text/html, Size: 2589 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] easier refreshing of acme wins 2015-03-26 18:49 ` Paul Lalonde @ 2015-03-26 22:05 ` Bakul Shah 2015-03-28 7:19 ` Aram Santogidis 0 siblings, 1 reply; 11+ messages in thread From: Bakul Shah @ 2015-03-26 22:05 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs On Thu, 26 Mar 2015 18:49:51 -0000 Paul Lalonde <paul.a.lalonde@gmail.com> wrote: > The feature direction I'd like when working with Git is for the window of a > git-changed file to become un-editable. This would require adding the idea > of a un-editable window, which is probably a bad idea. Not sure what you mean. If you git {pull,checkout,merge,...}, files you have been editing (but not yet saved) may already require merging. You may be better off using some client side git hook that checks the state of acme edited files and tries to do the right thing (not that I have ever used these hooks). > Meanwhile I use the script below to generate X commands to reload changed > windows. If I had a little more gumption (and less fear) I'd pipe the last > output to make acme execute the Edits. > > #!/bin/bash > cd `git rev-parse --git-dir`/.. > git diff --name-only HEAD~ | sed s+^+`pwd`/+ | sort > /tmp/foobar > 9p read acme/index | awk '{print $6}' | sort | comm -12 - /tmp/foobar | > sed 's+\(.*\)+Edit X=\1=,r+' Nice! ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] easier refreshing of acme wins 2015-03-26 22:05 ` Bakul Shah @ 2015-03-28 7:19 ` Aram Santogidis 2015-04-03 13:16 ` Mathieu Lonjaret 0 siblings, 1 reply; 11+ messages in thread From: Aram Santogidis @ 2015-03-28 7:19 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs [-- Attachment #1: Type: text/plain, Size: 1444 bytes --] Hi, I posted a similar question in the list few days back http://marc.info/?l=9fans&m=142721596630272&w=1 and one solution that was suggested by Antons and works fine for me is the following. Edit X:^... [^+].*[^\/]$: e Cheers, Aram On Thu, Mar 26, 2015 at 11:05 PM, Bakul Shah <bakul@bitblocks.com> wrote: > > On Thu, 26 Mar 2015 18:49:51 -0000 Paul Lalonde <paul.a.lalonde@gmail.com> > wrote: > > The feature direction I'd like when working with Git is for the window > of a > > git-changed file to become un-editable. This would require adding the > idea > > of a un-editable window, which is probably a bad idea. > > Not sure what you mean. If you git {pull,checkout,merge,...}, > files you have been editing (but not yet saved) may already > require merging. You may be better off using some client side > git hook that checks the state of acme edited files and tries > to do the right thing (not that I have ever used these hooks). > > > Meanwhile I use the script below to generate X commands to reload changed > > windows. If I had a little more gumption (and less fear) I'd pipe the > last > > output to make acme execute the Edits. > > > > #!/bin/bash > > cd `git rev-parse --git-dir`/.. > > git diff --name-only HEAD~ | sed s+^+`pwd`/+ | sort > /tmp/foobar > > 9p read acme/index | awk '{print $6}' | sort | comm -12 - /tmp/foobar | > > sed 's+\(.*\)+Edit X=\1=,r+' > > Nice! > > [-- Attachment #2: Type: text/html, Size: 2262 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] easier refreshing of acme wins 2015-03-28 7:19 ` Aram Santogidis @ 2015-04-03 13:16 ` Mathieu Lonjaret 2015-04-03 16:24 ` Skip Tavakkolian 0 siblings, 1 reply; 11+ messages in thread From: Mathieu Lonjaret @ 2015-04-03 13:16 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs Yes, I had seen that thread, but I explained I don't want the same thing as what you're asking for. I do not want to refresh them all in one command. I want to selectively refresh some of them, but in an easier fashion than having to type Get for each of them. On 28 March 2015 at 08:19, Aram Santogidis <gnubuntux@gmail.com> wrote: > Hi, > > I posted a similar question in the list few days back > http://marc.info/?l=9fans&m=142721596630272&w=1 > > and one solution that was suggested by Antons and works fine for me is the > following. > > Edit X:^... [^+].*[^\/]$: e > > Cheers, > Aram > > On Thu, Mar 26, 2015 at 11:05 PM, Bakul Shah <bakul@bitblocks.com> wrote: >> >> >> On Thu, 26 Mar 2015 18:49:51 -0000 Paul Lalonde <paul.a.lalonde@gmail.com> >> wrote: >> > The feature direction I'd like when working with Git is for the window >> > of a >> > git-changed file to become un-editable. This would require adding the >> > idea >> > of a un-editable window, which is probably a bad idea. >> >> Not sure what you mean. If you git {pull,checkout,merge,...}, >> files you have been editing (but not yet saved) may already >> require merging. You may be better off using some client side >> git hook that checks the state of acme edited files and tries >> to do the right thing (not that I have ever used these hooks). >> >> > Meanwhile I use the script below to generate X commands to reload >> > changed >> > windows. If I had a little more gumption (and less fear) I'd pipe the >> > last >> > output to make acme execute the Edits. >> > >> > #!/bin/bash >> > cd `git rev-parse --git-dir`/.. >> > git diff --name-only HEAD~ | sed s+^+`pwd`/+ | sort > /tmp/foobar >> > 9p read acme/index | awk '{print $6}' | sort | comm -12 - /tmp/foobar | >> > sed 's+\(.*\)+Edit X=\1=,r+' >> >> Nice! >> > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] easier refreshing of acme wins 2015-04-03 13:16 ` Mathieu Lonjaret @ 2015-04-03 16:24 ` Skip Tavakkolian 2015-04-08 15:24 ` Mathieu Lonjaret 0 siblings, 1 reply; 11+ messages in thread From: Skip Tavakkolian @ 2015-04-03 16:24 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs [-- Attachment #1: Type: text/plain, Size: 2362 bytes --] wouldn't something like this work? in the example i (clumsily) find the .go files, remove them and then B them in again. % for (i in `{9p ls acme|grep '[1-9]+'}) { x = `{9p read acme/$i/tag|sed -n -e 's/^([^ ]*\.go) .*$/\1/p' } if (! ~ $x '') { echo del | 9p write acme/$i/ctl B $x } } On Fri, Apr 3, 2015 at 6:16 AM, Mathieu Lonjaret <mathieu.lonjaret@gmail.com > wrote: > Yes, I had seen that thread, but I explained I don't want the same > thing as what you're asking for. I do not want to refresh them all in > one command. I want to selectively refresh some of them, but in an > easier fashion than having to type Get for each of them. > > > On 28 March 2015 at 08:19, Aram Santogidis <gnubuntux@gmail.com> wrote: > > Hi, > > > > I posted a similar question in the list few days back > > http://marc.info/?l=9fans&m=142721596630272&w=1 > > > > and one solution that was suggested by Antons and works fine for me is > the > > following. > > > > Edit X:^... [^+].*[^\/]$: e > > > > Cheers, > > Aram > > > > On Thu, Mar 26, 2015 at 11:05 PM, Bakul Shah <bakul@bitblocks.com> > wrote: > >> > >> > >> On Thu, 26 Mar 2015 18:49:51 -0000 Paul Lalonde < > paul.a.lalonde@gmail.com> > >> wrote: > >> > The feature direction I'd like when working with Git is for the window > >> > of a > >> > git-changed file to become un-editable. This would require adding the > >> > idea > >> > of a un-editable window, which is probably a bad idea. > >> > >> Not sure what you mean. If you git {pull,checkout,merge,...}, > >> files you have been editing (but not yet saved) may already > >> require merging. You may be better off using some client side > >> git hook that checks the state of acme edited files and tries > >> to do the right thing (not that I have ever used these hooks). > >> > >> > Meanwhile I use the script below to generate X commands to reload > >> > changed > >> > windows. If I had a little more gumption (and less fear) I'd pipe the > >> > last > >> > output to make acme execute the Edits. > >> > > >> > #!/bin/bash > >> > cd `git rev-parse --git-dir`/.. > >> > git diff --name-only HEAD~ | sed s+^+`pwd`/+ | sort > /tmp/foobar > >> > 9p read acme/index | awk '{print $6}' | sort | comm -12 - > /tmp/foobar | > >> > sed 's+\(.*\)+Edit X=\1=,r+' > >> > >> Nice! > >> > > > > [-- Attachment #2: Type: text/html, Size: 3701 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] easier refreshing of acme wins 2015-04-03 16:24 ` Skip Tavakkolian @ 2015-04-08 15:24 ` Mathieu Lonjaret 0 siblings, 0 replies; 11+ messages in thread From: Mathieu Lonjaret @ 2015-04-08 15:24 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs Nice. but, as I explained, automatically refreshing all the wins (or even only the .go ones) is not really what I want. Moreover, this is probably even worse as I'd lose any custom tags I'd have added on those windows. On 3 April 2015 at 18:24, Skip Tavakkolian <skip.tavakkolian@gmail.com> wrote: > wouldn't something like this work? in the example i (clumsily) find the .go > files, remove them and then B them in again. > > % for (i in `{9p ls acme|grep '[1-9]+'}) { > x = `{9p read acme/$i/tag|sed -n -e 's/^([^ ]*\.go) .*$/\1/p' } > if (! ~ $x '') { > echo del | 9p write acme/$i/ctl > B $x > } > } > > On Fri, Apr 3, 2015 at 6:16 AM, Mathieu Lonjaret > <mathieu.lonjaret@gmail.com> wrote: >> >> Yes, I had seen that thread, but I explained I don't want the same >> thing as what you're asking for. I do not want to refresh them all in >> one command. I want to selectively refresh some of them, but in an >> easier fashion than having to type Get for each of them. >> >> >> On 28 March 2015 at 08:19, Aram Santogidis <gnubuntux@gmail.com> wrote: >> > Hi, >> > >> > I posted a similar question in the list few days back >> > http://marc.info/?l=9fans&m=142721596630272&w=1 >> > >> > and one solution that was suggested by Antons and works fine for me is >> > the >> > following. >> > >> > Edit X:^... [^+].*[^\/]$: e >> > >> > Cheers, >> > Aram >> > >> > On Thu, Mar 26, 2015 at 11:05 PM, Bakul Shah <bakul@bitblocks.com> >> > wrote: >> >> >> >> >> >> On Thu, 26 Mar 2015 18:49:51 -0000 Paul Lalonde >> >> <paul.a.lalonde@gmail.com> >> >> wrote: >> >> > The feature direction I'd like when working with Git is for the >> >> > window >> >> > of a >> >> > git-changed file to become un-editable. This would require adding >> >> > the >> >> > idea >> >> > of a un-editable window, which is probably a bad idea. >> >> >> >> Not sure what you mean. If you git {pull,checkout,merge,...}, >> >> files you have been editing (but not yet saved) may already >> >> require merging. You may be better off using some client side >> >> git hook that checks the state of acme edited files and tries >> >> to do the right thing (not that I have ever used these hooks). >> >> >> >> > Meanwhile I use the script below to generate X commands to reload >> >> > changed >> >> > windows. If I had a little more gumption (and less fear) I'd pipe >> >> > the >> >> > last >> >> > output to make acme execute the Edits. >> >> > >> >> > #!/bin/bash >> >> > cd `git rev-parse --git-dir`/.. >> >> > git diff --name-only HEAD~ | sed s+^+`pwd`/+ | sort > /tmp/foobar >> >> > 9p read acme/index | awk '{print $6}' | sort | comm -12 - /tmp/foobar >> >> > | >> >> > sed 's+\(.*\)+Edit X=\1=,r+' >> >> >> >> Nice! >> >> >> > >> > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] easier refreshing of acme wins 2015-03-26 16:02 [9fans] easier refreshing of acme wins Mathieu Lonjaret 2015-03-26 16:34 ` Bakul Shah @ 2015-04-09 8:02 ` yy 2015-04-09 13:28 ` Mathieu Lonjaret 1 sibling, 1 reply; 11+ messages in thread From: yy @ 2015-04-09 8:02 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs On 26 March 2015 at 17:02, Mathieu Lonjaret <mathieu.lonjaret@gmail.com> wrote: > However, I find it a bit tedious that I have to write (or paste) > myself the Get tag for each of the wins I want to refresh. To the > point that I'm thinking of hardcoding the Get tag as one of the > "permanent" tags for a win. One easy solution is to use as command something you already have in the tag bar. I have used '|' as Edit (I think the patch is my contrib, but I'm not sure), you may use it as Get. Or, since it looks like we are talking about go files, you could use 'g' or 'o', which will always be there. It is not ideal, but it is something you can do in 5 minutes. -- - yiyus || JGL . ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] easier refreshing of acme wins 2015-04-09 8:02 ` yy @ 2015-04-09 13:28 ` Mathieu Lonjaret 2015-04-15 15:44 ` Mathieu Lonjaret 0 siblings, 1 reply; 11+ messages in thread From: Mathieu Lonjaret @ 2015-04-09 13:28 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs ah, good idea. thanks! On 9 April 2015 at 10:02, yy <yiyu.jgl@gmail.com> wrote: > On 26 March 2015 at 17:02, Mathieu Lonjaret <mathieu.lonjaret@gmail.com> wrote: >> However, I find it a bit tedious that I have to write (or paste) >> myself the Get tag for each of the wins I want to refresh. To the >> point that I'm thinking of hardcoding the Get tag as one of the >> "permanent" tags for a win. > > One easy solution is to use as command something you already have in > the tag bar. I have used '|' as Edit (I think the patch is my contrib, > but I'm not sure), you may use it as Get. Or, since it looks like we > are talking about go files, you could use 'g' or 'o', which will > always be there. > > It is not ideal, but it is something you can do in 5 minutes. > > > -- > - yiyus || JGL . > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] easier refreshing of acme wins 2015-04-09 13:28 ` Mathieu Lonjaret @ 2015-04-15 15:44 ` Mathieu Lonjaret 0 siblings, 0 replies; 11+ messages in thread From: Mathieu Lonjaret @ 2015-04-15 15:44 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs [-- Attachment #1: Type: text/plain, Size: 2252 bytes --] I followed yiyus suggestion and ended up using ".go" as an alias for Get. I expect it's going to work nicely. the change is trivial: diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c index 6fe423a..5c55e21 100644 --- a/src/cmd/acme/exec.c +++ b/src/cmd/acme/exec.c @@ -75,6 +75,7 @@ static Rune LEdit[] = { 'E', 'd', 'i', 't', 0 }; static Rune LExit[] = { 'E', 'x', 'i', 't', 0 }; static Rune LFont[] = { 'F', 'o', 'n', 't', 0 }; static Rune LGet[] = { 'G', 'e', 't', 0 }; +static Rune LRefreshGo[] = { '.', 'g', 'o', 0 }; static Rune LID[] = { 'I', 'D', 0 }; static Rune LIncl[] = { 'I', 'n', 'c', 'l', 0 }; static Rune LIndent[] = { 'I', 'n', 'd', 'e', 'n', 't', 0 }; @@ -106,6 +107,7 @@ Exectab exectab[] = { { LExit, xexit, FALSE, XXX, XXX }, { LFont, fontx, FALSE, XXX, XXX }, { LGet, get, FALSE, TRUE, XXX }, + { LRefreshGo, get, FALSE, TRUE, XXX }, { LID, id, FALSE, XXX, XXX }, { LIncl, incl, FALSE, XXX, XXX }, { LIndent, indent, FALSE, XXX, XXX }, On 9 April 2015 at 15:28, Mathieu Lonjaret <mathieu.lonjaret@gmail.com> wrote: > ah, good idea. thanks! > > > On 9 April 2015 at 10:02, yy <yiyu.jgl@gmail.com> wrote: > > On 26 March 2015 at 17:02, Mathieu Lonjaret <mathieu.lonjaret@gmail.com> > wrote: > >> However, I find it a bit tedious that I have to write (or paste) > >> myself the Get tag for each of the wins I want to refresh. To the > >> point that I'm thinking of hardcoding the Get tag as one of the > >> "permanent" tags for a win. > > > > One easy solution is to use as command something you already have in > > the tag bar. I have used '|' as Edit (I think the patch is my contrib, > > but I'm not sure), you may use it as Get. Or, since it looks like we > > are talking about go files, you could use 'g' or 'o', which will > > always be there. > > > > It is not ideal, but it is something you can do in 5 minutes. > > > > > > -- > > - yiyus || JGL . > > > [-- Attachment #2: Type: text/html, Size: 3554 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-04-15 15:44 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-03-26 16:02 [9fans] easier refreshing of acme wins Mathieu Lonjaret 2015-03-26 16:34 ` Bakul Shah 2015-03-26 18:49 ` Paul Lalonde 2015-03-26 22:05 ` Bakul Shah 2015-03-28 7:19 ` Aram Santogidis 2015-04-03 13:16 ` Mathieu Lonjaret 2015-04-03 16:24 ` Skip Tavakkolian 2015-04-08 15:24 ` Mathieu Lonjaret 2015-04-09 8:02 ` yy 2015-04-09 13:28 ` Mathieu Lonjaret 2015-04-15 15:44 ` Mathieu Lonjaret
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).