From d8d9feaf6cd5a609e36f7e72c1de9490dcbeede7 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 24 Feb 2005 01:36:41 +0000 Subject: [PATCH] Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-17 Replace embedded control characters with octal escapes 2005-02-24 Miles Bader * lisp/international/mule.el (auto-coding-regexp-alist) (ctext-pre-write-conversion): Replace embedded control characters with octal escapes; this prevents diff from thinking the file is binary. --- lisp/ChangeLog.unicode | 7 +++++++ lisp/international/mule.el | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog.unicode b/lisp/ChangeLog.unicode index 4b21ba2503e..afe74a32d4b 100644 --- a/lisp/ChangeLog.unicode +++ b/lisp/ChangeLog.unicode @@ -1,3 +1,10 @@ +2005-02-24 Miles Bader + + * international/mule.el (auto-coding-regexp-alist) + (ctext-pre-write-conversion): Replace embedded control characters + with octal escapes; this prevents diff from thinking the file is + binary. + 2005-02-12 Miles Bader * version.el (emacs-version): Change to "23.0.0". diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 93e64e447c0..13e3539c3f0 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1482,7 +1482,7 @@ text, and convert it in the temporary buffer. Otherwise, convert in-place." (save-excursion (goto-char last-pos) (insert (string-to-multibyte - (format "\e%%/%d%c%c%s" + (format "\e%%/%d%c%c%s\002" noctets (+ (/ len 128) 128) (+ (% len 128) 128) @@ -1526,7 +1526,7 @@ and the contents of `file-coding-system-alist'." (defcustom auto-coding-regexp-alist '(("^BABYL OPTIONS:[ \t]*-\\*-[ \t]*rmail[ \t]*-\\*-" . no-conversion) - ("\\`;ELC" . emacs-mule)) ; Emacs 20-compiled + ("\\`;ELC\024\0\0\0" . emacs-mule)) ; Emacs 20-compiled "Alist of patterns vs corresponding coding systems. Each element looks like (REGEXP . CODING-SYSTEM). A file whose first bytes match REGEXP is decoded by CODING-SYSTEM on reading.