GNU bug report logs - #19720
24.4; minor mode's font-lock-add-keywords & auto-mode-alist problem

Previous Next

Package: emacs;

Reported by: Joost Kremers <joostkremers <at> fastmail.fm>

Date: Wed, 28 Jan 2015 22:56:02 UTC

Severity: minor

Found in version 24.4

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19720 in the body.
You can then email your comments to 19720 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19720; Package emacs. (Wed, 28 Jan 2015 22:56:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joost Kremers <joostkremers <at> fastmail.fm>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 28 Jan 2015 22:56:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Joost Kremers <joostkremers <at> fastmail.fm>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4; minor mode's font-lock-add-keywords & auto-mode-alist problem
Date: Wed, 28 Jan 2015 23:55:04 +0100
Font lock keywords added with `font-lock-add-keywords' in a minor mode's
activation function do not work when the minor mode is activated in a
major mode's hook and the major mode is activated through an entry in
`auto-mode-alist'. They work fine if the major mode is activated
manually (i.e., with `M-x <major-mode>').

I discovered the problem when I added font lock keywords to
`pandoc-mode` and opened a Markdown file. `pandoc-mode' is a minor mode
that I activate in `markdown-mode-hook'.

I haven't tested it with other major/minor modes, therefore I can't be
sure if it's related to either `markdown-mode' or `pandoc-mode', or if
it's a general problem.

Recipe to reproduce:

- Start Emacs with `emacs -Q'
- load `markdown-mode.el' (from http://jblevins.org/projects/markdown-mode/markdown-mode.el )
- load `pandoc-mode.el' (from https://github.com/joostkremers/pandoc-mode )
- (add-hook 'markdown-mode-hook 'pandoc-mode)
- (add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
- save the following text as `sample.text' and open:

====================

This is a simple Markdown test file. It contains a citation
[@Chomsky1995], a Pandoc-specific Markdown extension. The citation
should be fontified, but this does not happens when `markdown-mode' is
activated through `auto-mode-alist'. To make sure the file is fontified,
*this* should be in _italic_ and __this__ in **boldface**.

====================

As stated, the citation `[@Chomsky1995]' should be fontified, but when
the file is first opened, it is not.

Note that `pandoc-mode' *is* active (all other functionality works) and
that right after the call to `font-lock-add-keywords' in `pandoc-mode'
(`pandoc-faces-load', to be exact), the buffer-local value of
`font-lock-keywords' *does* contain the new keywords. (I tested this by
assigning the value of `font-lock-keywords' to another variable right
after the call to `font-lock-add-keywords'.) For some reason, however,
the keywords are removed again, because when Emacs has finished opening
the file, `C-h v font-lock-keywords' only shows the keywords added by
`markdown-mode', not those added by `pandoc-mode'.

When `markdown-mode' is activated with `M-x markdown-mode', the
font-lock keywords that `pandoc-mode' adds work: the relevant elements
are fontified and `C-h v font-lock-keywords' shows that the keywords are
there.







in GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2)
 of 2014-10-22 on IdeaPad
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	elementary OS Luna

Important settings:
  value of $LC_MONETARY: en_IE.UTF-8
  value of $LC_NUMERIC: en_IE.UTF-8
  value of $LC_TIME: en_IE.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: EShell

Minor modes in effect:
  TeX-PDF-mode: t
  shell-dirtrack-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  global-edit-server-edit-mode: t
  ido-vertical-mode: t
  global-auto-complete-mode: t
  pyvenv-mode: t
  guide-key-mode: t
  global-aggressive-indent-mode: t
  autopair-global-mode: t
  autopair-mode: t
  global-visual-fill-column-mode: t
  show-paren-mode: t
  ido-everywhere: t
  delete-selection-mode: t
  override-global-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
. p y <tab> <kp-home> n n n n n n n n - x y p R S <backspace> 
l i e b e SPC r <backspace> F r a u M-b M-b M-c C-e 
SPC G e r n e r t , <return> <return> <return> C-t 
e n t s c h u l d i g e n SPC n i e <M-backspace> S 
i e SPC b i t t e SPC d i e SPC s p ' a t e <M-backspace> 
<backspace> SPC s p " a t e SPC <M-backspace> <backspace> 
C-\ " a t e SPC A n t w o r t . SPC H a t SPC e m i 
n <M-backspace> m e i n e SPC E m a i l SPC v o n SPC 
l e t z t e r SPC W o c h e SPC a l l e SPC I h r e 
SPC F r a g e n SPC b e a n t w o r t e t M-b M-b M-b 
<M-backspace> C-e , o d <backspace> <backspace> SPC 
o d e r SPC <return> <return> C-t C-b s i n d SPC s 
<backspace> n o c h SPC F r a g e n SPC o f f e n SPC 
g e b l i e b e n ? <return> <return> m f g <tab> C-c 
C-c o c l <tab> . p y <tab> y m o c l <tab> . p y <tab> 
q b u n n n n n n n n D q G <C-tab> s-m U b u D D <return> 
q D q z c d <return> M-x r e p o r t <tab> <return
>

Recent messages:
[mu4e] Retrieving mail...done
[mu4e] Indexing... processed 30000, updated 8
[mu4e] Indexing completed; processed 30216, updated 8, cleaned-up 4
[mu4e] Contacts received: 4678
[mu4e] Retrieving mail...done
[mu4e] Indexing... processed 30000, updated 4
[mu4e] Indexing completed; processed 30217, updated 4, cleaned-up 2
[mu4e] Contacts received: 4678
[mu4e] mu4e-main-mode
[mu4e] Found 32 matching messages

Load-path shadows:
~/.emacs.d/lisp/custom hides /usr/local/share/emacs/24.4/lisp/custom
~/.emacs.d/lisp/reftex-toc hides /usr/local/share/emacs/24.4/lisp/textmodes/reftex-toc
/home/joost/.elpa/org-plus-contrib-20150126/ob-scheme hides /usr/local/share/emacs/24.4/lisp/org/ob-scheme
/home/joost/.elpa/org-plus-contrib-20150126/ob-dot hides /usr/local/share/emacs/24.4/lisp/org/ob-dot
/home/joost/.elpa/org-plus-contrib-20150126/org hides /usr/local/share/emacs/24.4/lisp/org/org
/home/joost/.elpa/org-plus-contrib-20150126/org-datetree hides /usr/local/share/emacs/24.4/lisp/org/org-datetree
/home/joost/.elpa/org-plus-contrib-20150126/org-bbdb hides /usr/local/share/emacs/24.4/lisp/org/org-bbdb
/home/joost/.elpa/org-plus-contrib-20150126/org-bibtex hides /usr/local/share/emacs/24.4/lisp/org/org-bibtex
/home/joost/.elpa/org-plus-contrib-20150126/ob-makefile hides /usr/local/share/emacs/24.4/lisp/org/ob-makefile
/home/joost/.elpa/org-plus-contrib-20150126/org-irc hides /usr/local/share/emacs/24.4/lisp/org/org-irc
/home/joost/.elpa/org-plus-contrib-20150126/ob-sqlite hides /usr/local/share/emacs/24.4/lisp/org/ob-sqlite
/home/joost/.elpa/org-plus-contrib-20150126/org-clock hides /usr/local/share/emacs/24.4/lisp/org/org-clock
/home/joost/.elpa/org-plus-contrib-20150126/ob-js hides /usr/local/share/emacs/24.4/lisp/org/ob-js
/home/joost/.elpa/org-plus-contrib-20150126/ox-publish hides /usr/local/share/emacs/24.4/lisp/org/ox-publish
/home/joost/.elpa/org-plus-contrib-20150126/ox-html hides /usr/local/share/emacs/24.4/lisp/org/ox-html
/home/joost/.elpa/org-plus-contrib-20150126/org-crypt hides /usr/local/share/emacs/24.4/lisp/org/org-crypt
/home/joost/.elpa/org-plus-contrib-20150126/ob-gnuplot hides /usr/local/share/emacs/24.4/lisp/org/ob-gnuplot
/home/joost/.elpa/org-plus-contrib-20150126/ox-org hides /usr/local/share/emacs/24.4/lisp/org/ox-org
/home/joost/.elpa/org-plus-contrib-20150126/org-docview hides /usr/local/share/emacs/24.4/lisp/org/org-docview
/home/joost/.elpa/org-plus-contrib-20150126/ob-maxima hides /usr/local/share/emacs/24.4/lisp/org/ob-maxima
/home/joost/.elpa/org-plus-contrib-20150126/ob-eval hides /usr/local/share/emacs/24.4/lisp/org/ob-eval
/home/joost/.elpa/org-plus-contrib-20150126/ox-latex hides /usr/local/share/emacs/24.4/lisp/org/ox-latex
/home/joost/.elpa/org-plus-contrib-20150126/ob-table hides /usr/local/share/emacs/24.4/lisp/org/ob-table
/home/joost/.elpa/org-plus-contrib-20150126/org-mhe hides /usr/local/share/emacs/24.4/lisp/org/org-mhe
/home/joost/.elpa/org-plus-contrib-20150126/ob-mscgen hides /usr/local/share/emacs/24.4/lisp/org/ob-mscgen
/home/joost/.elpa/org-plus-contrib-20150126/org-table hides /usr/local/share/emacs/24.4/lisp/org/org-table
/home/joost/.elpa/org-plus-contrib-20150126/org-gnus hides /usr/local/share/emacs/24.4/lisp/org/org-gnus
/home/joost/.elpa/org-plus-contrib-20150126/ox-ascii hides /usr/local/share/emacs/24.4/lisp/org/ox-ascii
/home/joost/.elpa/org-plus-contrib-20150126/ox-man hides /usr/local/share/emacs/24.4/lisp/org/ox-man
/home/joost/.elpa/org-plus-contrib-20150126/org-habit hides /usr/local/share/emacs/24.4/lisp/org/org-habit
/home/joost/.elpa/org-plus-contrib-20150126/ob-ocaml hides /usr/local/share/emacs/24.4/lisp/org/ob-ocaml
/home/joost/.elpa/org-plus-contrib-20150126/ob-latex hides /usr/local/share/emacs/24.4/lisp/org/ob-latex
/home/joost/.elpa/org-plus-contrib-20150126/org-rmail hides /usr/local/share/emacs/24.4/lisp/org/org-rmail
/home/joost/.elpa/org-plus-contrib-20150126/ob-C hides /usr/local/share/emacs/24.4/lisp/org/ob-C
/home/joost/.elpa/org-plus-contrib-20150126/ob-fortran hides /usr/local/share/emacs/24.4/lisp/org/ob-fortran
/home/joost/.elpa/org-plus-contrib-20150126/org-version hides /usr/local/share/emacs/24.4/lisp/org/org-version
/home/joost/.elpa/org-plus-contrib-20150126/ob-ruby hides /usr/local/share/emacs/24.4/lisp/org/ob-ruby
/home/joost/.elpa/org-plus-contrib-20150126/ob hides /usr/local/share/emacs/24.4/lisp/org/ob
/home/joost/.elpa/org-plus-contrib-20150126/org-indent hides /usr/local/share/emacs/24.4/lisp/org/org-indent
/home/joost/.elpa/org-plus-contrib-20150126/ob-lob hides /usr/local/share/emacs/24.4/lisp/org/ob-lob
/home/joost/.elpa/org-plus-contrib-20150126/org-faces hides /usr/local/share/emacs/24.4/lisp/org/org-faces
/home/joost/.elpa/org-plus-contrib-20150126/ob-lilypond hides /usr/local/share/emacs/24.4/lisp/org/ob-lilypond
/home/joost/.elpa/org-plus-contrib-20150126/ob-css hides /usr/local/share/emacs/24.4/lisp/org/ob-css
/home/joost/.elpa/org-plus-contrib-20150126/ob-ref hides /usr/local/share/emacs/24.4/lisp/org/ob-ref
/home/joost/.elpa/org-plus-contrib-20150126/org-w3m hides /usr/local/share/emacs/24.4/lisp/org/org-w3m
/home/joost/.elpa/org-plus-contrib-20150126/ob-matlab hides /usr/local/share/emacs/24.4/lisp/org/ob-matlab
/home/joost/.elpa/org-plus-contrib-20150126/ob-octave hides /usr/local/share/emacs/24.4/lisp/org/ob-octave
/home/joost/.elpa/org-plus-contrib-20150126/org-macs hides /usr/local/share/emacs/24.4/lisp/org/org-macs
/home/joost/.elpa/org-plus-contrib-20150126/org-feed hides /usr/local/share/emacs/24.4/lisp/org/org-feed
/home/joost/.elpa/org-plus-contrib-20150126/ob-org hides /usr/local/share/emacs/24.4/lisp/org/ob-org
/home/joost/.elpa/org-plus-contrib-20150126/org-element hides /usr/local/share/emacs/24.4/lisp/org/org-element
/home/joost/.elpa/org-plus-contrib-20150126/org-mobile hides /usr/local/share/emacs/24.4/lisp/org/org-mobile
/home/joost/.elpa/org-plus-contrib-20150126/ob-core hides /usr/local/share/emacs/24.4/lisp/org/ob-core
/home/joost/.elpa/org-plus-contrib-20150126/ob-haskell hides /usr/local/share/emacs/24.4/lisp/org/ob-haskell
/home/joost/.elpa/org-plus-contrib-20150126/org-footnote hides /usr/local/share/emacs/24.4/lisp/org/org-footnote
/home/joost/.elpa/org-plus-contrib-20150126/ob-io hides /usr/local/share/emacs/24.4/lisp/org/ob-io
/home/joost/.elpa/org-plus-contrib-20150126/org-archive hides /usr/local/share/emacs/24.4/lisp/org/org-archive
/home/joost/.elpa/org-plus-contrib-20150126/ob-asymptote hides /usr/local/share/emacs/24.4/lisp/org/ob-asymptote
/home/joost/.elpa/org-plus-contrib-20150126/ox hides /usr/local/share/emacs/24.4/lisp/org/ox
/home/joost/.elpa/org-plus-contrib-20150126/ox-beamer hides /usr/local/share/emacs/24.4/lisp/org/ox-beamer
/home/joost/.elpa/org-plus-contrib-20150126/ob-lisp hides /usr/local/share/emacs/24.4/lisp/org/ob-lisp
/home/joost/.elpa/org-plus-contrib-20150126/ob-plantuml hides /usr/local/share/emacs/24.4/lisp/org/ob-plantuml
/home/joost/.elpa/org-plus-contrib-20150126/org-list hides /usr/local/share/emacs/24.4/lisp/org/org-list
/home/joost/.elpa/org-plus-contrib-20150126/ob-sass hides /usr/local/share/emacs/24.4/lisp/org/ob-sass
/home/joost/.elpa/org-plus-contrib-20150126/ob-shen hides /usr/local/share/emacs/24.4/lisp/org/ob-shen
/home/joost/.elpa/org-plus-contrib-20150126/ob-screen hides /usr/local/share/emacs/24.4/lisp/org/ob-screen
/home/joost/.elpa/org-plus-contrib-20150126/ob-sql hides /usr/local/share/emacs/24.4/lisp/org/ob-sql
/home/joost/.elpa/org-plus-contrib-20150126/ob-calc hides /usr/local/share/emacs/24.4/lisp/org/ob-calc
/home/joost/.elpa/org-plus-contrib-20150126/org-attach hides /usr/local/share/emacs/24.4/lisp/org/org-attach
/home/joost/.elpa/org-plus-contrib-20150126/org-plot hides /usr/local/share/emacs/24.4/lisp/org/org-plot
/home/joost/.elpa/org-plus-contrib-20150126/ob-ditaa hides /usr/local/share/emacs/24.4/lisp/org/ob-ditaa
/home/joost/.elpa/org-plus-contrib-20150126/ob-sh hides /usr/local/share/emacs/24.4/lisp/org/ob-sh
/home/joost/.elpa/org-plus-contrib-20150126/org-ctags hides /usr/local/share/emacs/24.4/lisp/org/org-ctags
/home/joost/.elpa/org-plus-contrib-20150126/org-loaddefs hides /usr/local/share/emacs/24.4/lisp/org/org-loaddefs
/home/joost/.elpa/org-plus-contrib-20150126/ob-scala hides /usr/local/share/emacs/24.4/lisp/org/ob-scala
/home/joost/.elpa/org-plus-contrib-20150126/ob-emacs-lisp hides /usr/local/share/emacs/24.4/lisp/org/ob-emacs-lisp
/home/joost/.elpa/org-plus-contrib-20150126/org-mouse hides /usr/local/share/emacs/24.4/lisp/org/org-mouse
/home/joost/.elpa/org-plus-contrib-20150126/ob-python hides /usr/local/share/emacs/24.4/lisp/org/ob-python
/home/joost/.elpa/org-plus-contrib-20150126/org-agenda hides /usr/local/share/emacs/24.4/lisp/org/org-agenda
/home/joost/.elpa/org-plus-contrib-20150126/ob-clojure hides /usr/local/share/emacs/24.4/lisp/org/ob-clojure
/home/joost/.elpa/org-plus-contrib-20150126/org-info hides /usr/local/share/emacs/24.4/lisp/org/org-info
/home/joost/.elpa/org-plus-contrib-20150126/ob-java hides /usr/local/share/emacs/24.4/lisp/org/ob-java
/home/joost/.elpa/org-plus-contrib-20150126/ob-R hides /usr/local/share/emacs/24.4/lisp/org/ob-R
/home/joost/.elpa/org-plus-contrib-20150126/org-install hides /usr/local/share/emacs/24.4/lisp/org/org-install
/home/joost/.elpa/org-plus-contrib-20150126/ox-icalendar hides /usr/local/share/emacs/24.4/lisp/org/ox-icalendar
/home/joost/.elpa/org-plus-contrib-20150126/org-compat hides /usr/local/share/emacs/24.4/lisp/org/org-compat
/home/joost/.elpa/org-plus-contrib-20150126/org-entities hides /usr/local/share/emacs/24.4/lisp/org/org-entities
/home/joost/.elpa/org-plus-contrib-20150126/ox-md hides /usr/local/share/emacs/24.4/lisp/org/ox-md
/home/joost/.elpa/org-plus-contrib-20150126/org-colview hides /usr/local/share/emacs/24.4/lisp/org/org-colview
/home/joost/.elpa/org-plus-contrib-20150126/ob-awk hides /usr/local/share/emacs/24.4/lisp/org/ob-awk
/home/joost/.elpa/org-plus-contrib-20150126/ob-tangle hides /usr/local/share/emacs/24.4/lisp/org/ob-tangle
/home/joost/.elpa/org-plus-contrib-20150126/org-macro hides /usr/local/share/emacs/24.4/lisp/org/org-macro
/home/joost/.elpa/org-plus-contrib-20150126/ob-exp hides /usr/local/share/emacs/24.4/lisp/org/ob-exp
/home/joost/.elpa/org-plus-contrib-20150126/org-pcomplete hides /usr/local/share/emacs/24.4/lisp/org/org-pcomplete
/home/joost/.elpa/org-plus-contrib-20150126/ob-perl hides /usr/local/share/emacs/24.4/lisp/org/ob-perl
/home/joost/.elpa/org-plus-contrib-20150126/ob-comint hides /usr/local/share/emacs/24.4/lisp/org/ob-comint
/home/joost/.elpa/org-plus-contrib-20150126/org-id hides /usr/local/share/emacs/24.4/lisp/org/org-id
/home/joost/.elpa/org-plus-contrib-20150126/ob-keys hides /usr/local/share/emacs/24.4/lisp/org/ob-keys
/home/joost/.elpa/org-plus-contrib-20150126/org-timer hides /usr/local/share/emacs/24.4/lisp/org/org-timer
/home/joost/.elpa/org-plus-contrib-20150126/org-inlinetask hides /usr/local/share/emacs/24.4/lisp/org/org-inlinetask
/home/joost/.elpa/org-plus-contrib-20150126/org-src hides /usr/local/share/emacs/24.4/lisp/org/org-src
/home/joost/.elpa/org-plus-contrib-20150126/ox-odt hides /usr/local/share/emacs/24.4/lisp/org/ox-odt
/home/joost/.elpa/org-plus-contrib-20150126/org-protocol hides /usr/local/share/emacs/24.4/lisp/org/org-protocol
/home/joost/.elpa/org-plus-contrib-20150126/org-capture hides /usr/local/share/emacs/24.4/lisp/org/org-capture
/home/joost/.elpa/org-plus-contrib-20150126/org-eshell hides /usr/local/share/emacs/24.4/lisp/org/org-eshell
/home/joost/.elpa/org-plus-contrib-20150126/ob-ledger hides /usr/local/share/emacs/24.4/lisp/org/ob-ledger
/home/joost/.elpa/org-plus-contrib-20150126/ob-picolisp hides /usr/local/share/emacs/24.4/lisp/org/ob-picolisp
/home/joost/.elpa/org-plus-contrib-20150126/ox-texinfo hides /usr/local/share/emacs/24.4/lisp/org/ox-texinfo

Features:
(shadow emacsbug ace-window url-http url-gw url-auth url-queue url-cache
url url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf mailcap url-util url-parse url-vars elisp-slime-nav
projectile ibuf-ext ibuffer f paredit ebib ebib-filters ebib-keywords
ebib-db ebib-utils parsebib org-colview cal-china lunar solar cal-dst
cal-bahai cal-islam cal-hebrew holidays hol-loaddefs diary-lib
diary-loaddefs cal-iso org-element org-agenda typo pandoc-mode
markdown-mode thingatpt deft shr-color color shr epa-file gnutls
network-stream starttls tls mailalias qp mail-extr sort misearch
multi-isearch jump-char ace-jump-mode timezone parse-time texmathp
writeroom-mode preview prv-emacs tex-buf adaptive-wrap reftex-dcr reftex
reftex-vars tex-fold flyspell ispell face-remap font-latex latex
tex-style tex dbus xml crm tex-mode shell latexenc pcmpl-unix quail
em-unix em-term term disp-table ehelp em-script em-prompt em-ls em-hist
em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias esh-var
esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell
esh-module esh-mode esh-util ielm pp undo-tree diff org-drill org-learn
org-id hi-lock org-w3m org-rmail org-mhe org-irc org-info org-gnus
org-docview org-bibtex bibtex org-bbdb anti-zenburn-theme edit-server
ido-vertical-mode jk-functions auto-complete-config auto-complete popup
flymake eldoc company elpy pyvenv elpy-refactor python json grep compile
files-x etags cus-edit wid-edit guide-key s ucs-normalize popwin
hideshow aggressive-indent names edebug autopair org-mu4e org org-macro
org-footnote org-pcomplete pcomplete org-list org-faces org-entities
noutline outline org-version ob-python ob-emacs-lisp ob ob-tangle ob-ref
ob-lob ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval
org-compat org-macs org-loaddefs find-func cal-menu calendar
cal-loaddefs mu4e mu4e-speedbar speedbar sb-image ezimage dframe
mu4e-main mu4e-view epa derived epg browse-url mu4e-headers mu4e-compose
mu4e-draft mu4e-actions rfc2368 smtpmail auth-source eieio byte-opt
bytecomp byte-compile cconv eieio-core gnus-util password-cache sendmail
mu4e-mark mu4e-message html2text mu4e-proc mu4e-utils doc-view jka-compr
image-mode dired mu4e-lists mu4e-about mu4e-vars message cl-macs
format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mailabbrev
mail-utils gmm-utils mailheader hl-line mu4e-meta offlineimap comint
ansi-color ring yasnippet help-mode cl gv windmove swbuff-jk swbuff
smart-mode-line-respectful-theme rich-minority smart-mode-line mule-util
dash visual-fill-column server edmacro kmacro cl-loaddefs cl-lib paren
ido delsel cus-start cus-load adaptive-wrap-autoloads tex-site advice
help-fns info easymenu package epg-config bind-key easy-mmode time-date
tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp
files text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 749602 67603)
 (symbols 48 53753 0)
 (miscs 40 4968 8773)
 (strings 32 162236 29282)
 (string-bytes 1 4424883)
 (vectors 16 78290)
 (vector-slots 8 1973759 149184)
 (floats 8 1419 1415)
 (intervals 56 26254 4869)
 (buffers 960 60)
 (heap 1024 80290 20455))

-- 
Joost Kremers
Life has its moments




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19720; Package emacs. (Thu, 29 Jan 2015 02:43:02 GMT) Full text and rfc822 format available.

Message #8 received at 19720 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Joost Kremers <joostkremers <at> fastmail.fm>
Cc: 19720 <at> debbugs.gnu.org
Subject: Re: bug#19720: 24.4;
 minor mode's font-lock-add-keywords & auto-mode-alist problem
Date: Wed, 28 Jan 2015 21:42:40 -0500
Joost Kremers wrote:

> Font lock keywords added with `font-lock-add-keywords' in a minor mode's
> activation function do not work when the minor mode is activated in a
> major mode's hook and the major mode is activated through an entry in
> `auto-mode-alist'.

The minimal example works fine:

emacs-24.4 -Q -l foo.el foo.txt

where foo.el has contents:

  (define-minor-mode foobar-mode "blah" :initial-value nil
    (font-lock-add-keywords nil '(("foobar" . 'font-lock-warning-face))))

  (add-hook 'text-mode-hook 'foobar-mode)

