From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: 23.0.60; M-x compile gives args out of range 0, 0 Date: Tue, 8 Apr 2008 19:21:47 +0000 Message-ID: <20080408192147.GB3399@muc.de> References: <47FB4E7D.3020504@swipnet.se> <20080408172227.GA3399@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1207681559 17659 80.91.229.12 (8 Apr 2008 19:05:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Apr 2008 19:05:59 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, Jan DjFFFFFFFFFFFFFFrv To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 08 21:06:31 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JjJ8z-0004WK-AF for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2008 21:06:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JjJ8L-0004X4-T3 for ged-emacs-devel@m.gmane.org; Tue, 08 Apr 2008 15:05:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JjJ8H-0004Tb-5y for emacs-devel@gnu.org; Tue, 08 Apr 2008 15:05:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JjJ8F-0004R1-PI for emacs-devel@gnu.org; Tue, 08 Apr 2008 15:05:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JjJ8F-0004Qi-ER for emacs-devel@gnu.org; Tue, 08 Apr 2008 15:05:23 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JjJ8F-0007ff-1n for emacs-devel@gnu.org; Tue, 08 Apr 2008 15:05:23 -0400 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JjJ8E-0007Wv-Rs for emacs-pretest-bug@gnu.org; Tue, 08 Apr 2008 15:05:22 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JjJ8B-0007f2-P7 for emacs-pretest-bug@gnu.org; Tue, 08 Apr 2008 15:05:22 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JjJ89-0007e0-QQ for emacs-pretest-bug@gnu.org; Tue, 08 Apr 2008 15:05:19 -0400 Original-Received: (qmail 16155 invoked by uid 3782); 8 Apr 2008 19:05:14 -0000 Original-Received: from acm.muc.de (p57AF571D.dip.t-dialin.net [87.175.87.29]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 08 Apr 2008 21:05:12 +0200 Original-Received: (qmail 5158 invoked by uid 1000); 8 Apr 2008 19:21:47 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:94731 gmane.emacs.pretest.bugs:21946 Archived-At: Hi, Stefan! On Tue, Apr 08, 2008 at 02:05:07PM -0400, Stefan Monnier wrote: > >> > When doing M-x compile I get: > >> > font-lock-extend-region-multiline: Args out of range: 0, 0 > >> Does the patch below make it disappear, by any chance? > >> Stefan > >> === modified file 'lisp/progmodes/cc-mode.el' > >> --- lisp/progmodes/cc-mode.el 2008-04-07 16:37:22 +0000 > >> +++ lisp/progmodes/cc-mode.el 2008-04-08 15:01:47 +0000 > > With respect, that's the wrong place to patch. It is liable to catch > > out anybody else who uses > > font-lock-extend-after-change-region-function in the future. This > > variable should be made buffer-local once and for all, like this: > I disagree. A major mode should basically *never* change globally > a defvar, except maybe for its own vars (plus a few exceptions, of > course). Well, that's a bit philosophical. In practice, major mode maintainers _will_ be setting such variables without explicitly localising them, causing just that little bit extra in debugging, stress, curse words, and so on. There's a category of variables which are _essentially_ buffer local, and nobody ever explicitly localises them first - things like major-mode, mark-ring, foo-minor-mode, buffer-undo-list, ..... fl-e-ac-rf is in this category. There are several other variables in font-lock.el which are explicity buffer-localised, amongst them the similar variable font-lock-extend-region-functions. So it would promote consistency if we did the same with fl-extend-ac-region-function. [ .... ] > I'm not opposed to make-variable-buffer-local, but the bug was clearly > in CC-mode, because a major mode should by default use > (set (make-local-variable ...) ...) rather than setq. I don't think it's clear at all. The same "bug", if such it be, exists in font-lock.el itself, L1452: (setq font-lock-syntactically-fontified end)) > BTW, why doesn't CC-mode set those vars via font-lock-defaults, as the > author of font-lock intended? For portability's sake. font-lock-defaults in XEmacs has a different format. In particular, it lacks the "other-vars" bit at the end. It's less hassle just not to use it. > Stefan -- Alan Mackenzie (Nuremberg, Germany).