diff options
| author | Miles Bader | 2000-10-20 16:38:06 +0000 |
|---|---|---|
| committer | Miles Bader | 2000-10-20 16:38:06 +0000 |
| commit | 617fee5a3494fce16b00cf050ecc18459d05d685 (patch) | |
| tree | d09addccee88a90c8244aa9b4de5fb7e998ef478 | |
| parent | 38f99c2720818d8bc40d9ba933e42379f9d8d496 (diff) | |
| download | emacs-617fee5a3494fce16b00cf050ecc18459d05d685.tar.gz emacs-617fee5a3494fce16b00cf050ecc18459d05d685.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/international/quail.el | 31 |
2 files changed, 25 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 953077af4ac..619bffa8db0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2000-10-21 Miles Bader <miles@gnu.org> | 1 | 2000-10-21 Miles Bader <miles@gnu.org> |
| 2 | 2 | ||
| 3 | * international/quail.el (quail-show-guidance-buf): Make sure | ||
| 4 | guidance window really has enough room. | ||
| 5 | (quail-update-guidance): If quail-guidance-win is already shown, | ||
| 6 | make sure its height is OK. | ||
| 7 | |||
| 3 | * window.el (window-text-height, set-window-text-height): | 8 | * window.el (window-text-height, set-window-text-height): |
| 4 | New functions. | 9 | New functions. |
| 5 | (shrink-window-if-larger-than-buffer): Use `window-text-height' | 10 | (shrink-window-if-larger-than-buffer): Use `window-text-height' |
diff --git a/lisp/international/quail.el b/lisp/international/quail.el index a079db779f8..6fc01468a76 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el | |||
| @@ -1903,17 +1903,21 @@ or in a newly created frame (if the selected frame has no other windows)." | |||
| 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 | )) |
| @@ -1951,9 +1955,14 @@ or in a newly created frame (if the selected frame has no other windows)." | |||
| 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. |