From 4c56f72f9b1cf42afdd06984bb4f83c382313a41 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Mon, 7 Aug 2006 20:53:06 +0000 Subject: [PATCH] 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 --- ChangeLog.3 | 2 +- NEWS | 22 ++++++++++++++++++---- lisp/muse-latex.el | 20 +++++++++++++++++++- lisp/muse-publish.el | 6 +++++- lisp/muse-texinfo.el | 2 +- lisp/muse-xml-common.el | 2 +- 6 files changed, 45 insertions(+), 9 deletions(-) diff --git a/ChangeLog.3 b/ChangeLog.3 index 6dde86a..93473d3 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -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 diff --git a/NEWS b/NEWS index 90d5ae6..511c6b2 100644 --- a/NEWS +++ b/NEWS @@ -61,10 +61,6 @@ fashion. **** Mention how to customize the WikiName recognition. -*** Emphasizing Text - -**** Mention the 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 **** -- 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. diff --git a/lisp/muse-latex.el b/lisp/muse-latex.el index 9b4d0be..ab3d178 100644 --- a/lisp/muse-latex.el +++ b/lisp/muse-latex.el @@ -296,7 +296,7 @@ This applies to =monospaced text= and 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) diff --git a/lisp/muse-publish.el b/lisp/muse-publish.el index 71b4a3f..70edf78 100644 --- a/lisp/muse-publish.el +++ b/lisp/muse-publish.el @@ -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 region (monospaced, block context, escaped) '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) diff --git a/lisp/muse-texinfo.el b/lisp/muse-texinfo.el index be6f407..f23bd27 100644 --- a/lisp/muse-texinfo.el +++ b/lisp/muse-texinfo.el @@ -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))) diff --git a/lisp/muse-xml-common.el b/lisp/muse-xml-common.el index a96f81f..1adc107 100644 --- a/lisp/muse-xml-common.el +++ b/lisp/muse-xml-common.el @@ -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) -- 2.11.4.GIT