emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: files.el


From: Daniel Pfeiffer
Subject: Re: files.el
Date: Thu, 28 Oct 2004 21:29:16 +0200

Saluton,

Juri Linkov <address@hidden> skribis:

> How about adding a new user option for magic-string-regexp -> mode mapping.

I had considered this, but didn't want to invest so much time.  It's also more
complicated in the xml case, because xml-mode is only the default for those,
unless a more specialized mode comes from the finame.

> The elements of such list could look, for example:
> 
>   ("^<\\?xml " . xml-mode)
>   ("^<!DOCTYPE" . xml-mode)
>   ("^.\\{,80\\}<html" . html-mode) ;; to look for <html within first 80
>   chars

Things like echo "<html>..."?  You'd have to make sure that all preceding
non-whitespace is contained in matching <...>, nested for comments.  Besides
80 is far too short, even without a comment, and watch out for case:

<?xml version="1.0" encoding="ISO-8859-15"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html>

Since html is currently the only candidate, maybe this could replace my file
name checking.  Be sure to put the special cases first in the alist.  I'm done
with my changes, so give it a shot!

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- 
lerne / learn / apprends / lär dig / ucz się    Esperanto:
                              http://lernu.net/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]