From: Martin Rudalics Date: Sat, 10 Mar 2007 08:39:11 +0000 (+0000) Subject: (PC-do-completion): Bind dirlength to nil to avoid X-Git-Tag: emacs-pretest-22.0.96~161 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a7b52a1e76037c97ca5f5cbee41f87ce6e6fc80d;p=emacs.git (PC-do-completion): Bind dirlength to nil to avoid that buffer contents get erased during completion. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3d04960ffdc..2029538256b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-03-10 Martin Rudalics + + * complete.el (PC-do-completion): Bind dirlength to nil to avoid + that buffer contents get erased during completion. + 2007-03-10 Glenn Morris * woman.el (woman-change-fonts): Add a hack to deal with 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)