Mercurial > emacs
comparison lisp/comint.el @ 12058:24c19691068e
Don't go forward over a word-char if we're at bob, and set match-data.
author | Simon Marshall <simon@gnu.org> |
---|---|
date | Fri, 02 Jun 1995 07:42:12 +0000 |
parents | 3466b44b0a11 |
children | d10ef5c093ce |
comparison
equal
deleted
inserted
replaced
12057:562d3062b82e | 12058:24c19691068e |
---|---|
1846 inside of a \"[...]\" (see `skip-chars-forward')." | 1846 inside of a \"[...]\" (see `skip-chars-forward')." |
1847 (save-excursion | 1847 (save-excursion |
1848 (let ((non-word-chars (concat "[^\\\\" word-chars "]")) (here (point))) | 1848 (let ((non-word-chars (concat "[^\\\\" word-chars "]")) (here (point))) |
1849 (while (and (re-search-backward non-word-chars nil 'move) | 1849 (while (and (re-search-backward non-word-chars nil 'move) |
1850 ;(memq (char-after (point)) shell-file-name-quote-list) | 1850 ;(memq (char-after (point)) shell-file-name-quote-list) |
1851 (not (bolp)) (eq (char-after (1- (point))) ?\\)) | 1851 (eq (preceding-char) ?\\)) |
1852 (backward-char 1)) | 1852 (backward-char 1)) |
1853 (forward-char 1) | 1853 ;; Don't go forward over a word-char (this can happen if we're at bob). |
1854 (and (< (point) here) (buffer-substring (point) here))))) | 1854 (if (or (not (bobp)) (looking-at non-word-chars)) |
1855 (forward-char 1)) | |
1856 ;; Set match-data to match the entire string. | |
1857 (if (< (point) here) | |
1858 (progn (store-match-data (list (point) here)) | |
1859 (match-string 0)))))) | |
1855 | 1860 |
1856 | 1861 |
1857 (defun comint-match-partial-filename () | 1862 (defun comint-match-partial-filename () |
1858 "Return the filename at point, or nil if non is found. | 1863 "Return the filename at point, or nil if non is found. |
1859 Environment variables are substituted. See `comint-word'." | 1864 Environment variables are substituted. See `comint-word'." |