# HG changeset patch # User Chong Yidong # Date 1160059586 0 # Node ID f5aa4451cadafd8380f4e58e4069d66d817b5016 # Parent 7e5dc6da708d4c100bfb6dde22c064bebf4056ae * international/mule-cmds.el (coding-system-change-eol-conversion): Ensure the coding system is initialized before calling coding-system-eol-type. diff -r 7e5dc6da708d -r f5aa4451cada lisp/ChangeLog --- a/lisp/ChangeLog Thu Oct 05 14:43:08 2006 +0000 +++ b/lisp/ChangeLog Thu Oct 05 14:46:26 2006 +0000 @@ -1,3 +1,9 @@ +2006-10-05 Chong Yidong + + * international/mule-cmds.el (coding-system-change-eol-conversion): + Ensure the coding system is initialized before calling + coding-system-eol-type. + 2006-10-04 Carsten Dominik * textmodes/org.el (org-rm-props, org-activate-plain-links) diff -r 7e5dc6da708d -r f5aa4451cada lisp/international/mule-cmds.el --- a/lisp/international/mule-cmds.el Thu Oct 05 14:43:08 2006 +0000 +++ b/lisp/international/mule-cmds.el Thu Oct 05 14:46:26 2006 +0000 @@ -216,19 +216,21 @@ ((eq eol-type 'dos) 1) ((eq eol-type 'mac) 2) (t eol-type)))) - (let ((orig-eol-type (coding-system-eol-type coding-system))) - (if (vectorp orig-eol-type) - (if (not eol-type) - coding-system - (aref orig-eol-type eol-type)) - (let ((base (coding-system-base coding-system))) - (if (not eol-type) - base - (if (= eol-type orig-eol-type) - coding-system - (setq orig-eol-type (coding-system-eol-type base)) - (if (vectorp orig-eol-type) - (aref orig-eol-type eol-type)))))))) + ;; We call `coding-system-base' before `coding-system-eol-type', + ;; because the coding-system may not be initialized until then. + (let* ((base (coding-system-base coding-system)) + (orig-eol-type (coding-system-eol-type coding-system))) + (cond ((vectorp orig-eol-type) + (if (not eol-type) + coding-system + (aref orig-eol-type eol-type))) + ((not eol-type) + base) + ((= eol-type orig-eol-type) + coding-system) + ((progn (setq orig-eol-type (coding-system-eol-type base)) + (vectorp orig-eol-type)) + (aref orig-eol-type eol-type))))) (defun coding-system-change-text-conversion (coding-system coding) "Return a coding system which differs from CODING-SYSTEM in text conversion.