Re: [9fans] acme Put doesn't save
Thank you R 2009/3/8 yy yiyu@gmail.com: 2009/3/4 roger peppe rogpe...@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 .
Re: [9fans] acme Put doesn't save
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
Re: [9fans] acme Put doesn't save
well, probably there is none such, sorry... :) R 2009/3/9 Rudolf Sykora rudolf.syk...@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
Re: [9fans] acme Put doesn't save
2009/3/4 roger peppe rogpe...@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 . 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(q1t-file-nc (c=tgetc(t, q1))!=' ' c!='\t' c!='\n') --- while(q1t-file-nc (c=tgetc(t, q1))!=' ' c!='\t' c!='\n' c!='/') 449c449 while(q1t-file-nc isfilec(c=textreadc(t, q1))){ --- while(q1t-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((b1) (b6)){ --- if((b1) (b30)){ 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
Re: [9fans] acme Put doesn't save
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 . 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){
Re: [9fans] acme Put doesn't save
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.
Re: [9fans] acme Put doesn't save
On Fri, Mar 6, 2009 at 10:48 AM, Rudolf Sykora rudolf.syk...@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
[9fans] acme Put doesn't save
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
Re: [9fans] acme Put doesn't save
2009/3/4 Rudolf Sykora rudolf.syk...@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 .
Re: [9fans] acme Put doesn't save
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.syk...@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
Re: [9fans] acme Put doesn't save
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
Re: [9fans] acme Put doesn't save
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
Re: [9fans] acme Put doesn't save
2009/3/4 Rudolf Sykora rudolf.syk...@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 .
Re: [9fans] acme Put doesn't save
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 quans...@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
Re: [9fans] acme Put doesn't save
On Wed Mar 4 09:12:08 EST 2009, uai...@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
Re: [9fans] acme Put doesn't save
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
Re: [9fans] acme Put doesn't save
2009/3/4 erik quanstrom quans...@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.