[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] Re: font-locking verbatim
From: |
Sacha Chua |
Subject: |
[emacs-wiki-discuss] Re: font-locking verbatim |
Date: |
Wed, 21 Apr 2004 23:27:13 +0800 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) |
address@hidden writes:
> Is there a way to put <verbatim> content (in Emacs) into a
> different colour?
The following patch does that, but I'm not sure if we should have it
in planner-dev, as it overrides whatever other faces there are on that
span. I can see how this might be useful for <example>, though. Then
again, since <example> needs to be processed first anyway so that
weird things don't happen, I guess it's all right. Can anyone second
the idea before I commit it to dev?
* looking for address@hidden/emacs-wiki--dev--1.0--patch-17 to compare with
* comparing to address@hidden/emacs-wiki--dev--1.0--patch-17
M emacs-wiki.el
* modified files
--- orig/emacs-wiki.el
+++ mod/emacs-wiki.el
@@ -1678,7 +1678,9 @@
(let ((start (- (point) 2))
end)
(when (setq end (emacs-wiki-highlight-ok-context-p start end "="))
- (search-forward "=" end t))))
+ (search-forward "=" end t)
+ (add-text-properties start (match-end 0)
+ '(face emacs-wiki-verbatim-face)))))
(defcustom emacs-wiki-highlight-markup
`(;; render in teletype and suppress further parsing
@@ -3124,10 +3126,15 @@
(add-text-properties beg (point) '(rear-nonsticky (read-only)
read-only t))))
+(defface emacs-wiki-verbatim-face
+ '((t (:foreground "gray")))
+ "Face for verbatim text.")
+
(defun emacs-wiki-verbatim-tag (beg end highlight-p)
(if highlight-p
(progn
(emacs-wiki-multiline-maybe beg end)
+ (add-text-properties beg end '(face emacs-wiki-verbatim-face))
(goto-char end))
(emacs-wiki-escape-html-specials end)
(add-text-properties beg end '(rear-nonsticky (read-only)
--
Sacha Chua <address@hidden> - Ateneo CS faculty geekette
interests: emacs, gnu/linux, making computer science education fun
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C