gnus-art.el (gnus-button-alist): Also support quotes 'like this'
[gnus] / texi / texi2latex.el
index 7c6e712..91ccda6 100644 (file)
@@ -1,5 +1,5 @@
 ;;; texi2latex.el --- convert a texi file into a LaTeX file.
-;; Copyright (C) 1996, 2004 Lars Magne Ingebrigtsen
+;; Copyright (C) 1996, 2004, 2008 Lars Magne Ingebrigtsen
 
 (require 'cl)
 
     (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}")
                "\\\\\n"))
       (insert "\\end{tabular}\n")
       (widen))))
-       
-;;; arch-tag: 31e30f7f-4876-4dd1-ba3a-6f9f7ea0d256
+
+(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)))