From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 25 05:01:48 2023 Received: (at submit) by debbugs.gnu.org; 25 Oct 2023 09:01:49 +0000 Received: from localhost ([127.0.0.1]:57278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvZlj-0003m6-IA for submit@debbugs.gnu.org; Wed, 25 Oct 2023 05:01:48 -0400 Received: from lists.gnu.org ([2001:470:142::17]:56808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvZlc-0003lm-Nu for submit@debbugs.gnu.org; Wed, 25 Oct 2023 05:01:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvZkz-0000hW-DO for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2023 05:00:54 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvZkw-000534-Tr for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2023 05:00:53 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BE6E8240027 for ; Wed, 25 Oct 2023 11:00:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1698224442; bh=nmpGYDGZXqlbX4XJPthHllQdMfwGyGwUBfZMW/K5HnE=; h=From:To:Subject:Date:Message-ID:MIME-Version:From; b=CQmcIIIZ9kw31BpYCTs7M0HjmbRN8wf7zaHtHyLNLjbUXThhCRs43vO/WrF9oLCYT n/AJofJ/NIfm642qj3HSw5SCUcs5xJDYL+68luHjULoOM12gLutpa7o0jC2iEe3QNv +b+FbnUev3R6DB8gR5/YzpzsrTpfkqFmO7W9RLagEdY3wDS9wI8gLYdX73OafIVrRp eWcNH+9xdvuK3lJSIa/sq7Xxyi78jGK3icB/ZqsYUJaQbssv3x0H204WP5e3yu1Bb1 v81O+8b+0+ttoUZPzZnj8hr3Gf8ADYsb9P6VwOxJNfWlpLs6fXX9qGhLSFVo3glUig 9O1nBQ3CogCIg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SFjZL0yQBz9rxD for ; Wed, 25 Oct 2023 11:00:41 +0200 (CEST) From: Ihor Radchenko To: bug-gnu-emacs@gnu.org Subject: 30.0.50; [BUG] pdumper, global-font-lock-mode, and :init-value in define-minor-mode Date: Wed, 25 Oct 2023 09:02:25 +0000 Message-ID: <875y2vgjmm.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) X-Debbugs-CC: Eli Zaretskii Hi, This is a followup after emacs-devel thread on using pdumper: https://yhetil.org/emacs-devel/83msw8kw2f.fsf@gnu.org/ I was trying to create a simple Emacs dump via ------ dump.el ------- (dump-emacs-portable "/tmp/emacs-dumped.dmp") ---------------------- ./src/emacs -q --batch -l ~/Downloads/dump.el Similar to the problem described in https://archive.casouri.cc/note/2020/painless-transition-to-portable-dumper/index.html I got global-font-lock-mode disabled (and the value is nil) when starting Emacs with the above dump file. The first immediate surprise here is that lisp/loadup.el already has (load "font-lock"). So, it should be pre-loaded already. I do not fully understand why re-dumping changes Emacs behavior. Trying to investigate a bit about the possible cause, I found the following suspicious form in font-core.el: (define-globalized-minor-mode global-font-lock-mode font-lock-mode turn-on-font-lock-if-desired ;; What was this :extra-args thingy for? --Stef ;; :extra-args (dummy) :initialize 'custom-initialize-delay :init-value (not (or noninteractive emacs-basic-display)) :group 'font-lock :version "22.1") Note how :init-value is set according to `noninteractive', which is t when creating the dump file. It looks like either a bug in font-core.el that makes wrong assumptions about :init-value evaluation time or a bug in `define-minor-mode' that may need to arrange :init-value calculation to be evaluated at load time. ----------- Another (possible) problem appeared when I tried to work around the above issue. I attempted (defun font-lock--enable-after-pdump () "Re-initialize `global-font-lock-mode' after loading Emacs with dump file." (setq global-font-lock-mode (not (or noninteractive emacs-basic-display)))) (add-hook 'after-pdump-load-hook #'font-lock--enable-after-pdump) But, to my surprise, it did not lead to font-lock-mode being active in *scratch* buffer. Either I miss something important here or `after-pdump-load-hook' may be evaluated too late in Emacs loading for the purposes for setting up font-lock. In GNU Emacs 30.0.50 (build 19, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2023-10-25 built on localhost Repository revision: 8f00c9c3c6c4e76651c000e41582e002755e598b Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101008 System Description: Gentoo Linux Configured using: 'configure --with-native-compilation CFLAGS=-g3 --with-pdumper=yes' -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 26 05:19:03 2023 Received: (at 66741) by debbugs.gnu.org; 26 Oct 2023 09:19:03 +0000 Received: from localhost ([127.0.0.1]:60601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvwW7-0004K5-8w for submit@debbugs.gnu.org; Thu, 26 Oct 2023 05:19:03 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:61787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvwW3-0004JU-0I for 66741@debbugs.gnu.org; Thu, 26 Oct 2023 05:19:02 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9be7e3fa1daso104792666b.3 for <66741@debbugs.gnu.org>; Thu, 26 Oct 2023 02:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698311902; x=1698916702; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=2Lq8hLlxTAP47LdB0im1Zeis+5ePXUdilUR7tyCqsp4=; b=XSHh7Hf9/O8qD3ZLdHEMa3bEA3EEr82YN6NkNVZk56YFo8rbdvmbhZ0Zps4zYDfRVj 0F8ADDdpcEU+nIcnnMuVFpoSNqQ7pX1tqdnuOluOAUOTHyadX0Mbc8earXwM3FeAuZOv j/RQ5Qdq0tzhL6blg5VbvH4+ge8Wt82OZRRz+NZHSlQ2aPXz9fXDxDkdCvvYWoqYgfOC hJ4Qkb/4rP8wy3VoqKkXV4cNDYmktOkH582Fvj0KUChs262dClVbJol+vXhgNYT8rtSD TD/QC1wE/eV5Tr1setkA486bB7ClSI+3uqVzvz4pYa7Z/Xe7QLp/WZ2B/MFe+P4jx9gA 6BUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698311902; x=1698916702; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2Lq8hLlxTAP47LdB0im1Zeis+5ePXUdilUR7tyCqsp4=; b=dvXy534t1Mx8X8FiQL7WiTTppIQ1YE6ZsihtlxLbNnwF8ws+guxHXS8ZorKTMD1C8J NF8aL/2NJ7XA10BvatB77bL3et7132ES6D4qeH3DlJjXpIfavYSCbDH1HTuJMByPmW7+ EL4qh0cX8TbV8O7J4f/kOecQpmHEnewIla7up2EeFwm38ENK4nMgf9b/WvonbVzrWAQB V3/teoWXWdmGP2dWfyKey9H0izmLH9elbDUDzC/bzqkaWE0swmHked/MaCY7k2QIHi8r uJuNPq1LiMnjjRMmBu1Yg+jjqq7fbjcDdBf3hTZhCH/pSpfMSJgS4ANg84BN6+If5sT/ 2LCA== X-Gm-Message-State: AOJu0Ywmpw/FwW59CAp0sfL0mo3lTBFL6V4JaWonBEb8nqTUN/+keC+m dnguWraPtKh8BWIoNrWbuj8= X-Google-Smtp-Source: AGHT+IEfgf5f7M++QGzw/QT+uE2rZs+ETxG69OZEnpLMGURGeRtYZkMthKRiZ5r47h3njJ5W/FropA== X-Received: by 2002:a17:907:9623:b0:9ae:6da8:1819 with SMTP id gb35-20020a170907962300b009ae6da81819mr13126835ejc.48.1698311902197; Thu, 26 Oct 2023 02:18:22 -0700 (PDT) Received: from Pro.fritz.box (p4fe3a163.dip0.t-ipconnect.de. [79.227.161.99]) by smtp.gmail.com with ESMTPSA id w25-20020a17090633d900b0099bcf9c2ec6sm11378368eja.75.2023.10.26.02.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 02:18:21 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Ihor Radchenko Subject: Re: bug#66741: 30.0.50; [BUG] pdumper, global-font-lock-mode, and :init-value in define-minor-mode In-Reply-To: <875y2vgjmm.fsf@localhost> (Ihor Radchenko's message of "Wed, 25 Oct 2023 09:02:25 +0000") References: <875y2vgjmm.fsf@localhost> Date: Thu, 26 Oct 2023 11:18:21 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66741 Cc: 66741@debbugs.gnu.org, eli zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Ihor Radchenko writes: > (define-globalized-minor-mode global-font-lock-mode > font-lock-mode turn-on-font-lock-if-desired > ;; What was this :extra-args thingy for? --Stef > ;; :extra-args (dummy) > :initialize 'custom-initialize-delay ^^^^^^^^^^^^^^^^^^^^^^^ This at least is the same problem as for transient-mark-mode. Don't know about the other things.