# HG changeset patch # User Simon Marshall # Date 802078932 0 # Node ID 24c19691068ed7255a012a26891c6e3c2ce7d6d7 # Parent 562d3062b82e7a089a3787f2f5a6ddbf8998c410 Don't go forward over a word-char if we're at bob, and set match-data. diff -r 562d3062b82e -r 24c19691068e lisp/comint.el --- a/lisp/comint.el Fri Jun 02 01:03:43 1995 +0000 +++ b/lisp/comint.el Fri Jun 02 07:42:12 1995 +0000 @@ -1848,10 +1848,15 @@ (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 ()