# HG changeset patch # User Martin Rudalics # Date 1173515871 0 # Node ID 2a096eef08d4f8ce916823f2f7aaf3a990db53c5 # Parent c6ac3e0be71371e38fcdebf521e8c211b6a8a2cb (PC-do-completion): Bind dirlength to nil to avoid that buffer contents get erased during completion. diff -r c6ac3e0be713 -r 2a096eef08d4 lisp/complete.el --- a/lisp/complete.el Sat Mar 10 06:26:03 2007 +0000 +++ b/lisp/complete.el Sat Mar 10 08:37:51 2007 +0000 @@ -417,7 +417,10 @@ (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)