From a7b52a1e76037c97ca5f5cbee41f87ce6e6fc80d Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 10 Mar 2007 08:39:11 +0000 Subject: [PATCH] (PC-do-completion): Bind dirlength to nil to avoid that buffer contents get erased during completion. --- lisp/ChangeLog | 5 +++++ lisp/complete.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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) -- 2.39.5