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: font-lock-fontify-block Date: Thu, 11 Mar 2021 21:57:18 +0000 Message-ID: <30f0a4188eb516fc37ed@heytings.org> References: <87a6sbg41o.fsf@gnus.org> <87lfatirk1.fsf@gnus.org> <83blbpmy2x.fsf@gnu.org> <837dmdmw60.fsf@gnu.org> <831rclmoy0.fsf@gnu.org> <83zgz9l9xw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32375"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 11 22:58:23 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 1lKTK2-0008Kn-Iw for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Mar 2021 22:58:22 +0100 Original-Received: from localhost ([::1]:57490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKTK1-0005Z8-LX for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Mar 2021 16:58:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKTJ5-0004uO-FQ for emacs-devel@gnu.org; Thu, 11 Mar 2021 16:57:23 -0500 Original-Received: from heytings.org ([95.142.160.155]:55960) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKTJ3-0002WJ-Ni; Thu, 11 Mar 2021 16:57:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1615499839; bh=sNo7JpizYP7rSOkNCJ6G54xjd2xDpAqHP5wV7+Vl8no=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=f5Y8Art8C+dHdz6vHJtNI2bhHkjHRjPK2QaGrEJz09Y3UyZm0YUFz3U/fz5dzAN30 juC8dwMxym9DyaMh5/8emnHHdAh2MHeBiRcu9NFijwgBGIZKh62YnL4icnDWXz6AZL m/lBQI8b85gkT5DN1QlDpEoS4RTmqRiMDW+kIeaK84vwkg3A7NITgrWTUWaV8KkFqn W93gzQ9RX1Zd2JfltvnCg8XXsfajnRp+fDjRtzY3+ZDKCJxB/1BokCuz8+/nvs0R8F 9SXiQhWJSrRU/w/eL2vOid7WFUw63N80k4e/lBm7BKXmaNbJjq2vUXRWzQ3JDEiF9N 9P3X/dlIl6DJw== In-Reply-To: <83zgz9l9xw.fsf@gnu.org> 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:266366 Archived-At: >>> Would you be OK with the idea of deprecating the use of >>> `font-lock-fontify-block' for the specific case where font-lock is not >>> enabled? >> >> I only ever use it in that case to _remove_ the faces from text yanked >> from a fontified buffer. So that's another important use case for M-o >> M-o. > > Actually, I see I've misremembered: this is handy not when > font-lock-mode is off, but when it's on and I yank text from another > mode. A typical use case is when I yank from some program fragment into > a text-mode buffer: the original fontification is left alone until I > type M-o M-o. > I have four remarks: 1. I was surprised to read this, it's something I never see. It turns out that I don't see this because I have in my .emacs: (global-whitespace-mode 1) (setq whitespace-style '(face trailing empty)) 2. That being said, font-lock-fontify-block is not a good solution to that problem, it doesn't work when the yanked text is larger than 16 lines, except of course with a prefix argument. 3. font-lock-flush would not solve that problem, it has no apparent effect in the case you mention. 4. Is this not something that could/should be done inside yank, with (if font-lock-mode (font-lock-fontify-region (point-min) (point-max)))?