[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: comint's directory tracking doesn't understand \( or \)
From: |
David Hansen |
Subject: |
Re: comint's directory tracking doesn't understand \( or \) |
Date: |
Fri, 02 Mar 2007 05:37:27 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.93 (gnu/linux) |
On Thu, 01 Mar 2007 22:28:53 -0500 Richard Stallman wrote:
> Can you write a fix for this?
> We could install the fix, if it is simple and safe.
I already reported that one or two weeks ago.
I can't say if the fix will be safe. I simply don't know enough
about other comint modes (not a bash shell buffer).
This patch fixes at least one related problem (now arbitrary
characters can be escaped with a backslash). But this is not the
full fix. `comint-delim-arg' still breaks at characters in
`comint-delimiter-argument-list' even if they are escaped with a
backslash.
This should be easy to fix but I have no idea if this may break
other comint modes (what about MS-DOS directory delimiters?).
BTW, I have the feeling that how comint splits arguments is overly
complicated. These regular expressions are just terrible and it
can be easily (and most probably faster) expressed by some loop
across all chars and maintaining a simple state. But that's for
after the release :)
David
Index: comint.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/comint.el,v
retrieving revision 1.358
diff -c -r1.358 comint.el
*** comint.el 23 Feb 2007 19:21:25 -0000 1.358
--- comint.el 2 Mar 2007 04:27:30 -0000
***************
*** 1384,1390 ****
(let* ((first (if (if (fboundp 'w32-shell-dos-semantics)
(w32-shell-dos-semantics))
"[^ \n\t\"'`]+\\|"
! "[^ \n\t\"'`\\]+\\|\\\\[\"'`\\ \t]+\\|"))
(argpart (concat first
"\\(\"\\([^\"\\]\\|\\\\.\\)*\"\\|\
'[^']*'\\|\
--- 1384,1390 ----
(let* ((first (if (if (fboundp 'w32-shell-dos-semantics)
(w32-shell-dos-semantics))
"[^ \n\t\"'`]+\\|"
! "[^ \n\t\"'`\\]+\\|\\(?:\\\\.\\)+\\|"))
(argpart (concat first
"\\(\"\\([^\"\\]\\|\\\\.\\)*\"\\|\
'[^']*'\\|\