Commit Briefs

Russ Cox

acme: fix extra print args


Russ Cox

acme: report close failure in Put, this time for sure

Missed in 0b349f6f that Bterm is not closing fd.



Russ Cox

acme: delete trailing spaces during Put in autoindent mode

Autoident mode is the leading cause of trailing spaces on lines. Remove them during Put to make various picky tools happier. The changes during Put are added as a separate entry to the file history, so that the first Undo after Put restores the spaces.


Russ Cox

acme: do not trim spaces during Put

The commit that introduced this was pushed accidentally. It is not a good idea to do this. (It breaks programs that think that a clean window means the body matches the on-disk file.)


Russ Cox

acme: drop trailing spaces during Put of auto-indent window

Auto-indent mode leaves trailing spaces on blank lines as you type past them, so silently elide them from the window content as it gets written back to disk. Another option would be to remove them from the window entirely during Put, but they're actually nice to have while editing, and to date Put has never modified the window content.


David du Colombier

acme: fix some memory leaks


Russ Cox

acme: preserve window position and selection during Get

Before, executing Get in a file rewound the window offset and selection to the start of the file. After this CL, Get preserves the window offset and selection, where preserve is defined as "the same line number and rune offset within the line". So if the window started at line 10 before and the selection was line 13 chars 5-7, then that will still be true after Get, provided the new content is large enough. This should help the common situation of plumbing a compiler error, realizing the window is out of date, clicking Get, and then losing the positioning from the plumb operation.


Russ Cox

acme: free buf in checksha1

Thanks to Lorenzo Beretta for noticing.


Russ Cox

acme: check file content before declaring file "modified since last read"

Bad remote file systems can change mtime unexpectedly, and then there is the problem that git rebase and similar operations like to change the files and then change them back, modifying the mtimes but not the content. Avoid spurious Put errors on both of those by checking file content. (False positive "modified since last read" make the real ones difficult to notice.)


Russ Cox

all: fix or silence all INSTALL warnings on macOS

Should be a clean build now. Change-Id: Id3460371cb5e8d4071f8faa9c2aec870d213a067 Reviewed-on: https://plan9port-review.googlesource.com/2781 Reviewed-by: Russ Cox <rsc@swtch.com>


Russ Cox

acme: add log file in acme root directory

Reading /mnt/acme/log reports a log of window create, put, and delete events, as they happen. It blocks until the next event is available. Example log output: 8 new /Users/rsc/foo.go 8 put /Users/rsc/foo.go 8 del /Users/rsc/foo.go This lets acme-aware programs react to file writes, for example compiling code, running a test, or updating an import block. TBR=r R=r https://codereview.appspot.com/89560044


Russ Cox

acme: add comment for aligned writes

TBR=r https://codereview.appspot.com/89510044


Russ Cox

acme: use buffered i/o to write file

Bakul Shah has observed corrupted files being written when acme writes over osxfuse to sshfs to a remote file system. In one example we examined, acme is writing an 0xf03-byte file in two system calls, first an 0x806-byte write and then a 0x6fd-byte write. (0x806 is BUFSIZE/sizeof(Rune); this file has no multibyte UTF-8.) What actually ends up happening is that an 0x806-byte file is written: 0x000-0x6fd contains what should be 0x806-0xf03 0x6fd-0x7fa contains zeros 0x7fa-0x806 contains what should be 0x7fa-0x806 (correct!) The theory is that fuse or sshfs or perhaps the remote file server is mishandling the unaligned writes. acme does not seem to be at fault. Using bio here will make the writes align to 8K boundaries, avoiding the bugs in whatever underlying piece is broken. TBR=r https://codereview.appspot.com/89550043


Russ Cox

acme: execute commands with / using shell

This allows commands in bin subdirectories. R=rsc CC=plan9port.codebot https://codereview.appspot.com/13254044