codings))
(defun select-safe-coding-system--format-list (list)
- (let ((spec " %-20s %6s %10s %s\n"))
- (insert (format spec "Coding System" "Pos" "Code Point" ""))
+ (let ((spec1 " %-20s %6s %-10s %s\n")
+ (spec2 " %-20s %6s #x%-8X %c\n")
+ (nmax 5))
+ (insert (format spec1 "Coding System" "Pos" "Codepoint" "Char"))
(cl-loop for (coding . pairs) in list
do (cl-loop for pair in pairs
- ;; If there's a lot, only do the first three.
- for i from 1 upto 3
+ ;; If there's a lot, only do the first five.
+ for i from 1 upto nmax
do (insert
- (format spec
+ (format spec2
(if (= i 1) coding "")
- (car pair) (cdr pair)
- (if (and (= i 3) (> (length pairs) 3))
- "..."
- ""))))))
+ (car pair)
+ (cdr pair)
+ (cdr pair))))
+ (if (> (length pairs) nmax)
+ (insert (format spec1 "" "..." "" "")))))
+
(insert "\n"))
(defun select-safe-coding-system-interactively (from to codings unsafe
(concat " \"" (if (> (length from) 10)
(concat (substring from 0 10) "...\"")
(concat from "\"")))
- (format-message " text\nin the buffer `%s'" bufname))
+ (format-message
+ " the following\nproblematic characters in the buffer `%s'"
+ bufname))
":\n")
(select-safe-coding-system--format-list unsafe)
(when rejected
(insert "These safely encode the text in the buffer,
but are not recommended for encoding text in this context,
e.g., for sending an email message.\n ")
- (select-safe-coding-system--format-list rejected))
+ (dolist (x rejected)
+ (princ " ") (princ x))
+ (insert "\n"))
(when unsafe
(insert (if rejected "The other coding systems"
"However, each of them")