[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f9ee2db493 2/3: Improve readability of list-input-methods
From: |
Stefan Kangas |
Subject: |
master f9ee2db493 2/3: Improve readability of list-input-methods |
Date: |
Tue, 9 Aug 2022 11:58:36 -0400 (EDT) |
branch: master
commit f9ee2db4937cf51aa4442f5d24275b82c773208b
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
Improve readability of list-input-methods
* lisp/international/mule-diag.el: Make screen more readable by
improving the formatting.
---
lisp/international/mule-diag.el | 55 +++++++++++++++++++++--------------------
1 file changed, 28 insertions(+), 27 deletions(-)
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index 6b630c73e8..646e0b8480 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -1065,35 +1065,36 @@ see the function `describe-fontset' for the format of
the list."
(help-xref-button 1 'help-input-method (match-string 1))))))))
(defun list-input-methods-1 ()
- (if (not input-method-alist)
- (princ "
+ (with-current-buffer standard-output
+ (if (not input-method-alist)
+ (insert "
No input method is available, perhaps because you have not
installed LEIM (Libraries of Emacs Input Methods).")
- (princ (substitute-command-keys
- "LANGUAGE\n NAME (`TITLE' in mode line)\n"))
- (princ " SHORT-DESCRIPTION\n------------------------------\n")
- (setq input-method-alist
- (sort input-method-alist
- (lambda (x y) (string< (nth 1 x) (nth 1 y)))))
-
- (let (language)
- (dolist (elt input-method-alist)
- (when (not (equal language (nth 1 elt)))
- (setq language (nth 1 elt))
- (princ language)
- (terpri))
- (princ (format-message
- " %s (`%s' in mode line)\n %s\n"
- (car elt)
- (let ((title (nth 3 elt)))
- (if (and (consp title) (stringp (car title)))
- (car title)
- title))
- ;; If the doc is multi-line, indent all
- ;; non-blank lines. (Bug#8066)
- (replace-regexp-in-string
- "\n\\(.\\)" "\n \\1"
- (substitute-command-keys (or (nth 4 elt) "")))))))))
+ (insert (substitute-command-keys
+ "LANGUAGE\n NAME (`TITLE' in mode line)\n"))
+ (insert " SHORT-DESCRIPTION\n------------------------------\n")
+ (setq input-method-alist
+ (sort input-method-alist
+ (lambda (x y) (string< (nth 1 x) (nth 1 y)))))
+
+ (let (language)
+ (dolist (elt input-method-alist)
+ (when (not (equal language (nth 1 elt)))
+ (setq language (nth 1 elt))
+ (insert "\n" (propertize language 'face 'help-for-help-header)
"\n\n"))
+ (insert (format-message
+ " %s (`%s' in mode line)\n %s\n"
+ (car elt)
+ (let ((title (nth 3 elt)))
+ (if (and (consp title) (stringp (car title)))
+ (car title)
+ title))
+ ;; If the doc is multi-line, indent all
+ ;; non-blank lines. (Bug#8066)
+ (replace-regexp-in-string
+ "\n\\(.\\)" "\n \\1"
+ (substitute-command-keys (or (nth 4 elt) ""))))))))))
+
;;; DIAGNOSIS