From 1fe8a37131900fe9d08d5a7d278cfa70871cc314 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 17 Oct 2007 08:43:24 +0000 Subject: [PATCH] * ptexinfmt.el (texinfo-copying-text, texinfo-copying) (texinfo-insertcopying, texinfo-format-scan): Move from infohack.el. * infohack.el: Do. * Makefile.in (.texi.dvi): Don't specify "-l ja" to texi2dvi. --- ChangeLog | 8 ++++++++ Makefile.in | 2 +- infohack.el | 33 --------------------------------- ptexinfmt.el | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 527a76c..a9fea44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-10-17 Katsumi Yamaoka + + * ptexinfmt.el (texinfo-copying-text, texinfo-copying) + (texinfo-insertcopying, texinfo-format-scan): Move from infohack.el. + * infohack.el: Do. + + * Makefile.in (.texi.dvi): Don't specify "-l ja" to texi2dvi. + 2007-09-21 TAKAHASHI Kaoru * ptexinfmt.el: Support @fonttextsize, @textdegree. diff --git a/Makefile.in b/Makefile.in index 0f709ab..04dee77 100644 --- a/Makefile.in +++ b/Makefile.in @@ -49,7 +49,7 @@ dvi: gnus-ja.dvi message-ja.dvi emacs-mime-ja.dvi\ .texi.dvi: sed -e '/@iflatex/,/@end iflatex/d' $< > gnustmp.texi - env TEX=$(PTEX) BIBTEX=$(JBIBTEX) $(TEXI2DVI) -l ja -o $@ gnustmp.texi + env TEX=$(PTEX) BIBTEX=$(JBIBTEX) $(TEXI2DVI) -o $@ gnustmp.texi rm -f gnustmp.* pdf: gnus-ja.pdf message-ja.pdf emacs-mime-ja.pdf\ diff --git a/infohack.el b/infohack.el index 2b3bea2..fc4ec60 100644 --- a/infohack.el +++ b/infohack.el @@ -27,39 +27,6 @@ (load-file (expand-file-name "ptexinfmt.el" "./")) -(if (fboundp 'texinfo-copying) - nil - ;; Support @copying and @insertcopying for Emacs 21.3 and lesser and - ;; XEmacs. - (defvar texinfo-copying-text "" - "Text of the copyright notice and copying permissions.") - - (defun texinfo-copying () - "Copy the copyright notice and copying permissions from the Texinfo file, -as indicated by the @copying ... @end copying command; -insert the text with the @insertcopying command." - (let ((beg (progn (beginning-of-line) (point))) - (end (progn (re-search-forward "^@end copying[ \t]*\n") (point)))) - (setq texinfo-copying-text - (buffer-substring-no-properties - (save-excursion (goto-char beg) (forward-line 1) (point)) - (save-excursion (goto-char end) (forward-line -1) (point)))) - (delete-region beg end))) - - (defun texinfo-insertcopying () - "Insert the copyright notice and copying permissions from the Texinfo file, -which are indicated by the @copying ... @end copying command." - (insert (concat "\n" texinfo-copying-text))) - - (defadvice texinfo-format-scan (before expand-@copying-section activate) - "Extract @copying and replace @insertcopying with it." - (goto-char (point-min)) - (when (search-forward "@copying" nil t) - (texinfo-copying)) - (while (search-forward "@insertcopying" nil t) - (delete-region (match-beginning 0) (match-end 0)) - (texinfo-insertcopying)))) - (defun infohack-remove-unsupported () (goto-char (point-min)) (while (re-search-forward "@\\(end \\)?ifnottex" nil t) diff --git a/ptexinfmt.el b/ptexinfmt.el index 6049a0e..7405e51 100644 --- a/ptexinfmt.el +++ b/ptexinfmt.el @@ -964,6 +964,41 @@ This command is executed when texinfmt sees @item inside @multitable." (texinfo-sort-region opoint (point)) (shell-command-on-region opoint (point) "sort -fd" 1)))) + + +;; @copying ... @end copying +;; that Emacs 21.4 and lesser and XEmacs don't support. +(if (fboundp 'texinfo-copying) + nil + (defvar texinfo-copying-text "" + "Text of the copyright notice and copying permissions.") + + (defun texinfo-copying () + "Copy the copyright notice and copying permissions from the Texinfo file, +as indicated by the @copying ... @end copying command; +insert the text with the @insertcopying command." + (let ((beg (progn (beginning-of-line) (point))) + (end (progn (re-search-forward "^@end copying[ \t]*\n") (point)))) + (setq texinfo-copying-text + (buffer-substring-no-properties + (save-excursion (goto-char beg) (forward-line 1) (point)) + (save-excursion (goto-char end) (forward-line -1) (point)))) + (delete-region beg end))) + + (defun texinfo-insertcopying () + "Insert the copyright notice and copying permissions from the Texinfo file, +which are indicated by the @copying ... @end copying command." + (insert (concat "\n" texinfo-copying-text))) + + (defadvice texinfo-format-scan (before expand-@copying-section activate) + "Extract @copying and replace @insertcopying with it." + (goto-char (point-min)) + (when (search-forward "@copying" nil t) + (texinfo-copying)) + (while (search-forward "@insertcopying" nil t) + (delete-region (match-beginning 0) (match-end 0)) + (texinfo-insertcopying)))) + (provide 'ptexinfmt) ;;; ptexinfmt.el ends here -- 1.7.10.4