On Sun, Jan 28, 2007 at 03:19:56PM -0800, David Roundy wrote:
> Incidentally (unrelated to this email), darcs has recently started opening
> my emacs without the file open that I want to edit (so I have to find it
> with "ls -tr"). Not sure what's triggered this, and I don't have time to
> look into it, but hopefully if you all keep an eye out for it, someone will
> track it down and fix it.
In spite of the fact that I need to prepare for class tomorrow, I tracked
this down a bit, and my DARCS_EDITOR is:
DARCS_EDITOR=emacs --eval "(setq make-backup-files nil)"
And the problem is that darcs is doing some crazy stuff in breakCommand, in
particular using words to split up the arguments, which of course breaks up
the lisp statement and makes everything go crazy. I recognize this as one
of the "waiting for resubmission" patches, which I see is a pretty tricky
one. Ideally, we'd let the user's shell do the splitting by running a
program such as:
breakCommand x = do system ("test_args "++x ++ " > foo")
args <- lines0 `fmap` readFile foo
where lines0 "" = []
lines0 s = let (l, s') = break (== '\0') s
in l : case s' of
[] -> []
(_:s'') -> lines0 s''
test_args.hs:
main = do args <- getArgs
mapM_ putStr0 args
where putStr0 x = do { putStr x; putChar '\0'; }
This is obviously a horribly clumsy way to trick the shell into expanding
our arguments for us, but something that is "equivalently good" would be
nice. In particular, I'd rather not have to define a "darcs" way of
escaping strings, and instead use whatever is native to whatever OS the
user is using.
--
David Roundy
http://www.darcs.net
_______________________________________________
darcs-devel mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-devel