]> git.eshelyaron.com Git - emacs.git/commitdiff
(quail-input-method): Resize the help window again after it has all its
authorMiles Bader <miles@gnu.org>
Wed, 20 Dec 2000 06:06:28 +0000 (06:06 +0000)
committerMiles Bader <miles@gnu.org>
Wed, 20 Dec 2000 06:06:28 +0000 (06:06 +0000)
contents.  Remove unneeded progn.

lisp/ChangeLog
lisp/international/quail.el

index 654926e7e9dc368d4c7a7317f397ca49f484a7d3..158d4024f6540ec8b4004065eee3415e9d756cce 100644 (file)
@@ -1,3 +1,8 @@
+2000-12-20  Miles Bader  <miles@gnu.org>
+
+       * international/quail.el (quail-help): Resize the help window
+       again after it has all its contents.  Remove unneeded progn.
+
 2000-12-19  Gerd Moellmann  <gerd@gnu.org>
 
        * pcmpl-linux.el: Fix copy/paste error.
index df9abb99675f4b093bdcc06ee8effbcc79b6d8d7..8e3781048984bdbdb5185f20266fe425228ca97d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; quail.el --- Provides simple input method for multilingual text
 
-;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
+;; Copyright (C) 1995, 2000 Electrotechnical Laboratory, JAPAN.
 ;; Licensed to the Free Software Foundation.
 
 ;; Author: Kenichi HANDA <handa@etl.go.jp>
