From 1ec171540d7cd4b4d288715833daf9809aee7b6b Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Thu, 17 Nov 2005 01:10:00 +0000 Subject: [PATCH] Merged from mwolson@gnu.org--2005 (patch 242-246, 249, 251-252, 255-257) Apply "safe" changes from muse--main--1.0. We're trying to make a minor release of 3.02 that isn't in so much flux. Patches applied: * jeho@jeho.org--2005/muse--jeho--1.0--base-0 tag of mwolson@gnu.org--2005/muse--main--1.0--patch-12 * jeho@jeho.org--2005/muse--jeho--1.0--patch-1 merge latest * jeho@jeho.org--2005/muse--jeho--1.0--patch-2 merge latest * jeho@jeho.org--2005/muse--jeho--1.0--patch-3 merge latest * jeho@jeho.org--2005/muse--jeho--1.0--patch-4 big merge of latest patches * jeho@jeho.org--2005/muse--jeho--1.0--patch-5 Merged from mwolson@gnu.org--2005 (patch 248-251) * jeho@jeho.org--2005/muse--jeho--1.0--patch-6 muse-mode.el fix for muse-visit-link-default * jeho@jeho.org--2005/muse--jeho--1.0--patch-7 muse-mode.el fix intangible problem in muse-link-at-point * jeho@jeho.org--2005/muse--jeho--1.0--patch-8 muse-wiki: added option for not rendering bare project names as links * jeho@jeho.org--2005/muse--jeho--1.0--patch-9 Merged from mwolson@gnu.org--2005 (patch 252-253) * jeho@jeho.org--2005/muse--jeho--1.0--patch-10 muse-mode.el: fix finding an anchor * jeho@jeho.org--2005/muse--jeho--1.0--patch-11 muse-latex.el: fix footnote-end * mwolson@gnu.org--2005/muse--main--1.0--patch-242 Use modification time for date directive. * mwolson@gnu.org--2005/muse--main--1.0--patch-243 Try to make link properties more sane. * mwolson@gnu.org--2005/muse--main--1.0--patch-244 Fix customization bugs concerning muse-project-alist. * mwolson@gnu.org--2005/muse--main--1.0--patch-245 Release Emacs Muse 3.02.01. * mwolson@gnu.org--2005/muse--main--1.0--patch-246 Figure out syntax of :set. * mwolson@gnu.org--2005/muse--main--1.0--patch-249 muse-latex: Ignore anchor if it occurs at end of line. * mwolson@gnu.org--2005/muse--main--1.0--patch-251 Minor bookkeeping update. * mwolson@gnu.org--2005/muse--main--1.0--patch-252 Allow anchors to occur near (rather than at) the beginning of line. * mwolson@gnu.org--2005/muse--main--1.0--patch-255 Merged from jeho@jeho.org--2005 (patch 0-11) * mwolson@gnu.org--2005/muse--main--1.0--patch-256 Emacs 21 flyspell fix. * mwolson@gnu.org--2005/muse--main--1.0--patch-257 By default, use ".muse" extension and do not detect by pathname. git-archimport-id: mwolson@gnu.org--2005/muse--rel--3.02--patch-1 --- AUTHORS | 15 ++- ChangeLog | 232 +++++++++++++++++++++++++++++++++ Makefile.defs | 4 +- NEWS | 42 ++++++ debian/NEWS | 17 +++ debian/changelog | 8 ++ debian/rules | 1 + examples/johnw/muse-johnw.el | 159 +++++++++++++++++----- examples/mwolson/muse-init.el | 10 +- examples/mwolson/templates/footer.html | 6 +- experimental/muse-xml.el | 8 +- lisp/muse-colors.el | 12 +- lisp/muse-latex.el | 32 ++--- lisp/muse-mode.el | 12 +- lisp/muse-project.el | 64 +++++---- lisp/muse-publish.el | 7 +- lisp/muse-wiki.el | 10 ++ lisp/muse.el | 8 +- muse.texi | 4 +- 19 files changed, 542 insertions(+), 109 deletions(-) create mode 100644 debian/NEWS diff --git a/AUTHORS b/AUTHORS index f3915ef..99b2fc6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -14,7 +14,7 @@ Sacha Chua: Contributor -- documentation Brad Collins: Contributor, author of examples/muse.rnc schema (assigned past and future changes) -Li Daobing: Contributor +Li Daobing: Contributor, author of muse-mathml.el (assigned past and future changes) Yann Hodique: Contributor, author of muse-wiki.el @@ -22,19 +22,28 @@ Yann Hodique: Contributor, author of muse-wiki.el Peter K. Lee: Contributor to muse-xml.el. 11 lines changed in muse-publish.el. - (no assignment yet, asking for one) + (assignment pending) + +Jim Ottaway: Contributor, + muse-latex.el: 1 line changed + muse-mode.el: 7 lines changed + muse-wiki.el: 7 lines changed + (assignment pending) Andrea Riciputi: Idea taken from code, but re-implemented Dale P. Smith: Contributor (disclaimed changes to Emacs) -John Sullivan: Contributor -- documentation (employed by FSF) +John Sullivan: Contributor -- documentation + (employed by FSF) Gary Vaughan: Original author of emacs-wiki-blosxom.el, which was the basis for muse-blosxom.el (assigned past and future changes) +Sergey Vlasov: Contributor (3 lines changed in muse-colors.el) + Lan Yufeng: Contributor (1 line changed in muse-colors.el) diff --git a/ChangeLog b/ChangeLog index 8ee8d61..28c2278 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,238 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2005/muse--main--1.0 # +2005-10-29 09:15:07 GMT Michael Olson patch-257 + + Summary: + By default, use ".muse" extension and do not detect by pathname. + Revision: + muse--main--1.0--patch-257 + + * lisp/muse-mode.el (muse-mode-auto-p): Default to nil. + (muse-file-extension): Default to "muse". This has the effect of + making Emacs associate the ".muse" extension with muse-mode, without + trying to figure things out from the path to the file. The former + method is usually considered to be best, so we'll go with it. + + modified files: + ChangeLog lisp/muse-mode.el lisp/muse.el + + +2005-10-29 07:10:16 GMT Michael Olson patch-256 + + Summary: + Emacs 21 flyspell fix. + Revision: + muse--main--1.0--patch-256 + + * lisp/muse-mode.el (muse-mode): I finally figured out how to get + flyspell to pay attention to my muse-mode-flyspell-p constraints, which + means that the version of flyspell that comes with Emacs21 will no + longer mess up links. + + modified files: + ChangeLog lisp/muse-mode.el + + +2005-10-29 03:22:40 GMT Michael Olson patch-255 + + Summary: + Merged from jeho@jeho.org--2005 (patch 0-11) + Revision: + muse--main--1.0--patch-255 + + * AUTHORS: Update. + + * lisp/muse-latex.el (muse-latex-markup-strings): Use the proper + footnode-end mark. + + * lisp/muse-mode.el (muse-link-at-point): Avoid error with intangible + links. + (muse-visit-link-default): Save position before searching, in case the + search fails. Use a regexp search. Start from beginning of document. + Refine search regexp. + + * lisp/muse-wiki.el (muse-wiki-ignore-bare-project-names): New option + that indicated whether project names without a page specifier will be + considered links. + (muse-wiki-handle-interwiki): Consult + `muse-wiki-ignore-bare-project-names'. + + Patches applied: + + * jeho@jeho.org--2005/muse--jeho--1.0--patch-6 + muse-mode.el fix for muse-visit-link-default + + * jeho@jeho.org--2005/muse--jeho--1.0--patch-7 + muse-mode.el fix intangible problem in muse-link-at-point + + * jeho@jeho.org--2005/muse--jeho--1.0--patch-8 + muse-wiki: added option for not rendering bare project names as links + + * jeho@jeho.org--2005/muse--jeho--1.0--patch-10 + muse-mode.el: fix finding an anchor + + * jeho@jeho.org--2005/muse--jeho--1.0--patch-11 + muse-latex.el: fix footnote-end + + modified files: + AUTHORS ChangeLog lisp/muse-latex.el lisp/muse-mode.el + lisp/muse-wiki.el + + new patches: + jeho@jeho.org--2005/muse--jeho--1.0--base-0 + jeho@jeho.org--2005/muse--jeho--1.0--patch-1 + jeho@jeho.org--2005/muse--jeho--1.0--patch-2 + jeho@jeho.org--2005/muse--jeho--1.0--patch-3 + jeho@jeho.org--2005/muse--jeho--1.0--patch-4 + jeho@jeho.org--2005/muse--jeho--1.0--patch-5 + jeho@jeho.org--2005/muse--jeho--1.0--patch-6 + jeho@jeho.org--2005/muse--jeho--1.0--patch-7 + jeho@jeho.org--2005/muse--jeho--1.0--patch-8 + jeho@jeho.org--2005/muse--jeho--1.0--patch-9 + jeho@jeho.org--2005/muse--jeho--1.0--patch-10 + jeho@jeho.org--2005/muse--jeho--1.0--patch-11 + + +2005-10-21 14:39:50 GMT Michael Olson patch-252 + + Summary: + Allow anchors to occur near (rather than at) the beginning of line. + Revision: + muse--main--1.0--patch-252 + + * lisp/muse-publish.el (muse-publish-markup-regexps): Allow non-word + characters before anchor, like " - ". Thanks to Phillip Lord for the + suggestion. + + modified files: + ChangeLog lisp/muse-publish.el + + +2005-10-13 04:20:29 GMT Michael Olson patch-251 + + Summary: + Minor bookkeeping update. + Revision: + muse--main--1.0--patch-251 + + * AUTHORS: Update information. + + modified files: + AUTHORS ChangeLog + + +2005-10-13 03:38:30 GMT Michael Olson patch-249 + + Summary: + muse-latex: Ignore anchor if it occurs at end of line. + Revision: + muse--main--1.0--patch-249 + + * lisp/muse-latex.el (muse-latex-insert-anchor): If the anchor occurs at + the end of a line, ignore it. Thanks to Na Li for the suggestion. + + modified files: + ChangeLog experimental/muse-xml.el lisp/muse-latex.el + + +2005-09-27 00:15:05 GMT Michael Olson patch-246 + + Summary: + Figure out syntax of :set. + Revision: + muse--main--1.0--patch-246 + + * lisp/muse-project.el (muse-project): Make the :set option inline to + match the actual syntax that Muse recognizes. + + * muse.texi (Projects): Note that I need to work on this section. + + modified files: + ChangeLog lisp/muse-project.el muse.texi + + +2005-09-26 22:31:57 GMT Michael Olson patch-245 + + Summary: + Release Emacs Muse 3.02.01. + Revision: + muse--main--1.0--patch-245 + + * NEWS: Update entries for Muse 3.02.01. + + * debian/rules: Install NEWS.Debian. + + * debian/NEWS: New file that contains Debian-related news items. + + * examples/mwolson/muse-init.el: Update with my latest changes. + + * examples/mwolson/templates/footer.html: Use + `muse-publishing-directive'. + + new files: + debian/.arch-ids/NEWS.id debian/NEWS + + modified files: + ChangeLog Makefile.defs NEWS debian/changelog debian/rules + examples/mwolson/muse-init.el + examples/mwolson/templates/footer.html lisp/muse.el muse.texi + + +2005-09-26 21:23:49 GMT Michael Olson patch-244 + + Summary: + Fix customization bugs concerning muse-project-alist. + Revision: + muse--main--1.0--patch-244 + + * examples/johnw/muse-johnw.el: Update with latest version from John. + + * muse-project.el (muse-project-alist-using-customize): New variable that + indicates whether or not we just used customize to modify the value of + muse-project-alist. + (muse-project-alist-get): Set muse-project-alist-using-customize. + (muse-project-alist-set): Only try to unescape muse-project-alist if + muse-project-alist-using-customize is set. Make sure that the value we + save to .emacs is unescaped. + (muse-project): Add definition for :value-delete so that we can work + around an Emacs21 and XEmacs21 annoyance. + + modified files: + ChangeLog examples/johnw/muse-johnw.el lisp/muse-project.el + + +2005-09-25 03:06:25 GMT Michael Olson patch-243 + + Summary: + Try to make link properties more sane. + Revision: + muse--main--1.0--patch-243 + + * lisp/muse-colors.el (muse-link-properties): Try to make link properties + a bit smarter. It is hoped that this fixes several strange key + movement and link coloring issues. Thanks to Sergey Vlasov for the + fix. + + modified files: + AUTHORS ChangeLog lisp/muse-colors.el + + +2005-09-24 00:01:56 GMT Michael Olson patch-242 + + Summary: + Use modification time for date directive. + Revision: + muse--main--1.0--patch-242 + + * lisp/muse-publish.el (muse-publish-markup-buffer): Set the date + directive using the currently-publishing file's modification time, + rather than the current time. + + modified files: + ChangeLog lisp/muse-publish.el + + 2005-09-22 16:15:59 GMT Michael Olson patch-240 Summary: diff --git a/Makefile.defs b/Makefile.defs index e4c87b7..cc5ce4f 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -20,6 +20,6 @@ INSTALLINFO = install-info --info-dir=$(INFODIR) #INSTALLINFO = install-info --section "Emacs" "emacs" --info-dir=$(INFODIR) # Useful only for the maintainer -VERSION = 3.02 -LASTUPLOAD = 3.01.arch.201-4 +VERSION = 3.02.01 +LASTUPLOAD = 3.02-1 BUILDOPTS = diff --git a/NEWS b/NEWS index 8f5eea2..853eb69 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,47 @@ Emacs Muse NEWS --- History of user-visible changes -*- outline -*- +* Changes in Muse 3.02.01 + +** Configuration + +*** `muse-project-alist' -- This variable should now save customizations +to the correct form in the .emacs file. Before, it was saving an +intermediate form of the variable. + +If you have used the customize interface in the previous release of +Muse to set `muse-project-alist', please do the following to import +your settings. + + - Open your .emacs file. + - Move the point to where `muse-project-alist' is set. + - Type `M-: (setq muse-project-alist-using-customize t) RET'. + - Type `C-M-x'. + - Type `M-x customize-save-variable RET muse-project-alist RET'. + +*** `muse-project-alist' -- A bug involving the deleting of items +using Emacs21 and XEmacs21 has been fixed. + +** Muse Mode + +*** Links should no longer prevent moving the point, and help text for +links should no longer cause errors to occur. + +** Publishing + +*** If 2 or more blank lines separate list or table items, each item +will be published in a separate list or table. + +*** The #date directive is now populated by default with the last +modified time of each file, rather than the current time of day. To +use this value, add '(muse-publishing-directive "date")' +to your header or footer. + +** HTML publishing + +*** `muse-xhtml-style-sheet' -- New option that indicates the style +settings to use for XHTML documents. This may be either a filename or +a string of stylesheet settings. + * Changes in Muse 3.02 ** New modules diff --git a/debian/NEWS b/debian/NEWS new file mode 100644 index 0000000..1378ad1 --- /dev/null +++ b/debian/NEWS @@ -0,0 +1,17 @@ +muse-el (3.02.01-1) unstable; urgency=low + +`muse-project-alist' -- This variable should now save customizations +to the correct form in the .emacs file. Before, it was saving an +intermediate form of the variable. + +If you have used the customize interface in the previous release of +Muse to set `muse-project-alist', please do the following to import +your settings. + + - Open your .emacs file. + - Move the point to where `muse-project-alist' is set. + - Type `M-: (setq muse-project-alist-using-customize t) RET'. + - Type `C-M-x'. + - Type `M-x customize-save-variable RET muse-project-alist RET'. + + -- Michael W. Olson (GNU address) Mon, 26 Sep 2005 17:00:46 -0500 diff --git a/debian/changelog b/debian/changelog index 5504a21..8b90910 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +muse-el (3.02.01-1) unstable; urgency=low + + * New upstream release. + * If you have used the customize interface to save `muse-project-alist', + you will need to follow the instructions in NEWS.Debian. + + -- Michael W. Olson (GNU address) Mon, 26 Sep 2005 17:00:46 -0500 + muse-el (3.02-1) unstable; urgency=medium * New upstream release. diff --git a/debian/rules b/debian/rules index 4086252..cb355d7 100755 --- a/debian/rules +++ b/debian/rules @@ -57,6 +57,7 @@ install: build # Other documentation install -m 0644 AUTHORS ${PKGDIR}${DOCDIR}/AUTHORS + install -m 0644 debian/NEWS ${PKGDIR}${DOCDIR}/NEWS.Debian install -m 0644 README ${PKGDIR}${DOCDIR}/README install -m 0644 ChangeLog ${PKGDIR}${DOCDIR}/changelog cat ChangeLog.2004 >> ${PKGDIR}${DOCDIR}/changelog diff --git a/examples/johnw/muse-johnw.el b/examples/johnw/muse-johnw.el index a72b815..694f0c9 100644 --- a/examples/johnw/muse-johnw.el +++ b/examples/johnw/muse-johnw.el @@ -21,7 +21,7 @@ '(add-to-list 'whitespace-modes 'muse-mode)) (defun muse-maybe-convert-poem () - (if (string-match "/poems" muse-publishing-current-file) + (if (string-match "/poems/" muse-publishing-current-file) (muse-poem-prepare-buffer))) (defun muse-insert-reset-chapter () @@ -52,12 +52,14 @@ :maintainer "jwiegley@hotmail.com" :before 'muse-maybe-convert-poem :after 'muse-my-html-finalize-buffer + :final 'muse-site-html-set-mode :header "~/Documents/site/header.html" :footer "~/Documents/site/footer.html") (muse-derive-style "site-journal-html" "journal-html" :maintainer "jwiegley@hotmail.com" :before 'muse-my-journal-find-entries :after 'muse-my-journal-insert-contents + :final 'muse-site-html-set-mode :header "~/Documents/site/header.html" :footer "~/Documents/site/footer.html") (muse-derive-style "newartisans-html" "html" @@ -86,7 +88,9 @@ "~/Documents/journal/summer2003" "~/Documents/journal/j2003" "~/Documents/journal/j2004" + "~/Documents/journal/j2005" "~/Documents/journal/journal" + "~/Documents/journal/pending" :book-part "Poems" :book-style "chapbook-pdf" :book-funcall muse-insert-all-poems-header @@ -104,9 +108,10 @@ "~/Documents/poems/commentary" :book-end t "~/Documents/contents" + "~/Documents/notes" :default "journal") - (:base "html" :path "~/Sites/johnw" + (:base "site-html" :path "~/Sites/johnw" :include "/contents/recent") (:base "pdf" :path "~/Sites/johnw/pdf" :include "/\\(essays\\|stories\\)/") @@ -120,17 +125,30 @@ :include "/journal/") (:base "journal-rdf" :path "~/Sites/johnw" :include "/journal/journal" - :base-url "http://www.newartisans.com/johnw/") + :base-url "http://johnwiegley.com/") (:base "journal-rss" :path "~/Sites/johnw" :include "/journal/journal" - :base-url "http://www.newartisans.com/johnw/")) + :base-url "http://johnwiegley.com/") + (:base "journal-rss" :path "~/Sites/johnw" + :include "/journal/pending" + :base-url "http://johnwiegley.com/")) + ("thoughts" ; collected writings + (:book-end t + "~/Documents/thoughts/thoughts" + :default "thoughts") + (:base "journal-pdf" :path "~/Sites/johnw/pdf") + (:base "site-journal-html" :path "~/Sites/johnw")) ("newartisans" ; my company ("~/Documents/newartisans" :default "index") (:base "newartisans-html" :path "~/Sites/newartisans" :exclude "/news") (:base "newartisans-journal-html" :path "~/Sites/newartisans" - :include "/news"))))) + :include "/news")) + ("planner" ; my company + ("~/Private/plan" + :default "TaskPool" + :major-mode planner-mode))))) '(muse-mode-highlight-p t nil (muse-colors)) '(muse-mode-auto-p t nil (muse-project)) '(muse-latex-header "~/Documents/site/header.tex") @@ -151,11 +169,12 @@ '("stories" ("~/Documents/stories")) "stories" "Collected Stories" "book-pdf" "~/Sites/johnw/pdf" force) (muse-book-publish-project - '("journal" + '("myjournal" ("~/Documents/journal/early" "~/Documents/journal/summer2003" "~/Documents/journal/j2003" "~/Documents/journal/j2004" + "~/Documents/journal/j2005" "~/Documents/journal/journal" :book-end t "~/Documents/poems/mystical" @@ -163,7 +182,7 @@ "~/Documents/poems/natural" "~/Documents/poems/melancholy" "~/Documents/poems/commentary")) - "thoughts" "Thought Journal" "journal-book-pdf" "~/Sites/johnw/pdf" force) + "myjournal" "Thought Journal" "journal-book-pdf" "~/Sites/johnw/pdf" force) (muse-book-publish-project '("poems" (:nochapters t ; do automatically add chapters @@ -200,7 +219,7 @@ (interactive) (muse-project-find-file "journal" "website") (goto-char (point-min)) - (forward-line 2) + (forward-line 3) (insert "* " (format-time-string "%Y%m%d: ") (read-string "Journal entry title: ") "\n\n\n\n") @@ -229,7 +248,8 @@ (setq index 1 contents (reverse contents)) (when (> (length contents) 0) (goto-char (point-min)) - (search-forward "