and foo.txt contains:

  foobar

foobar gets font-lock-warning-face.

So your problem may be specific to your specific modes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19720; Package emacs. (Thu, 29 Jan 2015 03:15:03 GMT) Full text and rfc822 format available.

Message #11 received at 19720 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Glenn Morris <rgm <at> gnu.org>,
 Joost Kremers <joostkremers <at> fastmail.fm>
Cc: 19720 <at> debbugs.gnu.org
Subject: Re: bug#19720: 24.4; minor mode's font-lock-add-keywords &
 auto-mode-alist problem
Date: Thu, 29 Jan 2015 05:14:24 +0200
On 01/29/2015 04:42 AM, Glenn Morris wrote:

>    (add-hook 'text-mode-hook 'foobar-mode)

I think we need a better example: text-mode doesn't even set 
font-lock-keywords.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19720; Package emacs. (Thu, 29 Jan 2015 04:00:02 GMT) Full text and rfc822 format available.

Message #14 received at 19720 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Joost Kremers <joostkremers <at> fastmail.fm>, 19720 <at> debbugs.gnu.org
Subject: Re: bug#19720: 24.4;
 minor mode's font-lock-add-keywords & auto-mode-alist problem
Date: Wed, 28 Jan 2015 22:59:14 -0500
Dmitry Gutov wrote:

