all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Juri Linkov <juri@jurta.org>
Cc: 1744@emacsbugs.donarmstrong.com
Subject: bug#1744: bug-reference-mode doesn't fontify when called from mode hook
Date: Thu, 08 Jan 2009 20:48:28 -0500	[thread overview]
Message-ID: <ag1vvdtfkj.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <877i5hfctm.fsf@jurta.org> (Juri Linkov's message of "Wed, 31 Dec 2008 01:44:21 +0200")

Juri Linkov wrote:

>   (add-hook 'change-log-mode-hook 'bug-reference-mode)
>
> and a file local variable `bug-reference-url-format'
> in the ChangeLog file:
[...]
> bug references never get fontified because `bug-reference-mode' tests
> whether a variable `bug-reference-url-format' is non-nil before calling
> `(jit-lock-register #'bug-reference-fontify)' in `bug-reference-mode',
> and this variable is not yet set because it gets initialized later
> in `hack-local-variables' called after `set-auto-mode' in `normal-mode'.


This reminds me a bit of bug#347. How about something like this:


*** bug-reference.el	5 Jan 2009 03:23:16 -0000	1.6
--- bug-reference.el	9 Jan 2009 01:47:30 -0000
***************
*** 114,121 ****
    ""
    nil
    (if bug-reference-mode
        (when bug-reference-url-format
! 	(jit-lock-register #'bug-reference-fontify))
      (jit-lock-unregister #'bug-reference-fontify)
      (save-restriction
        (widen)
--- 114,125 ----
    ""
    nil
    (if bug-reference-mode
+       (progn
+ 	(let ((enable-local-variables :safe)
+ 	      (enable-local-eval nil))
+ 	  (hack-local-variables))
  	(when bug-reference-url-format
! 	  (jit-lock-register #'bug-reference-fontify)))
      (jit-lock-unregister #'bug-reference-fontify)
      (save-restriction
        (widen)






  reply	other threads:[~2009-01-09  1:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87vdsiaf7z.fsf@jurta.org>
2008-12-30 23:44 ` bug#1744: bug-reference-mode doesn't fontify when called from mode hook Juri Linkov
2009-01-09  1:48   ` Glenn Morris [this message]
2009-01-12  0:57     ` Juri Linkov
2009-01-12  1:36       ` Glenn Morris
2009-01-12 21:06         ` Stefan Monnier
2009-01-14  0:50   ` bug#1744: marked as done (bug-reference-mode doesn't fontify when called from mode hook) Emacs bug Tracking System

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=ag1vvdtfkj.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=1744@emacsbugs.donarmstrong.com \
    --cc=juri@jurta.org \
    /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.