Subject: Re: bug#7883: [PATCH] comint history expansion fails to process :N or $ modifier

From: Roland McGrath <[email-masked]>
Date: Mon, 14 Feb 2011 17:56:19 -0800 (PST)

> This just undoes the fix installed for
> 
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1795
> 
> (Although it wasn't really fixed anyway.)

The change was not a fix for that problem at all, as you say.  That problem
continues to exist in various forms (that also exist in v22) and is a bug
in entirely different parts of the code.  I noticed the gratuitous
insertion of spaces long ago, but it didn't really irk me quite enough to
look into it.  I see no reason whatsoever why expansion should be looking
for metacharacters and fiddling things around like that at all.  I always
assumed it was a dismally misguided attempt at pretty-printing, which, even
it weren't completely broken (as it is), is not a proper thing to be doing
implicitly during history expansion at all.

This misfeature appears to be fixed by:

(setq comint-delimiter-argument-list nil) ;buffer-local

The buffer-local setting comes from the global value of
shell-delimiter-argument-list, which I've just set to nil in my init files.

I really can't tell what the thinking behind the default setting of that
was, since it's not commented particularly well.  It seems just entirely
wrong-headed to me.  As far as I can tell, the only uses of the things it
affects (comint-delimiter-argument-list, comint-arguments, comint-args)
are in this history expansion stuff, where it is just thoroughly wrong if
you either want to have history expansion work anything like it does in
the shell (which is largely immune to any details of shell syntax, though
bash's is not so immune to quoting as is csh's, which is the original and
One True definition of ! history's meaning), or you know much of anything
about shell syntax.

Thanks,
Roland