summaryrefslogtreecommitdiff
path: root/lisp/complete.el
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2007-03-10 08:39:11 +0000
committerMartin Rudalics <rudalics@gmx.at>2007-03-10 08:39:11 +0000
commita7b52a1e76037c97ca5f5cbee41f87ce6e6fc80d (patch)
tree78bc8529b70dd24292973b62ab124a91c9840ef8 /lisp/complete.el
parent5bc21f358c94be373e23c7ab6f2dcce7d5b67baf (diff)
downloademacs-a7b52a1e76037c97ca5f5cbee41f87ce6e6fc80d.tar.gz
(PC-do-completion): Bind dirlength to nil to avoid
that buffer contents get erased during completion.
Diffstat (limited to 'lisp/complete.el')
-rw-r--r--lisp/complete.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/complete.el b/lisp/complete.el
index 104f3789403..ce5094d1aef 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -417,7 +417,10 @@ of `minibuffer-completion-table' and the minibuffer contents.")
(pred minibuffer-completion-predicate)
(filename (funcall PC-completion-as-file-name-predicate))
(dirname nil) ; non-nil only if a filename is being completed
- (dirlength 0)
+ ;; The following used to be "(dirlength 0)" which caused the erasure of
+ ;; the entire buffer text before `point' when inserting a completion
+ ;; into a buffer.
+ dirlength
(str (buffer-substring beg end))
(incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str)))
(ambig nil)