From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.devel Subject: Re: master 2399541: Remove font-lock toggle from font-lock-update Date: Mon, 29 Mar 2021 09:44:03 +0000 Message-ID: References: <20210324143048.23515.75257@vcs0.savannah.gnu.org> <20210324143050.40C6E20D10@vcs0.savannah.gnu.org> <8786a8e8fa731c1bd1ef@heytings.org> <87h7l0blrc.fsf@gnus.org> <87czvobksy.fsf@gnus.org> <87r1k4a1c0.fsf@gnus.org> <8786a8e8fa96815c66e3@heytings.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="5EwG55XBzB" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="869"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 29 11:45:44 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lQoSu-00007B-HQ for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Mar 2021 11:45:44 +0200 Original-Received: from localhost ([::1]:48432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQoSt-0008RM-HF for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Mar 2021 05:45:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQoRM-0006Jf-V0 for emacs-devel@gnu.org; Mon, 29 Mar 2021 05:44:08 -0400 Original-Received: from heytings.org ([95.142.160.155]:49644) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQoRK-0008Dv-NM for emacs-devel@gnu.org; Mon, 29 Mar 2021 05:44:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1617011043; bh=uiIu8oMaUIPJYqUmwbCtZ2t22r3T7eiQYXAlgivwDOg=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=hGvytycZ3hMAdDDTH5SjK1GtbkuI7f6jnfHWOxWA9KPLyTmUqSG3M+vwoMfpov8ID QR3dUQWVPA5sYl6MJrn9dAQnX5VPAwM6nCgApkdU74dQWaxBJHEoLxm9RD0MvGlaZL 8penw+WzWLmfKGz/aKlKIO4pSt6O18mph/zYZvshWUcs2CffPRHu6/Gig7UowfF4P9 EnW2IM0LoOgnkyrdoohxgekdEi56/Fivqm0IEUOxOd7g+MjVOboKzZwQEjN9zkQTZ9 /BzfYTD3LjQiPUMsK8OtK4O/vAz4lyLNX7t7XE6i8/fwt1yRXrZsgPgi6QAZzU/uYA MDWVfEnYLu0TQ== In-Reply-To: Content-ID: Received-SPF: pass client-ip=95.142.160.155; envelope-from=gregory@heytings.org; helo=heytings.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:267146 Archived-At: --5EwG55XBzB Content-Type: text/plain; charset=us-ascii; format=flowed Content-ID: Thanks for your detailed reply! > > Yes, there are three cases: - font-lock-mode is nil - font-lock-mode is > t but the font-lock machinery is not activated (e.g. in text-mode with > the default config). - font-lock fully activated. > With this indication and another mail you sent to Eli, I think I finally understand what you mean. One thing I'm not entirely sure is whether the second case is (and font-lock-mode (not font-lock-keywords)) or (and font-lock-mode (not font-lock-fontified)), but my guess is that font-lock-fontified is an internal variable and that it is safer to use font-lock-keywords here. >> +Otherwise, with prefix ARG, toggle Font Lock mode." > > Is this behavior useful? > I think it is, yes, and I think it makes sense to use the prefix argument for that. M-x font-lock-mode does not always produce the expected effect, which can be puzzling, so having a way to "do what I mean" in a command is useful. I attach the patch, updated with your suggestions. --5EwG55XBzB Content-Type: text/x-diff; name=0001-Improve-font-lock-update-and-rename-it-to-font-lock-.patch; charset=us-ascii Content-Transfer-Encoding: base64 Content-ID: Content-Description: Content-Disposition: attachment; filename=0001-Improve-font-lock-update-and-rename-it-to-font-lock-.patch RnJvbSA0OWQ3NThlNWE5MWYxOTYxNWZlMWU3ODU4YjAxM2M4OGQ5NWRhMGE0 IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogR3JlZ29yeSBIZXl0 aW5ncyA8Z3JlZ29yeUBoZXl0aW5ncy5vcmc+DQpEYXRlOiBNb24sIDI5IE1h ciAyMDIxIDA5OjMxOjE1ICswMDAwDQpTdWJqZWN0OiBbUEFUQ0hdIEltcHJv dmUgZm9udC1sb2NrLXVwZGF0ZSBhbmQgcmVuYW1lIGl0IHRvIGZvbnQtbG9j ay1kd2ltDQoNCiogbGlzcC9mb250LWxvY2suZWwgKGZvbnQtbG9jay1kd2lt KTogUmVuYW1lZCBmcm9tICdmb250LWxvY2stdXBkYXRlJy4NCk9ubHkgcmVm b250aWZ5IHRoZSByZWdpb24gd2hlbiBpdCBpcyBhY3RpdmUsIGFuZCBhY3Qg bW9yZSBjYXV0aW91c2x5Lg0KDQoqIGxpc3QvZm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uDQorUmVmb250aWZ5IHRoZSByZWdpb24gaWYgaXQgaXMg YWN0aXZlLCBvciB0aGUgYWNjZXNzaWJsZSBwb3J0aW9uIG9mIHRoZQ0KK2J1 ZmZlci4gIE90aGVyd2lzZSwgd2l0aCBwcmVmaXggQVJHLCB0b2dnbGUgRm9u dCBMb2NrIG1vZGUuIg0KICAgKGludGVyYWN0aXZlICJQIikNCiAgIChzYXZl LWV4Y3Vyc2lvbg0KLSAgICAoaWYgKGFuZCAobm90IGFyZykgZm9udC1sb2Nr LW1vZGUpDQotICAgICAgICAoZm9udC1sb2NrLWZvbnRpZnktcmVnaW9uIChw b2ludC1taW4pIChwb2ludC1tYXgpKQ0KLSAgICAgIChmb250LWxvY2stdW5m b250aWZ5LXJlZ2lvbiAocG9pbnQtbWluKSAocG9pbnQtbWF4KSkNCisgICAg KGlmIChub3QgYXJnKQ0KKyAgICAgICAgKGlmICh1c2UtcmVnaW9uLXApDQor ICAgICAgICAgICAgKGZvbnQtbG9jay11cGRhdGUtcmVnaW9uIChyZWdpb24t YmVnaW5uaW5nKSAocmVnaW9uLWVuZCkpDQorICAgICAgICAgIChmb250LWxv Y2stdXBkYXRlLXJlZ2lvbikpDQorICAgICAgKGZvbnQtbG9jay11cGRhdGUt cmVnaW9uKQ0KICAgICAgIChmb250LWxvY2stbW9kZSAndG9nZ2xlKSkpKQ0K IA0KIChkZWZ1biBmb250LWxvY2stZGVmYXVsdC1mb250aWZ5LWJ1ZmZlciAo KQ0KLS0gDQoyLjMwLjINCg0K --5EwG55XBzB--