acme: set $samfile (same as $%) during execution

R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/6854092
diff --git a/man/man1/acme.1 b/man/man1/acme.1
index 3dc1f2a..aa02f77 100644
--- a/man/man1/acme.1
+++ b/man/man1/acme.1
@@ -527,6 +527,8 @@
 .BR /home/rob/sam/+Errors .
 The environment of such commands contains the variable
 .B $%
+and
+.B $samfile
 with value set to the filename of the window in which the command is run,
 and
 .B $winid
diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c
index 39d05ec..ae6668c 100644
--- a/src/cmd/acme/exec.c
+++ b/src/cmd/acme/exec.c
@@ -1421,6 +1421,7 @@
 
 		if(filename){
 			putenv("%", filename);
+			putenv("samfile", filename);
 			free(filename);
 		}
 		c->md = fsysmount(rdir, ndir, incl, nincl);