From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#37137: Setting font-lock-case-fold-search to t causes hangs on certain types in c-mode Date: Mon, 2 Sep 2019 19:26:26 +0000 Message-ID: <20190902192626.GA4133@ACM> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="46488"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 37137@debbugs.gnu.org To: Stefan Monnier , Zachary Napier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 02 21:27:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i4ryp-000BxU-V7 for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Sep 2019 21:27:12 +0200 Original-Received: from localhost ([::1]:39430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4ryo-0003D2-UG for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Sep 2019 15:27:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50187) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4ryi-0003Cv-Rm for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2019 15:27:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4ryh-0002ic-T7 for bug-gnu-emacs@gnu.org; Mon, 02 Sep 2019 15:27:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50173) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4ryf-0002hB-VT; Mon, 02 Sep 2019 15:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i4ryf-0000Rb-O8; Mon, 02 Sep 2019 15:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 02 Sep 2019 19:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37137 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 37137-submit@debbugs.gnu.org id=B37137.15674523941665 (code B ref 37137); Mon, 02 Sep 2019 19:27:01 +0000 Original-Received: (at 37137) by debbugs.gnu.org; 2 Sep 2019 19:26:34 +0000 Original-Received: from localhost ([127.0.0.1]:58994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i4ryE-0000Ql-IY for submit@debbugs.gnu.org; Mon, 02 Sep 2019 15:26:34 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:37123 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1i4ryA-0000Qb-MS for 37137@debbugs.gnu.org; Mon, 02 Sep 2019 15:26:31 -0400 Original-Received: (qmail 74555 invoked by uid 3782); 2 Sep 2019 18:33:35 -0000 Original-Received: from acm.muc.de (p4FE15DD5.dip0.t-ipconnect.de [79.225.93.213]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 02 Sep 2019 20:33:34 +0200 Original-Received: (qmail 4651 invoked by uid 1000); 2 Sep 2019 19:26:26 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:166163 Archived-At: Hello, Stefan and Zachary. On Mon, Sep 02, 2019 at 08:50:12 -0400, Stefan Monnier wrote: > > I inherited this .emacs file from someone else who had this > > set. I'm guessing it used to be customizable? > AFAICT it's never been custom-izable, and it really would be weird for > it to be. I think it's more likely that this custom-set-variables was > hand-edited. That variable couldn't possibly have been customisable. It's default value being other than nil breaks font locking, in that it spikes its active binding to t, regardless of the value supplied in (nth 2 font-lock-defaults). > > I can just change the regexps I am using in > > font-lock-add-keywords. > That's a much safer approach. You can also do > (add-hook '-mode-hook > (lambda () > (setq-local font-lock-case-fold-search t))) > for the specific mode where you need it: it may break the font-locking > of that mode, but if it does, at least the breakage will be limited to > that mode. No. font-lock-keywords-case-fold-search is purely a font-lock internal variable. Any buffer local value of it created outside of font-lock gets ignored. Setting its default value to anything other than nil will break font-locking, as described above. There is neither need nor sense in setting font-lock-keywords-case-fold-search. Instead, set element 2 of font-lock-defaults to the desired setting. > Stefan -- Alan Mackenzie (Nuremberg, Germany).