From: Eli Zaretskii Date: Sat, 24 Jan 2009 15:32:15 +0000 (+0000) Subject: (set-language-environment-coding-systems): If default-buffer-file-coding-system X-Git-Tag: emacs-pretest-23.0.90~238 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=207422daaee6269e843846e2ee974b4dec69bc10;p=emacs.git (set-language-environment-coding-systems): If default-buffer-file-coding-system is nil, set up to have EOLs that are native for the underlying system-type. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 44aa9245765..27ec14a138b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2009-01-24 Eli Zaretskii + + * international/mule-cmds.el (set-language-environment-coding-systems): If + default-buffer-file-coding-system is nil, set up to have EOLs that + are native for the underlying system-type. + 2009-01-24 Juanma Barranquero * emacs-lisp/eldoc.el (eldoc-function-argstring-format): diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 465c3efecf5..4ec283386a9 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -1933,7 +1933,25 @@ See `set-language-info-alist' for use in programs." "Do various coding system setups for language environment LANGUAGE-NAME." (let* ((priority (get-language-info language-name 'coding-priority)) (default-coding (car priority)) - (eol-type (coding-system-eol-type default-buffer-file-coding-system))) + ;; If default-buffer-file-coding-system is nil, don't use + ;; coding-system-eol-type, because it treats nil as + ;; `no-conversion'. default-buffer-file-coding-system is set + ;; to nil by reset-language-environment, and in that case we + ;; want to have here the native EOL type for each platform. + ;; FIXME: there should be a common code that runs both on + ;; startup and here to set the default EOL type correctly. + ;; Right now, DOS/Windows platforms set this on dos-w32.el, + ;; which works only as long as the order of loading files at + ;; dump time and calling functions at startup is not modified + ;; significantly, i.e. as long as this function is called + ;; _after_ default-buffer-file-coding-system was set by + ;; dos-w32.el. + (eol-type + (if (null default-buffer-file-coding-system) + (cond ((memq system-type '(windows-nt ms-dos)) 1) + ((eq system-type 'macos) 2) + (t 0)) + (coding-system-eol-type default-buffer-file-coding-system)))) (when priority (set-default-coding-systems (if (memq eol-type '(0 1 2 unix dos mac))