Commit 35ce8cd7 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(set-auto-coding): Recognize coding: in first

line even if not the first variable.
parent d062cf33
......@@ -645,10 +645,10 @@ function by default."
(or limit
(setq limit len)))
(setq limit len))
(when (and (string-match "-\\*-[ \t]*coding:[ \t]*\\([^ ;]+\\)" string)
(< (match-beginning 1) limit))
(when (and (string-match "-\\*-\\(.*;\\)?[ \t]*coding:[ \t]*\\([^ ;]+\\)" string)
(< (match-beginning 2) limit))
(setq coding-system
(intern (substring string (match-beginning 1) (match-end 1))))
(intern (substring string (match-beginning 2) (match-end 2))))
(if (not (coding-system-p coding-system))
(setq coding-system nil)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment