From unknown Sun Aug 10 16:50:55 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#13817 <13817@debbugs.gnu.org> To: bug#13817 <13817@debbugs.gnu.org> Subject: Status: 24.3.50; Disabling whitespace-mode that was enabled in sgml-mode-hook breaks font-lock Reply-To: bug#13817 <13817@debbugs.gnu.org> Date: Sun, 10 Aug 2025 23:50:55 +0000 retitle 13817 24.3.50; Disabling whitespace-mode that was enabled in sgml-m= ode-hook breaks font-lock reassign 13817 emacs submitter 13817 Dmitry Gutov severity 13817 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 26 01:31:59 2013 Received: (at submit) by debbugs.gnu.org; 26 Feb 2013 06:31:59 +0000 Received: from localhost ([127.0.0.1]:50353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAE51-0000lw-3i for submit@debbugs.gnu.org; Tue, 26 Feb 2013 01:31:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54736) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAE4t-0000li-UA for submit@debbugs.gnu.org; Tue, 26 Feb 2013 01:31:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAE2z-00032M-LW for submit@debbugs.gnu.org; Tue, 26 Feb 2013 01:30:08 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:49052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAE2z-00032E-6T for submit@debbugs.gnu.org; Tue, 26 Feb 2013 01:29:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAE2i-0001vE-Hc for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2013 01:29:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAE2T-0002rf-QA for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2013 01:29:36 -0500 Received: from mail-la0-x22f.google.com ([2a00:1450:4010:c03::22f]:34700) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAE2T-0002rK-Gd for bug-gnu-emacs@gnu.org; Tue, 26 Feb 2013 01:29:21 -0500 Received: by mail-la0-f47.google.com with SMTP id fj20so3471353lab.20 for ; Mon, 25 Feb 2013 22:29:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:subject:date:message-id:mime-version :content-type; bh=wZVlmaVoer11YHW1j43fInpDKRjlDJaKtv3F1vS6Tkg=; b=s6Lgi4Pu5gO4B0gpypmiQfC/HA1V8FLUNGjr1J4c4KRJNlVglUs+niug9S8K9uQMdN pZOgQ68QgtO9Hscfd75FhYFg1TDRKDDrWXX/3vyvcb4FjJvEhAKwskFHDPGPslV/obav N8FnmVD8f1zw4/fhi9RguxXHQ1KSalrKQSbrE3XLo42jTWoVPQS+FQ4rYG3OsrqNZ94A Cw0h1l16GGK6NATwpK8YHxljAgndSS1gh26tVaeI8GqsBA3Ri5XfufbfmuRHyW5lijJa TdI4DbCmtK1KUAeLEmYCBxyzuZdhsZ6pxCxJR9V0q8/H0kfJqUf6DopMJndTLTlApSOW WaoA== X-Received: by 10.152.144.138 with SMTP id sm10mr12325327lab.53.1361860160108; Mon, 25 Feb 2013 22:29:20 -0800 (PST) Received: from vbx ([178.252.98.87]) by mx.google.com with ESMTPS id mq7sm8246633lab.1.2013.02.25.22.29.18 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 25 Feb 2013 22:29:19 -0800 (PST) From: Dmitry Gutov To: bug-gnu-emacs@gnu.org Subject: 24.3.50; Disabling whitespace-mode that was enabled in sgml-mode-hook breaks font-lock Date: Tue, 26 Feb 2013 10:29:13 +0400 Message-ID: <87ppznbnba.fsf@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Revno 111881 fixed the obvious problem with whitespace-mode, here's a less obvious one. This seems to be localized to sgml-mode and its derivatives so far: js-mode, ruby-mode, etc are not affected. 1. (add-hook 'sgml-mode-hook 'whitespace-mode) 2. Open a file in sgml-mode or html-mode, or create a buffer and turn either mode manually. whitespace-mode will be enabled. 3. M-x whitespace-mode => it's disabled, font-lock is gone, the value of font-lock-keywords is (t nil). On the surface, the reason for this is that when whitespace-mode is being turned on in the hook, font-lock-keywords is still nil, and so nil is saved in whitespace-font-lock-keywords. In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.6.0) of 2013-02-26 on vbx Bzr revision: 111882 eggert@cs.ucla.edu-20130226030908-c65ivknn1bm5hjru Windowing system distributor `The X.Org Foundation', version 11.0.11300000 System Description: Ubuntu 12.10 From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 17 18:31:47 2013 Received: (at 13817) by debbugs.gnu.org; 17 Mar 2013 22:31:47 +0000 Received: from localhost ([127.0.0.1]:60395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHM7F-0005od-RV for submit@debbugs.gnu.org; Sun, 17 Mar 2013 18:31:46 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:63109) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHM7D-0005oO-Av for 13817@debbugs.gnu.org; Sun, 17 Mar 2013 18:31:43 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFFpYZL/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJgcLFBgNJIgeBsEtkQoDpHqBXoMT X-IPAS-Result: Av8EABK/CFFFpYZL/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJgcLFBgNJIgeBsEtkQoDpHqBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="5114618" Received: from 69-165-134-75.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.165.134.75]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 17 Mar 2013 18:30:05 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 4B743AE1BB; Sun, 17 Mar 2013 18:30:07 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#13817: 24.3.50; Disabling whitespace-mode that was enabled in sgml-mode-hook breaks font-lock Message-ID: References: <87ppznbnba.fsf@yandex.ru> Date: Sun, 17 Mar 2013 18:30:07 -0400 In-Reply-To: <87ppznbnba.fsf@yandex.ru> (Dmitry Gutov's message of "Tue, 26 Feb 2013 10:29:13 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 13817 Cc: 13817@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > On the surface, the reason for this is that when whitespace-mode is being > turned on in the hook, font-lock-keywords is still nil, and so nil is > saved in whitespace-font-lock-keywords. whitespace.el should probably use font-lock-remove-keywords instead. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 19 01:10:41 2013 Received: (at 13817-done) by debbugs.gnu.org; 19 Mar 2013 05:10:42 +0000 Received: from localhost ([127.0.0.1]:34616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHoor-0002i6-65 for submit@debbugs.gnu.org; Tue, 19 Mar 2013 01:10:41 -0400 Received: from mail-la0-f52.google.com ([209.85.215.52]:44665) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHooo-0002hw-MO for 13817-done@debbugs.gnu.org; Tue, 19 Mar 2013 01:10:40 -0400 Received: by mail-la0-f52.google.com with SMTP id fs12so136770lab.11 for <13817-done@debbugs.gnu.org>; Mon, 18 Mar 2013 22:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding:x-antivirus:x-antivirus-status; bh=JXF2Mrqu0JZeogjTafylgLjrJhYbDdmNCysbybKHrK8=; b=WiiUv1BhMjubP8tC3yPagoF7s3JSfFNDaKS9vLrgflLqXYdxFM2S+JhQvqffjVm0TG uaE/g9ikIHluW4uaBS0sjfApI0M83aVufZBa/MRwTzLhmlmB4OizOa75fv5P4gEAJKcu A7rViw6kUMpYw9OhplN5EjdCzYn+jZWhLH2NAZM459Va66T4UhvDEwCjYEKs26ua+Vm7 FXgk5WLoZD/yklnSS94PhVMxBn8NluMRx6L9AAieZ7nQ2rxs9AFkEMOaxHPSWwT3+tCd yLGMqP4ckUWqdDLcdBUbG5ap2sszA2q5AKNHs2NwHpnR1MnbkFVN5Usuk0pEeI3zxkfg Mh+A== X-Received: by 10.152.45.140 with SMTP id n12mr557549lam.36.1363669739943; Mon, 18 Mar 2013 22:08:59 -0700 (PDT) Received: from [127.0.0.1] ([178.252.98.87]) by mx.google.com with ESMTPS id fq10sm6215376lbb.14.2013.03.18.22.08.58 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Mar 2013 22:08:58 -0700 (PDT) Message-ID: <5147F2EC.4060102@yandex.ru> Date: Tue, 19 Mar 2013 09:09:00 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#13817: 24.3.50; Disabling whitespace-mode that was enabled in sgml-mode-hook breaks font-lock References: <87ppznbnba.fsf@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 130318-0, 18.03.2013), Outbound message X-Antivirus-Status: Clean X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 13817-done Cc: 13817-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Version: 24.4 On 18.03.2013 2:30, Stefan Monnier wrote: >> On the surface, the reason for this is that when whitespace-mode is being >> turned on in the hook, font-lock-keywords is still nil, and so nil is >> saved in whitespace-font-lock-keywords. > > whitespace.el should probably use font-lock-remove-keywords instead. That helped, thank you. I left the disabling/enabling of font-lock-mode there, because otherwise the changes in highlighting are not visible until the buffer is modified. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 19 09:04:36 2013 Received: (at 13817-done) by debbugs.gnu.org; 19 Mar 2013 13:04:36 +0000 Received: from localhost ([127.0.0.1]:35183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHwDU-0004EB-GP for submit@debbugs.gnu.org; Tue, 19 Mar 2013 09:04:36 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:4611) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHwDT-0004E3-6G for 13817-done@debbugs.gnu.org; Tue, 19 Mar 2013 09:04:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFFxKvA/2dsb2JhbABEuzWDWRdzgh4BAQQBViMQCw4mBwsUGA0kiB4GsR+QDpEKA6R6gV6DEw X-IPAS-Result: Av8EABK/CFFFxKvA/2dsb2JhbABEuzWDWRdzgh4BAQQBViMQCw4mBwsUGA0kiB4GsR+QDpEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="5251361" Received: from 69-196-171-192.dsl.teksavvy.com (HELO pastel.home) ([69.196.171.192]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 19 Mar 2013 09:02:47 -0400 Received: by pastel.home (Postfix, from userid 20848) id BC01A632AA; Tue, 19 Mar 2013 09:02:34 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#13817: 24.3.50; Disabling whitespace-mode that was enabled in sgml-mode-hook breaks font-lock Message-ID: References: <87ppznbnba.fsf@yandex.ru> <5147F2EC.4060102@yandex.ru> Date: Tue, 19 Mar 2013 09:02:34 -0400 In-Reply-To: <5147F2EC.4060102@yandex.ru> (Dmitry Gutov's message of "Tue, 19 Mar 2013 09:09:00 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 13817-done Cc: 13817-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >>> On the surface, the reason for this is that when whitespace-mode is being >>> turned on in the hook, font-lock-keywords is still nil, and so nil is >>> saved in whitespace-font-lock-keywords. >> whitespace.el should probably use font-lock-remove-keywords instead. > That helped, thank you. > I left the disabling/enabling of font-lock-mode there, because otherwise the > changes in highlighting are not visible until the buffer is modified. Supposedly `font-lock-fontify-buffer' is meant to do that without disabling+enabling. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 19 11:15:57 2013 Received: (at 13817-done) by debbugs.gnu.org; 19 Mar 2013 15:15:57 +0000 Received: from localhost ([127.0.0.1]:35859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHyGa-0000JK-JV for submit@debbugs.gnu.org; Tue, 19 Mar 2013 11:15:57 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:33316) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UHyGY-0000JB-0J for 13817-done@debbugs.gnu.org; Tue, 19 Mar 2013 11:15:55 -0400 Received: by mail-la0-f43.google.com with SMTP id ek20so1122511lab.2 for <13817-done@debbugs.gnu.org>; Tue, 19 Mar 2013 08:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding:x-antivirus:x-antivirus-status; bh=Zh9rLIG1VbV4qb0ddfN0lOc5U1upqRMjLDW1WC+KOYs=; b=nGybT1HL849phJwoa8oU9z2URX9YZizXlsYR8K5/QBmANfMJWkoIZj772/N7umZbLb Z7uz1AeeklzSy5fpozbVZm+niJO5jJe4riS5adNqbbFqJweNp1j0SVnV6ui8VVOrnuhN aWuOqzVWm3dr9yJCVd2oElVPvajuxSaoJinmN4ILBBGIpHdrET+hkfZ/WDqG/aeZCcOU o5zXTm27hzvUfePxJiySK8cLlQ9rUjewBYZvilBaPyz8oWYkGvqVXA49N2WHMuFOb1y8 g9+jCbzvVcb3R4BJSAMRYP2XtA2OvWJhw+mRKFn+pDjDXCMBTFLWdbu60kfxses+fCi7 qMrQ== X-Received: by 10.112.27.106 with SMTP id s10mr8201246lbg.27.1363706052891; Tue, 19 Mar 2013 08:14:12 -0700 (PDT) Received: from [127.0.0.1] ([178.252.98.87]) by mx.google.com with ESMTPS id m2sm6851774lbz.7.2013.03.19.08.14.09 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Mar 2013 08:14:10 -0700 (PDT) Message-ID: <514880C7.2060007@yandex.ru> Date: Tue, 19 Mar 2013 19:14:15 +0400 From: Dmitry Gutov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: Stefan Monnier Subject: Re: bug#13817: 24.3.50; Disabling whitespace-mode that was enabled in sgml-mode-hook breaks font-lock References: <87ppznbnba.fsf@yandex.ru> <5147F2EC.4060102@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 130319-0, 19.03.2013), Outbound message X-Antivirus-Status: Clean X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13817-done Cc: 13817-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On 19.03.2013 17:02, Stefan Monnier wrote: >>>> On the surface, the reason for this is that when whitespace-mode is being >>>> turned on in the hook, font-lock-keywords is still nil, and so nil is >>>> saved in whitespace-font-lock-keywords. >>> whitespace.el should probably use font-lock-remove-keywords instead. >> That helped, thank you. >> I left the disabling/enabling of font-lock-mode there, because otherwise the >> changes in highlighting are not visible until the buffer is modified. > > Supposedly `font-lock-fontify-buffer' is meant to do that without > disabling+enabling. That works, too. :) From unknown Sun Aug 10 16:50:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 17 Apr 2013 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator