Synch to No Gnus 200409030207.
authoryamaoka <yamaoka>
Fri, 3 Sep 2004 02:07:57 +0000 (02:07 +0000)
committeryamaoka <yamaoka>
Fri, 3 Sep 2004 02:07:57 +0000 (02:07 +0000)
texi/ChangeLog
texi/texi2latex.el

index d21073c..605f58c 100644 (file)
@@ -1,3 +1,11 @@
+2004-09-03  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * texi2latex.el (latexi-translate-file): Support @copying and
+       @insertcopying.
+       (latexi-copying-text): New variable.
+       (latexi-copying): New function.
+       (latexi-insertcopying): New function.
+
 2004-09-02  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * gnus-news.texi: Fix typo in previous commit.
 2004-09-02  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * gnus-news.texi: Fix typo in previous commit.
index 82cabde..586db1d 100644 (file)
     (erase-buffer)
     (insert-buffer-substring cur)
     (goto-char (point-min))
     (erase-buffer)
     (insert-buffer-substring cur)
     (goto-char (point-min))
+    (when (search-forward "@copying" nil t)
+      (latexi-copying))
+    (while (search-forward "@insertcopying" nil t)
+      (delete-region (match-beginning 0) (match-end 0))
+      (latexi-insertcopying))
+    (goto-char (point-min))
     (latexi-strip-line)
     (latexi-translate-string "@'e" "\\'{e}")
     (latexi-translate-string "@`a" "\\`{a}")
     (latexi-strip-line)
     (latexi-translate-string "@'e" "\\'{e}")
     (latexi-translate-string "@`a" "\\`{a}")
                "\\\\\n"))
       (insert "\\end{tabular}\n")
       (widen))))
                "\\\\\n"))
       (insert "\\end{tabular}\n")
       (widen))))
-       
+
+(defvar latexi-copying-text ""
+  "Text of the copyright notice and copying permissions.")
+
+(defun latexi-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 latexi-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 latexi-insertcopying ()
+  "Insert the copyright notice and copying permissions from the Texinfo file,
+which are indicated by the @copying ... @end copying command."
+  (insert (concat "\n" latexi-copying-text)))