diff options
author | Martin Rudalics <rudalics@gmx.at> | 2014-12-18 18:12:24 +0100 |
---|---|---|
committer | Martin Rudalics <rudalics@gmx.at> | 2014-12-18 18:12:24 +0100 |
commit | 47f730e3b6a36d6b3e22b91caac576ec2ac4bd7c (patch) | |
tree | a516327425c0cd36f4cc1fe56376fc0860e7ab54 /lisp/tmm.el | |
parent | 36c43e95de5e067b7d6a06db479765b4e4a22986 (diff) | |
download | emacs-47f730e3b6a36d6b3e22b91caac576ec2ac4bd7c.tar.gz |
Add code for "preserving" window sizes.
* frame.c (frame_windows_min_size): New argument IGNORE.
(adjust_frame_size): When called from change_frame_size call
frame_windows_min_size with IGNORE Qt so we can ignore size
restrictions.
* dired.el (dired-pop-to-buffer): Call fit-window-to-buffer with
`preserve-size' t.
(dired-mark-pop-up): Preserve size of window showing marked
files.
* electric.el (Electric-pop-up-window):
* help.el (resize-temp-buffer-window): Call fit-window-to-buffer
with `preserve-size' t.
* minibuffer.el (minibuffer-completion-help): Use
`resize-temp-buffer-window' instead of `fit-window-to-buffer'
(Bug#19355). Preserve size of completions window.
* register.el (register-preview): Preserve size of register
preview window.
* tmm.el (tmm-add-prompt): Call fit-window-to-buffer
with `preserve-size' t (Bug#1291).
* window.el (with-displayed-buffer-window): Add calls to
`window-preserve-size'.
(window-min-pixel-size, window--preservable-size)
(window-preserve-size, window-preserved-size)
(window--preserve-size, window--min-size-ignore-p): New
functions.
(window-min-size, window-min-delta, window--resizable)
(window--resize-this-window, split-window-below)
(split-window-right): Amend doc-string.
(adjust-window-trailing-edge): Handle preserving window
sizes. Signal user-error instead of an error when there's no
window above or below.
(window--min-size-1, window-sizable, window--size-fixed-1)
(window-size-fixed-p, window--min-delta-1)
(frame-windows-min-size, window--max-delta-1, window-resize)
(window--resize-child-windows, window--resize-siblings)
(enlarge-window, shrink-window, split-window): Handle preserving
window sizes.
(window--state-put-2): Handle horizontal scroll bars.
(window--display-buffer): Call `preserve-size' if asked for.
(display-buffer): Mention `preserve-size' alist member in
doc-string.
(fit-window-to-buffer): New argument PRESERVE-SIZE.
Diffstat (limited to 'lisp/tmm.el')
-rw-r--r-- | lisp/tmm.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/tmm.el b/lisp/tmm.el index 09729755c14..8aedb780925 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -371,7 +371,6 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'." (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)) @@ -381,9 +380,15 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'." (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 () |