From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Possible bug? font-lock-add-keywords in minor mode and auto-mode-alist Date: 26 Jan 2015 11:28:15 GMT Message-ID: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1422271828 4976 80.91.229.3 (26 Jan 2015 11:30:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Jan 2015 11:30:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 26 12:30:27 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YFhsA-0004mo-N3 for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Jan 2015 12:30:26 +0100 Original-Received: from localhost ([::1]:41088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFhsA-0004qL-2p for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Jan 2015 06:30:26 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 58 Original-X-Trace: individual.net jpsSVjmQtYRkJCWe6Q7pQgnJNwG8DRtaT5vomjYTKKOnbfvUvD Cancel-Lock: sha1:TaojfV7ClLPoNl6BdcRqBHQrEVo= User-Agent: slrn/pre1.0.0-18 (Linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:210001 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102280 Archived-At: 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)