Function: after-insert-file-set-coding

after-insert-file-set-coding is a byte-compiled function defined in mule.el.gz.

Signature

(after-insert-file-set-coding INSERTED &optional VISIT)

Documentation

Set buffer-file-coding-system of current buffer after text is inserted.

INSERTED is the number of characters that were inserted, as figured in the situation before this function. Return the number of characters inserted, as figured in the situation after. The two numbers can be different if the buffer has become unibyte. The optional second arg VISIT non-nil means that we are visiting a file.

Source Code

;; Defined in /usr/src/emacs/lisp/international/mule.el.gz
(defun after-insert-file-set-coding (inserted &optional visit)
  "Set `buffer-file-coding-system' of current buffer after text is inserted.
INSERTED is the number of characters that were inserted, as figured
in the situation before this function.  Return the number of characters
inserted, as figured in the situation after.  The two numbers can be
different if the buffer has become unibyte.
The optional second arg VISIT non-nil means that we are visiting a file."
  (if (and visit
	   coding-system-for-read
	   (not (eq coding-system-for-read 'auto-save-coding)))
      (setq buffer-file-coding-system-explicit
	    (cons coding-system-for-read nil)))
  (if last-coding-system-used
      (let ((coding-system
	     (find-new-buffer-file-coding-system last-coding-system-used)))
	(if coding-system
	    (setq buffer-file-coding-system coding-system))))
  inserted)