;;; tmm.el --- text mode access to menu-bar -*- lexical-binding: t -*-
-;; Copyright (C) 1994-1996, 2000-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1994-1996, 2000-2015 Free Software Foundation, Inc.
;; Author: Ilya Zakharevich <ilya@math.mps.ohio-state.edu>
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
;; Keywords: convenience
;; This file is part of GNU Emacs.
(unless tmm-c-prompt
(error "No active menu entries"))
(setq tmm-old-mb-map (tmm-define-keys t))
- ;; Get window and hide it for electric mode to get correct size
(or tmm-completion-prompt
(add-hook 'completion-setup-hook
'tmm-completion-delete-prompt 'append))
(with-current-buffer "*Completions*"
(tmm-remove-inactive-mouse-face)
(when tmm-completion-prompt
- (let ((inhibit-read-only t))
+ (let ((inhibit-read-only t)
+ (window (get-buffer-window "*Completions*")))
(goto-char (point-min))
- (insert tmm-completion-prompt))))
+ (insert tmm-completion-prompt)
+ (when window
+ ;; Try to show everything just inserted and preserve height of
+ ;; *Completions* window. This should fix a behavior described
+ ;; in Bug#1291.
+ (fit-window-to-buffer window nil nil nil nil t)))))
(insert tmm-c-prompt))
(defun tmm-shortcut ()