(PC-do-completion): Bind dirlength to nil to avoid
authorMartin Rudalics <rudalics@gmx.at>
Sat, 10 Mar 2007 08:39:11 +0000 (08:39 +0000)
committerMartin Rudalics <rudalics@gmx.at>
Sat, 10 Mar 2007 08:39:11 +0000 (08:39 +0000)
that buffer contents get erased during completion.

lisp/ChangeLog
lisp/complete.el

index 3d04960..2029538 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-10  Martin Rudalics  <rudalics@gmx.at>
+
+       * complete.el (PC-do-completion): Bind dirlength to nil to avoid
+       that buffer contents get erased during completion.
+
 2007-03-10  Glenn Morris  <rgm@gnu.org>
 
        * woman.el (woman-change-fonts): Add a hack to deal with
index 104f378..ce5094d 100644 (file)
@@ -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)