emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FW: comint.el fix


From: Marshall, Simon
Subject: FW: comint.el fix
Date: Fri, 20 Jun 2003 15:19:37 +0100

Over to you guys.  There are 2 (if ...) forms in comint-arguments where
this change seems applicable, though I've not tested the suggested
change at all.
 
-----Original Message-----
From: Gordon Grimes [mailto:address@hidden 
Sent: 20 June 2003 15:08
To: address@hidden; address@hidden
Subject: comint.el fix


Hi,
I don't use the patch utils so I'll just detail the fix.  Also, there's
no version information in my comint.el file so I can't refer you to a
version.
 
Problem:
When completing a "!$" history item with TAB, the behavior is wrong if
the preceeding line had a ";" not surrounded by spaces.
 
Example:
% echo hi; echo bye
% echo !$       ## completes to "echo echo bye" rather than simply "echo
bye".
 
Cause:
An extra token from the preceeding line is grabbed because the second
token "hi;" is split into two but the token counter is incremented only
once.
 
In function 'comint-arguments', the variable 'count' is incremented in
the '(if beg..." conditional. It assumes that the variable 'args' will
get a single element added ('str') if the clause is executed. However,
the function 'comint-delim-arg' splits tokens such as "foo;" into "foo
;".  
 
Fix:
Rather than incrementing 'count', just set it to the length of the list
(outside of the conditional):
 
    (if beg
       (setq str ......
               args ....
       )
    )  ;; end of if
    (setq count (length args))    ;; unconditional
 
enjoy,
gordon
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]