all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: E Sabof <esabof@gmail.com>
To: 14179@debbugs.gnu.org
Subject: bug#14179: [PATCH] hi-lock: more appropriate use of font-locking
Date: Thu, 11 Apr 2013 05:19:13 +0100	[thread overview]
Message-ID: <CAEp6DyYoy2zsD5648V+HbuDMuvveVt=469ooH6ooLJD0U328RA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 810 bytes --]

Most modes that use custom fontification (ex occur-mode), won't turn the
font-lock-mode off. So hi-lock would add a keyword, and remove all existing
fontification. The below patch fixes this behaviour.

Evgeni

Modified   lisp/hi-lock.el
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index e2dc4ea..e16ed76 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -689,7 +689,7 @@ Otherwise, read face name from minibuffer with
completion and history."
     ;; Refuse to highlight a text that is already highlighted.
     (unless (assoc regexp hi-lock-interactive-patterns)
       (push pattern hi-lock-interactive-patterns)
-      (if font-lock-mode
+      (if (and font-lock-mode (font-lock-specified-p major-mode))
   (progn
     (font-lock-add-keywords nil (list pattern) t)
     (font-lock-fontify-buffer))

[-- Attachment #2: Type: text/html, Size: 1445 bytes --]

             reply	other threads:[~2013-04-11  4:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11  4:19 E Sabof [this message]
2013-12-20 19:47 ` bug#14179: [PATCH] hi-lock: more appropriate use of font-locking 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='CAEp6DyYoy2zsD5648V+HbuDMuvveVt=469ooH6ooLJD0U328RA@mail.gmail.com' \
    --to=esabof@gmail.com \
    --cc=14179@debbugs.gnu.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.