> On 01/29/2015 04:42 AM, Glenn Morris wrote:
>
>>    (add-hook 'text-mode-hook 'foobar-mode)
>
> I think we need a better example: text-mode doesn't even set
> font-lock-keywords.

s/text/f90

same result.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19720; Package emacs. (Thu, 29 Jan 2015 06:43:02 GMT) Full text and rfc822 format available.

Message #17 received at 19720 <at> debbugs.gnu.org (full text, mbox):

From: Joost Kremers <joostkremers <at> fastmail.fm>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 19720 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#19720: 24.4;
 minor mode's font-lock-add-keywords & auto-mode-alist problem
Date: Thu, 29 Jan 2015 07:42:23 +0100
On Thu, Jan 29 2015, Glenn Morris <rgm <at> gnu.org> wrote:
> Dmitry Gutov wrote:
>
>> On 01/29/2015 04:42 AM, Glenn Morris wrote:
>>
>>>    (add-hook 'text-mode-hook 'foobar-mode)
>>
>> I think we need a better example: text-mode doesn't even set
>> font-lock-keywords.
>
> s/text/f90
>
> same result.

Yup. Looks like it's a problem with `markdown-mode'.

Sorry for the noise.


-- 
Joost Kremers
Life has its moments




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19720; Package emacs. (Thu, 29 Jan 2015 10:13:02 GMT) Full text and rfc822 format available.

Message #20 received at 19720 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Joost Kremers <joostkremers <at> fastmail.fm>,
 Glenn Morris <rgm <at> gnu.org>
Cc: 19720 <at> debbugs.gnu.org
Subject: Re: bug#19720: 24.4; minor mode's font-lock-add-keywords &
 auto-mode-alist problem
Date: Thu, 29 Jan 2015 12:11:52 +0200
On 01/29/2015 08:42 AM, Joost Kremers wrote:

> Yup. Looks like it's a problem with `markdown-mode'.

But what kind of problem?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19720; Package emacs. (Thu, 29 Jan 2015 11:12:02 GMT) Full text and rfc822 format available.

Message #23 received at 19720 <at> debbugs.gnu.org (full text, mbox):

From: Joost Kremers <joostkremers <at> fastmail.fm>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 19720 <at> debbugs.gnu.org
Subject: Re: bug#19720: 24.4;
 minor mode's font-lock-add-keywords & auto-mode-alist problem
Date: Thu, 29 Jan 2015 12:11:16 +0100
On Thu, Jan 29 2015, Dmitry Gutov <dgutov <at> yandex.ru> wrote:
> On 01/29/2015 08:42 AM, Joost Kremers wrote:
>
>> Yup. Looks like it's a problem with `markdown-mode'.
>
> But what kind of problem?

