From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: [juri@jurta.org: Why 10 lines?] Date: Fri, 02 Jun 2006 12:54:27 +0900 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1149220496 2253 80.91.229.2 (2 Jun 2006 03:54:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 2 Jun 2006 03:54:56 +0000 (UTC) Cc: juri@jurta.org, walters@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 02 05:54:53 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fm0kO-0000UW-Hf for ged-emacs-devel@m.gmane.org; Fri, 02 Jun 2006 05:54:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fm0kO-0001nB-66 for ged-emacs-devel@m.gmane.org; Thu, 01 Jun 2006 23:54:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fm0kB-0001n5-TJ for emacs-devel@gnu.org; Thu, 01 Jun 2006 23:54:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fm0k9-0001mt-6q for emacs-devel@gnu.org; Thu, 01 Jun 2006 23:54:38 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fm0k9-0001mq-2b for emacs-devel@gnu.org; Thu, 01 Jun 2006 23:54:37 -0400 Original-Received: from [150.29.246.133] (helo=mx1.aist.go.jp) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fm0qT-0007iS-UX; Fri, 02 Jun 2006 00:01:10 -0400 Original-Received: from smtp3.aist.go.jp ([150.29.246.12]) by mx1.aist.go.jp with ESMTP id k523sUKX004663; Fri, 2 Jun 2006 12:54:30 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp3.aist.go.jp with ESMTP id k523sTL5026184; Fri, 2 Jun 2006 12:54:29 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 3.36 #1 (Debian)) id 1Fm0jz-0004BJ-00; Fri, 02 Jun 2006 12:54:27 +0900 Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Thu, 01 Jun 2006 23:12:59 -0400) 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) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:55597 Archived-At: In article , Richard Stallman writes: > Please DTRT. Ok. > ------- Start of forwarded message ------- > From: Juri Linkov > 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 ). 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 " (re-search-forward " - --- 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 "" size t) > ! ;; In case of no header, search only 10 lines > ! (forward-line 10)) > (point)))) > (when (and (search-forward " (re-search-forward " - -- > 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 -------