From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "D. D. Brierton" Newsgroups: gmane.emacs.help Subject: Re: Suggestions? Better filetype sniffing -- XHTML vs. HTML Date: Tue, 24 Feb 2004 17:16:50 +0000 Organization: DZR Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <7i8yisfmqx.fsf@neoscale.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1077644067 16569 80.91.224.253 (24 Feb 2004 17:34:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 Feb 2004 17:34:27 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 24 18:34:17 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AvgRk-0005lr-01 for ; Tue, 24 Feb 2004 18:34:17 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1AvgQn-0008Hy-FY for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Feb 2004 12:33:17 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!diablo.theplanet.net!zen.net.uk!demorgan.zen.co.uk!landlord!stones.force9.net.POSTED!not-for-mail User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Original-Newsgroups: gnu.emacs.help Original-Lines: 37 Original-NNTP-Posting-Host: 212.159.101.92 Original-X-Complaints-To: abuse@plus.net.uk Original-X-Trace: stones.force9.net 1077642909 212.159.101.92 (Tue, 24 Feb 2004 17:15:09 GMT) Original-NNTP-Posting-Date: Tue, 24 Feb 2004 17:15:09 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:121201 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:17154 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:17154 On Tue, 24 Feb 2004 08:47:18 -0800, Kin Cho wrote: > (add-hook 'find-file-hooks 'my-find-file-hooks t) > > (defun my-find-file-hooks () > (when (save-excursion (search-forward-regexp "\?xml\\|XHTML" 80 t)) > ;; do whatever you need to do > )) Thanks for this suggestion, Kin. Following on from your suggestion, I guess that rather than adding a hook to find-file-hooks, I guess I could add it to 'sgml-html-mode-hook instead, so .php or .html files etc initially open in sgml-html-mode, but then if a