changeset 23717:ad0e76fa89be

(after-insert-file-set-buffer-file-coding-system): If the buffer is changed to unibyte, return inserted bytes.
author Kenichi Handa <handa@m17n.org>
date Mon, 16 Nov 1998 01:17:06 +0000
parents d30ffa793626
children bdbaad08e6a2
files lisp/international/mule.el
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule.el	Mon Nov 16 01:17:06 1998 +0000
+++ b/lisp/international/mule.el	Mon Nov 16 01:17:06 1998 +0000
@@ -953,15 +953,18 @@
 	    (modified-p (buffer-modified-p)))
 	(when coding-system
 	  (set-buffer-file-coding-system coding-system)
-	  (if (and (or (eq coding-system 'no-conversion)
+	  (if (and enable-multibyte-characters
+		   (or (eq coding-system 'no-conversion)
 		       (eq (coding-system-type coding-system) 5))
 		   ;; If buffer was unmodified, we must be visiting it.
 		   (not modified-p))
 	      ;; For coding systems no-conversion and raw-text...,
 	      ;; edit the buffer as unibyte.
-	      (set-buffer-multibyte nil))
+	      (let ((pos-byte (position-bytes (+ (point) inserted))))
+		(set-buffer-multibyte nil)
+		(setq inserted (- pos-byte (position-bytes (point))))))
 	  (set-buffer-modified-p modified-p))))
-  nil)
+  inserted)
 
 (add-hook 'after-insert-file-functions
 	  'after-insert-file-set-buffer-file-coding-system)