all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Felician Nemeth <felician.nemeth@gmail.com>
Cc: 39190@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#39190: 28.0.50; two buffers with same buffer-file-name (diff-syntax-fontify-props)
Date: Tue, 18 Feb 2020 02:06:48 +0200	[thread overview]
Message-ID: <87o8twep2f.fsf@mail.linkov.net> (raw)
In-Reply-To: <87sgjj7njt.fsf@betli.tmit.bme.hu> (Felician Nemeth's message of "Sun, 09 Feb 2020 17:06:30 +0100")

>>> delay-mode-hooks was intended as the safest workaround to install in emacs-27.
>>
>> delay-mode-hooks is now in emacs-27.
>
> This makes the original problem disappear.  Thank you.

Unfortunately, this change broke diff-syntax font-lock of conf-space-mode -
font-lock from files in conf-space-mode is not displayed in diffs anymore.

First, these steps show how it used to work when set-auto-mode was called
from diff-syntax-fontify-props without wrapping in delay-mode-hooks macro:

- diff-syntax-fontify-props calls set-auto-mode
- in auto-mode-alist a file extension is associated with conf-mode-maybe
- conf-mode-maybe calls conf-mode
- conf-mode checks for the variable 'delay-mode-hooks':
- initially delay-mode-hooks is nil, so call conf-space-mode
- conf-space-mode calls its parent mode conf-mode again
- when conf-mode is called again, its delay-mode-hooks is t
  and it sets its mode variables.

Now the failure caused by wrapping (delay-mode-hooks (set-auto-mode))
in diff-syntax-fontify-props is because on the first call of conf-mode,
the variable 'delay-mode-hooks' is already t, not nil as it was before
the change.

All this due to such trick used in conf-mode with these comments:

(defun conf-mode ()
  ...
  ;; `conf-mode' plays two roles: it's the parent of several sub-modes
  ;; but it's also the function that chooses between those submodes.
  ;; To tell the difference between those two cases where the function
  ;; might be called, we check `delay-mode-hooks'.
  ;; (adopted from tex-mode.el)
  (if (not delay-mode-hooks)
      ;; try to guess sub-mode of conf-mode based on buffer content

So it detects the situation when define-derived-mode runs the parent
with delay-mode-hooks.

I have no idea what to do in this case.





  reply	other threads:[~2020-02-18  0:06 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-19 11:14 bug#39190: 28.0.50; two buffers with same buffer-file-name (diff-syntax-fontify-props) Felician Nemeth
2020-01-20 22:56 ` Juri Linkov
2020-01-20 23:34   ` Stefan Monnier
2020-01-24  0:13     ` Juri Linkov
2020-01-24 14:18       ` Stefan Monnier
2020-01-28  0:01         ` Juri Linkov
2020-01-28  1:30           ` Stefan Monnier
2020-01-28  3:32             ` Eli Zaretskii
2020-01-28 13:58               ` Stefan Monnier
2020-01-28 14:54                 ` Dmitry Gutov
2020-01-28 22:53                   ` Juri Linkov
2020-01-28 17:54                 ` Eli Zaretskii
2020-01-28 20:12                   ` Stefan Monnier
2020-01-28 20:23                     ` Eli Zaretskii
2020-01-28 23:17                       ` Stefan Monnier
2020-01-29 17:13                         ` Eli Zaretskii
2020-01-29 21:33                           ` Stefan Monnier
2020-01-30 14:17                             ` Eli Zaretskii
2020-01-30 14:34                               ` Stefan Monnier
2020-01-30 22:50             ` Juri Linkov
2020-01-30 23:09               ` Stefan Monnier
2020-01-30 23:31               ` Dmitry Gutov
2020-01-26 19:34       ` Felician Nemeth
2020-01-28  0:05         ` Juri Linkov
2020-01-28 17:18           ` Felician Nemeth
2020-01-29 23:07             ` Juri Linkov
2020-01-30 19:48               ` Felician Nemeth
2020-01-30 22:45                 ` Juri Linkov
2020-02-02  9:42                   ` Felician Nemeth
2020-02-02 13:50                     ` Stefan Monnier
2020-02-02 23:41                       ` Juri Linkov
2020-02-03 13:14                         ` Dmitry Gutov
2020-02-03 22:44                           ` Juri Linkov
2020-02-04 13:08                             ` Dmitry Gutov
2020-02-03 22:45                     ` Juri Linkov
2020-02-04 13:36                       ` Stefan Monnier
2020-02-04 23:20                         ` Juri Linkov
2020-02-05 22:39                           ` Juri Linkov
2020-02-09 16:06                             ` Felician Nemeth
2020-02-18  0:06                               ` Juri Linkov [this message]
2020-02-18 13:33                                 ` Stefan Monnier
2020-02-18 22:53                                   ` Juri Linkov
2020-02-18 23:07                                     ` Stefan Monnier
2020-02-18 23:31                                       ` Stefan Monnier
2020-02-19  0:49                                         ` Juri Linkov
2020-02-19 13:20                                           ` Stefan Monnier
2020-02-20  0:58                                             ` Juri Linkov
2020-03-24 21:37                                         ` Juri Linkov
2020-03-24 22:29                                           ` Stefan Monnier
2020-03-25 20:39                                             ` Juri Linkov
2020-03-25 21:13                                               ` Stefan Monnier
2020-03-25 21:48                                                 ` Juri Linkov

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=87o8twep2f.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=39190@debbugs.gnu.org \
    --cc=felician.nemeth@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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.