Archives

") + (or (search-forward "

Archives

" nil t) + (search-forward "#include virtual=\"/sidebar.html\"" nil t)) (beginning-of-line) (insert "

Contents

\n\n
    \n") (dolist (item contents) @@ -243,9 +263,21 @@ (defun muse-my-html-finalize-buffer () (when muse-publish-generate-contents (muse-my-html-insert-contents (cdr muse-publish-generate-contents)) - (setq muse-publish-generate-contents nil))) + (setq muse-publish-generate-contents nil)) + (when (string= (muse-publish-output-name) "recent.html") + (goto-char (point-min)) + (search-forward "Page published by Emacs Muse") + (forward-line 1) + (delete-region (point-min) (point)) + (search-forward "Page published by Emacs Muse") + (beginning-of-line) + (delete-region (point) (point-max)))) + +(defun muse-site-html-set-mode (file output-path final-target) + (set-file-modes output-path ?\755)) (defvar muse-my-journal-entries nil) +(defvar muse-my-journal-nested t) (defun muse-my-journal-find-entries () (goto-char (point-min)) @@ -253,9 +285,15 @@ (inhibit-read-only t) entries) (while (re-search-forward heading-regexp nil t) - (let ((date (match-string 1)) + (let ((begin (match-beginning 0)) + (date (match-string 1)) (title (muse-match-string-no-properties 2)) - qotd desc) + enclosure qotd desc) + (if title + (save-match-data + (if (string-match muse-explicit-link-regexp title) + (setq enclosure (match-string 1 title) + title (match-string 2 title))))) (save-match-data (when (and date (string-match @@ -266,16 +304,60 @@ (string-to-number (match-string 2 date)) (string-to-number (match-string 1 date)) (current-time-zone))))) - (when title - (while (string-match "\\*" title) - (setq title (replace-match "" nil nil title))) - (set (make-local-variable 'muse-my-journal-entries) - (cons (cons title date) - muse-my-journal-entries))))))) + (while (string-match "\\*" title) + (setq title (replace-match "" nil nil title))) + (unless muse-my-journal-nested + (let* ((path (muse-style-element :path)) + (item-path + (concat (expand-file-name (format-time-string "%Y/%m") + path) + "/" (muse-journal-anchorize-title title))) + (end + (save-excursion + (if (re-search-forward heading-regexp nil t) + (match-beginning 0) + (if (re-search-forward "^Footnotes:" nil t) + (match-beginning 0) + (point-max))))) + (data (buffer-substring begin end)) + (footnotes + (save-excursion + (if (re-search-forward "^Footnotes:" nil t) + (buffer-substring (match-beginning 0) (point-max))))) + (project (muse-project))) + (save-excursion + (unless (file-directory-p (file-name-directory item-path)) + (make-directory (file-name-directory item-path) t)) + (find-file item-path) + (erase-buffer) + (insert "#title " title ?\n) + (insert "#date " (format-time-string "%B %e, %Y" date) ?\n) + (insert ?\n) + (setq begin (point)) + (insert data) + (goto-char begin) + (forward-line 2) + (delete-region begin (point)) + (goto-char (point-max)) + (if footnotes + (insert ?\n footnotes)) + (save-buffer) + (kill-buffer (current-buffer)) + (let ((muse-my-journal-nested t) + (muse-current-project project)) + (muse-publish-file item-path "journal-pdf" + (file-name-directory item-path)) + (muse-publish-file item-path "site-journal-html" + (file-name-directory item-path))) + (delete-file item-path)))) + (set (make-local-variable 'muse-my-journal-entries) + (cons (cons title date) + muse-my-journal-entries)))))) (defun muse-my-journal-insert-contents () (goto-char (point-min)) - (search-forward "

    Archives

    ") + (or (search-forward "

    Archives

    " nil t) + (search-forward "#include virtual=\"/sidebar.html\"" nil t)) (beginning-of-line) (if (string= "journal" (muse-page-name)) (insert "

    Recent Entries

    \n\n
      \n") @@ -288,35 +370,40 @@ (muse-publish-output-name) (muse-journal-anchorize-title (car entry)) (car entry)))) - (insert "
    \n\n")) + (insert "
