Permalink
Browse files

Use separate escaping for embedded images.

* NEWS: Update through patch-95.

* lisp/muse-latex.el (muse-latex-markup-specials-url): Use
  \textbackslash{} for "\".  Thanks to Jim Ottaway for the suggestion.
  (muse-latex-markup-specials-image): New option that enables escaping of
  specials in images.  This was split from the URL specials.
  (muse-latex-decide-specials): Handle 'image context.

* lisp/muse-publish.el (muse-publish-escape-specials): Document 'image
  context.
  (muse-publish-url): Use 'image context for images.

* lisp/muse-texinfo.el (muse-texinfo-decide-specials): Treat images the
  same as URLs.

* lisp/muse-xml-common.el (muse-xml-decide-specials): Ditto.
git-archimport-id: mwolson@gnu.org--2006/muse--main--1.0--patch-176
  • Loading branch information...
1 parent 2639b2f commit 4c56f72f9b1cf42afdd06984bb4f83c382313a41 @mwolson mwolson committed Aug 7, 2006
Showing with 45 additions and 9 deletions.
  1. +1 −1 ChangeLog.3
  2. +18 −4 NEWS
  3. +19 −1 lisp/muse-latex.el
  4. +5 −1 lisp/muse-publish.el
  5. +1 −1 lisp/muse-texinfo.el
  6. +1 −1 lisp/muse-xml-common.el
View
@@ -1690,7 +1690,7 @@
* lisp/muse-wiki.el:: Add muse-wiki-update-local-wikiword-regexp to
muse-before-publish-hook and muse-mode-hook so that implicit links are
published properly.
- (muse-wiki-wikiword-match-project-files): New option for determining
+ (muse-wiki-match-all-project-files): New option for determining
whether to match all project files as implicit links. This is off by
default.
(muse-wiki-update-local-wikiword-regexp): New function to make the
View
22 NEWS
@@ -61,10 +61,6 @@ fashion.
**** Mention how to customize the WikiName recognition.
-*** Emphasizing Text
-
-**** Mention the <code> tag.
-
*** Extending Muse
**** Move "Common Elements" and "Deriving Styles" chapters here.
@@ -157,6 +153,8 @@ buffers before publishing.
*** If we cannot find a project to publish, indicate this in an
error message. This fixes an infinite loop.
+*** Update the file-alist whenever a Muse file is saved.
+
** Publishing (lisp/muse-publish.el)
*** Implement escaping of specials throughout the entire document.
@@ -210,6 +208,9 @@ This allows for more flexibility, since some people seem to prefer to
have the emdash directly against the surrounding text, while others
like it to be spaced.
+*** If the #disable-tables publishing directive exists on the current
+Muse page, do not generate a table.
+
*** New tags, see the Tag Summary section in the manual for details
**** <comment> -- Designate entire regions as comments.
@@ -242,6 +243,19 @@ empty string.
*** Fix some bugs.
+*** New option: muse-wiki-wikiword-match-project-files.
+Whether to extend WikiName functionality to also match
+existing filenames, regardless of whether they are named in
+WikiWord format.
+
+If non-nil, Muse will color and publish implicit links to any
+file in your project. The default is nil.
+
+*** Match filenames in the project before the general WikiWord
+regexp.
+
+*** Take the value of `muse-wiki-hide-nop-tag' into account.
+
** XML publishing (lisp/muse-xml.el)
*** Update examples/muse.rnc to handle nested list items.
View
@@ -296,7 +296,7 @@ This applies to =monospaced text= and <code> regions."
:group 'muse-latex)
(defcustom muse-latex-markup-specials-url
- '((?\\ . "\\\\")
+ '((?\\ . "\\textbackslash{}")
(?\_ . "\\_")
(?\< . "\\<")
(?\> . "\\>")
@@ -311,10 +311,28 @@ These are applied to URLs."
:type '(alist :key-type character :value-type string)
:group 'muse-latex)
+(defcustom muse-latex-markup-specials-image
+ '((?\\ . "\\textbackslash{}") ; cannot find suitable replacement
+ (?\< . "\\<")
+ (?\> . "\\>")
+ (?\$ . "\\$")
+ (?\% . "\\%")
+ (?\{ . "\\{")
+ (?\} . "\\}")
+ (?\& . "\\&")
+ (?\# . "\\#") ; cannot find suitable replacement
+ )
+ "A table of characters which must be represented specially.
+These are applied to image filenames."
+ :type '(alist :key-type character :value-type string)
+ :group 'muse-latex)
+
(defun muse-latex-decide-specials (context)
"Determine the specials to escape, depending on CONTEXT."
(cond ((memq context '(underline emphasis document url-desc verbatim))
muse-latex-markup-specials-document)
+ ((eq context 'image)
+ muse-latex-markup-specials-image)
((memq context '(email url))
muse-latex-markup-specials-url)
((eq context 'literal)
View
@@ -795,6 +795,7 @@ The following contexts exist in Muse.
'email email@example.com
'url http://example.com
'url-desc [[...][description of an explicit link]]
+'image [[image.png]]
'example <example> region (monospaced, block context, escaped)
'verbatim <verbatim> region (escaped)
'document normal text"
@@ -1318,7 +1319,10 @@ the cadr is the page name, and the cddr is the anchor."
(muse-publish-escape-specials-in-string orig-url 'url-desc))
(let ((target (muse-publish-classify-url url)))
(setq type (car target)
- url (muse-publish-escape-specials-in-string (cadr target) 'url)
+ url (if (eq type 'image)
+ (muse-publish-escape-specials-in-string (cadr target)
+ 'image)
+ (muse-publish-escape-specials-in-string (cadr target) 'url))
anchor (muse-publish-escape-specials-in-string
(cddr target) 'url)))
(cond ((eq type 'anchor-ref)
View
@@ -195,7 +195,7 @@ These are applied to URLs."
(defun muse-texinfo-decide-specials (context)
"Determine the specials to escape, depending on CONTEXT."
- (cond ((eq context 'url)
+ (cond ((memq context '(url image))
muse-texinfo-markup-specials-url)
(t muse-texinfo-markup-specials)))
View
@@ -82,7 +82,7 @@ These are extra characters that are escaped within URLs."
(defun muse-xml-decide-specials (context)
"Determine the specials to escape, depending on CONTEXT."
- (cond ((memq context '(email url))
+ (cond ((memq context '(email url image))
'muse-xml-escape-url)
((eq context 'url-extra)
muse-xml-markup-specials-url-extra)

0 comments on commit 4c56f72

Please sign in to comment.