summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/simple.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 326082318bc..5f58d18e74e 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2438,8 +2438,16 @@ it were the arg to `interactive' (which see) to interactively read the value."
(interactive)
(let (beg end)
(skip-chars-forward "^ \t\n")
+ (while (looking-at " [^ \n\t]")
+ (forward-char 1)
+ (skip-chars-forward "^ \t\n"))
(setq end (point))
(skip-chars-backward "^ \t\n")
+ (while (and (= (preceding-char) ?\ )
+ (not (and (> (point) (1+ (point-min)))
+ (= (char-after (- (point) 2)) ?\ ))))
+ (backward-char 1)
+ (skip-chars-backward "^ \t\n"))
(setq beg (point))
(choose-completion-string (buffer-substring beg end))))