# HG changeset patch # User Stefan Monnier # Date 1208196796 0 # Node ID 8518c76e40835305ad2a8124d44c8a8cfad6d852 # Parent d23d9685c2149b828026712796ad93b8b8221da2 (tmm-completion-delete-prompt): Don't hardcode point-min==1. (tmm-add-prompt): Make sure completion-setup-hook is preserved even in case of an error in display-completion-list. diff -r d23d9685c214 -r 8518c76e4083 lisp/ChangeLog --- a/lisp/ChangeLog Mon Apr 14 18:11:52 2008 +0000 +++ b/lisp/ChangeLog Mon Apr 14 18:13:16 2008 +0000 @@ -1,5 +1,9 @@ 2008-04-14 Stefan Monnier + * tmm.el (tmm-completion-delete-prompt): Don't hardcode point-min==1. + (tmm-add-prompt): Make sure completion-setup-hook is preserved even in + case of an error in display-completion-list. + * filecache.el (file-cache-completions-keymap): Move init from file-cache-completion-setup-function into declaration. (file-cache-minibuffer-complete): Simplify. diff -r d23d9685c214 -r 8518c76e4083 lisp/tmm.el --- a/lisp/tmm.el Mon Apr 14 18:11:52 2008 +0000 +++ b/lisp/tmm.el Mon Apr 14 18:13:16 2008 +0000 @@ -345,8 +345,8 @@ (defun tmm-completion-delete-prompt () (set-buffer standard-output) - (goto-char 1) - (delete-region 1 (search-forward "Possible completions are:\n"))) + (goto-char (point-min)) + (delete-region (point) (search-forward "Possible completions are:\n"))) (defun tmm-remove-inactive-mouse-face () "Remove the mouse-face property from inactive menu items." @@ -378,9 +378,10 @@ (or tmm-completion-prompt (add-hook 'completion-setup-hook 'tmm-completion-delete-prompt 'append)) - (with-output-to-temp-buffer "*Completions*" - (display-completion-list completions)) - (remove-hook 'completion-setup-hook 'tmm-completion-delete-prompt)) + (unwind-protect + (with-output-to-temp-buffer "*Completions*" + (display-completion-list completions)) + (remove-hook 'completion-setup-hook 'tmm-completion-delete-prompt))) (set-buffer "*Completions*") (tmm-remove-inactive-mouse-face) (when tmm-completion-prompt