diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-04-14 18:13:16 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-04-14 18:13:16 +0000 |
commit | 9241efbe694b06bb2b040f8c161137b5c5d6bcfd (patch) | |
tree | 7d78b642e6a10ced175fb16372cb0f9b946ca382 /lisp/tmm.el | |
parent | d8e1753cfd4ab293f45b565bc81dabbb7b61da1a (diff) | |
download | emacs-9241efbe694b06bb2b040f8c161137b5c5d6bcfd.tar.gz |
(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.
Diffstat (limited to 'lisp/tmm.el')
-rw-r--r-- | lisp/tmm.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/tmm.el b/lisp/tmm.el index e8d98388afc..b04e0c28d9f 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -345,8 +345,8 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'." (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 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'." (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 |