changeset 18349:f468344dd2bd

(quail-help): Use with-output-to-temp-buffer. (quail-translation-help): Likewise. (quail-conversion-help): Likewise.
author Kenichi Handa <handa@m17n.org>
date Sat, 21 Jun 1997 01:14:06 +0000
parents 157cdb505495
children 3f4364889538
files lisp/international/quail.el
diffstat 1 files changed, 51 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/quail.el	Sat Jun 21 00:46:21 1997 +0000
+++ b/lisp/international/quail.el	Sat Jun 21 01:14:06 1997 +0000
@@ -1461,41 +1461,37 @@
 (defun quail-help ()
   "Show brief description of the current Quail package."
   (interactive)
-  (let ((package quail-current-package)
-	(buf (get-buffer-create "*Quail-help*")))
-    (save-excursion
-      (set-buffer buf)
-      (erase-buffer)
-      (setq quail-current-package package)
-      (insert "Quail input method (name:"
-	      (quail-name)
-	      ", mode line indicator:["
-	      (quail-title)
-	      "])\n---- Documentation ----\n"
-	      (quail-docstring))
-      (newline)
-      (if (quail-show-layout) (quail-show-kbd-layout))
-      (insert )
-      (quail-help-insert-keymap-description
-       quail-mode-map
-       "---- Key bindings (before starting translation) ----
+  (let ((package quail-current-package))
+    (with-output-to-temp-buffer "*Quail-Help*"
+      (save-excursion
+	(set-buffer standard-output)
+	(let ((quail-current-package package))
+	  (insert "Quail input method (name:"
+		  (quail-name)
+		  ", mode line indicator:["
+		  (quail-title)
+		  "])\n---- Documentation ----\n"
+		  (quail-docstring))
+	  (newline)
+	  (if (quail-show-layout) (quail-show-kbd-layout))
+	  (quail-help-insert-keymap-description
+	   quail-mode-map
+	   "---- Key bindings (before starting translation) ----
 key		binding
 ---		-------\n")
-      (quail-help-insert-keymap-description
-       (quail-translation-keymap)
-       "--- Key bindings (while translating) ---
+	  (quail-help-insert-keymap-description
+	   (quail-translation-keymap)
+	   "--- Key bindings (while translating) ---
 key		binding
 ---		-------\n")
-      (if (quail-conversion-keymap)
-	  (quail-help-insert-keymap-description
-	   (quail-conversion-keymap)
-       "--- Key bindings (while converting) ---
+	  (if (quail-conversion-keymap)
+	      (quail-help-insert-keymap-description
+	       (quail-conversion-keymap)
+	       "--- Key bindings (while converting) ---
 key		binding
 ---		-------\n"))
-      (goto-char (point-min))
-      (set-buffer-modified-p nil)
-      (help-mode))
-    (display-buffer buf)))
+	  (help-mode))))))
+
 
 (defun quail-help-insert-keymap-description (keymap &optional header)
   (let (from to)
@@ -1543,45 +1539,40 @@
   "Show help message while translating in Quail mode."
   (interactive)
   (let ((package quail-current-package)
-	(current-key quail-current-key)
-	(buf (get-buffer-create "*Quail-Help*")))
-    (save-excursion
-      (set-buffer buf)
-      (erase-buffer)
-      (setq quail-current-package package)
-      (insert
-       (format "You are translating the key sequence \"%s\" in Quail mode.\n"
-	       quail-current-key))
-      (quail-help-insert-keymap-description
-       (quail-translation-keymap)
-       "-----------------------
+	(current-key quail-current-key))
+    (with-output-to-temp-buffer "*Quail-Help*"
+      (save-excursion
+	(set-buffer standard-output)
+	(let ((quail-current-package package))
+	  (princ "You are translating the key sequence ")
+	  (prin1 quail-current-key)
+	  (princ" in Quail mode.\n")
+	  (quail-help-insert-keymap-description
+	   (quail-translation-keymap)
+	   "-----------------------
 key		binding
----		-------\n")
-      (goto-char (point-min))
-      (set-buffer-modified-p nil))
-    (display-buffer buf)))
-  
+---		-------\n"))
+	(help-mode)))))
+
 (defun quail-conversion-help ()
   "Show help message while converting in Quail mode."
   (interactive)
   (let ((package quail-current-package)
 	(str (buffer-substring (overlay-start quail-conv-overlay)
-				 (overlay-end quail-conv-overlay)))
-	(buf (get-buffer-create "*Quail-Help*")))
-    (save-excursion
-      (set-buffer buf)
-      (erase-buffer)
-      (setq quail-current-package package)
-      (insert
-       (format "You are converting the string \"%s\" in Quail mode.\n" str))
-      (quail-help-insert-keymap-description
-       (quail-conversion-keymap)
+				 (overlay-end quail-conv-overlay))))
+    (with-output-to-temp-buffer "*Quail-Help*"
+      (save-excursion
+	(set-buffer standard-output)
+	(let ((quail-current-package package))
+	  (princ "You are converting the string ")
+	  (prin1 str)
+	  (princ " in Quail mode.\n")
+	  (quail-help-insert-keymap-description
+	   (quail-conversion-keymap)
        "-----------------------
 key		binding
----		-------\n")
-      (goto-char (point-min))
-      (set-buffer-modified-p nil))
-    (display-buffer buf)))
+---		-------\n"))
+	(help-mode)))))
 
 
 (defvar quail-directory-name "quail"