From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: slashdevslashnull@gmx.net Newsgroups: gmane.emacs.help Subject: Re: Suggestions? Better filetype sniffing -- XHTML vs. HTML Date: Fri, 27 May 2005 16:29:04 +0200 Message-ID: <87fyw891zj.fsf@matthi.local> References: <7i8yisfmqx.fsf@neoscale.com> <7iznb8e648.fsf@neoscale.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1117208808 26055 80.91.229.2 (27 May 2005 15:46:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 27 May 2005 15:46:48 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 27 17:46:46 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dbh1P-000398-AG for geh-help-gnu-emacs@m.gmane.org; Fri, 27 May 2005 17:45:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dbh5g-0005Tk-Mq for geh-help-gnu-emacs@m.gmane.org; Fri, 27 May 2005 11:49:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dbh1K-0003RX-Fs for help-gnu-emacs@gnu.org; Fri, 27 May 2005 11:45:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dbh1B-0003O6-QN for help-gnu-emacs@gnu.org; Fri, 27 May 2005 11:45:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dbh1A-0003LK-N2 for help-gnu-emacs@gnu.org; Fri, 27 May 2005 11:45:00 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Dbgsc-0008Oh-4c for help-gnu-emacs@gnu.org; Fri, 27 May 2005 11:36:10 -0400 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1DbgnF-0000kH-6I for help-gnu-emacs@gnu.org; Fri, 27 May 2005 17:30:37 +0200 Original-Received: from port-212-202-198-76.dynamic.qsc.de ([212.202.198.76]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 27 May 2005 17:30:37 +0200 Original-Received: from slashdevslashnull by port-212-202-198-76.dynamic.qsc.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 27 May 2005 17:30:37 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 37 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: port-212-202-198-76.dynamic.qsc.de User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:CkI26bj8WEEaEFlkzQK9bjKaad0= X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:27020 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:27020 "D. D. Brierton" writes: > On Tue, 24 Feb 2004 09:31:51 -0800, Kin Cho wrote: > >> Change 'xml-html-mode to (xml-html-mode). >> >> If you know C, 'xml-html-mode is like taking the address of a >> function. > > That did the trick. Thanks a lot! > > Best, Darren > > -- > ====================================================================== > D. D. Brierton darren@dzr-web.com www.dzr-web.com > Trying is the first step towards failure (Homer Simpson) > ====================================================================== It still doesnt work for me. The hook prevents MMM-Mode from being activated for html - files (non xhtml) for me. This may be due to splitting your Emacs WebDev (thank you for that) across multiple files or the MMM-Mode version i am using (0.4.8) or something else. I guess its because MMM-Mode reruns the sgml-html-mode hooks while activating which somehow fails for html files when point is not at the beginning of the buffer which seems to be the case. (defun guess-xhtml-hook () "Guess whether the current buffer is XHTML." (when (save-excursion (goto-char 1) (search-forward-regexp "<[?]xml\\|//W3C//DTD XHTML" 80 t)) (xml-html-mode))) works for me.