summaryrefslogtreecommitdiff
path: root/lisp/comint.el
diff options
context:
space:
mode:
authorSimon Marshall <simon@gnu.org>1995-06-02 07:42:12 +0000
committerSimon Marshall <simon@gnu.org>1995-06-02 07:42:12 +0000
commitecaac826eae652021b9df7cd733df98c459ba0b8 (patch)
tree9e5b4052726b4d3dfa208d6b815e13542cc93e60 /lisp/comint.el
parent155c18a47928e2650682201ca8fcce5fbfe8337a (diff)
downloademacs-ecaac826eae652021b9df7cd733df98c459ba0b8.tar.gz
Don't go forward over a word-char if we're at bob, and set match-data.
Diffstat (limited to 'lisp/comint.el')
-rw-r--r--lisp/comint.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index de0d63a50db..6897ae6511d 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -1848,10 +1848,15 @@ inside of a \"[...]\" (see `skip-chars-forward')."
(let ((non-word-chars (concat "[^\\\\" word-chars "]")) (here (point)))
(while (and (re-search-backward non-word-chars nil 'move)
;(memq (char-after (point)) shell-file-name-quote-list)
- (not (bolp)) (eq (char-after (1- (point))) ?\\))
+ (eq (preceding-char) ?\\))
(backward-char 1))
- (forward-char 1)
- (and (< (point) here) (buffer-substring (point) here)))))
+ ;; Don't go forward over a word-char (this can happen if we're at bob).
+ (if (or (not (bobp)) (looking-at non-word-chars))
+ (forward-char 1))
+ ;; Set match-data to match the entire string.
+ (if (< (point) here)
+ (progn (store-match-data (list (point) here))
+ (match-string 0))))))
(defun comint-match-partial-filename ()