From 6d9a45a2e4d8f02ab2b67dbd752c53bad4d9a3c5 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Sat, 21 Jul 2007 15:22:48 +0000 Subject: [PATCH] planner-calendar: Make « and » work * planner-calendar.el (planner-calendar-prev-month-href) (planner-calendar-next-month-href): Don't escape specials specials in the URL description. This should fix a bug with "«" and "»". * planner-publish.el (planner-publish-ignore-url-desc-specials): New variable that determines whether to ignore specials in URL descriptions. (planner-publish-decide-specials): New function that uses this variable. ("planner-xml", "planner-xhtml", "planner-xhtml"): Set :specials to planner-publish-decide-specials. git-archimport-id: mwolson@gnu.org--2006-planner-el/planner-el--devel--0--patch-125 --- ChangeLog | 11 +++++++++++ planner-calendar.el | 6 ++++-- planner-publish.el | 13 +++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8cf58d4..da1f770 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,9 +6,20 @@ planner-publish.el: Remove support for old markup-tag syntax, now that Muse 3.03 is released. + * planner-calendar.el (planner-calendar-prev-month-href) + (planner-calendar-next-month-href): Don't escape specials specials + in the URL description. This should fix a bug with "«" and + "»". + * planner-publish.el: Error out when loading if we have Muse less than 3.03. Also, remove `unless' wrapper around uses of muse-derive-style. + (planner-publish-ignore-url-desc-specials): New variable that + determines whether to ignore specials in URL descriptions. + (planner-publish-decide-specials): New function that uses this + variable. + ("planner-xml", "planner-xhtml", "planner-xhtml"): Set :specials + to planner-publish-decide-specials. * planner-el.texi: Replace "www.mwolson.org" with "mwolson.org" for brevity. diff --git a/planner-calendar.el b/planner-calendar.el index f1a1e1c..667e21d 100644 --- a/planner-calendar.el +++ b/planner-calendar.el @@ -312,7 +312,8 @@ support POSIX \"ln\"." (defun planner-calendar-prev-month-href (month year name &optional nop max-days) "Return an href anchor string for the last day page in the previous month." (let ((prev-date (planner-calendar-prev-date (list month 1 year) max-days)) - (muse-publish-desc-transforms nil)) + (muse-publish-desc-transforms nil) + (planner-publish-ignore-url-desc-specials t)) (planner-calendar-published-file-href (planner-calendar-date-to-filename prev-date) name nop))) @@ -322,7 +323,8 @@ support POSIX \"ln\"." (planner-calendar-next-date (list month (calendar-last-day-of-month month year) year) max-days)) - (muse-publish-desc-transforms nil)) + (muse-publish-desc-transforms nil) + (planner-publish-ignore-url-desc-specials t)) (planner-calendar-published-file-href (planner-calendar-date-to-filename next-date) name nop))) diff --git a/planner-publish.el b/planner-publish.el index 906ba9d..5297adb 100644 --- a/planner-publish.el +++ b/planner-publish.el @@ -446,6 +446,16 @@ See `muse-publish-markup-regexps' for details on the syntax used." ;;;_ + Markup +(defvar planner-publish-ignore-url-desc-specials nil + "If non-nil, do not escape specials in URL descriptions.") + +(defun planner-publish-decide-specials (context) + "Determine the specials to escape for Planner, depending on CONTEXT." + (if (and (eq context 'url-desc) + planner-publish-ignore-url-desc-specials) + nil + (muse-xml-decide-specials context))) + (defun planner-publish-markup-task () "Replace tasks with XML representation of task data." (save-restriction @@ -731,6 +741,7 @@ DIRECTORY and START." :regexps 'planner-publish-markup-regexps :functions 'planner-publish-markup-functions :tags 'planner-publish-markup-tags + :specials 'planner-publish-decide-specials :strings 'planner-xml-markup-strings :before 'planner-publish-prepare-buffer :after 'planner-publish-finalize-buffer @@ -741,6 +752,7 @@ DIRECTORY and START." :regexps 'planner-publish-markup-regexps :functions 'planner-publish-markup-functions :tags 'planner-publish-markup-tags + :specials 'planner-publish-decide-specials :strings 'planner-html-markup-strings :before 'planner-publish-prepare-buffer :after 'planner-publish-finalize-buffer @@ -751,6 +763,7 @@ DIRECTORY and START." :regexps 'planner-publish-markup-regexps :functions 'planner-publish-markup-functions :tags 'planner-publish-markup-tags + :specials 'planner-publish-decide-specials :strings 'planner-html-markup-strings :before 'planner-publish-prepare-buffer :after 'planner-publish-finalize-buffer -- 2.11.4.GIT