From 27aacc588c986c42702f9cabb2eefcf6856af7ad Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Sun, 19 Jun 2005 00:43:54 +0000 Subject: [PATCH] Move lisp files to `lisp' directory; hack on Makefiles, XEmacs compat. * AUTHORS: Update entry. * muse-*.el: Move to the lisp directory. * lisp/Makefile: New file containing rules to test and compile the source. * Makefile.defs: New file that contains common definitions for all other Makefiles, such as Emacs command to use. * Makefile: Move lisp-specific rules to lisp/Makefile. (SUBDIRS): New variable containing subdirectories to clean. * README: Update to reflect new location of source files. Give updated directions for compiling with XEmacs. * examples/Makefile (.PRECIOUS): Added to denote which type of files to compile. (%.html): Pass SITEFLAG as an environment variable to ../scripts/publish. * examples/QuickStart (The): Re-add the stray tag since it seems to be needed to keep the process from failing. This has *got* to be a bug in Muse, but I don't want to deal with it now. * lisp/muse-colors.el (muse-make-faces): Bind newsym locally. * lisp/muse-convert.el: Move line to commentary section. * lisp/muse-latex.el (muse-latex-markup-table): Note that the locally-bound `type' variable isn't used here. * lisp/muse-mode.el (muse-index-as-string): Remove unused `file' binding. * lisp/muse-texinfo.el (muse-texinfo-markup-table): Remove unused `field' binding. * scripts/muse-build.el (load-path): Correct paths. * scripts/muse-build.el (muse-elint-files): Add a few variables here so as to avoid spurious warnings. * scripts/publish (style): Make use of SITEFLAG environment variable, if it exists. * lisp/muse.el (muse-line-end-position, muse-line-beginning-position): (muse-match-string-no-properties): New functions that take the place of `line-end-position', `line-beginning-position', and `match-string-no-properties', respectively. * examples/johnw/muse-johnw.el (muse-my-html-insert-contents) (muse-my-journal-find-entries): Use Muse-specific version of `match-string-no-properties', `line-beginning-position', and `line-end-position' since these do not exist in XEmacs. * lisp/muse-colors.el (muse-colors-emphasized, muse-colors-region) (muse-colors-custom-tags, muse-colors-link, muse-colors-title): Ditto. * lisp/muse-convert.el (muse-latex-transform): Ditto. * lisp/muse-html.el (muse-html-insert-anchor, muse-html-markup-footnote) (muse-html-insert-contents): Ditto. * lisp/muse-journal.el (muse-journal-rss-munge-buffer): Ditto. * lisp/muse-mode.el (muse-link-at-point, muse-edit-link-at-point): Ditto. * lisp/muse-poem.el (muse-poem-prepare-buffer): Ditto. * lisp/muse-publish.el (muse-publish-markup-tag) (muse-publish-markup-footnote, muse-publish-markup-leading-space) (muse-published-buffer-contents): Ditto. * scripts/muse-build.el (muse-elint-files): Ditto. git-archimport-id: mwolson@gnu.org--2005/muse--main--1.0--patch-65 --- AUTHORS | 4 +- ChangeLog | 164 ++++++++++++++++++++++++++++++++ Makefile | 67 +++++++------ Makefile.defs | 13 +++ README | 22 ++--- examples/Makefile | 11 ++- examples/QuickStart | 1 + examples/johnw/muse-johnw.el | 4 +- lisp/Makefile | 28 ++++++ muse-blosxom.el => lisp/muse-blosxom.el | 0 muse-book.el => lisp/muse-book.el | 0 muse-colors.el => lisp/muse-colors.el | 89 ++++++++--------- muse-convert.el => lisp/muse-convert.el | 8 +- muse-docbook.el => lisp/muse-docbook.el | 0 muse-html.el => lisp/muse-html.el | 6 +- muse-http.el => lisp/muse-http.el | 0 muse-journal.el => lisp/muse-journal.el | 6 +- muse-latex.el => lisp/muse-latex.el | 1 + muse-mode.el => lisp/muse-mode.el | 25 +++-- muse-poem.el => lisp/muse-poem.el | 4 +- muse-project.el => lisp/muse-project.el | 0 muse-publish.el => lisp/muse-publish.el | 12 +-- muse-regexps.el => lisp/muse-regexps.el | 0 muse-texinfo.el => lisp/muse-texinfo.el | 2 +- muse.el => lisp/muse.el | 15 +++ scripts/muse-build.el | 15 +-- scripts/publish | 2 +- 27 files changed, 362 insertions(+), 137 deletions(-) rewrite Makefile (68%) create mode 100644 Makefile.defs create mode 100644 lisp/Makefile rename muse-blosxom.el => lisp/muse-blosxom.el (100%) rename muse-book.el => lisp/muse-book.el (100%) rename muse-colors.el => lisp/muse-colors.el (91%) rename muse-convert.el => lisp/muse-convert.el (96%) rename muse-docbook.el => lisp/muse-docbook.el (100%) rename muse-html.el => lisp/muse-html.el (99%) rename muse-http.el => lisp/muse-http.el (100%) rename muse-journal.el => lisp/muse-journal.el (99%) rename muse-latex.el => lisp/muse-latex.el (99%) rename muse-mode.el => lisp/muse-mode.el (96%) rename muse-poem.el => lisp/muse-poem.el (98%) rename muse-project.el => lisp/muse-project.el (100%) rename muse-publish.el => lisp/muse-publish.el (99%) rename muse-regexps.el => lisp/muse-regexps.el (100%) rename muse-texinfo.el => lisp/muse-texinfo.el (99%) rename muse.el => lisp/muse.el (91%) diff --git a/AUTHORS b/AUTHORS index 18b6e74..0131e13 100644 --- a/AUTHORS +++ b/AUTHORS @@ -18,7 +18,9 @@ Li Daobing: Contributor (assigned past and future changes) Yann Hodique: Contributor - (2 lines changed in muse-publish.el) + (2 lines changed in muse-publish.el, + ~10 lines changed in muse-mode.el, + began assignment, ok to include changes) Andrea Riciputi: Idea taken from code, but re-implemented diff --git a/ChangeLog b/ChangeLog index c08a3db..7ff6744 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,170 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2005/muse--main--1.0 # +2005-06-19 00:43:54 GMT Michael Olson patch-65 + + Summary: + Move lisp files to `lisp' directory; hack on Makefiles, XEmacs compat. + Revision: + muse--main--1.0--patch-65 + + * AUTHORS: Update entry. + + * muse-*.el: Move to the lisp directory. + + * lisp/Makefile: New file containing rules to test and compile the + source. + + * Makefile.defs: New file that contains common definitions for all other + Makefiles, such as Emacs command to use. + + * Makefile: Move lisp-specific rules to lisp/Makefile. + (SUBDIRS): New variable containing subdirectories to clean. + + * README: Update to reflect new location of source files. Give updated + directions for compiling with XEmacs. + + * examples/Makefile (.PRECIOUS): Added to denote which type of files to + compile. + (%.html): Pass SITEFLAG as an environment variable to + ../scripts/publish. + + * examples/QuickStart (The): Re-add the stray tag since it + seems to be needed to keep the process from failing. This has *got* to + be a bug in Muse, but I don't want to deal with it now. + + * lisp/muse-colors.el (muse-make-faces): Bind newsym locally. + + * lisp/muse-convert.el: Move line to commentary section. + + * lisp/muse-latex.el (muse-latex-markup-table): Note that the + locally-bound `type' variable isn't used here. + + * lisp/muse-mode.el (muse-index-as-string): Remove unused `file' binding. + + * lisp/muse-texinfo.el (muse-texinfo-markup-table): Remove unused `field' + binding. + + * scripts/muse-build.el (load-path): Correct paths. + + * scripts/muse-build.el (muse-elint-files): Add a few variables here so + as to avoid spurious warnings. + + * scripts/publish (style): Make use of SITEFLAG environment variable, if + it exists. + + * lisp/muse.el (muse-line-end-position, muse-line-beginning-position): + (muse-match-string-no-properties): New functions that take the place of + `line-end-position', `line-beginning-position', and + `match-string-no-properties', respectively. + + * examples/johnw/muse-johnw.el (muse-my-html-insert-contents) + (muse-my-journal-find-entries): Use Muse-specific version of + `match-string-no-properties', `line-beginning-position', and + `line-end-position' since these do not exist in XEmacs. + + * lisp/muse-colors.el (muse-colors-emphasized, muse-colors-region) + (muse-colors-custom-tags, muse-colors-link, muse-colors-title): Ditto. + + * lisp/muse-convert.el (muse-latex-transform): Ditto. + + * lisp/muse-html.el (muse-html-insert-anchor, muse-html-markup-footnote) + (muse-html-insert-contents): Ditto. + + * lisp/muse-journal.el (muse-journal-rss-munge-buffer): Ditto. + + * lisp/muse-mode.el (muse-link-at-point, muse-edit-link-at-point): Ditto. + + * lisp/muse-poem.el (muse-poem-prepare-buffer): Ditto. + + * lisp/muse-publish.el (muse-publish-markup-tag) + (muse-publish-markup-footnote, muse-publish-markup-leading-space) + (muse-published-buffer-contents): Ditto. + + * scripts/muse-build.el (muse-elint-files): Ditto. + + new files: + .arch-ids/Makefile.defs.id Makefile.defs lisp/.arch-ids/=id + lisp/.arch-ids/Makefile.id lisp/Makefile + + modified files: + AUTHORS ChangeLog Makefile README examples/Makefile + examples/QuickStart examples/johnw/muse-johnw.el + lisp/muse-colors.el lisp/muse-convert.el lisp/muse-html.el + lisp/muse-journal.el lisp/muse-latex.el lisp/muse-mode.el + lisp/muse-poem.el lisp/muse-publish.el lisp/muse-texinfo.el + lisp/muse.el scripts/muse-build.el scripts/publish + + renamed files: + .arch-ids/muse-blosxom.el.id + ==> lisp/.arch-ids/muse-blosxom.el.id + .arch-ids/muse-book.el.id + ==> lisp/.arch-ids/muse-book.el.id + .arch-ids/muse-colors.el.id + ==> lisp/.arch-ids/muse-colors.el.id + .arch-ids/muse-convert.el.id + ==> lisp/.arch-ids/muse-convert.el.id + .arch-ids/muse-docbook.el.id + ==> lisp/.arch-ids/muse-docbook.el.id + .arch-ids/muse-html.el.id + ==> lisp/.arch-ids/muse-html.el.id + .arch-ids/muse-http.el.id + ==> lisp/.arch-ids/muse-http.el.id + .arch-ids/muse-journal.el.id + ==> lisp/.arch-ids/muse-journal.el.id + .arch-ids/muse-latex.el.id + ==> lisp/.arch-ids/muse-latex.el.id + .arch-ids/muse-mode.el.id + ==> lisp/.arch-ids/muse-mode.el.id + .arch-ids/muse-poem.el.id + ==> lisp/.arch-ids/muse-poem.el.id + .arch-ids/muse-project.el.id + ==> lisp/.arch-ids/muse-project.el.id + .arch-ids/muse-publish.el.id + ==> lisp/.arch-ids/muse-publish.el.id + .arch-ids/muse-regexps.el.id + ==> lisp/.arch-ids/muse-regexps.el.id + .arch-ids/muse-texinfo.el.id + ==> lisp/.arch-ids/muse-texinfo.el.id + .arch-ids/muse.el.id + ==> lisp/.arch-ids/muse.el.id + muse-blosxom.el + ==> lisp/muse-blosxom.el + muse-book.el + ==> lisp/muse-book.el + muse-colors.el + ==> lisp/muse-colors.el + muse-convert.el + ==> lisp/muse-convert.el + muse-docbook.el + ==> lisp/muse-docbook.el + muse-html.el + ==> lisp/muse-html.el + muse-http.el + ==> lisp/muse-http.el + muse-journal.el + ==> lisp/muse-journal.el + muse-latex.el + ==> lisp/muse-latex.el + muse-mode.el + ==> lisp/muse-mode.el + muse-poem.el + ==> lisp/muse-poem.el + muse-project.el + ==> lisp/muse-project.el + muse-publish.el + ==> lisp/muse-publish.el + muse-regexps.el + ==> lisp/muse-regexps.el + muse-texinfo.el + ==> lisp/muse-texinfo.el + muse.el + ==> lisp/muse.el + + new directories: + lisp lisp/.arch-ids + + 2005-06-18 20:12:05 GMT Michael Olson patch-64 Summary: diff --git a/Makefile b/Makefile dissimilarity index 68% index d91c2ae..1e35ab4 100644 --- a/Makefile +++ b/Makefile @@ -1,35 +1,32 @@ -.PHONY: all examples doc clean realclean distclean fullclean test dist -EMACS = emacs -ELC = $(patsubst %.el,%.elc,$(wildcard *.el)) - -all: $(ELC) - -examples: - (cd examples && $(MAKE)) - -doc: - makeinfo muse.texi - makeinfo --html --no-split muse.texi - -muse-build.elc: scripts/muse-build.el - @echo muse-build.el is not byte-compiled - -%.elc: %.el - @$(EMACS) -q --no-site-file -batch \ - -l scripts/muse-build.el -L . \ - -f batch-byte-compile $< - -clean: - -rm -f *.elc *~ - (cd examples && $(MAKE) clean) - -realclean distclean fullclean: clean - -rm -f muse.info muse.html - (cd examples && $(MAKE) distclean) - -test: fullclean $(ELC) - emacs -q -batch -L . -l scripts/muse-build.el \ - -f muse-elint-files muse-*.el - -dist: distclean - (cd ..; tar cvzf ~/Public/Emacs/muse.tar.gz muse) +.PHONY: all lisp examples doc clean realclean distclean fullclean test dist + +include Makefile.defs + +SUBDIRS = lisp examples + +all: lisp + +lisp: + (cd lisp && $(MAKE)) + +examples: + (cd examples && $(MAKE)) + +doc: + makeinfo muse.texi + makeinfo --html --no-split muse.texi + +clean: + for i in $(SUBDIRS); do \ + (cd $$i && $(MAKE) clean); done + +realclean distclean fullclean: clean + -rm -f muse.info muse.html + for i in $(SUBDIRS); do \ + (cd $$i && $(MAKE) distclean); done + +test: + (cd lisp && $(MAKE) test) + +dist: distclean + (cd ..; tar cvzf ~/Public/Emacs/muse.tar.gz muse) diff --git a/Makefile.defs b/Makefile.defs new file mode 100644 index 0000000..4ef85ec --- /dev/null +++ b/Makefile.defs @@ -0,0 +1,13 @@ +# -*- Makefile -*- +EMACS = emacs +SITEFLAG = --no-site-file + +# Xemacs users will probably want the following settings. +#EMACS = xemacs +#SITEFLAG = -no-site-file + +# Installation options +# PREFIX is only used here. +PREFIX = /usr/local +ELISPDIR = $PREFIX/share/emacs/site-lisp +INFODIR = $PREFIX/info diff --git a/README b/README index f4efddc..1f22a8a 100644 --- a/README +++ b/README @@ -18,9 +18,9 @@ styles for generating different kinds of output. Directory contents ================== -When you unpack the Muse tarball, you will find the source files for -Muse in the top level of the newly-created directory. The directory -structure is as follows. +The directory structure is as follows. + +The manual is in the top-level directory. contrib :: Files that are not a part of Muse proper, but are useful enough to be bundled with Muse. @@ -30,6 +30,8 @@ examples :: Example configuration files for use with Muse, as well as experimental :: Source code that is not yet considered stable. +lisp :: Muse source code. + scripts :: Scripts that are used when publishing the QuickStart document; they might prove useful if you want to automate the building of Muse documents. @@ -42,24 +44,18 @@ Compiling This is an optional step, since Emacs Lisp source code does not necessarily have to be byte-compiled. It will yield a speed increase, -however. +though. A working copy of Emacs or XEmacs is needed in order to compile the Emacs Muse. By default, the program that is installed with the name `emacs' will be used. If you want to use the `xemacs' binary to perform the compilation, we -would need to do the following. - - - Change the second line of `Makefile' and `examples/Makefile' to: +would need to edit `Makefile.defs' in the top-level directory as +follows. EMACS = xemacs - - - Change the use of "--no-site-file" in `Makefile' to - "-no-site-file". - -It is hoped that these steps will be unnecessary in future Muse -releases. +SITEFLAG = -no-site-file Installation ------------ diff --git a/examples/Makefile b/examples/Makefile index 17845e4..a326c63 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,5 +1,8 @@ .PHONY: all examples clean realclean distclean fullclean -EMACS = emacs +.PRECIOUS: %.html %.pdf %.info + +include ../Makefile.defs + EXAMPLES = QuickStart.html QuickStart.pdf QuickStart.info all: examples @@ -7,13 +10,13 @@ all: examples examples: $(EXAMPLES) %.html: % - ../scripts/publish html $< + SITEFLAG=$(SITEFLAG) ../scripts/publish html $< %.pdf: % - ../scripts/publish pdf $< + SITEFLAG=$(SITEFLAG) ../scripts/publish pdf $< %.info: % - ../scripts/publish info $< + SITEFLAG=$(SITEFLAG) ../scripts/publish info $< clean: -rm -f missfont.log diff --git a/examples/QuickStart b/examples/QuickStart index 7c0d567..98339c6 100644 --- a/examples/QuickStart +++ b/examples/QuickStart @@ -242,6 +242,7 @@ Term1 :: Term2 :: This is a second definition + ** Tables Only very simple tables are supported. The syntax is: diff --git a/examples/johnw/muse-johnw.el b/examples/johnw/muse-johnw.el index 379d421..a72b815 100644 --- a/examples/johnw/muse-johnw.el +++ b/examples/johnw/muse-johnw.el @@ -221,7 +221,7 @@ (if (< l base) (throw 'done t))) (when (<= l 1) - (setq contents (cons (cons l (match-string-no-properties 2)) + (setq contents (cons (cons l (muse-match-string-no-properties 2)) contents)) (goto-char (match-beginning 2)) (muse-html-insert-anchor (concat "sec" (int-to-string index))) @@ -254,7 +254,7 @@ entries) (while (re-search-forward heading-regexp nil t) (let ((date (match-string 1)) - (title (match-string-no-properties 2)) + (title (muse-match-string-no-properties 2)) qotd desc) (save-match-data (when (and date diff --git a/lisp/Makefile b/lisp/Makefile new file mode 100644 index 0000000..a26bd49 --- /dev/null +++ b/lisp/Makefile @@ -0,0 +1,28 @@ +.PHONY: all lisp clean realclean distclean fullclean test +.PRECIOUS: %.elc + +include ../Makefile.defs + +ELC = $(patsubst %.el,%.elc,$(wildcard *.el)) + +all: lisp + +lisp: $(ELC) + +muse-build.elc: ../scripts/muse-build.el + @echo muse-build.el is not byte-compiled + +%.elc: %.el + @$(EMACS) -q $(SITEFLAG) -batch \ + -L ../contrib -L . \ + -l ../scripts/muse-build.el\ + -f batch-byte-compile $< + +clean realclean distclean fullclean: + -rm -f *.elc *~ + +test: $(ELC) + $(EMACS) -q $(SITEFLAG) -batch \ + -L ../contrib -L . \ + -l ../scripts/muse-build.el \ + -f muse-elint-files muse-*.el diff --git a/muse-blosxom.el b/lisp/muse-blosxom.el similarity index 100% rename from muse-blosxom.el rename to lisp/muse-blosxom.el diff --git a/muse-book.el b/lisp/muse-book.el similarity index 100% rename from muse-book.el rename to lisp/muse-book.el diff --git a/muse-colors.el b/lisp/muse-colors.el similarity index 91% rename from muse-colors.el rename to lisp/muse-colors.el index cf41fdd..9033ac6 100644 --- a/muse-colors.el +++ b/lisp/muse-colors.el @@ -79,43 +79,44 @@ this to nil." "Outline faces to use when assigning Muse header faces.") (defun muse-make-faces () - (dolist (num '(1 2 3 4)) - (setq newsym (intern (concat "muse-header-" - (int-to-string num)))) - (cond - ((null muse-colors-autogen-headings) - (make-empty-face newsym)) - ((featurep 'xemacs) - (if (eq muse-colors-autogen-headings 'outline) - (copy-face (nth (1- num) - muse-colors-outline-faces-list) - newsym) + (let (newsym) + (dolist (num '(1 2 3 4)) + (setq newsym (intern (concat "muse-header-" + (int-to-string num)))) + (cond + ((null muse-colors-autogen-headings) + (make-empty-face newsym)) + ((featurep 'xemacs) + (if (eq muse-colors-autogen-headings 'outline) + (copy-face (nth (1- num) + muse-colors-outline-faces-list) + newsym) + (eval `(defface ,newsym + '((t (:size + ,(nth (1- num) '("24pt" "18pt" "14pt" "12pt")) + :bold t))) + "Muse header face" + :group 'muse-colors)))) + ((< emacs-major-version 21) + (if (eq muse-colors-autogen-headings 'outline) + (copy-face (nth (1- num) + muse-colors-outline-faces-list) + newsym) + (copy-face 'default newsym))) + ((eq muse-colors-autogen-headings 'outline) (eval `(defface ,newsym - '((t (:size - ,(nth (1- num) '("24pt" "18pt" "14pt" "12pt")) - :bold t))) + '((t (:inherit + ,(nth (1- num) + muse-colors-outline-faces-list)))) "Muse header face" - :group 'muse-colors)))) - ((< emacs-major-version 21) - (if (eq muse-colors-autogen-headings 'outline) - (copy-face (nth (1- num) - muse-colors-outline-faces-list) - newsym) - (copy-face 'default newsym))) - ((eq muse-colors-autogen-headings 'outline) - (eval `(defface ,newsym - '((t (:inherit - ,(nth (1- num) - muse-colors-outline-faces-list)))) - "Muse header face" - :group 'muse-colors))) - (t - (eval `(defface ,newsym - '((t (:height ,(1+ (* 0.1 (- 5 num))) - :inherit variable-pitch - :weight bold))) - "Muse header face" - :group 'muse-colors)))))) + :group 'muse-colors))) + (t + (eval `(defface ,newsym + '((t (:height ,(1+ (* 0.1 (- 5 num))) + :inherit variable-pitch + :weight bold))) + "Muse header face" + :group 'muse-colors))))))) (defface muse-link-face '((((class color) (background light)) @@ -191,7 +192,7 @@ whether progress messages should be displayed to the user." (when (or (= beg (point-min)) (eq (char-before beg) ?\n)) (add-text-properties - (line-beginning-position) (line-end-position) + (muse-line-beginning-position) (muse-line-end-position) (list 'face (intern (concat "muse-header-" (int-to-string leader)))))) ;; beginning of line or space or symbol @@ -368,13 +369,13 @@ of the functions listed in `muse-colors-markup'." beg 'font-lock-multiline) (point-min))) (goto-char beg) - (setq beg (line-beginning-position))) + (setq beg (muse-line-beginning-position))) (when font-lock-multiline (setq end (or (text-property-any end (point-max) 'font-lock-multiline nil) (point-max)))) (goto-char end) - (setq end (line-beginning-position 2)) + (setq end (muse-line-beginning-position 2)) ;; Undo any fontification in the area. (font-lock-unfontify-region beg end) ;; And apply fontification based on `muse-colors-markup' @@ -438,8 +439,8 @@ Functions should not modify the contents of the buffer." "\\([^\"]+\\)\"\\)?") attrstr)) (let ((attr (cons (downcase - (match-string-no-properties 1 attrstr)) - (match-string-no-properties 3 attrstr)))) + (muse-match-string-no-properties 1 attrstr)) + (muse-match-string-no-properties 3 attrstr)))) (setq attrstr (replace-match "" t t attrstr)) (if attrs (nconc attrs (list attr)) @@ -535,8 +536,8 @@ bad-link face" (while (> (match-end 0) cur) (flyspell-unhighlight-at cur) (setq cur (1+ cur))))) - (let* ((link (match-string-no-properties 2)) - (desc (match-string-no-properties 3)) + (let* ((link (muse-match-string-no-properties 2)) + (desc (muse-match-string-no-properties 3)) (props (muse-link-properties desc (muse-link-face (match-string 2)))) (invis-props (append props (muse-link-properties desc)))) @@ -556,13 +557,13 @@ bad-link face" (goto-char (match-end 0)) (add-text-properties (match-beginning 0) (match-end 0) - (muse-link-properties (match-string-no-properties 0) + (muse-link-properties (muse-match-string-no-properties 0) (muse-link-face (match-string 2)))) (goto-char (match-end 0)))) (defun muse-colors-title () (add-text-properties (+ 7 (match-beginning 0)) - (line-end-position) + (muse-line-end-position) '(face muse-header-1))) (provide 'muse-colors) diff --git a/muse-convert.el b/lisp/muse-convert.el similarity index 96% rename from muse-convert.el rename to lisp/muse-convert.el index 2f92a7e..e7227ce 100644 --- a/muse-convert.el +++ b/lisp/muse-convert.el @@ -21,11 +21,13 @@ ;;; Commentary: +;; Helper commands for converting a LaTeX file into a Muse file. + ;;; Contributors: ;;; Code: -;; Helper commands for converting a LaTeX file into a Muse file +(require 'muse) (require 'muse-regexps) (defun muse-write-citation (note author citation pages) @@ -69,9 +71,9 @@ (looking-at "^\\\\author") (looking-at "^\\\\\\(med\\|big\\|small\\)skip") (looking-at "^\\\\maketitle")) - (delete-region (point) (line-end-position))) + (delete-region (point) (muse-line-end-position))) ((looking-at "^\\\\title{\\(.+\\)}") - (delete-region (match-end 1) (line-end-position)) + (delete-region (match-end 1) (muse-line-end-position)) (delete-region (point) (match-beginning 1)) (insert "#title "))) (forward-line)) diff --git a/muse-docbook.el b/lisp/muse-docbook.el similarity index 100% rename from muse-docbook.el rename to lisp/muse-docbook.el diff --git a/muse-html.el b/lisp/muse-html.el similarity index 99% rename from muse-html.el rename to lisp/muse-html.el index 39b08d1..f31c5cb 100644 --- a/muse-html.el +++ b/lisp/muse-html.el @@ -382,7 +382,7 @@ system to an associated HTML coding system. If no match is found, (insert "") (when muse-html-anchor-on-word (or (and (search-forward (format "" tag) - (line-end-position) t) + (muse-line-end-position) t) (goto-char (match-beginning 0))) (forward-word 1))) (insert "")) @@ -456,7 +456,7 @@ if not escaped." str)))) (defun muse-html-markup-footnote () - (if (/= (line-beginning-position) (match-beginning 0)) + (if (/= (muse-line-beginning-position) (match-beginning 0)) "\\1" (prog1 "

\\1." @@ -514,7 +514,7 @@ if not escaped." (if (< l base) (throw 'done t))) (when (<= l max-depth) - (setq contents (cons (cons l (match-string-no-properties 2)) + (setq contents (cons (cons l (muse-match-string-no-properties 2)) contents)) (goto-char (match-beginning 2)) (muse-html-insert-anchor (concat "sec" (int-to-string index))) diff --git a/muse-http.el b/lisp/muse-http.el similarity index 100% rename from muse-http.el rename to lisp/muse-http.el diff --git a/muse-journal.el b/lisp/muse-journal.el similarity index 99% rename from muse-journal.el rename to lisp/muse-journal.el index b468f28..e5e1169 100644 --- a/muse-journal.el +++ b/lisp/muse-journal.el @@ -530,7 +530,7 @@ For more on the structure of this list, see (match-beginning 0) (point-max)))) (goto-char (point-min)) - (delete-region (point) (line-end-position)) + (delete-region (point) (muse-line-end-position)) (re-search-forward "\n+" nil t) (while (and (char-after) (eq ?\ (char-syntax (char-after)))) @@ -544,10 +544,10 @@ For more on the structure of this list, see (muse-publish-markup-buffer "rss-entry" "html") (goto-char (point-min)) (re-search-forward "Page published by Emacs Muse") - (goto-char (line-end-position)) + (goto-char (muse-line-end-position)) (setq beg (point)) (re-search-forward "Page published by Emacs Muse") - (goto-char (line-beginning-position)) + (goto-char (muse-line-beginning-position)) (setq desc (concat ""))))) (delete-region (point-min) (point-max)) diff --git a/muse-latex.el b/lisp/muse-latex.el similarity index 99% rename from muse-latex.el rename to lisp/muse-latex.el index 29cf7c9..d4e98c6 100644 --- a/muse-latex.el +++ b/lisp/muse-latex.el @@ -238,6 +238,7 @@ system to an associated CJK coding system." (match-string 1) (delete-region (match-beginning 0) (match-end 0)))) (fields (split-string str "\\s-*|+\\s-*")) + ;; FIXME: `type' isn't used (type (and (string-match "\\s-*\\(|+\\)\\s-*" str) (length (match-string 1 str))))) (insert "\\begin{tabular}{" (make-string (length fields) ?l) "}\n") diff --git a/muse-mode.el b/lisp/muse-mode.el similarity index 96% rename from muse-mode.el rename to lisp/muse-mode.el index cd0ec81..5674831 100644 --- a/muse-mode.el +++ b/lisp/muse-mode.el @@ -193,7 +193,8 @@ See `muse-publish' for more information." (or (and (looking-at muse-url-regexp) (match-string 0)) (and (or (looking-at muse-link-regexp) - (and (search-backward "[[" (line-beginning-position) t) + (and (search-backward + "[[" (muse-line-beginning-position) t) (looking-at muse-link-regexp))) (<= here (match-end 0)) (match-string 1))))))) @@ -211,16 +212,15 @@ See `muse-publish' for more information." "Edit the current link. Do not rename the page originally referred to." (interactive) - (let (old-name) - (if (muse-link-at-point) - (replace-match - (muse-make-link - (read-string "Link: " - (match-string-no-properties 1)) - (read-string "Text: " - (match-string-no-properties 2))) - t t) - (error "There is no valid link at point")))) + (if (muse-link-at-point) + (replace-match + (muse-make-link + (read-string "Link: " + (muse-match-string-no-properties 1)) + (read-string "Text: " + (muse-match-string-no-properties 2))) + t t) + (error "There is no valid link at point"))) (defun muse-visit-link (link &optional other-window) "Visit the URL or link named by LINK-NAME." @@ -365,8 +365,7 @@ This function is not entirely accurate, but it's close enough." (let ((files (sort (copy-alist (muse-project-file-alist)) (function (lambda (l r) - (string-lessp (car l) (car r)))))) - file) + (string-lessp (car l) (car r))))))) (with-temp-buffer (while files (unless (and exclude-private diff --git a/muse-poem.el b/lisp/muse-poem.el similarity index 98% rename from muse-poem.el rename to lisp/muse-poem.el index 706dc7e..d2fd312 100644 --- a/muse-poem.el +++ b/lisp/muse-poem.el @@ -159,7 +159,7 @@ (goto-char (point-min)) (insert "#title ") (forward-line 1) - (delete-region (point) (1+ (line-end-position))) + (delete-region (point) (1+ (muse-line-end-position))) (insert "\n") (let ((beg (point)) end line) (if (search-forward "\n\n\n" nil t) @@ -174,7 +174,7 @@ (set (make-local-variable 'muse-poem-longest-line) "") (while (< (point) end) (setq line (buffer-substring-no-properties (point) - (line-end-position))) + (muse-line-end-position))) (if (> (length line) (length muse-poem-longest-line)) (setq muse-poem-longest-line line)) (forward-line 1)) diff --git a/muse-project.el b/lisp/muse-project.el similarity index 100% rename from muse-project.el rename to lisp/muse-project.el diff --git a/muse-publish.el b/lisp/muse-publish.el similarity index 99% rename from muse-publish.el rename to lisp/muse-publish.el index d922c84..b726fac 100644 --- a/muse-publish.el +++ b/lisp/muse-publish.el @@ -586,8 +586,8 @@ the file is published no matter what." "([^\"]+\\)\"\\)?") attrstr)) (let ((attr (cons (downcase - (match-string-no-properties 1 attrstr)) - (match-string-no-properties 3 attrstr)))) + (muse-match-string-no-properties 1 attrstr)) + (muse-match-string-no-properties 3 attrstr)))) (setq attrstr (replace-match "" t t attrstr)) (if attrs (nconc attrs (list attr)) @@ -699,7 +699,7 @@ the file is published no matter what." (defun muse-publish-markup-footnote () "Scan ahead and snarf up the footnote body" - (if (= (line-beginning-position) (match-beginning 0)) + (if (= (muse-line-beginning-position) (match-beginning 0)) "" (let ((footnote (save-match-data (string-to-number (match-string 1)))) @@ -845,7 +845,7 @@ like read-only from being inadvertently deleted." count) (when (and markup-space (>= (setq count (skip-chars-forward " ")) 0)) - (delete-region (line-beginning-position) (point)) + (delete-region (muse-line-beginning-position) (point)) (while (> count 0) (insert markup-space) (setq count (- count 2)))))) @@ -996,9 +996,9 @@ like read-only from being inadvertently deleted." (with-current-buffer buffer (goto-char (point-min)) (let ((beg (and (search-forward "Emacs Muse begins here") - (line-end-position))) + (muse-line-end-position))) (end (and (search-forward "Emacs Muse ends here") - (line-beginning-position)))) + (muse-line-beginning-position)))) (buffer-substring-no-properties beg end)))) (defun muse-published-contents (file) diff --git a/muse-regexps.el b/lisp/muse-regexps.el similarity index 100% rename from muse-regexps.el rename to lisp/muse-regexps.el diff --git a/muse-texinfo.el b/lisp/muse-texinfo.el similarity index 99% rename from muse-texinfo.el rename to lisp/muse-texinfo.el index 18d58d8..645eda1 100644 --- a/muse-texinfo.el +++ b/lisp/muse-texinfo.el @@ -175,7 +175,7 @@ differs little between the various styles." (let* ((str (prog1 (match-string 1) (delete-region (match-beginning 0) (match-end 0)))) - (fields (split-string str "\\s-*|+\\s-*")) field) + (fields (split-string str "\\s-*|+\\s-*"))) (insert "@multitable @columnfractions ") (dotimes (field (length fields)) (insert (number-to-string (/ 1.0 (length fields))) " ")) diff --git a/muse.el b/lisp/muse.el similarity index 91% rename from muse.el rename to lisp/muse.el index 64645a6..08f496f 100644 --- a/muse.el +++ b/lisp/muse.el @@ -161,6 +161,21 @@ omitted, a default message listing FORM itself is used." (save-excursion (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)))) +(defun muse-line-end-position (&optional n) + (if (fboundp 'line-end-position) + (line-end-position n) + (save-excursion (end-of-line n) (point)))) + +(defun muse-line-beginning-position (&optional n) + (if (fboundp 'line-beginning-position) + (line-beginning-position n) + (save-excursion (beginning-of-line n) (point)))) + +(defun muse-match-string-no-properties (num &optional string) + (if (fboundp 'match-string-no-properties) + (match-string-no-properties num string) + (match-string num string))) + (provide 'muse) ;;; muse.el ends here diff --git a/scripts/muse-build.el b/scripts/muse-build.el index 7cb97fa..46f450d 100644 --- a/scripts/muse-build.el +++ b/scripts/muse-build.el @@ -1,5 +1,5 @@ -(add-to-list 'load-path ".") -(add-to-list 'load-path "contrib") +(add-to-list 'load-path "../lisp") +(add-to-list 'load-path "../contrib") (defun muse-elint-files () (require 'elint) @@ -26,7 +26,10 @@ (add-to-list 'elint-standard-variables 'buffer-file-coding-system) (add-to-list 'elint-standard-variables 'save-some-buffers-action-alist) (add-to-list 'elint-standard-variables 'emacs-major-version) + (add-to-list 'elint-standard-variables 'emacs-minor-version) + (add-to-list 'elint-standard-variables 'emacs-version) (add-to-list 'elint-standard-variables 'window-system) + (add-to-list 'elint-standard-variables 'muse-mode-abbrev-table) (dolist (file command-line-args-left) (find-file file) (message "Checking %s ..." file) @@ -35,8 +38,8 @@ (goto-char (point-min)) (forward-line 2) (while (not (or (eobp) - (looking-at "^Linting complete"))) - (message (buffer-substring (line-beginning-position) - (line-end-position))) - (forward-line 1))) + (looking-at "^Linting complete"))) + (message (buffer-substring (muse-line-beginning-position) + (muse-line-end-position))) + (forward-line 1))) (kill-buffer (current-buffer)))) diff --git a/scripts/publish b/scripts/publish index 6f09846..106da1e 100755 --- a/scripts/publish +++ b/scripts/publish @@ -1,7 +1,7 @@ #!/bin/bash style=$(echo $1 | sed 's/^--//') shift -emacs -q -batch -L .. \ +emacs -q -batch $SITEFLAG -L ../lisp \ -l muse.el -l muse-regexps.el -l muse-publish.el \ -l muse-html.el -l muse-latex.el -l muse-texinfo.el \ -f muse-batch-publish-files $style --output-dir=. "$@" -- 2.11.4.GIT