[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Possible bug? font-lock-add-keywords in minor mode and auto-mode-alist
From: |
Joost Kremers |
Subject: |
Possible bug? font-lock-add-keywords in minor mode and auto-mode-alist |
Date: |
26 Jan 2015 11:28:15 GMT |
User-agent: |
slrn/pre1.0.0-18 (Linux) |
Hi all,
I'm running into a strange problem that I cannot explain. I'm trying to
add some font-lock keywords through a minor mode.[1] I activate the
minor mode by putting it in the hook of a particular major mode, and the
minor mode activation function calls font-lock-add-keywords with the
proper arguments.
Everything works fine if I call the major mode function interactively
(`M-x markdown-mode', to be precise). The minor mode is activated and
the font-lock keywords are added correctly.
However, if `markdown-mode' is activated through `auto-font-alist', the
additional font-lock keywords are not added.
More precisely, they seem to be added and immediately removed again.
This at least is suggested by my debug efforts: I've added some code to
the function that activates the additional font-lock keywords that saves
the buffer-local value of font-lock-keywords to another variable. When I
check this variable's value after loading a markdown file, the
additional keywords are there. Checking the value of
`font-lock-keywords' at this point shows that the additional keywords
are not there (anymore).
I tried to see if there's anything in my init file that interferes, but
that doesn't seem to be the case. The problem still occurs, even if I
reduce my init file to the following:
,----
| (load-library "/path/to/markdown-mode")
| (load-library "/path/to/pandoc-mode")
| (add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
| (add-hook 'markdown-mode-hook 'pandoc-mode)
`----
Does anyone have an idea where I should look further to debug this
issue? I looked at the code for `set-auto-mode', but couldn't find
anything suspicious...
TIA
Joost
[1] In particular, pandoc-mode:
https://github.com/joostkremers/pandoc-mode
The code adding the font-lock keywords is here:
https://github.com/gbgar/pandoc-mode/commit/a66726170e8db5928e6778f671b4ccfe663a5379
--
Joost Kremers joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
- Possible bug? font-lock-add-keywords in minor mode and auto-mode-alist,
Joost Kremers <=
- Message not available