Commit 02e91426 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(describe-coding-system): Remove unused `coding-spec' variable.

(list-input-methods): Be more careful when setting up the help buffer.
parent 3da91622
......@@ -46,7 +46,7 @@
(defun sort-charset-list ()
(setq charset-list
(sort charset-list
(function (lambda (x y) (< (charset-id x) (charset-id y)))))))
(lambda (x y) (< (charset-id x) (charset-id y))))))
......@@ -175,20 +175,19 @@ but still shows the full information."
;; Determine a predicate for `sort' by SORT-KEY.
(setq sort-func
(cond ((eq sort-key 'id)
(function (lambda (x y) (< (car x) (car y)))))
(lambda (x y) (< (car x) (car y))))
((eq sort-key 'name)
(function (lambda (x y) (string< (nth 1 x) (nth 1 y)))))
(lambda (x y) (string< (nth 1 x) (nth 1 y))))
((eq sort-key 'iso-spec)
(lambda (x y)
(or (< (nth 3 x) (nth 3 y))
(and (= (nth 3 x) (nth 3 y))
(or (< (nth 4 x) (nth 4 y))
(and (= (nth 4 x) (nth 4 y))
(< (nth 5 x) (nth 5 y)))))))))
(< (nth 5 x) (nth 5 y))))))))
(error "Invalid charset sort key: %s" sort-key))))
......@@ -353,10 +352,9 @@ DEFAULT-VALUE, if non-nil, is the default value.
INITIAL-INPUT, if non-nil, is a string inserted in the minibuffer initially.
See the documentation of the function `completing-read' for the
detailed meanings of these arguments."
(let* ((table (append (mapcar (function (lambda (x) (list (symbol-name x))))
(let* ((table (append (mapcar (lambda (x) (list (symbol-name x)))
(mapcar (function (lambda (x)
(list (symbol-name (car x)))))
(mapcar (lambda (x) (list (symbol-name (car x))))
(charset (completing-read prompt table
nil t initial-input 'charset-history
......@@ -586,7 +584,6 @@ PC `codepages' and other coded character sets. See `non-iso-charset-alist'."
(with-output-to-temp-buffer (help-buffer)
(print-coding-system-briefly coding-system 'doc-string)
(princ "\n")
(let ((coding-spec (coding-system-spec coding-system)))
(princ "Type: ")
(let ((type (coding-system-type coding-system))
(flags (coding-system-flags coding-system)))
......@@ -634,7 +631,7 @@ PC `codepages' and other coded character sets. See `non-iso-charset-alist'."
((or (null eol-type) (eq eol-type 0)) (princ "LF\n"))
((eq eol-type 1) (princ "CRLF\n"))
((eq eol-type 2) (princ "CR\n"))
(t (princ "invalid\n")))))
(t (princ "invalid\n"))))
(let ((postread (coding-system-get coding-system 'post-read-conversion)))
(when postread
(princ "After decoding text normally,")
......@@ -800,13 +797,12 @@ Priority order for recognizing coding systems when reading files:\n")
(while categories
(setq coding-system (symbol-value (car categories)))
(lambda (x)
(if (and (not (eq x coding-system))
(coding-system-get x 'no-initial-designation)
(let ((flags (coding-system-flags x)))
(not (or (aref flags 10) (aref flags 11)))))
(setq codings (cons x codings)))))
(setq codings (cons x codings))))
(get (car categories) 'coding-systems))
(if codings
(let ((max-col (frame-width))
......@@ -1115,9 +1111,9 @@ see the function `describe-fontset' for the format of the list."
;; This code is duplicated near the end of mule-diag.
(let ((fontsets
(sort (fontset-list)
(function (lambda (x y)
(lambda (x y)
(string< (fontset-plain-name x)
(fontset-plain-name y)))))))
(fontset-plain-name y))))))
(while fontsets
(if arg
(print-fontset (car fontsets) nil)
......@@ -1128,7 +1124,8 @@ see the function `describe-fontset' for the format of the list."
(defun list-input-methods ()
"Display information about all input methods."
(with-output-to-temp-buffer "*Help*"
(help-setup-xref '(list-input-methods) (interactive-p))
(with-output-to-temp-buffer (help-buffer)
(with-current-buffer standard-output
......@@ -1137,8 +1134,7 @@ see the function `describe-fontset' for the format of the list."
"^ \\([^ ]+\\) (`.*' in mode line)$" nil t)
(help-xref-button 1 #'help-input-method
(match-string 1)
"mouse-2: describe this method")))
(help-setup-xref '(list-input-methods) (interactive-p)))))
"mouse-2: describe this method"))))))
(defun list-input-methods-1 ()
(if (not input-method-alist)
......@@ -1150,7 +1146,7 @@ installed LEIM (Libraries of Emacs Input Methods)."))
(princ " SHORT-DESCRIPTION\n------------------------------\n")
(setq input-method-alist
(sort input-method-alist
(function (lambda (x y) (string< (nth 1 x) (nth 1 y))))))
(lambda (x y) (string< (nth 1 x) (nth 1 y)))))
(let ((l input-method-alist)
language elt)
(while l
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment