[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emacs-wiki-discuss] Re: Escaping '=' in markup
From: |
Trent Buck |
Subject: |
Re: [emacs-wiki-discuss] Re: Escaping '=' in markup |
Date: |
Tue, 26 Jul 2005 20:03:25 +1000 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Michael Olson <address@hidden> writes:
> Once I get back from vacation, I'd like to implement a <code> tag that is
> marked up the exact way as =equal signs= are. That way, you can wrap such
> lines in <code> and things will just work. In the interim, <verbatim> might
> potentially do what you want.
Is this sufficient?
;;; Escape text in <code> tags.
(add-to-list 'emacs-wiki-markup-tags
'("code" t nil t emacs-wiki-code-tag))
;; Based on emacs-wiki-publish.el:emacs-wiki-example-tag
(defun emacs-wiki-code-tag (beg end highlight-p)
(if highlight-p
(progn
(remove-text-properties
beg end '(face nil font-lock-multiline nil
invisible nil intangible nil display nil
mouse-face nil keymap nil help-echo nil))
(goto-char end))
(insert "<code>")
(emacs-wiki-escape-html-specials end)
(when (< (point) end)
(goto-char end))
(insert "</code>")
(add-text-properties beg (point) '(rear-nonsticky (read-only)
read-only t))))
I have a bunch of code in the following files that I haven't bothered to clean
up, since I expect to move to Muse first.
http://twb.ath.cx/~twb/src/my-elisp/emacs-wiki-elide.el
http://twb.ath.cx/~twb/src/my-elisp/emacs-wiki-fixes.el
http://twb.ath.cx/~twb/src/my-elisp/emacs-wiki-graph.el
http://twb.ath.cx/~twb/src/my-elisp/emacs-wiki-svg.el
http://twb.ath.cx/~twb/src/my-elisp/emacs-wiki-wtf.el
--
Trent Buck, Student Errant