system and SOURCE is a symbol `auto-coding-alist',
`auto-coding-regexp-alist', `coding:', or `auto-coding-functions'
indicating by what CODING is specified. Note that the validity
-of CODING is not checked; it's callers responsibility to check it.
+of CODING is not checked; it's the caller's responsibility to check it.
If nothing is specified, the return value is nil."
(or (let ((coding-system (auto-coding-alist-lookup filename)))
;; is just "\r" and we can't use "^" nor "$" in regexp.
(when (and tail-found (or (not coding-system) (not char-trans)))
(goto-char tail-start)
- (re-search-forward "[\r\n]\^L" nil t)
+ (re-search-forward "[\r\n]\^L" tail-end t)
(if (re-search-forward
"[\r\n]\\([^[\r\n]*\\)[ \t]*Local Variables:[ \t]*\\([^\r\n]*\\)[\r\n]"
tail-end t)