From dddb4597e1ad9eed36ee9010ca81f55349a99643 Mon Sep 17 00:00:00 2001 From: Werner LEMBERG Date: Fri, 16 Nov 2007 08:03:45 +0000 Subject: [PATCH] * files.el (set-auto-mode-1): Check second line for -*- if file starts with '\" (which is used by man pages to identify needed troff preprocessors). --- lisp/ChangeLog | 6 ++++++ lisp/files.el | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0c34a9f6090..e8fbe7eec5c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2007-11-16 Werner Lemberg + + * files.el (set-auto-mode-1): Check second line for -*- if file + starts with '\" (which is used by man pages to identify needed + troff preprocessors). + 2007-11-16 Glenn Morris * mail/mail-extr.el (mail-extr-all-top-level-domains): Update domains. diff --git a/lisp/files.el b/lisp/files.el index a7dd79b8a88..d8c78a320ec 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2428,7 +2428,11 @@ Otherwise, return nil; point may be changed." ;; put them in the first line of ;; such a file without screwing up ;; the interpreter invocation. - (and (looking-at "^#!") 2)) t) + ;; The same holds for + ;; '\" + ;; in man pages (preprocessor + ;; magic for the `man' program). + (and (looking-at "^\\(#!\\|'\\\\\"\\)") 2)) t) (progn (skip-chars-forward " \t") (setq beg (point)) -- 2.39.2