I've been trying to figure that out, but haven't gotten very far yet.
I'm no expert on font-lock and I can't really tell if `markdown-mode'
does anything out of the ordinary with it.

I'll take this back to gnu.emacs.help and also send the maintainer of
`markdown-mode' an email. Perhaps he can shed some light on this.

-- 
Joost Kremers
Life has its moments




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19720; Package emacs. (Thu, 29 Jan 2015 11:37:02 GMT) Full text and rfc822 format available.

Message #26 received at 19720 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Joost Kremers <joostkremers <at> fastmail.fm>
Cc: 19720 <at> debbugs.gnu.org
Subject: Re: bug#19720: 24.4; minor mode's font-lock-add-keywords &
 auto-mode-alist problem
Date: Thu, 29 Jan 2015 13:36:41 +0200
On 01/29/2015 01:11 PM, Joost Kremers wrote:

> I've been trying to figure that out, but haven't gotten very far yet.
> I'm no expert on font-lock and I can't really tell if `markdown-mode'
> does anything out of the ordinary with it.
>
> I'll take this back to gnu.emacs.help and also send the maintainer of
> `markdown-mode' an email. Perhaps he can shed some light on this.

Looks like the problem is that `markdown-reload-extensions', which is 
called from `markdown-mode', not only sets `font-lock-defaults', but 
also calls `font-lock-refresh-defaults'.

This function is also added to `hack-local-variables-hook'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19720; Package emacs. (Thu, 29 Jan 2015 15:13:02 GMT) Full text and rfc822 format available.

