# HG changeset patch # User Richard M. Stallman # Date 1008115929 0 # Node ID 903480208cfd2ea615ae70135ef4c2d3950180a5 # Parent faa66f17e91f7dc3ab4a2cfdf1ecc1d838fe515d (set-auto-coding): Use set-auto-mode-1. diff -r faa66f17e91f -r 903480208cfd lisp/international/mule.el --- a/lisp/international/mule.el Wed Dec 12 00:10:17 2001 +0000 +++ b/lisp/international/mule.el Wed Dec 12 00:12:09 2001 +0000 @@ -1386,26 +1386,18 @@ ;; At first check the head. (when head-found (goto-char head-start) - (setq pos (re-search-forward "[\n\r]" head-end t)) - (if (and pos - (= (char-after head-start) ?#) - (= (char-after (1+ head-start)) ?!)) - ;; If the file begins with "#!" (exec interpreter magic), - ;; look for coding frobs in the first two lines. You cannot - ;; necessarily put them in the first line of such a file - ;; without screwing up the interpreter invocation. - (setq pos (search-forward "\n" head-end t))) - (if pos (setq head-end pos)) + (setq head-end (set-auto-mode-1)) + (setq head-start (point)) (when (< head-found head-end) (goto-char head-start) (when (and set-auto-coding-for-load (re-search-forward - "-\\*-\\(.*;\\)?[ \t]*unibyte:[ \t]*\\([^ ;]+\\)" + "\\(.*;\\)?[ \t]*unibyte:[ \t]*\\([^ ;]+\\)" head-end t)) (setq coding-system 'raw-text)) (when (and (not coding-system) (re-search-forward - "-\\*-\\(.*;\\)?[ \t]*coding:[ \t]*\\([^ ;]+\\)" + "\\(.*;\\)?[ \t]*coding:[ \t]*\\([^ ;]+\\)" head-end t)) (setq coding-system (intern (match-string 2))) (or (coding-system-p coding-system)