9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: yy <yiyu.jgl@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] acme Put doesn't save
Date: Sun,  8 Mar 2009 01:57:11 +0100	[thread overview]
Message-ID: <a81fe9be0903071657m74e3f0b2m8ad43ef6403af48c@mail.gmail.com> (raw)
In-Reply-To: <df49a7370903040718qcdb202erf15710d4ee660ab0@mail.gmail.com>

[-- 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

  parent reply	other threads:[~2009-03-08  0:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2009-03-04 11:44 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

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=a81fe9be0903071657m74e3f0b2m8ad43ef6403af48c@mail.gmail.com \
    --to=yiyu.jgl@gmail.com \
    --cc=9fans@9fans.net \
    /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;
as well as URLs for NNTP newsgroup(s).