]> code.delx.au - gnu-emacs/blobdiff - lisp/tmm.el
* xmenu.c: Revert last change.
[gnu-emacs] / lisp / tmm.el
index e8d98388afc32e2f9b15ffe0503140c59a08c417..a7ca2047162b21fa6be06d09f2d23890d9e91d1c 100644 (file)
@@ -9,10 +9,10 @@
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,9 +20,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -345,8 +343,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 +376,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