aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii1998-12-30 17:21:44 +0000
committerEli Zaretskii1998-12-30 17:21:44 +0000
commitbd3ac67e7b166d085835ea00b3d83d822d962391 (patch)
treef6a83f1e592f19f78414fdd6b48abb502217dd4f
parente58883dd43af15f1547fdbe9e0fe895fe5c659f5 (diff)
downloademacs-bd3ac67e7b166d085835ea00b3d83d822d962391.tar.gz
emacs-bd3ac67e7b166d085835ea00b3d83d822d962391.zip
(prefer-coding-system): If the argument requires specific EOL conversion
type, make the default coding systems use that.
-rw-r--r--lisp/international/mule-cmds.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 6d9f5b1e9ec..ecb7bab89f5 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -238,6 +238,9 @@ This also sets the following values:
238 o default value for the command `set-terminal-coding-system' (not on MSDOS) 238 o default value for the command `set-terminal-coding-system' (not on MSDOS)
239 o default value for the command `set-keyboard-coding-system' 239 o default value for the command `set-keyboard-coding-system'
240 240
241If CODING-SYSTEM specifies a certain type of EOL conversion, the coding
242systems set by this function will use that type of EOL conversion.
243
241This command does not change the default value of terminal coding system 244This command does not change the default value of terminal coding system
242for MS-DOS terminal, because DOS terminals only support a single coding 245for MS-DOS terminal, because DOS terminals only support a single coding
243system, and Emacs automatically sets the default to that coding system at 246system, and Emacs automatically sets the default to that coding system at
@@ -246,7 +249,8 @@ startup."
246 (if (not (and coding-system (coding-system-p coding-system))) 249 (if (not (and coding-system (coding-system-p coding-system)))
247 (error "Invalid coding system `%s'" coding-system)) 250 (error "Invalid coding system `%s'" coding-system))
248 (let ((coding-category (coding-system-category coding-system)) 251 (let ((coding-category (coding-system-category coding-system))
249 (base (coding-system-base coding-system))) 252 (base (coding-system-base coding-system))
253 (eol-type (coding-system-eol-type coding-system)))
250 (if (not coding-category) 254 (if (not coding-category)
251 ;; CODING-SYSTEM is no-conversion or undecided. 255 ;; CODING-SYSTEM is no-conversion or undecided.
252 (error "Can't prefer the coding system `%s'" coding-system)) 256 (error "Can't prefer the coding system `%s'" coding-system))
@@ -260,7 +264,12 @@ startup."
260 (if (and base (interactive-p)) 264 (if (and base (interactive-p))
261 (message "Highest priority is set to %s (base of %s)" 265 (message "Highest priority is set to %s (base of %s)"
262 base coding-system)) 266 base coding-system))
263 (set-default-coding-systems (or base coding-system)))) 267 ;; If they asked for specific EOL conversion, honor that.
268 (if (memq eol-type '(0 1 2 unix dos mac))
269 (setq coding-system
270 (coding-system-change-eol-conversion base eol-type))
271 (setq coding-system base))
272 (set-default-coding-systems coding-system)))
264 273
265(defun find-coding-systems-region-subset-p (list1 list2) 274(defun find-coding-systems-region-subset-p (list1 list2)
266 "Return non-nil if all elements in LIST1 are included in LIST2. 275 "Return non-nil if all elements in LIST1 are included in LIST2.