changeset 90620:b6af682a7e04

(coding-system-list): Be sure to exclude subsidiary coding systems.
author Kenichi Handa <handa@m17n.org>
date Tue, 17 Oct 2006 11:45:46 +0000
parents f0097c798466
children d8a2b76fe3d4
files lisp/international/mule.el
diffstat 1 files changed, 7 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule.el	Mon Oct 16 07:54:00 2006 +0000
+++ b/lisp/international/mule.el	Tue Oct 17 11:45:46 2006 +0000
@@ -910,20 +910,13 @@
 listed.  The value doesn't include subsidiary coding systems which are
 made from bases and aliases automatically for various end-of-line
 formats (e.g. iso-latin-1-unix, koi8-r-dos)."
-  (let* ((codings (copy-sequence coding-system-list))
-	 (tail (cons nil codings)))
-    ;; Remove subsidiary coding systems (eol variants) and alias
-    ;; coding systems (if necessary).
-    (while (cdr tail)
-      (let* ((coding (car (cdr tail)))
-	     (aliases (coding-system-aliases coding)))
-	(if (or
-	     ;; CODING is an eol variant if not in ALIASES.
-	     (not (memq coding aliases))
-	     ;; CODING is an alias if it is not car of ALIASES.
-	     (and base-only (not (eq coding (car aliases)))))
-	    (setcdr tail (cdr (cdr tail)))
-	  (setq tail (cdr tail)))))
+  (let ((codings nil))
+    (dolist (coding coding-system-list)
+      (if (eq (coding-system-base coding) coding)
+	  (if base-only
+	      (setq codings (cons coding codings))
+	    (dolist (alias (coding-system-aliases coding))
+	      (setq codings (cons alias codings))))))
     codings))
 
 (defconst char-coding-system-table nil