\n\n") + ;; jww (2005-04-17): a hack to rewrite MP3 titles + (goto-char (point-min)) + (let ((inhibit-read-only t)) + (while (re-search-forward "

\\(.+?\\)

" nil t) + (replace-match "

 \\2

")))) ;; (eval-when-compile ;; (defvar muse-current-project)) -;; +;; ;; (defvar muse-ref-tag '("ref" nil t muse-ref-markup-tag)) -;; +;; ;; (defun muse-ref-markup-tag (beg end attrs) ;; "This markup tag allows a poem to be included from another project page. ;; The form of usage is: ;; " ;; (let ((page (cdr (assoc (cdr (assoc "title" attrs)) -;; (muse-project-file-alist)))) -;; beg start end text) +;; (muse-project-file-alist)))) +;; beg start end text) ;; (if (null page) -;; (insert " *Reference to\n unknown page \"" -;; (cdr (assoc "title" attrs)) "\".*\n") +;; (insert " *Reference to\n unknown page \"" +;; (cdr (assoc "title" attrs)) "\".*\n") ;; (setq beg (point)) ;; (let (title) -;; (if (string-match "html" muse-publishing-current-style) -;; t -;; (insert -;; (with-temp-buffer -;; (insert-file-contents page) -;; (goto-char (point-min)) -;; (forward-paragraph) -;; (forward-line) -;; (buffer-substring-no-properties (point) (point-max))))))))) -;; +;; (if (string-match "html" muse-publishing-current-style) +;; t +;; (insert +;; (with-temp-buffer +;; (insert-file-contents page) +;; (goto-char (point-min)) +;; (forward-paragraph) +;; (forward-line) +;; (buffer-substring-no-properties (point) (point-max))))))))) +;; ;; (add-to-list 'muse-publish-markup-tags muse-ref-tag) (when (and window-system (load "httpd" t)) diff --git a/examples/mwolson/muse-init.el b/examples/mwolson/muse-init.el index 8d7a7d6..3c63040 100644 --- a/examples/mwolson/muse-init.el +++ b/examples/mwolson/muse-init.el @@ -63,7 +63,7 @@ ("Blog" (,@(muse-project-alist-dirs "~/proj/wiki/blog") - :default "guestbook") + :default "index") ,@(muse-project-alist-styles "~/proj/wiki/blog" "~/personal-site/site/blog" @@ -89,9 +89,11 @@ ;; Wiki settings (setq muse-wiki-interwiki-alist '(("PlugWiki" . "http://plug.student-orgs.purdue.edu/plugwiki/") - ("PLUG" . "http://plug.student-orgs.purdue.edu/plugwiki/") ("TheEmacsWiki" . "http://www.emacswiki.org/cgi-bin/wiki/") - ("ArchWiki" . "http://wiki.gnuarch.org/"))) + ("ArchWiki" . "http://wiki.gnuarch.org/") + ;; abbreviations + ("CERIAS" . "http://www.cerias.purdue.edu/") + ("PLUG" . "http://plug.student-orgs.purdue.edu/plugwiki/"))) ;;; Functions @@ -187,6 +189,8 @@ If FILE is not specified, use the published version of the current file." (my-muse-project-find-file "Blog"))) (global-set-key "\C-cpn" #'(lambda () (interactive) (my-muse-project-find-file "MyNotes"))) +(global-set-key "\C-cpp" #'(lambda () (interactive) + (my-muse-project-find-file "Plans"))) (global-set-key "\C-cpr" #'(lambda () (interactive) (my-muse-project-find-file "Projects"))) (global-set-key "\C-cpw" #'(lambda () (interactive) diff --git a/examples/mwolson/templates/footer.html b/examples/mwolson/templates/footer.html index f517d50..a7bb847 100644 --- a/examples/mwolson/templates/footer.html +++ b/examples/mwolson/templates/footer.html @@ -81,11 +81,7 @@ - Updated - (format-time-string - "%Y-%m-%d" - (nth 5 (file-attributes muse-publishing-current-file))) - + Updated (muse-publishing-directive "date") diff --git a/experimental/muse-xml.el b/experimental/muse-xml.el index 996a720..3e29baa 100644 --- a/experimental/muse-xml.el +++ b/experimental/muse-xml.el @@ -261,10 +261,6 @@ match is found, `muse-xml-charset-default' is used instead." (t (insert "

")))) -(defun muse-xml-markup-anchor () - (save-match-data - (muse-xml-insert-anchor (match-string 1))) "") - (defun muse-xml-insert-anchor (anchor) "Insert an anchor, either around the word at point, or within a tag." (skip-chars-forward muse-regexp-space) @@ -272,6 +268,10 @@ match is found, `muse-xml-charset-default' is used instead." (goto-char (match-end 0))) (insert "")) +(defun muse-xml-markup-anchor () + (save-match-data + (muse-xml-insert-anchor (match-string 1))) "") + (defun muse-xml-markup-table () (let* ((str (prog1 (match-string 1) diff --git a/lisp/muse-colors.el b/lisp/muse-colors.el index 29ef335..f4e2cea 100644 --- a/lisp/muse-colors.el +++ b/lisp/muse-colors.el @@ -35,6 +35,9 @@ ;; Lan Yufeng (nlany DOT web AT gmail DOT com) found an error where ;; headings were being given the wrong face, contributing a patch to ;; fix this. +;; +;; Sergey Vlasov (vsu AT altlinux DOT ru) fixed an issue with coloring +;; links that are in consecutive lines. ;;; Code: @@ -565,12 +568,9 @@ Functions should not modify the contents of the buffer." (defsubst muse-link-properties (help-str &optional face) (append (if face - (list 'face face 'rear-nonsticky t - muse-keymap-property muse-mode-local-map) - (list 'invisible 'muse 'intangible t 'rear-nonsticky t - muse-keymap-property muse-mode-local-map)) - (list 'mouse-face 'highlight - 'help-echo help-str + (list 'face face 'mouse-face 'highlight) + (list 'invisible 'muse 'intangible t)) + (list 'help-echo help-str 'rear-nonsticky t muse-keymap-property muse-mode-local-map))) (defun muse-link-face (link-name &optional explicit) diff --git a/lisp/muse-latex.el b/lisp/muse-latex.el index d2c8d0e..5bcbe2f 100644 --- a/lisp/muse-latex.el +++ b/lisp/muse-latex.el @@ -169,7 +169,7 @@ For more on the structure of this list, see (section-other . "\\paragraph{") (section-other-end . "}") (footnote . "\\footnote{") - (footnote-end . "{") + (footnote-end . "}") (footnotemark . "\\footnotemark[%d]") (footnotetext . "\\footnotetext[%d]{") (footnotetext-end . "}") @@ -254,20 +254,22 @@ system to an associated CJK coding system." :group 'muse-latex) (defun muse-latex-insert-anchor (anchor) - "Insert an anchor, either around the word at point, or within a tag." - (skip-chars-forward muse-regexp-space) - (if (looking-at "<\\([^ />]+\\)>") - (let ((tag (match-string 1))) - (goto-char (match-end 0)) - (insert "\\hypertarget{" anchor "}{") - (or (and (search-forward (format "" tag) - (muse-line-end-position) t) - (goto-char (match-beginning 0))) - (forward-word 1)) - (insert "}")) - (insert "\\hypertarget{" anchor "}{") - (forward-word 1) - (insert "}"))) + "Insert an anchor, either around the word at point, or within a tag. +If the anchor occurs at the end of a line, ignore it." + (unless (bolp) ; point is placed after newline if anchor at end + (skip-chars-forward muse-regexp-space) + (if (looking-at "<\\([^ />]+\\)>") + (let ((tag (match-string 1))) + (goto-char (match-end 0)) + (insert "\\hypertarget{" anchor "}{") + (or (and (search-forward (format "" tag) + (muse-line-end-position) t) + (goto-char (match-beginning 0))) + (forward-word 1)) + (insert "}")) + (insert "\\hypertarget{" anchor "}{") + (forward-word 1) + (insert "}")))) (defun muse-latex-markup-anchor () (save-match-data diff --git a/lisp/muse-mode.el b/lisp/muse-mode.el index 1ebc930..c7cb2c6 100644 --- a/lisp/muse-mode.el +++ b/lisp/muse-mode.el @@ -63,7 +63,7 @@ :require 'muse-colors :group 'muse-mode) -(defcustom muse-mode-auto-p t +(defcustom muse-mode-auto-p nil "If non-nil, automagically determine when Muse mode should be activated." :type 'boolean :set (function @@ -175,6 +175,8 @@ so only enable this if you don't use either of these." (set (make-local-variable 'paragraph-start) (concat paragraph-start "\\|\\s-+\\(-\\|[0-9]+\\.\\)\\s-+" "\\|\\[[0-9]+\\]\\s-*")) + ;; If we're using Emacs21, this makes flyspell work like it should + (setq flyspell-generic-check-word-p 'muse-mode-flyspell-p) ;; Comment syntax is `; comment' (set (make-local-variable 'comment-start) "; ") @@ -250,6 +252,7 @@ This is used to keep links from being improperly colorized by flyspell." (defun muse-link-at-point (&optional pos) "Return link text if a URL or link is at point." (let ((case-fold-search nil) + (inhibit-point-motion-hooks t) (here (or pos (point)))) (when (or (null pos) (and (char-after pos) @@ -322,7 +325,12 @@ in `muse-project-alist'." (find-file-other-window link) (find-file link)))))) (if anchor - (search-forward (concat anchor "\\b") nil t)))) + (let ((pos (point))) + (goto-char (point-min)) + (unless (re-search-forward (concat "^\\W*" (regexp-quote anchor) + "\\b") + nil t) + (goto-char pos)))))) (defun muse-visit-link (link &optional other-window) "Visit the URL or link named by LINK." diff --git a/lisp/muse-project.el b/lisp/muse-project.el index c750e8e..efe7a5f 100644 --- a/lisp/muse-project.el +++ b/lisp/muse-project.el @@ -52,9 +52,15 @@ Each function is passed the project object, a cons with the format :type 'hook :group 'muse-project) +(defvar muse-project-alist-using-customize nil + "Used internally by Muse to indicate whether `muse-project-alist' +has been modified via the customize interface.") +(make-variable-buffer-local 'muse-project-alist-using-customize) + (defun muse-project-alist-get (sym) "Turn `muse-project-alist' into something we can customize easily." (when (boundp sym) + (setq muse-project-alist-using-customize t) (let* ((val (copy-alist (symbol-value sym))) (head val)) (while val @@ -90,39 +96,44 @@ Each function is passed the project object, a cons with the format "Turn customized version of `muse-project-alist' into something Muse can make use of." (set sym val) - (while val - (let ((head (car (cdar val))) - res) - ;; Turn cons cells into flat list, string->symbol - (while head - (cond ((stringp (car head)) - (add-to-list 'res (car head) t)) - ((consp (car head)) - (add-to-list 'res (intern (caar head)) t) - (add-to-list 'res (car (cdar head)) t))) - (setq head (cdr head))) - (setcdr (car val) (cons res (cdr (cdar val))))) - (let ((styles (cdar val))) - ;; String->symbol in every style - (while (cdr styles) - (let ((head (cadr styles)) - res) - (while (consp head) - (setq res (plist-put res (intern (car head)) - (cadr head))) - (setq head (cddr head))) - (setcdr styles (cons res (cddr styles)))) - (setq styles (cdr styles)))) - (setq val (cdr val)))) + (when muse-project-alist-using-customize + ;; Make sure the unescaped version is written to .emacs + (put sym 'saved-value (list (custom-quote val))) + ;; Perform unescaping + (while val + (let ((head (car (cdar val))) + res) + ;; Turn cons cells into flat list, string->symbol + (while head + (cond ((stringp (car head)) + (add-to-list 'res (car head) t)) + ((consp (car head)) + (add-to-list 'res (intern (caar head)) t) + (add-to-list 'res (car (cdar head)) t))) + (setq head (cdr head))) + (setcdr (car val) (cons res (cdr (cdar val))))) + (let ((styles (cdar val))) + ;; String->symbol in every style + (while (cdr styles) + (let ((head (cadr styles)) + res) + (while (consp head) + (setq res (plist-put res (intern (car head)) + (cadr head))) + (setq head (cddr head))) + (setcdr styles (cons res (cddr styles)))) + (setq styles (cdr styles)))) + (setq val (cdr val))))) (define-widget 'muse-project 'default "A widget that defines a Muse project." :format "\n%v" :value-create 'muse-widget-type-value-create :value-get 'muse-widget-child-value-get + :value-delete 'ignore :match 'muse-widget-type-match :type '(cons :format " %v" - (repeat :tag "Settings" :format "%{%t%}:\n%v%i\n\n" + (repeat :tag "Settings" :format "%{%t%}:\n%v%i\n\n" (choice (string :tag "Directory") (list :tag "Book function" @@ -156,7 +167,8 @@ Muse can make use of." (const t)) (list :tag "Set variables" (const :tag ":set" ":set") - (repeat (list (symbol :tag "Variable") + (repeat (list :inline t + (symbol :tag "Variable") (sexp :tag "Setting")))) (list :tag "Visit links using" (const :tag ":visit-link" ":visit-link") diff --git a/lisp/muse-publish.el b/lisp/muse-publish.el index b885506..c5c98b0 100644 --- a/lisp/muse-publish.el +++ b/lisp/muse-publish.el @@ -97,7 +97,7 @@ be returned." (1350 "^;\\s-+\\(.+\\)" 0 comment) ;; define anchor points - (1400 "^#\\(\\S-+\\)\\s-*" 0 anchor) + (1400 "^\\W*#\\(\\S-+\\)\\s-*" 0 anchor) ;; prevent emphasis characters in explicit links from being marked (1500 muse-explicit-link-regexp 0 muse-publish-mark-noemphasis) @@ -507,7 +507,10 @@ If STYLE is not specified, use current style." (muse-publishing-directives (list (cons "title" title) (cons "author" (user-full-name)) - (cons "date" (format-time-string "%B %e, %Y")))) + (cons "date" (format-time-string + "%B %e, %Y" + (nth 5 (file-attributes + muse-publishing-current-file)))))) (muse-publishing-p t)) (run-hooks 'muse-before-publish-hook) (muse-publish-markup-region (point-min) (point-max) title style) diff --git a/lisp/muse-wiki.el b/lisp/muse-wiki.el index b6c4409..10f74be 100644 --- a/lisp/muse-wiki.el +++ b/lisp/muse-wiki.el @@ -63,6 +63,15 @@ :type 'boolean :group 'muse-wiki) +(defcustom muse-wiki-ignore-bare-project-names nil + "Determine whether project names without a page specifer are links. +If non-nil, project names without a page specifier will not be +considered links. +When nil, project names without a specifier are highlighted and +they link to the default page of the project that they name." + :type 'boolean + :group 'muse-wiki) + (defvar muse-wiki-interwiki-regexp "" "Regexp that matches all interwiki links. This is automatically generated by setting `muse-wiki-interwiki-alist'. @@ -171,6 +180,7 @@ Match 2 is set to the description." (funcall subst word) (concat subst word)) (and (assoc project muse-project-alist) + (or word (not muse-wiki-ignore-bare-project-names)) (muse-wiki-resolve-project-page project word)))))) (defun muse-wiki-handle-wikiword (&optional string) diff --git a/lisp/muse.el b/lisp/muse.el index edf89af..14bfd64 100644 --- a/lisp/muse.el +++ b/lisp/muse.el @@ -4,8 +4,8 @@ ;; Emacs Lisp Archive Entry ;; Filename: muse.el -;; Version: 3.02 -;; Date: Thu 16-Sep-2005 +;; Version: 3.02.01 +;; Date: Thu 26-Sep-2005 ;; Keywords: hypermedia ;; Author: John Wiegley (johnw AT gnu DOT org) ;; Maintainer: Michael Olson (mwolson AT gnu DOT org) @@ -45,7 +45,7 @@ ;;; Code: -(defvar muse-version "3.02" +(defvar muse-version "3.02.01" "The version of Muse currently loaded") (defun muse-version (&optional insert) @@ -94,7 +94,7 @@ This is autogenerated from `muse-ignored-extensions'.") (muse-update-ignored-extensions-regexp 'muse-ignored-extensions muse-ignored-extensions))) -(defcustom muse-file-extension nil +(defcustom muse-file-extension "muse" "File extension of Muse files. Omit the period at the beginning." :type '(choice (const :tag "None" nil) diff --git a/muse.texi b/muse.texi index 1219dc3..4c02bb0 100644 --- a/muse.texi +++ b/muse.texi @@ -12,7 +12,7 @@ @syncodeindex fn cp @copying -This manual is for the Emacs Muse version 3.02. +This manual is for the Emacs Muse version 3.02.01. Copyright (C) 2004, 2005 Free Software Foundation, Inc. @@ -383,6 +383,8 @@ output as HTML to the directory @file{~/public_html}, and as PDF to the directory @file{~/public_html/pdf}. Within any project page, you may create a link to other pages using the syntax @samp{[[pagename]]}. +@c PRE3_03: Give more examples +@c PRE3_03: Describe :set and other options fully @node Keystroke Summary, Markup Rules, Projects, Top @comment node-name, next, previous, up -- 2.11.4.GIT