From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#69431: 30.0.50; Strange fontificaion behavior Date: Sat, 06 Apr 2024 13:01:18 -0400 Message-ID: References: <871q8x6e06.fsf@mail.parknet.co.jp> <86msrlu87i.fsf@gnu.org> <87v869oklj.fsf@localhost> <86il29u4hy.fsf@gnu.org> <87sf1dogi8.fsf@localhost> <87h6hi8d87.fsf@mail.parknet.co.jp> <86il1g2dfd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31229"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: =?UTF-8?Q?Bj=C3=B6rn?= Bidar , 69431@debbugs.gnu.org, yantar92@posteo.net, Eli Zaretskii , hirofumi@mail.parknet.co.jp To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 06 19:02:15 2024 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 1rt9Ql-0007rw-Ay for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Apr 2024 19:02:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rt9QT-00052H-K1; Sat, 06 Apr 2024 13:01:57 -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 1rt9QS-000526-3l for bug-gnu-emacs@gnu.org; Sat, 06 Apr 2024 13:01:56 -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 1rt9QR-0007X0-Ri for bug-gnu-emacs@gnu.org; Sat, 06 Apr 2024 13:01:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rt9QY-0000TL-3a for bug-gnu-emacs@gnu.org; Sat, 06 Apr 2024 13:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Apr 2024 17:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69431 X-GNU-PR-Package: emacs Original-Received: via spool by 69431-submit@debbugs.gnu.org id=B69431.17124228991704 (code B ref 69431); Sat, 06 Apr 2024 17:02:02 +0000 Original-Received: (at 69431) by debbugs.gnu.org; 6 Apr 2024 17:01:39 +0000 Original-Received: from localhost ([127.0.0.1]:40876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rt9Q9-0000RP-Vs for submit@debbugs.gnu.org; Sat, 06 Apr 2024 13:01:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rt9Q5-0000Qb-Ao for 69431@debbugs.gnu.org; Sat, 06 Apr 2024 13:01:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rt9Pq-0007QZ-SE; Sat, 06 Apr 2024 13:01:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=z5a6iwgXiuImTtEsRR8NTW7CjDdbQPuwer58mFZtXdU=; b=fi4CvJlCxhkovorQGPf1 iK5tDr48/kLlPQSXsD8g43IoHls+Wch9fcGsrS2cUNMjF1aLCgQyho8mW9BcwyuKOHKB2713q2aJb YRhwjczck1BYW6wq67EADdQgVNf4awTwtZ0+BgT2OqyWejEu3bz/vJSATZQfLRGEITiq6V2F5UU5C T2ORflSWW1aBI7D4GytKQIgjGvj0ED8cAVf5Y8OehwW8S9oAShsuSjLToIUN/mKkKZue3zZ9SQcjV X1afnCjLraXKfvxQBEfY/qrgem/EMD7gQJwrqa2urU+uDzYSXNQEUP/yO2sn9nuEh0P/Awirm0lEA 3ZwBuSuYoBVDRA==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rt9Pq-0002EY-G9; Sat, 06 Apr 2024 13:01:18 -0400 In-Reply-To: (Andrea Corallo's message of "Sun, 31 Mar 2024 16:40:34 -0400") 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:282807 Archived-At: Okay after "some" debugging my theory is that it is problematic to setup the fontification while the setup of another fontification is active on the stack. This is what is happening here because while we are setting up fontification for 'test.org' native compilation activated 'emacs-lisp-compilation-mode' on the '*Async-native-compile-log*' buffer. If I remove the invocations of 'emacs-lisp-compilation-mode' from 'comp-run-async-workers' my org file gets fontified correctly. Applying: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D modified lisp/files.el @@ -2828,6 +2828,13 @@ after-find-file (define-obsolete-function-alias 'report-errors 'with-demoted-errors "25.1") +(defun k-variable-watcher (_symbol newval op _buffer) + (when (string=3D (buffer-name) "test.org") + (message "XXX %s" op) + (backtrace))) + +(add-variable-watcher 'font-lock-keywords #'k-variable-watcher) + (defun normal-mode (&optional find-file) "Choose the major mode for this buffer automatically. Also sets up any specified local variables of the file or its directory. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The backtrace I see in *Messages* looks like this in the non working case (cold eln-cache): =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D XXX set backtrace() k-variable-watcher(font-lock-keywords ((eval list (or outline-search-func= tion (concat "^\\(?:" outline-regexp "\\).*" outline-heading-end-regexp)) 0= '(if outline-minor-mode (if outline-minor-mode-highlight (list 'face (outl= ine-font-lock-face))) (outline-font-lock-face)) (when outline-minor-mode (p= case outline-minor-mode-highlight ('override t) ('append 'append))) t)) set= #) font-lock-set-defaults() font-lock-mode-internal(t) font-lock-default-function(t) font-lock-mode() turn-on-font-lock() turn-on-font-lock-if-desired() global-font-lock-mode-enable-in-buffers() run-hooks(after-change-major-mode-hook) run-mode-hooks(emacs-lisp-compilation-mode-hook) emacs-lisp-compilation-mode() comp-run-async-workers() native--compile-async("/home/andcor03/emacs2/lisp/net/dbus.el" nil late) apply(native--compile-async ("/home/andcor03/emacs2/lisp/net/dbus.el" nil= late)) read-event(nil nil 0.001) dbus-call-method(:system "org.freedesktop.DBus" "/org/freedesktop/DBus" "= org.freedesktop.DBus" "AddMatch" "type=3D'signal',interface=3D'org.freedesk= top.DBus.Local',member=3D'Disconnected',path=3D'/org/freedesktop/DBus/Local= '") dbus-register-signal(:system nil "/org/freedesktop/DBus/Local" "org.freed= esktop.DBus.Local" "Disconnected" dbus-handle-bus-disconnect) dbus-init-bus(:system) dbus--init() byte-code("\300\301\302\"\210\302 \210\303\304!\207" [add-hook after-pdum= p-load-hook dbus--init provide dbus] 3) require(dbus) byte-code("\300\301!\210\300\302!\210\303\304\305\306\307DD\310\311\312\3= 13\314&\7\207" [require gnus dbus custom-declare-variable gnus-dbus-close-o= n-sleep funcall function #f(compiled-function () #) ("/home/andcor03/emacs2/lisp/gnus/gnus-dbus.elc" . 86) :group gnus-db= us :type boolean] 8) require(gnus-dbus) byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\= 210\300\306!\210\300\307!\210\300\310!\210\311\312\313\"\210\311\314\315\"\= 210\311\316\315\"\210\311\317\315\"\210\320\321\322\323\324DD\325\326\327\3= 30\331&\7\210\320\332\322\323\333DD\334\335\336\326\327\330\337&\11\210\320= \340\322\323\341DD\342\335\336\326\327\330\343&\11\210\320\344\322\323\345D= D\346\326\327\330\331&\7\210\320\347\322\323\350DD\351\326\327\330\352&\7\2= 10\320\353\322\323\354DD\355\326\356\330\357&\7\210\320\360\322\323\361DD\3= 62\326\356\330\363&\7\210\320\364\322\323\365DD\366\326\327\330\367&\7\210\= 320\370\322\323\371DD\372\326\373\330\357&\7\210\320\374\322\323\375DD\376\= 326\373\330\377&\7\207" [require gnus gnus-win gnus-int gnus-spec gnus-rang= e gnus-util gnus-cloud gnus-dbus autoload message-make-date "message" gnus-= agent-read-servers-validate "gnus-agent" gnus-agent-save-local gnus-agent-p= ossibly-alter-active custom-declare-variable gnus-startup-file funcall func= tion #f(compiled-function () #) ("/home/andco= r03/emacs2/lisp/gnus/gnus-start.elc" . 86) :group gnus-start :type file gnu= s-backup-startup-file #f(compiled-function () #)= ("/home/andcor03/emacs2/lisp/gnus/gnus-start.elc" . 172) :version "22.1" (= choice (const :tag "Never" never) (const :tag "If existing" nil) (other :ta= g "Always" t)) gnus-save-startup-file-via-temp-buffer #f(compiled-function = () #) ("/home/andcor03/emacs2/lisp/gnus/gnus-sta= rt.elc" . 316) (choice (const :tag "Write via buffer" t) (const :tag "Write= directly to file" nil)) gnus-init-file #f(compiled-function () #) ("/home/andcor03/emacs2/lisp/gnus/gnus-start.elc" . 549)= gnus-site-init-file #f(compiled-function () #= ) ("/home/andcor03/emacs2/lisp/gnus/gnus-start.elc" . 672) (choice file (co= nst nil)) gnus-use-dribble-file #f(compiled-function () #) ("/home/andcor03/emacs2/lisp/gnus/gnus-start.elc" . 820) gnus-dr= ibble-file boolean gnus-dribble-directory #f(compiled-function () #) ...] 10) require(gnus-start) byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\= 210\300\306!\210\300\307!\210\300\310!\210\300\311!\210\300\312!\210\300\31= 3!\210\300\314!\210\315\316\317\"\210\315\320\321\"\210\315\322\323\"\210\3= 15\324\323\"\210\315\325\326\"\210\327\330\331\332\333DD\334\335\303\336\33= 7&\7\210\327\340\331\332\341DD\342\335\343\336\344&\7\210\327\345\331\332\3= 46DD\347\350\351\335\352\336\353&\11\210\327\354\331\332\355DD\356\350\357\= 335\352\336\353&\11\210\327\360\331\332\361DD\362\335\363\336\364&\7\210\32= 7\365\331\332\366DD\367\370\371\335\352\336\372&\11\210\327\373\331\332\374= DD\375\335\363\336\353&\7\210\327\376\331\332\377DD\201@\0\335\363\336\201A= \0&\7\210\327\201B\0\331\332\201C\0DD\201D\0\335\363\335\343\336\353&\11\21= 0\327\201E\0\331\332\201F\0DD\201G\0\335\363\350\201H\0\336\201I\0&\11\210\= 327\201J\0\331\332\201K\0DD\201L\0\350\201M\0\335\201N\0\336\337&\11\210\32= 7\201O\0\331\332\201P\0DD\201Q\0\335\201N\0\336\337&\7\210\327\201R\0\331\3= 32\201S\0DD\201T\0\335\352\336\201U\0&\7\210\327\201V\0\331\332\201W\0DD\20= 1X\0\335\352\350\201Y\0\336\201U\0&\11\210\327\201Z\0\331\332\201[\0DD\201\= \\0\335\201N\0\336\201U\0&\7\210\327\201]\0\331\332\201^\0DD\201_\0\335\363= \336\332&\7\207" [require cl-lib gnus gnus-start nnmail gnus-spec gnus-int = gnus-range gnus-win gnus-undo gmm-utils time-date range autoload gnus-agent= -total-fetched-for "gnus-agent" gnus-cache-total-fetched-for "gnus-cache" g= nus-cloud-upload-all-data "gnus-cloud" gnus-cloud-download-all-data gnus-to= pic-find-groups "gnus-topic" custom-declare-variable gnus-no-groups-message= funcall function #f(compiled-function () #) = ("/home/andcor03/emacs2/lisp/gnus/gnus-group.elc" . 86) :group :type string= gnus-keep-same-level #f(compiled-function () #= ) ("/home/andcor03/emacs2/lisp/gnus/gnus-group.elc" . 153) gnus-group-level= s (choice (const nil) (const best) (sexp :tag "other" t)) gnus-group-goto-u= nread #f(compiled-function () #) ("/home/andcor= 03/emacs2/lisp/gnus/gnus-group.elc" . 752) :link (custom-manual "(gnus)Grou= p Maneuvering") gnus-group-various boolean gnus-goto-next-group-when-activa= ting #f(compiled-function () #) ("/home/andcor0= 3/emacs2/lisp/gnus/gnus-group.elc" . 837) (custom-manual "(gnus)Scanning Ne= w Messages") gnus-permanently-visible-groups #f(compiled-function () #) ...] 10) require(gnus-group) byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\= 210\300\306!\210\300\307!\210\300\310!\210\300\311!\210\300\312!\210\300\31= 3!\210\300\314!\210\300\315!\210\316\317\320\321\322$\210\316\323\320\"\210= \316\324\325\321\326$\210\316\327\330\321\211$\210\316\331\330\321\211$\210= \316\332\330\321\211$\210\316\333\334\321\211$\210\316\335\334\321\211$\210= \336\337\340\341\342DD\343\344\345\346\347&\7\210\336\350\340\341\351DD\352= \353\354\344\345\355\356\346\347&\13\210\336\357\340\341\360DD\361\353\362\= 344\363\355\364\346\347&\13\210\336\365\340\341\366DD\367\344\370\346\371&\= 7\210\336\372\340\341\373DD\374\344\370\346\375&\7\210\376\377\201@\0\321#\= 210\201A\0\211\203\355\0\211@\377\1N\203\350\0\201@\0\1N\204\350\0\201B\0\2= 01@\0\2\377\4N#\210\210A\202\310\0\210\201C\0\377\201@\0\201D\0#\210\336\20= 1@\0\340\341\201E\0DD\201F\0\355\201D\0\344\370\346\201G\0&\11\210\336\201H= \0\340\341\201I\0DD\201J\0\355\201K\0\344\370\346\347&\11\210\336\201L\0\34= 0\341\201M\0DD\201N\0\344\370\346\201O\0&\7\210\336\201P\0\340\341\201Q\0DD= \201R\0\355\201S\0\344\370\346\347&\11\210\336\201T\0\340\341\201U\0DD\201V= \0\344\370\346\201W\0&\7\207" [require cl-lib gnus gnus-group gnus-spec gnu= s-range gnus-int gnus-undo gnus-util gmm-utils mm-decode shr url nnoo autol= oad gnus-summary-limit-include-cached "gnus-cache" nil (gnus-summary-mode) = gnus-cache-write-active gnus-pick-line-number "gnus-salt" t nnselect-articl= e-rsv "nnselect" nnselect-article-group gnus-nnselect-group-p gnus-search-t= hread "gnus-search" gnus-search-server-to-engine custom-declare-variable gn= us-kill-summary-on-exit funcall function #f(compiled-function () #) ("/home/andcor03/emacs2/lisp/gnus/gnus-sum.elc" . 87) = :group gnus-summary-exit :type boolean gnus-summary-next-group-on-exit #f(c= ompiled-function () #) ("/home/andcor03/emacs2/= lisp/gnus/gnus-sum.elc" . 253) :link (custom-manual "(gnus)Group Maneuverin= g") :version "23.1" gnus-summary-stop-at-end-of-message #f(compiled-functio= n () #) ("/home/andcor03/emacs2/lisp/gnus/gnus-= sum.elc" . 349) ...] 12) require(gnus-sum) byte-code("\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305\3= 06\307#\204\36\0\300\310\306\307#\210\300\311!\210\312\313\314\315\316DD\31= 7\320\321\322\323&\7\210\312\324\314\315\325DD\326\320\327\330\331\332\333\= 322\323&\13\210\334\335\336\337\340\341%\207" [require org-macs gnus-sum gn= us-util nnheader nnselect nil t nnir ol custom-declare-variable org-gnus-pr= efer-web-links funcall function #f(compiled-function () #) ("/home/andcor03/emacs2/lisp/org/ol-gnus.elc" . 87) :group or= g-link-store :type boolean org-gnus-no-server #f(compiled-function () #) ("/home/andcor03/emacs2/lisp/org/ol-gnus.elc" .= 353) org-link-follow :version "24.4" :package-version (Org . "8.0") org-li= nk-set-parameters "gnus" :follow org-gnus-open :store org-gnus-store-link] = 12) require(ol-gnus) org-load-modules-maybe() org-mode() set-auto-mode-0(org-mode nil) set-auto-mode--apply-alist((("\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'" nil epa-fi= le) ("\\.elc\\'" . elisp-byte-code-mode) ("\\.zst\\'" nil jka-compr) ("\\.d= z\\'" nil jka-compr) ("\\.xz\\'" nil jka-compr) ("\\.lzma\\'" nil jka-compr= ) ("\\.lz\\'" nil jka-compr) ("\\.g?z\\'" nil jka-compr) ("\\.bz2\\'" nil j= ka-compr) ("\\.Z\\'" nil jka-compr) ("\\.vr[hi]?\\'" . vera-mode) ("\\(?:\\= .\\(?:rbw?\\|ru\\|rake\\|thor\\|axlsx\\|jbuilder\\|rabl\\|gemspec\\|podspec= \\)\\|/\\(?:Gem\\|Rake\\|Cap\\|Thor\\|Puppet\\|Berks\\|Brew\\|Fast\\|Vagran= t\\|Guard\\|Pod\\)file\\)\\'" . ruby-mode) ("\\.re?st\\'" . rst-mode) ("/\\= (?:Pipfile\\|\\.?flake8\\)\\'" . conf-mode) ("\\.py[iw]?\\'" . python-mode)= ("\\.m\\'" . octave-maybe-mode) ("\\.less\\'" . less-css-mode) ("\\.scss\\= '" . scss-mode) ("\\.cs\\'" . csharp-mode) ("\\.awk\\'" . awk-mode) ("\\.\\= (u?lpc\\|pike\\|pmod\\(\\.in\\)?\\)\\'" . pike-mode) ("\\.idl\\'" . idl-mod= e) ("\\.java\\'" . java-mode) ("\\.m\\'" . objc-mode) ("\\.ii\\'" . c++-mod= e) ("\\.i\\'" . c-mode) ("\\.lex\\'" . c-mode) ("\\.y\\(acc\\)?\\'" . c-mod= e) ("\\.h\\'" . c-or-c++-mode) ("\\.c\\'" . c-mode) ("\\.\\(CC?\\|HH?\\)\\'= " . c++-mode) ("\\.[ch]\\(pp\\|xx\\|\\+\\+\\)\\'" . c++-mode) ("\\.\\(cc\\|= hh\\)\\'" . c++-mode) ("\\.\\(bat\\|cmd\\)\\'" . bat-mode) ("\\.[sx]?html?\= \(\\.[a-zA-Z_]+\\)?\\'" . mhtml-mode) ("\\.svgz?\\'" . image-mode) ("\\.svg= z?\\'" . xml-mode) ("\\.x[bp]m\\'" . image-mode) ("\\.x[bp]m\\'" . c-mode) = ("\\.p[bpgn]m\\'" . image-mode) ("\\.tiff?\\'" . image-mode) ("\\.gif\\'" .= image-mode) ("\\.png\\'" . image-mode) ("\\.jpe?g\\'" . image-mode) ("\\.w= ebp\\'" . image-mode) ("\\.te?xt\\'" . text-mode) ("\\.[tT]e[xX]\\'" . tex-= mode) ("\\.ins\\'" . tex-mode) ("\\.ltx\\'" . latex-mode) ("\\.dtx\\'" . do= ctex-mode) ...) nil nil) set-auto-mode() normal-mode(t) after-find-file(nil t) find-file-noselect-1(# "~/test.org" nil nil "~/test.org"= (14180533 64513)) find-file-noselect("/home/andcor03/test.org") command-line-1(("-eval" "(setq native-comp-jit-compilation t)" "/home/and= cor03/test.org")) command-line() normal-top-level() =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Why are we setting 'font-lock-keywords' on test.org if the last major mode activation we have on the stack is for 'emacs-lisp-compilation-mode'? IOW why the current buffer is test.org if 'emacs-lisp-compilation-mode' is called wrapped by 'with-current-buffer' on '*Async-native-compile-log*'? Also is the value of 'font-lock-keywords' we are setting on test.org the expected one or are we mixing up things? Thanks Andrea