From: Kenichi Handa <handa@m17n.org>
Cc: juri@jurta.org, walters@gnu.org, emacs-devel@gnu.org
Subject: Re: [juri@jurta.org: Why 10 lines?]
Date: Fri, 02 Jun 2006 12:54:27 +0900 [thread overview]
Message-ID: <E1Fm0jz-0004BJ-00@etlken> (raw)
In-Reply-To: <E1Fm05r-0002bd-6s@fencepost.gnu.org> (message from Richard Stallman on Thu, 01 Jun 2006 23:12:59 -0400)
In article <E1Fm05r-0002bd-6s@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> writes:
> Please DTRT.
Ok.
> ------- Start of forwarded message -------
> From: Juri Linkov <juri@jurta.org>
> To: emacs-devel@gnu.org
> 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
handa@m17n.org
> 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
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel
> ------- End of forwarded message -------
next parent reply other threads:[~2006-06-02 3:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1Fm05r-0002bd-6s@fencepost.gnu.org>
2006-06-02 3:54 ` Kenichi Handa [this message]
2006-06-02 9:28 ` [juri@jurta.org: Why 10 lines?] Juri Linkov
2006-06-02 11:19 ` Kenichi Handa
2006-06-02 22:21 ` Kevin Rodgers
2006-06-03 6:43 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1Fm0jz-0004BJ-00@etlken \
--to=handa@m17n.org \
--cc=emacs-devel@gnu.org \
--cc=juri@jurta.org \
--cc=walters@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).