(frame-delete-all): Copy the whole alist first.
[bpt/emacs.git] / lisp / complete.el
index b4e3745..daeac1f 100644 (file)
@@ -22,7 +22,7 @@
 ;; along with GNU Emacs; see the file COPYING.  If not, write to
 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
-;; Commentary:
+;;; Commentary:
 
 ;; Extended completion for the Emacs minibuffer.
 ;;
@@ -94,7 +94,7 @@
 ;; is supported in include file names.
 
 
-;; Code:
+;;; Code:
 
 (defvar PC-meta-flag t
   "*If nil, TAB does normal Emacs completion and M-TAB does Partial Completion.
@@ -475,7 +475,8 @@ See `PC-complete' for details."
                                             (delete-char 1)
                                             (setq end (1- end))))
                                      (setq improved t))
-                                   (insert (substring prefix i (1+ i)))
+                                   ;; Use format to discard text properties.
+                                   (insert (format "%s" (substring prefix i (1+ i))))
                                    (setq end (1+ end)))
                                  (setq i (1+ i)))
                                (or pt (equal (point) beg)
@@ -522,7 +523,7 @@ See `PC-complete' for details."
                ;; If totally ambiguous, display a list of completions
                (if (or completion-auto-help
                        (eq mode 'help))
-                   (with-output-to-temp-buffer " *Completions*"
+                   (with-output-to-temp-buffer "*Completions*"
                      (display-completion-list (sort helpposs 'string-lessp)))
                  (PC-temp-minibuffer-message " (Next char not unique)"))
                nil)))))
@@ -533,9 +534,10 @@ See `PC-complete' for details."
            (if (null mode)
                (PC-temp-minibuffer-message " (Sole completion)"))
          (delete-region beg end)
-         (insert (if filename
-                     (substitute-in-file-name (concat dirname (car poss)))
-                   (car poss))))
+         (insert (format "%s"
+                         (if filename
+                             (substitute-in-file-name (concat dirname (car poss)))
+                           (car poss)))))
        t)))))