emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: Why 10 lines?]


From: Kenichi Handa
Subject: Re: address@hidden: Why 10 lines?]
Date: Fri, 02 Jun 2006 12:54:27 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

In article <address@hidden>, Richard Stallman <address@hidden> writes:

> Please DTRT.

Ok.

> ------- Start of forwarded message -------
> From: Juri Linkov <address@hidden>
> To: address@hidden
> Subject: Why 10 lines?
[...]
> sgml-html-meta-auto-coding-function has the hard-coded limit of 10 lines
> to search for the HTML meta tag.  But HTML files can have the HTML meta tag
> outside the 10-line limit.  For example, HTML files generated by livejournal
> contain this tag on 11-th line, and Emacs fails to recognize the coding
> of such HTML files.

> I propose to limit the search for the HTML meta tag by the end of the
> existing HTML header (by looking for </head>).  The limit of 10 lines
> (or perhaps any slightly increased number) could be still applied only
> for the case if there are no HTML header.

I think the change is good and has no problem.  So, I
installed it.

---
Kenichi Handa
address@hidden


> Index: lisp/international/mule.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/international/mule.el,v
> retrieving revision 1.236
> diff -c -r1.236 mule.el
> *** lisp/international/mule.el        24 May 2006 13:22:12 -0000      1.236
> - --- lisp/international/mule.el      1 Jun 2006 00:55:47 -0000
> ***************
> *** 2253,2261 ****
>     "If the buffer has an HTML meta tag, use it to determine encoding.
>   This function is intended to be added to `auto-coding-functions'."
>     (setq size (min (+ (point) size)
> - -             ;; Only search forward 10 lines
>                 (save-excursion
> !                 (forward-line 10)
>                   (point))))
>     (when (and (search-forward "<html" size t)
>            (re-search-forward 
> "<meta\\s-+http-equiv=\"content-type\"\\s-+content=\"text/\\sw+;\\s-*charset=\\(.+?\\)\""
>  size t))
> - --- 2257,2267 ----
>     "If the buffer has an HTML meta tag, use it to determine encoding.
>   This function is intended to be added to `auto-coding-functions'."
>     (setq size (min (+ (point) size)
>                 (save-excursion
> !                 ;; Limit the search by the end of the HTML header
> !                 (or (search-forward "</head>" size t)
> !                     ;; In case of no header, search only 10 lines
> !                     (forward-line 10))
>                   (point))))
>     (when (and (search-forward "<html" size t)
>            (re-search-forward 
> "<meta\\s-+http-equiv=\"content-type\"\\s-+content=\"text/\\sw+;\\s-*charset=\\(.+?\\)\""
>  size t))

> - -- 
> Juri Linkov
> http://www.jurta.org/emacs/



> _______________________________________________
> Emacs-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-devel
> ------- End of forwarded message -------





reply via email to

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