From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#66741: 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 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40796"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eli zaretskii To: 66741@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 25 11:02:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qvZmO-000ANo-JF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Oct 2023 11:02:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvZlw-0003uk-W3; Wed, 25 Oct 2023 05:01:53 -0400 Original-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 1qvZlc-0003Mj-U9 for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2023 05:01:38 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvZlc-0005A5-Lh; Wed, 25 Oct 2023 05:01:32 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qvZm6-0003mj-Dx; Wed, 25 Oct 2023 05:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: eliz@gnu.org, bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Oct 2023 09:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66741 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: eli zaretskii Original-Received: via spool by submit@debbugs.gnu.org id=B.169822450914527 (code B ref -1); Wed, 25 Oct 2023 09:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Oct 2023 09:01:49 +0000 Original-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 Original-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 Original-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 Original-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 Original-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== Original-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) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273150 Archived-At: 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