@@ -2407,54 +2407,53 @@ package to describe."
     ;; Then, insert text in the help buffer while paying attention to
     ;; the width of the frame in which the buffer displayed.
     (save-excursion
-      (progn
-       (set-buffer (get-buffer "*Help*"))
-       (setq buffer-read-only nil)
-       (insert "Input method: " (quail-name)
-               " (mode line indicator:"
-               (quail-title)
-               ")\n\n")
-       (save-restriction
-         (narrow-to-region (point) (point))
-         (insert (quail-docstring))
-         (goto-char (point-min))
-         (with-syntax-table emacs-lisp-mode-syntax-table
-           (while (re-search-forward "\\\\<\\sw\\(\\sw\\|\\s_\\)+>" nil t)
-             (let ((sym (intern-soft
-                         (buffer-substring (+ (match-beginning 0) 2)
-                                           (1- (point))))))
-               (if (and (boundp sym)
-                        (stringp (symbol-value sym)))
-                   (replace-match (symbol-value sym) t t)))))
-         (goto-char (point-max)))
-       (or (bolp)
-           (insert "\n"))
-       (insert "\n")
-
-       (let ((done-list nil))
-         ;; Show keyboard layout if the current package requests it..
-         (when (quail-show-layout)
-           (insert "
+      (set-buffer (get-buffer "*Help*"))
+      (setq buffer-read-only nil)
+      (insert "Input method: " (quail-name)
+             " (mode line indicator:"
+             (quail-title)
+             ")\n\n")
+      (save-restriction
+       (narrow-to-region (point) (point))
+       (insert (quail-docstring))
+       (goto-char (point-min))
+       (with-syntax-table emacs-lisp-mode-syntax-table
+         (while (re-search-forward "\\\\<\\sw\\(\\sw\\|\\s_\\)+>" nil t)
+           (let ((sym (intern-soft
+                       (buffer-substring (+ (match-beginning 0) 2)
+                                         (1- (point))))))
+             (if (and (boundp sym)
+                      (stringp (symbol-value sym)))
+                 (replace-match (symbol-value sym) t t)))))
+       (goto-char (point-max)))
+      (or (bolp)
+         (insert "\n"))
+      (insert "\n")
+
+      (let ((done-list nil))
+       ;; Show keyboard layout if the current package requests it..
+       (when (quail-show-layout)
+         (insert "
 KEYBOARD LAYOUT
 ---------------
 This input method works by translating individual input characters.
 Assuming that your actual keyboard has the `")
-           (help-insert-xref-button
-            quail-keyboard-layout-type
-            #'quail-show-keyboard-layout quail-keyboard-layout-type
-            "mouse-2, RET: show this layout")
-           (insert "' layout,
+         (help-insert-xref-button
+          quail-keyboard-layout-type
+          #'quail-show-keyboard-layout quail-keyboard-layout-type
+          "mouse-2, RET: show this layout")
+         (insert "' layout,
 translation results in the following \"virtual\" keyboard layout:
 ")
-           (setq done-list
-                 (quail-insert-kbd-layout quail-keyboard-layout))
-           (insert "If your keyboard has a different layout, rearranged from
+         (setq done-list
+               (quail-insert-kbd-layout quail-keyboard-layout))
+         (insert "If your keyboard has a different layout, rearranged from
 `")
-           (help-insert-xref-button
-            "standard"
-            #'quail-show-keyboard-layout "standard"
-            "mouse-2, RET: show this layout")
-           (insert "', the \"virtual\" keyboard you get with this input method
+         (help-insert-xref-button
+          "standard"
+          #'quail-show-keyboard-layout "standard"
+          "mouse-2, RET: show this layout")
+         (insert "', the \"virtual\" keyboard you get with this input method
 will be rearranged in the same way.
 
 You can set the variable `quail-keyboard-layout-type' to specify
@@ -2462,43 +2461,47 @@ the physical layout of your keyboard; the tables shown in
 documentation of input methods including this one are based on the
 physical keyboard layout as specified with that variable.
 ")
-           (help-insert-xref-button
-            "[customize keyboard layout]"
-            #'customize-variable 'quail-keyboard-layout-type
-            "mouse-2, RET: set keyboard layout type")
-           (insert "\n"))
-
-         ;; Show key sequences.
-         (let ((decode-map (list 'decode-map))
-               elt pos num)
-           (setq num (quail-build-decode-map (list (quail-map)) "" decode-map
-                                             0 512 done-list))
-           (when (> num 0)
-             (insert "
+         (help-insert-xref-button
+          "[customize keyboard layout]"
+          #'customize-variable 'quail-keyboard-layout-type
+          "mouse-2, RET: set keyboard layout type")
+         (insert "\n"))
+
+       ;; Show key sequences.
+       (let ((decode-map (list 'decode-map))
+             elt pos num)
+         (setq num (quail-build-decode-map (list (quail-map)) "" decode-map
+                                           0 512 done-list))
+         (when (> num 0)
+           (insert "
 KEY SEQUENCE
 -----------
 ")
-             (if (quail-show-layout)
-                 (insert "You can also input more characters")
-               (insert "You can input characters"))
-             (insert " by the following key sequences:\n")
-             (quail-insert-decode-map decode-map))))
-
-       (quail-help-insert-keymap-description
-        (quail-translation-keymap)
-        "\
+           (if (quail-show-layout)
+               (insert "You can also input more characters")
+             (insert "You can input characters"))
+           (insert " by the following key sequences:\n")
+           (quail-insert-decode-map decode-map))))
+
+      (quail-help-insert-keymap-description
+       (quail-translation-keymap)
+       "\
 KEY BINDINGS FOR TRANSLATION
 ----------------------------\n")
-       (insert ?\n)
-       (if (quail-conversion-keymap)
-           (quail-help-insert-keymap-description
-            (quail-conversion-keymap)
-            "\
+      (insert ?\n)
+      (if (quail-conversion-keymap)
+         (quail-help-insert-keymap-description
+          (quail-conversion-keymap)
+          "\
 KEY BINDINGS FOR CONVERSION
 ---------------------------\n"))
-       (help-setup-xref (list #'quail-help (quail-name))
-                        (interactive-p))
-       (setq quail-current-package nil)))))
+      (help-setup-xref (list #'quail-help (quail-name))
+                      (interactive-p))
+      (setq quail-current-package nil)      
+      ;; Resize the help window again, now that it has all its contents.
+      (save-selected-window
+       (select-window (get-buffer-window (current-buffer)))
+       (run-hooks 'temp-buffer-show-hook)))))
 
 (defun quail-help-insert-keymap-description (keymap &optional header)
   (let (pos1 pos2 eol)