Skip to content

Commit

Permalink
Add <code> tag.
Browse files Browse the repository at this point in the history
* lisp/muse-colors.el (muse-colors-tags): Switch coloring of code and
  verbatim.  Verbatim makes text literal and escaped, code makes text
  teletype and escaped.

* muse-publish.el (muse-publish-markup-tags): Add "code".
  (muse-publish-code-tag): New function that publishes code the same way
  as =teletyped= text.
git-archimport-id: mwolson@gnu.org--2005/muse--main--1.0--patch-224
  • Loading branch information
mwolson committed Sep 5, 2005
1 parent 3e500bb commit d0b583c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
19 changes: 19 additions & 0 deletions ChangeLog
Expand Up @@ -2,6 +2,25 @@
# arch-tag: automatic-ChangeLog--mwolson@gnu.org--2005/muse--main--1.0
#

2005-09-05 14:24:22 GMT Michael Olson <mwolson@gnu.org> patch-224

Summary:
Add <code> tag.
Revision:
muse--main--1.0--patch-224

* lisp/muse-colors.el (muse-colors-tags): Switch coloring of code and
verbatim. Verbatim makes text literal and escaped, code makes text
teletype and escaped.

* muse-publish.el (muse-publish-markup-tags): Add "code".
(muse-publish-code-tag): New function that publishes code the same way
as =teletyped= text.

modified files:
ChangeLog lisp/muse-colors.el lisp/muse-publish.el


2005-09-05 13:24:19 GMT Michael Olson <mwolson@gnu.org> patch-223

Summary:
Expand Down
4 changes: 2 additions & 2 deletions lisp/muse-colors.el
Expand Up @@ -442,8 +442,8 @@ of the functions listed in `muse-colors-markup'."

(defcustom muse-colors-tags
'(("example" t nil muse-colors-example-tag)
("verbatim" t nil muse-colors-example-tag)
("code" t nil muse-colors-literal-tag)
("code" t nil muse-colors-example-tag)
("verbatim" t nil muse-colors-literal-tag)
("lisp" t nil muse-colors-literal-tag)
("literal" t nil muse-colors-literal-tag))
"A list of tag specifications for specially highlighting text.
Expand Down
25 changes: 17 additions & 8 deletions lisp/muse-publish.el
Expand Up @@ -265,6 +265,7 @@ current style."
'(("contents" nil t muse-publish-contents-tag)
("verse" t nil muse-publish-verse-tag)
("example" t nil muse-publish-example-tag)
("code" t nil muse-publish-code-tag)
("literal" t nil muse-publish-mark-read-only)
("verbatim" t nil muse-publish-verbatim-tag)
("lisp" t nil muse-publish-lisp-tag)
Expand Down Expand Up @@ -1091,14 +1092,6 @@ like read-only from being inadvertently deleted."
(if (eq ?\ (char-syntax (char-before)))
(delete-char -1))))

(defun muse-publish-example-tag (beg end)
(muse-publish-escape-specials beg end)
(goto-char beg)
(insert (muse-markup-text 'begin-example))
(goto-char end)
(insert (muse-markup-text 'end-example))
(muse-publish-mark-read-only beg (point)))

(defun muse-publish-mark-read-only (beg end)
(add-text-properties beg end '(rear-nonsticky (read-only) read-only t))
nil)
Expand All @@ -1109,6 +1102,22 @@ like read-only from being inadvertently deleted."
(add-text-properties beg end '(noemphasis t))
nil)

(defun muse-publish-code-tag (beg end)
(muse-publish-escape-specials beg end)
(goto-char beg)
(insert (muse-markup-text 'begin-literal))
(goto-char end)
(insert (muse-markup-text 'end-literal))
(muse-publish-mark-read-only beg (point)))

(defun muse-publish-example-tag (beg end)
(muse-publish-escape-specials beg end)
(goto-char beg)
(insert (muse-markup-text 'begin-example))
(goto-char end)
(insert (muse-markup-text 'end-example))
(muse-publish-mark-read-only beg (point)))

(defun muse-publish-verbatim-tag (beg end)
(muse-publish-escape-specials beg end)
(muse-publish-mark-read-only beg end))
Expand Down

0 comments on commit d0b583c

Please sign in to comment.