Message #29 received at 19720 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: Joost Kremers <joostkremers <at> fastmail.fm>, 19720 <at> debbugs.gnu.org
Subject: Re: bug#19720: 24.4;
 minor mode's font-lock-add-keywords & auto-mode-alist problem
Date: Thu, 29 Jan 2015 10:12:54 -0500
> Looks like the problem is that `markdown-reload-extensions', which is called
> from `markdown-mode', not only sets `font-lock-defaults', but also calls
> `font-lock-refresh-defaults'.

FWIW, I think part of the problem is that there's no way to "reset
font-lock-keywords" without throwing away all the keywords added via
font-lock-add-keywords.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19720; Package emacs. (Fri, 30 Jan 2015 17:01:01 GMT) Full text and rfc822 format available.

Message #32 received at 19720 <at> debbugs.gnu.org (full text, mbox):

From: Joost Kremers <joostkremers <at> fastmail.fm>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 19720 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#19720: 24.4;
 minor mode's font-lock-add-keywords & auto-mode-alist problem
Date: Fri, 30 Jan 2015 17:59:57 +0100
On Thu, Jan 29 2015, Stefan Monnier <monnier <at> IRO.UMontreal.CA> wrote:
>> Looks like the problem is that `markdown-reload-extensions', which is called
>> from `markdown-mode', not only sets `font-lock-defaults', but also calls
>> `font-lock-refresh-defaults'.
>
> FWIW, I think part of the problem is that there's no way to "reset
> font-lock-keywords" without throwing away all the keywords added via
> font-lock-add-keywords.

But why does it only happen when the mode is set through an entry in
`auto-mode-alist' and not when I activate `markdown-mode' myself with
`M-x markdown-mode'? 

-- 
Joost Kremers
Life has its moments




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19720; Package emacs. (Wed, 30 Oct 2019 15:52:02 GMT) Full text and rfc822 format available.

Message #35 received at 19720 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Joost Kremers <joostkremers <at> fastmail.fm>
Cc: 19720 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#19720: 24.4; minor mode's font-lock-add-keywords &
 auto-mode-alist problem
Date: Wed, 30 Oct 2019 16:51:30 +0100
Joost Kremers <joostkremers <at> fastmail.fm> writes:

> I've been trying to figure that out, but haven't gotten very far yet.
> I'm no expert on font-lock and I can't really tell if `markdown-mode'
> does anything out of the ordinary with it.
>
> I'll take this back to gnu.emacs.help and also send the maintainer of
> `markdown-mode' an email. Perhaps he can shed some light on this.

This seems to be a problem in markdown-mode (which is an external
package), and not in Emacs, so I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 19720 <at> debbugs.gnu.org and Joost Kremers <joostkremers <at> fastmail.fm> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 30 Oct 2019 15:52:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 28 Nov 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 143 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.