all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrea Corallo <acorallo@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "Björn Bidar" <bjorn.bidar@thaodan.de>,
	69431@debbugs.gnu.org, yantar92@posteo.net,
	"Eli Zaretskii" <eliz@gnu.org>,
	hirofumi@mail.parknet.co.jp
Subject: bug#69431: 30.0.50; Strange fontificaion behavior
Date: Sat, 06 Apr 2024 13:01:18 -0400	[thread overview]
Message-ID: <yp1il0ul929.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <yp1msqenni5.fsf@fencepost.gnu.org> (Andrea Corallo's message of "Sun, 31 Mar 2024 16:40:34 -0400")

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:

==============
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= (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.
==============

The backtrace I see in *Messages* looks like this in the non working
case (cold eln-cache):

==============
XXX set
  backtrace()
  k-variable-watcher(font-lock-keywords ((eval list (or outline-search-function (concat "^\\(?:" outline-regexp "\\).*" outline-heading-end-regexp)) 0 '(if outline-minor-mode (if outline-minor-mode-highlight (list 'face (outline-font-lock-face))) (outline-font-lock-face)) (when outline-minor-mode (pcase outline-minor-mode-highlight ('override t) ('append 'append))) t)) set #<buffer test.org>)
  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='signal',interface='org.freedesktop.DBus.Local',member='Disconnected',path='/org/freedesktop/DBus/Local'")
  dbus-register-signal(:system nil "/org/freedesktop/DBus/Local" "org.freedesktop.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-pdump-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\313\314&\7\207" [require gnus dbus custom-declare-variable gnus-dbus-close-on-sleep funcall function #f(compiled-function () #<bytecode -0x1df07492cba9682>) ("/home/andcor03/emacs2/lisp/gnus/gnus-dbus.elc" . 86) :group gnus-dbus :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\330\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\345DD\346\326\327\330\331&\7\210\320\347\322\323\350DD\351\326\327\330\352&\7\210\320\353\322\323\354DD\355\326\356\330\357&\7\210\320\360\322\323\361DD\362\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-range gnus-util gnus-cloud gnus-dbus autoload message-make-date "message" gnus-agent-read-servers-validate "gnus-agent" gnus-agent-save-local gnus-agent-possibly-alter-active custom-declare-variable gnus-startup-file funcall function #f(compiled-function () #<bytecode -0x16373a68b89bcc3e>) ("/home/andcor03/emacs2/lisp/gnus/gnus-start.elc" . 86) :group gnus-start :type file gnus-backup-startup-file #f(compiled-function () #<bytecode 0xd353236499f29a>) ("/home/andcor03/emacs2/lisp/gnus/gnus-start.elc" . 172) :version "22.1" (choice (const :tag "Never" never) (const :tag "If existing" nil) (other :tag "Always" t)) gnus-save-startup-file-via-temp-buffer #f(compiled-function () #<bytecode 0xb738b6fba16d1a>) ("/home/andcor03/emacs2/lisp/gnus/gnus-start.elc" . 316) (choice (const :tag "Write via buffer" t) (const :tag "Write directly to file" nil)) gnus-init-file #f(compiled-function () #<bytecode 0xb3022756901fc2>) ("/home/andcor03/emacs2/lisp/gnus/gnus-start.elc" . 549) gnus-site-init-file #f(compiled-function () #<bytecode 0x1e4de8aa016bec56>) ("/home/andcor03/emacs2/lisp/gnus/gnus-start.elc" . 672) (choice file (const nil)) gnus-use-dribble-file #f(compiled-function () #<bytecode 0xb738b6fba16d1a>) ("/home/andcor03/emacs2/lisp/gnus/gnus-start.elc" . 820) gnus-dribble-file boolean gnus-dribble-directory #f(compiled-function () #<bytecode 0xb738b6fba17c1a>) ...] 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\313!\210\300\314!\210\315\316\317\"\210\315\320\321\"\210\315\322\323\"\210\315\324\323\"\210\315\325\326\"\210\327\330\331\332\333DD\334\335\303\336\337&\7\210\327\340\331\332\341DD\342\335\343\336\344&\7\210\327\345\331\332\346DD\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\327\365\331\332\366DD\367\370\371\335\352\336\372&\11\210\327\373\331\332\374DD\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\210\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\327\201O\0\331\332\201P\0DD\201Q\0\335\201N\0\336\337&\7\210\327\201R\0\331\332\201S\0DD\201T\0\335\352\336\201U\0&\7\210\327\201V\0\331\332\201W\0DD\201X\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" gnus-cloud-upload-all-data "gnus-cloud" gnus-cloud-download-all-data gnus-topic-find-groups "gnus-topic" custom-declare-variable gnus-no-groups-message funcall function #f(compiled-function () #<bytecode -0x156b006a3fe4da40>) ("/home/andcor03/emacs2/lisp/gnus/gnus-group.elc" . 86) :group :type string gnus-keep-same-level #f(compiled-function () #<bytecode 0x22638b6ab444452>) ("/home/andcor03/emacs2/lisp/gnus/gnus-group.elc" . 153) gnus-group-levels (choice (const nil) (const best) (sexp :tag "other" t)) gnus-group-goto-unread #f(compiled-function () #<bytecode 0x22638b6ab445552>) ("/home/andcor03/emacs2/lisp/gnus/gnus-group.elc" . 752) :link (custom-manual "(gnus)Group Maneuvering") gnus-group-various boolean gnus-goto-next-group-when-activating #f(compiled-function () #<bytecode 0x22638b6ab445552>) ("/home/andcor03/emacs2/lisp/gnus/gnus-group.elc" . 837) (custom-manual "(gnus)Scanning New Messages") gnus-permanently-visible-groups #f(compiled-function () #<bytecode 0x22638b6ab444452>) ...] 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\313!\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\201@\0\2\377\4N#\210\210A\202\310\0\210\201C\0\377\201@\0\201D\0#\210\336\201@\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\340\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 gnus-range gnus-int gnus-undo gnus-util gmm-utils mm-decode shr url nnoo autoload gnus-summary-limit-include-cached "gnus-cache" nil (gnus-summary-mode) gnus-cache-write-active gnus-pick-line-number "gnus-salt" t nnselect-article-rsv "nnselect" nnselect-article-group gnus-nnselect-group-p gnus-search-thread "gnus-search" gnus-search-server-to-engine custom-declare-variable gnus-kill-summary-on-exit funcall function #f(compiled-function () #<bytecode 0x1f738b5a7440a24>) ("/home/andcor03/emacs2/lisp/gnus/gnus-sum.elc" . 87) :group gnus-summary-exit :type boolean gnus-summary-next-group-on-exit #f(compiled-function () #<bytecode 0x1f738b5a7440a24>) ("/home/andcor03/emacs2/lisp/gnus/gnus-sum.elc" . 253) :link (custom-manual "(gnus)Group Maneuvering") :version "23.1" gnus-summary-stop-at-end-of-message #f(compiled-function () #<bytecode 0x1f738b5a7441124>) ("/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\306\307#\204\36\0\300\310\306\307#\210\300\311!\210\312\313\314\315\316DD\317\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 gnus-util nnheader nnselect nil t nnir ol custom-declare-variable org-gnus-prefer-web-links funcall function #f(compiled-function () #<bytecode -0x14706cb1bbcafd06>) ("/home/andcor03/emacs2/lisp/org/ol-gnus.elc" . 87) :group org-link-store :type boolean org-gnus-no-server #f(compiled-function () #<bytecode -0x14706cb1bbcafd06>) ("/home/andcor03/emacs2/lisp/org/ol-gnus.elc" . 353) org-link-follow :version "24.4" :package-version (Org . "8.0") org-link-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-file) ("\\.elc\\'" . elisp-byte-code-mode) ("\\.zst\\'" nil jka-compr) ("\\.dz\\'" nil jka-compr) ("\\.xz\\'" nil jka-compr) ("\\.lzma\\'" nil jka-compr) ("\\.lz\\'" nil jka-compr) ("\\.g?z\\'" nil jka-compr) ("\\.bz2\\'" nil jka-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\\|Vagrant\\|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-mode) ("\\.java\\'" . java-mode) ("\\.m\\'" . objc-mode) ("\\.ii\\'" . c++-mode) ("\\.i\\'" . c-mode) ("\\.lex\\'" . c-mode) ("\\.y\\(acc\\)?\\'" . c-mode) ("\\.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) ("\\.svgz?\\'" . 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) ("\\.webp\\'" . image-mode) ("\\.te?xt\\'" . text-mode) ("\\.[tT]e[xX]\\'" . tex-mode) ("\\.ins\\'" . tex-mode) ("\\.ltx\\'" . latex-mode) ("\\.dtx\\'" . doctex-mode) ...) nil nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer test.org> "~/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/andcor03/test.org"))
  command-line()
  normal-top-level()
==============

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





  parent reply	other threads:[~2024-04-06 17:01 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27 16:58 bug#69431: 30.0.50; Strange fontificaion behavior OGAWA Hirofumi
2024-02-27 17:29 ` Eli Zaretskii
2024-02-27 17:58   ` Ihor Radchenko
2024-02-27 18:49     ` Eli Zaretskii
2024-02-27 19:20       ` OGAWA Hirofumi
2024-02-27 19:26       ` Ihor Radchenko
2024-02-27 19:33         ` Eli Zaretskii
2024-02-27 20:11           ` Andrea Corallo
2024-02-27 20:23             ` OGAWA Hirofumi
2024-02-27 20:24             ` Ihor Radchenko
2024-02-27 20:27             ` Ihor Radchenko
2024-02-27 21:48               ` Andrea Corallo
2024-02-28 12:00                 ` Ihor Radchenko
     [not found]           ` <87v869h86b.fsf@>
2024-02-28 13:53             ` Andrea Corallo
2024-02-28 16:57               ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]               ` <87zfvkfrw0.fsf@>
2024-02-28 18:44                 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-28 19:34                 ` Andrea Corallo
2024-02-28 21:41                   ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]                   ` <87jzmofes3.fsf@>
2024-02-29 22:16                     ` Andrea Corallo
2024-03-01  1:13                       ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-01  1:18                       ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-03 16:20               ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]               ` <87bk7vgucb.fsf@>
2024-03-03 17:01                 ` Andrea Corallo
2024-03-06 16:38         ` Andrea Corallo
2024-03-07 11:59           ` OGAWA Hirofumi
2024-03-07 14:49             ` Andrea Corallo
2024-03-07 22:33               ` Andrea Corallo
2024-03-21  8:32                 ` Eli Zaretskii
2024-03-23 19:29                   ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]                   ` <87frwgeohj.fsf@>
2024-03-23 20:34                     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-23 20:34                     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-24  9:12                   ` Andrea Corallo
2024-03-24  9:28                     ` Eli Zaretskii
2024-03-26 21:37                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-27  8:31                       ` Andrea Corallo
2024-03-27 14:27                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-31 19:49                           ` Andrea Corallo
2024-03-31 20:40                             ` Andrea Corallo
2024-04-01 10:59                               ` Ihor Radchenko
2024-04-01 12:33                               ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-06 17:01                               ` Andrea Corallo [this message]
2024-04-06 18:38                                 ` Ihor Radchenko
2024-04-07  7:47                                   ` Andrea Corallo
     [not found]                                     ` <87plv1v3za.fsf@>
2024-04-07 11:46                                       ` Eli Zaretskii
2024-04-07 12:01                                         ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]                                         ` <875xwtidpn.fsf@>
2024-04-07 12:48                                           ` Eli Zaretskii
     [not found]                                             ` <871q7hi5f9.fsf@>
2024-04-07 15:50                                               ` Eli Zaretskii
2024-04-07 18:02                                                 ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]                                                 ` <87v84tgifz.fsf@>
2024-04-07 18:35                                                   ` Eli Zaretskii
2024-04-07 19:09                                                     ` Björn Bidar via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-08  7:15                                                   ` Andrea Corallo
2024-04-08 11:40                                                     ` Eli Zaretskii
2024-04-07 12:29                                       ` Andrea Corallo
2024-04-07 15:29                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-08  7:00                                       ` Andrea Corallo
2024-04-08 12:49                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-07 14:31           ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yp1il0ul929.fsf@fencepost.gnu.org \
    --to=acorallo@gnu.org \
    --cc=69431@debbugs.gnu.org \
    --cc=bjorn.bidar@thaodan.de \
    --cc=eliz@gnu.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=monnier@iro.umontreal.ca \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.