Mercurial > emacs
comparison lisp/international/quail.el @ 32696:a384f310fd27
(quail-show-guidance-buf): Make sure guidance window really has enough room.
(quail-update-guidance): If quail-guidance-win is already shown, make
sure its height is OK.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Fri, 20 Oct 2000 16:36:11 +0000 |
parents | 75b162c6dc9e |
children | a08ba216f051 |
comparison
equal
deleted
inserted
replaced
32695:5a4f1fbd4ed7 | 32696:a384f310fd27 |
---|---|
1901 (if (eq win (frame-root-window)) | 1901 (if (eq win (frame-root-window)) |
1902 ;; Create a frame. It is sure that we are using some | 1902 ;; Create a frame. It is sure that we are using some |
1903 ;; window system. | 1903 ;; window system. |
1904 (quail-make-guidance-frame quail-guidance-buf) | 1904 (quail-make-guidance-frame quail-guidance-buf) |
1905 ;; Find the bottom window and split it if necessary. | 1905 ;; Find the bottom window and split it if necessary. |
1906 (let (height) | 1906 (setq win (window-at |
1907 (setq win (window-at | 1907 0 (1- (- (frame-height) (window-height win))))) |
1908 0 (1- (- (frame-height) (window-height win))))) | 1908 (let ((height (window-height win)) |
1909 (setq height (window-height win)) | 1909 (window-min-height 2)) |
1910 ;; If WIN is tall enough, split it vertically and use | 1910 ;; If WIN is tall enough, split it vertically and use |
1911 ;; the lower one. | 1911 ;; the lower one. |
1912 (if (>= height 4) | 1912 (when (>= height 4) |
1913 (let ((window-min-height 2)) | 1913 ;; Here, `split-window' returns a lower window |
1914 ;; Here, `split-window' returns a lower window | 1914 ;; which is what we wanted. |
1915 ;; which is what we wanted. | 1915 (setq win (split-window win (- height 2)))) |
1916 (setq win (split-window win (- height 2))))) | 1916 ;; This makes sure that there's really enougth room |
1917 ;; for 1 line of text, even if the mode-line is | |
1918 ;; taller than one line (and so the total | |
1919 ;; window-height of two wouldn't be enough). | |
1920 (set-window-text-height win 1) | |
1917 (set-window-buffer win quail-guidance-buf) | 1921 (set-window-buffer win quail-guidance-buf) |
1918 ;;(set-window-dedicated-p win t) | 1922 ;;(set-window-dedicated-p win t) |
1919 )) | 1923 )) |
1920 (set-window-buffer win quail-guidance-buf) | 1924 (set-window-buffer win quail-guidance-buf) |
1921 (set-minibuffer-window win)) | 1925 (set-minibuffer-window win)) |
1949 (defun quail-update-guidance () | 1953 (defun quail-update-guidance () |
1950 "Update the Quail guidance buffer and completion buffer (if displayed now)." | 1954 "Update the Quail guidance buffer and completion buffer (if displayed now)." |
1951 ;; Update guidance buffer. | 1955 ;; Update guidance buffer. |
1952 (if (quail-require-guidance-buf) | 1956 (if (quail-require-guidance-buf) |
1953 (let ((guidance (quail-guidance))) | 1957 (let ((guidance (quail-guidance))) |
1954 (or (and (eq (selected-frame) (window-frame (minibuffer-window))) | 1958 (if (and (eq (selected-frame) (window-frame (minibuffer-window))) |
1955 (eq (selected-frame) (window-frame quail-guidance-win))) | 1959 (eq (selected-frame) (window-frame quail-guidance-win))) |
1956 (quail-show-guidance-buf)) | 1960 ;; Make sure the height of the guidance window is OK |
1961 ;; (sometimes, if the minibuffer window has expanded due to | |
1962 ;; user input, it will cause the guidance window to be only | |
1963 ;; partially visible). | |
1964 (set-window-text-height quail-guidance-win 1) | |
1965 (quail-show-guidance-buf)) | |
1957 (cond ((or (eq guidance t) | 1966 (cond ((or (eq guidance t) |
1958 (consp guidance)) | 1967 (consp guidance)) |
1959 ;; Show the current possible translations. | 1968 ;; Show the current possible translations. |
1960 (quail-show-translations)) | 1969 (quail-show-translations)) |
1961 ((null guidance) | 1970 ((null guidance) |