summaryrefslogtreecommitdiff
path: root/lisp/pcomplete.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2011-08-23 01:21:09 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2011-08-23 01:21:09 -0400
commitb3fd59bd988b168ab996bb6368af8bda2bec29b5 (patch)
tree7e7e34231bf98d6590093ed121881fb3b2783568 /lisp/pcomplete.el
parent8b76d6f8eab68baebd7cc7da85e93bf09e4d34da (diff)
downloademacs-b3fd59bd988b168ab996bb6368af8bda2bec29b5.tar.gz
* lisp/pcomplete.el (pcomplete-parse-comint-arguments): Fix inf-loop.
Mark obsolete. * lisp/shell.el (shell-parse-pcomplete-arguments): New function. (shell-completion-vars): Use it instead. Fixes: debbugs:9160
Diffstat (limited to 'lisp/pcomplete.el')
-rw-r--r--lisp/pcomplete.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index 46a82e3720d..02f3c4ad1da 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -811,15 +811,19 @@ this is `comint-dynamic-complete-functions'."
(while (< (point) end)
(skip-chars-forward " \t\n")
(push (point) begins)
- (let ((skip t))
- (while skip
- (skip-chars-forward "^ \t\n")
- (if (eq (char-before) ?\\)
- (skip-chars-forward " \t\n")
- (setq skip nil))))
+ (while
+ (progn
+ (skip-chars-forward "^ \t\n\\")
+ (when (eq (char-after) ?\\)
+ (forward-char 1)
+ (unless (eolp)
+ (forward-char 1)
+ t))))
(push (buffer-substring-no-properties (car begins) (point))
args))
(cons (nreverse args) (nreverse begins)))))
+(make-obsolete 'pcomplete-parse-comint-arguments
+ 'comint-parse-pcomplete-arguments "24.1")
(defun pcomplete-parse-arguments (&optional expand-p)
"Parse the command line arguments. Most completions need this info."