From 96a8a0dfd60cc141d0d65510edfad53ea435b961 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 17 Oct 2011 12:30:02 -0400 Subject: [PATCH] * lisp/minibuffer.el (completion--replace): Inherit surrounding properties. (minibuffer-complete-and-exit): Use it. Fixes: debbugs:114 --- lisp/ChangeLog | 4 ++++ lisp/minibuffer.el | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1ebca8675ce..60c2b62cfe2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2011-10-17 Stefan Monnier + * minibuffer.el (completion--replace): Inherit surrounding properties + (bug#114). + (minibuffer-complete-and-exit): Use it. + * comint.el (comint--table-subvert): Quote the all-completions output (bug#9160). diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index acb71d115d1..38785fc48e8 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -596,7 +596,7 @@ Moves point to the end of the new text." (setq end (- end suffix-len)) (setq newtext (substring newtext 0 (- suffix-len)))) (goto-char beg) - (insert newtext) + (insert-and-inherit newtext) (delete-region (point) (+ (point) (- end beg))) (forward-char suffix-len))) @@ -927,9 +927,7 @@ If `minibuffer-completion-confirm' is `confirm-after-completion', ;; file, so `try-completion' actually completes to ;; that file. (= (length string) (length compl))) - (goto-char end) - (insert compl) - (delete-region beg end)))) + (completion--replace beg end compl)))) (exit-minibuffer)) ((memq minibuffer-completion-confirm '(confirm confirm-after-completion)) -- 2.39.2