* [9fans] acme Put doesn't save @ 2009-03-04 11:44 Rudolf Sykora 2009-03-04 12:21 ` yy 2009-03-04 12:28 ` roger peppe 0 siblings, 2 replies; 18+ messages in thread From: Rudolf Sykora @ 2009-03-04 11:44 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs Hello I am running p9p acme. I open a directory, so in the tag line I have sth. ending with '/' and in the window I have the list of files in that directory. Now I go to the tag line and append a name, say 'a', to the existing path, i.e. now I have there e.g. '/home/ruda/a'. Then I write Put somewhere and try to middle click it thinking the window contents gets saved to '/home/ruda/a'. But it does not. Why? Thanks Ruda ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-04 11:44 [9fans] acme Put doesn't save Rudolf Sykora @ 2009-03-04 12:21 ` yy 2009-03-04 12:32 ` Rudolf Sykora 2009-03-04 12:28 ` roger peppe 1 sibling, 1 reply; 18+ messages in thread From: yy @ 2009-03-04 12:21 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs 2009/3/4 Rudolf Sykora <rudolf.sykora@gmail.com>: > Hello > > I am running p9p acme. I open a directory, so in the tag line I have > sth. ending with '/' and in the window I have the list of files in > that directory. Now I go to the tag line and append a name, say 'a', > to the existing path, i.e. now I have there e.g. '/home/ruda/a'. Then > I write Put somewhere and try to middle click it thinking the window > contents gets saved to '/home/ruda/a'. But it does not. Why? > > Thanks > Ruda > Because at the beginning of the put function in exec.c you have: if(et==nil || et->w==nil || et->w->isdir) return; and et->w->isdir is true. But there are workarounds if you want to save the contents of the window. -- - yiyus || JGL . ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-04 12:21 ` yy @ 2009-03-04 12:32 ` Rudolf Sykora 2009-03-04 13:25 ` yy 0 siblings, 1 reply; 18+ messages in thread From: Rudolf Sykora @ 2009-03-04 12:32 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs > Because at the beginning of the put function in exec.c you have: > if(et==nil || et->w==nil || et->w->isdir) > return; > and et->w->isdir is true. But there are workarounds if you want to > save the contents of the window. Well, I had some text in in-this-way created window and I only grabbed the window trying to place it in another column and suddenly it was all empty... :( All my text not only not saved, but lost completely... This isn't nice. So is there a workaround other than 1) make a new window, 2) copy & past the text there 3) save from the new window? I thought that the decision when it saves and when not should be directed by the name format: ending with / then not save, ending with sth sane, save... Ruda ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-04 12:32 ` Rudolf Sykora @ 2009-03-04 13:25 ` yy 0 siblings, 0 replies; 18+ messages in thread From: yy @ 2009-03-04 13:25 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs 2009/3/4 Rudolf Sykora <rudolf.sykora@gmail.com>: > So is there a workaround other than 1) make a new window, 2) copy & > past the text there 3) save from the new window? > The easier solution that comes to my mind now is Edit w filename. I haven't looked into it, but I think you lost the content of your window because when directory windows are resized acme columnates them again (which is a nice thing, if you ask me). It would be good that the isdir flag of a window changed when you edit its name. I will have a look (playing with acme source is like my new hobby...). It is not too consistent now: you can remove the basename and then do 'Get', but you cannot add it again and do 'Put' (I'm talking by memory. BTW, everything works as expected in acme-sac, the only acme I can use at work). -- - yiyus || JGL . ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-04 11:44 [9fans] acme Put doesn't save Rudolf Sykora 2009-03-04 12:21 ` yy @ 2009-03-04 12:28 ` roger peppe 1 sibling, 0 replies; 18+ messages in thread From: roger peppe @ 2009-03-04 12:28 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs i reckon this could be classed as a bug. you can't change a directory window to a file window. 2009/3/4 Rudolf Sykora <rudolf.sykora@gmail.com>: > Hello > > I am running p9p acme. I open a directory, so in the tag line I have > sth. ending with '/' and in the window I have the list of files in > that directory. Now I go to the tag line and append a name, say 'a', > to the existing path, i.e. now I have there e.g. '/home/ruda/a'. Then > I write Put somewhere and try to middle click it thinking the window > contents gets saved to '/home/ruda/a'. But it does not. Why? > > Thanks > Ruda > > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save
@ 2009-03-04 13:09 erik quanstrom
2009-03-04 14:10 ` hugo rivera
0 siblings, 1 reply; 18+ messages in thread
From: erik quanstrom @ 2009-03-04 13:09 UTC (permalink / raw)
To: rudolf.sykora, 9fans
>
> So is there a workaround other than 1) make a new window, 2) copy &
> past the text there 3) save from the new window?
>
4) New 5) B.
- erik
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-04 13:09 erik quanstrom @ 2009-03-04 14:10 ` hugo rivera 2009-03-04 14:34 ` erik quanstrom 0 siblings, 1 reply; 18+ messages in thread From: hugo rivera @ 2009-03-04 14:10 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs While learning some of acme's basic commands I was also shocked by this, and I agree with Ruda that executing a Put with a non-existent file (e.g. '/home/ruda/a' ;-) should save the contents of the window in that file. Probably there are other ways to do it, like Edit w /home/ruda/a, but the ones I've seen so far involve a little more typing. Is it just out of the question to implement Ruda's suggestion? (if it was a suggestion at all) It is just a little more comfortable, and it fits very natural into acme, if you ask me. 2009/3/4, erik quanstrom <quanstro@quanstro.net>: > > > > So is there a workaround other than 1) make a new window, 2) copy & > > past the text there 3) save from the new window? > > > > > 4) New 5) B. > > > - erik > > -- Hugo ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-04 14:10 ` hugo rivera @ 2009-03-04 14:34 ` erik quanstrom 2009-03-04 14:57 ` hugo rivera ` (2 more replies) 0 siblings, 3 replies; 18+ messages in thread From: erik quanstrom @ 2009-03-04 14:34 UTC (permalink / raw) To: 9fans On Wed Mar 4 09:12:08 EST 2009, uair00@gmail.com wrote: > While learning some of acme's basic commands I was also shocked by > this, and I agree with Ruda that executing a Put with a non-existent > file (e.g. '/home/ruda/a' ;-) should save the contents of the window > in that file. this isn't true. if you click on New and then type something for a filename you will notice that the tag line box becomes filled and then click on Put, the file *will* be saved, even if the file does not exist. if on the other hand you try to modify the name of a directory listing frame, the tag line box is not filled. this is a hint that you're doing something wrong. also there is no Put option. this is a bigger hint that you're doing something wrong. the reason that directories behave differently is that in acme programs are allowed to take over a window. while the directory listing is built in, it operates on the same principle, and it does not make sense to write a directory through acme's interface. - erik ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-04 14:34 ` erik quanstrom @ 2009-03-04 14:57 ` hugo rivera 2009-03-04 15:18 ` roger peppe 2009-03-04 15:19 ` Rudolf Sykora 2 siblings, 0 replies; 18+ messages in thread From: hugo rivera @ 2009-03-04 14:57 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs 2009/3/4, erik quanstrom <quanstro@quanstro.net>: > this isn't true. if you click on New and then type something > for a filename you will notice that the tag line box becomes > filled and then click on Put, the file *will* be saved, even if the > file does not exist. It is, if you considered the fact that I was talking about adding a file name into an already existing window tag showing the contents of the directory, and not about using Put in conjuction with New to create an empty file (which is the case if you execute New with a non-existing file and then you inmediatly execute Put, but why would one do this is unknow to me) -- Hugo ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-04 14:34 ` erik quanstrom 2009-03-04 14:57 ` hugo rivera @ 2009-03-04 15:18 ` roger peppe 2009-03-06 10:48 ` Rudolf Sykora 2009-03-08 0:57 ` yy 2009-03-04 15:19 ` Rudolf Sykora 2 siblings, 2 replies; 18+ messages in thread From: roger peppe @ 2009-03-04 15:18 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs 2009/3/4 erik quanstrom <quanstro@quanstro.net>: > if on the other hand you try to modify the name of a directory > listing frame, the tag line box is not filled. this is a hint > that you're doing something wrong. also there is no Put option. > this is a bigger hint that you're doing something wrong. not really - +Errors windows fulfil both of those criteria, but Put works fine in those. > the reason that directories behave differently is that in acme > programs are allowed to take over a window. while the directory > listing is built in, it operates on the same principle, and it does > not make sense to write a directory through acme's interface. i agree it doesn't make sense to write a directory, but you can't anyway, even if the interface allowed it, and the resulting error message would be self-expanatory. personally, i think that Put should work on any non-application window, and that re-columnation should only take place if the textual content hasn't been modified by the user. (and probably also that if you change the name of a window to a directory name and do "Get", that it would get a directory listing). but YMMV as always. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-04 15:18 ` roger peppe @ 2009-03-06 10:48 ` Rudolf Sykora 2009-03-06 11:12 ` Robert Raschke 2009-03-08 0:57 ` yy 1 sibling, 1 reply; 18+ messages in thread From: Rudolf Sykora @ 2009-03-06 10:48 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs It really seems that acme-sac does save in the described way (at least it saves). That makes me wonder. Do plan9 acme, p9p acme and acme-sac have more similar differences? Are the programs separate in their development? Thanks Ruda > personally, i think that Put should work on any non-application > window, and that re-columnation should only take place if > the textual content hasn't been modified by the user. (and > probably also that if you change the name of a window to a directory > name and do "Get", that it would get a directory listing). > > but YMMV as always. > > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-06 10:48 ` Rudolf Sykora @ 2009-03-06 11:12 ` Robert Raschke 0 siblings, 0 replies; 18+ messages in thread From: Robert Raschke @ 2009-03-06 11:12 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs On Fri, Mar 6, 2009 at 10:48 AM, Rudolf Sykora <rudolf.sykora@gmail.com> wrote: > It really seems that acme-sac does save in the described way (at least > it saves). That makes me wonder. Do plan9 acme, p9p acme and acme-sac > have more similar differences? Are the programs separate in their > development? Acme-sac is based on the Inferno Acme, which is written in limbo and has a few minor discrepancies to the P9 acme (for example, backspace with text selected only deletes the selected text, it doesn't delete the character prior to it). Acme-sac is a life saver on windows. I couldn't live without it. Big thank yous go out to caerwyn for this work. Robby ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-04 15:18 ` roger peppe 2009-03-06 10:48 ` Rudolf Sykora @ 2009-03-08 0:57 ` yy 2009-03-08 1:02 ` yy ` (2 more replies) 1 sibling, 3 replies; 18+ messages in thread From: yy @ 2009-03-08 0:57 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs [-- Attachment #1: Type: text/plain, Size: 993 bytes --] 2009/3/4 roger peppe <rogpeppe@gmail.com>: > personally, i think that Put should work on any non-application > window, and that re-columnation should only take place if > the textual content hasn't been modified by the user. (and > probably also that if you change the name of a window to a directory > name and do "Get", that it would get a directory listing). > > but YMMV as always. > I think the attached patch is what you are proposing. If you apply it, when you edit dir windows, the file menu will be added (Undo, Put will only appear when the window name changes), and columnate won't be called for that window. If you execute Put in that window it will be saved, if the window name is a directory there will be an error. Another changes I did is that now if you edit the title of +Error windows the file menu will appear, and Get will appear when the window name finishes with '/'. I haven't tested it too much, but it is working here. -- - yiyus || JGL . [-- Attachment #2: acmeput.patch --] [-- Type: text/x-diff, Size: 1606 bytes --] diff /sys/src/cmd/acme/exec.c . 643c643 < if(et==nil || et->w==nil || et->w->isdir) --- > if(et==nil || et->w==nil) 645a646 > w->isdir = FALSE; diff /sys/src/cmd/acme/look.c . 109c109 < while(q1<t->file->nc && (c=tgetc(t, q1))!=' ' && c!='\t' && c!='\n') --- > while(q1<t->file->nc && (c=tgetc(t, q1))!=' ' && c!='\t' && c!='\n' && c!='/') 449c449 < while(q1<t->file->nc && isfilec(c=textreadc(t, q1))){ --- > while(q1<t->file->nc && isfilec(c=textreadc(t, q1)) && c!='/'){ diff /sys/src/cmd/acme/text.c . 58c58 < if(t->what==Body && t->w->isdir && odx!=Dx(t->all)){ --- > if(t->what==Body && t->w->isdir && !t->w->dirty && odx!=Dx(t->all)){ 215d214 < t->w->filemenu = FALSE; 251d249 < t->w->filemenu = TRUE; 945c943 < if((b&1) && (b&6)){ --- > if((b&1) && (b&30)){ 950c948 < if(b & 2){ --- > if(b & 10){ diff /sys/src/cmd/acme/wind.c . 100c100 < if(w->body.file->mod && !w->isdir && !w->isscratch) --- > if(!w->isscratch && w->dirty) 262a263 > w->isdir = FALSE; 266a268,270 > else if(n>=1 && runeeq(L"/", 1, name+(n-1), 1)) > w->isdir = TRUE; > w->filemenu = !w->isscratch; 347a352,355 > if(w->isdir){ > runemove(new+i, L" Get", 4); > i += 4; > } 358c366 < if(!w->isdir && dirty){ --- > if(!w->isdir && !w->isscratch && dirty){ 363,366d370 < if(w->isdir){ < runemove(new+i, L" Get", 4); < i += 4; < } 411c415 < if(!w->isdir && !w->isscratch && (w->body.file->mod || w->body.ncache)) --- > if(!w->isscratch && w->dirty) diff /sys/src/cmd/acme/xfid.c . 117c117 < if(!w->isdir && w->col!=nil){ --- > if(w->col!=nil){ rc 2461: diff 2462: some ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-08 0:57 ` yy @ 2009-03-08 1:02 ` yy 2009-03-09 8:05 ` Rudolf Sykora 2009-03-09 12:22 ` Rudolf Sykora 2 siblings, 0 replies; 18+ messages in thread From: yy @ 2009-03-08 1:02 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs [-- Attachment #1: Type: text/plain, Size: 174 bytes --] Sorry, but I included some not related changes in the previous patch (I will stop sending patches to the list as soon as I get a contrib dir...) -- - yiyus || JGL . [-- Attachment #2: acmeput2.patch --] [-- Type: text/x-diff, Size: 1133 bytes --] diff /sys/src/cmd/acme/exec.c . 643c643 < if(et==nil || et->w==nil || et->w->isdir) --- > if(et==nil || et->w==nil) 645a646 > w->isdir = FALSE; diff /sys/src/cmd/acme/text.c . 58c58 < if(t->what==Body && t->w->isdir && odx!=Dx(t->all)){ --- > if(t->what==Body && t->w->isdir && !t->w->dirty && odx!=Dx(t->all)){ 215d214 < t->w->filemenu = FALSE; 251d249 < t->w->filemenu = TRUE; diff /sys/src/cmd/acme/wind.c . 100c100 < if(w->body.file->mod && !w->isdir && !w->isscratch) --- > if(!w->isscratch && w->dirty) 262a263 > w->isdir = FALSE; 266a268,270 > else if(n>=1 && runeeq(L"/", 1, name+(n-1), 1)) > w->isdir = TRUE; > w->filemenu = !w->isscratch; 347a352,355 > if(w->isdir){ > runemove(new+i, L" Get", 4); > i += 4; > } 358c366 < if(!w->isdir && dirty){ --- > if(!w->isdir && !w->isscratch && dirty){ 363,366d370 < if(w->isdir){ < runemove(new+i, L" Get", 4); < i += 4; < } 411c415 < if(!w->isdir && !w->isscratch && (w->body.file->mod || w->body.ncache)) --- > if(!w->isscratch && w->dirty) diff /sys/src/cmd/acme/xfid.c . 117c117 < if(!w->isdir && w->col!=nil){ --- > if(w->col!=nil){ ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-08 0:57 ` yy 2009-03-08 1:02 ` yy @ 2009-03-09 8:05 ` Rudolf Sykora 2009-03-09 12:22 ` Rudolf Sykora 2 siblings, 0 replies; 18+ messages in thread From: Rudolf Sykora @ 2009-03-09 8:05 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs Thank you R 2009/3/8 yy <yiyu.jgl@gmail.com>: > 2009/3/4 roger peppe <rogpeppe@gmail.com>: >> personally, i think that Put should work on any non-application >> window, and that re-columnation should only take place if >> the textual content hasn't been modified by the user. (and >> probably also that if you change the name of a window to a directory >> name and do "Get", that it would get a directory listing). >> >> but YMMV as always. >> > > I think the attached patch is what you are proposing. If you apply it, > when you edit dir windows, the file menu will be added (Undo, Put will > only appear when the window name changes), and columnate won't be > called for that window. If you execute Put in that window it will be > saved, if the window name is a directory there will be an error. > Another changes I did is that now if you edit the title of +Error > windows the file menu will appear, and Get will appear when the window > name finishes with '/'. I haven't tested it too much, but it is > working here. > > > > -- > - yiyus || JGL . > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-08 0:57 ` yy 2009-03-08 1:02 ` yy 2009-03-09 8:05 ` Rudolf Sykora @ 2009-03-09 12:22 ` Rudolf Sykora 2009-03-09 13:23 ` Rudolf Sykora 2 siblings, 1 reply; 18+ messages in thread From: Rudolf Sykora @ 2009-03-09 12:22 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs > I think the attached patch is what you are proposing. If you apply it, > -- > - yiyus || JGL . > Sorry for the question, but how can I apply the patch you sent? I mean, having the file with the patch and the file to be changed, what command is to be performed? thanks R ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-09 12:22 ` Rudolf Sykora @ 2009-03-09 13:23 ` Rudolf Sykora 0 siblings, 0 replies; 18+ messages in thread From: Rudolf Sykora @ 2009-03-09 13:23 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs well, probably there is none such, sorry... :) R 2009/3/9 Rudolf Sykora <rudolf.sykora@gmail.com>: >> I think the attached patch is what you are proposing. If you apply it, >> -- >> - yiyus || JGL . >> > > Sorry for the question, but how can I apply the patch you sent? > I mean, having the file with the patch and the file to be changed, > what command is to be performed? > > thanks > R > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [9fans] acme Put doesn't save 2009-03-04 14:34 ` erik quanstrom 2009-03-04 14:57 ` hugo rivera 2009-03-04 15:18 ` roger peppe @ 2009-03-04 15:19 ` Rudolf Sykora 2 siblings, 0 replies; 18+ messages in thread From: Rudolf Sykora @ 2009-03-04 15:19 UTC (permalink / raw) To: Fans of the OS Plan 9 from Bell Labs > if on the other hand you try to modify the name of a directory > listing frame, the tag line box is not filled. this is a hint > that you're doing something wrong. also there is no Put option. > this is a bigger hint that you're doing something wrong. You may call it a hint. I noticed the 'Put' doesn't appear there. But (non-)existence of sth in the tag line doesn't mean it can't be issued. Moreover, I still can't see why it can't work. If I change the tag line by appending a name (which is not, say, a name of a directory within the current directory), I don't understand why this couldn't be saved... and the window couldn't represent the new (or changed) file from now on. > the reason that directories behave differently is that in acme > programs are allowed to take over a window. while the directory > listing is built in, it operates on the same principle, and it does > not make sense to write a directory through acme's interface. > > - erik I don't get what you mean... Ruda ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2009-03-09 13:23 UTC | newest] Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-03-04 11:44 [9fans] acme Put doesn't save Rudolf Sykora 2009-03-04 12:21 ` yy 2009-03-04 12:32 ` Rudolf Sykora 2009-03-04 13:25 ` yy 2009-03-04 12:28 ` roger peppe 2009-03-04 13:09 erik quanstrom 2009-03-04 14:10 ` hugo rivera 2009-03-04 14:34 ` erik quanstrom 2009-03-04 14:57 ` hugo rivera 2009-03-04 15:18 ` roger peppe 2009-03-06 10:48 ` Rudolf Sykora 2009-03-06 11:12 ` Robert Raschke 2009-03-08 0:57 ` yy 2009-03-08 1:02 ` yy 2009-03-09 8:05 ` Rudolf Sykora 2009-03-09 12:22 ` Rudolf Sykora 2009-03-09 13:23 ` Rudolf Sykora 2009-03-04 15:19 ` Rudolf Sykora
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).