* WL-MK (test-wl): Added `make-wl-news'.
[elisp/wanderlust.git] / utils / ptexinfmt.el
index 036c97b..2f5abaa 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993,
 ;;               1994, 1995, 1996, 1997 Free Software Foundation, Inc.
 ;; Copyright (C) 1999 Yoshiki Hayashi <yoshiki@xemacs.org>
-;; Copyright (C) 2000 TAKAHASHI Kaoru <kaoru@kaisei.org>
+;; Copyright (C) 2000, 2001, 2002 TAKAHASHI Kaoru <kaoru@kaisei.org>
 
 ;; Author: TAKAHASHI Kaoru <kaoru@kaisei.org>
 ;;     Yoshiki Hayashi <yoshiki@xemacs.org>
@@ -38,8 +38,6 @@
 (require 'poe)
 (require 'broken)
 
-(provide 'ptexinfmt)
-
 ;;; Broken
 (defvar ptexinfmt-disable-broken-notice-flag t
   "If non-nil disable notice, when call `broken-facility'.
@@ -49,7 +47,7 @@ This is NO-NOTICE argument in `broken-facility'.")
 (broken-facility texinfo-format-printindex
   "Can't sort on Mule for Windows."
   (if (and (memq system-type '(windows-nt ms-dos))
-;;; I don't know version threshold. 
+;;; I don't know version threshold.
 ;;;       (string< texinfmt-version "2.37 of 24 May 1997")
           (boundp 'MULE) (not (featurep 'meadow))) ; Mule for Windows
       nil
@@ -117,25 +115,19 @@ This is NO-NOTICE argument in `broken-facility'.")
   ptexinfmt-disable-broken-notice-flag)
 
 
-;;; Obsolete
-;; Removed Texinfo 3.8
-(put 'overfullrule 'texinfo-format 'texinfo-discard-line)
-(put 'smallbreak 'texinfo-format 'texinfo-discard-line)
-(put 'medbreak 'texinfo-format 'texinfo-discard-line)
-(put 'bigbreak 'texinfo-format 'texinfo-discard-line)
-;; Removed Texinfo 3.9
-(put 'setchapterstyle 'texinfo-format 'texinfo-discard-line-with-args)
-
 ;;; Hardcopy and HTML (discard)
-;; I18N
+;; html
 (put 'documentlanguage 'texinfo-format 'texinfo-discard-line-with-args)
 (put 'documentencoding 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'documentdescription 'texinfo-format 'texinfo-discard-line-with-args)
 
 ;; size
 (put 'smallbook 'texinfo-format 'texinfo-discard-line)
+(put 'letterpaper 'texinfo-format 'texinfo-discard-line)
 (put 'afourpaper 'texinfo-format 'texinfo-discard-line)
 (put 'afourlatex 'texinfo-format 'texinfo-discard-line)
 (put 'afourwide 'texinfo-format 'texinfo-discard-line)
+(put 'afivepaper 'texinfo-format 'texinfo-discard-line)
 (put 'pagesizes 'texinfo-format 'texinfo-discard-line-with-args)
 
 ;; style
@@ -187,7 +179,7 @@ This is NO-NOTICE argument in `broken-facility'.")
   (texinfo-pop-stack 'direntry))
 
 
-;;; Block Enclosing and Conditional
+;;; Block Enclosing
 ;; @detailmenu ... @end detailmenu
 (put 'detailmenu 'texinfo-format 'texinfo-discard-line)
 (put 'detailmenu 'texinfo-end 'texinfo-discard-command)
@@ -200,29 +192,52 @@ This is NO-NOTICE argument in `broken-facility'.")
 (put 'smallformat 'texinfo-format 'texinfo-format-flushleft)
 (put 'smallformat 'texinfo-end 'texinfo-end-flushleft)
 
-;; @ifnottex ... @end ifnottex
+;; @cartouche  ... @end cartouche
+(put 'cartouche 'texinfo-format 'texinfo-discard-line)
+(put 'cartouche 'texinfo-end 'texinfo-discard-command)
+
+
+;;; Conditional
+;; @ifnottex ... @end ifnottex (makeinfo 3.11 or later)
 (put 'ifnottex 'texinfo-format 'texinfo-discard-line)
 (put 'ifnottex 'texinfo-end 'texinfo-discard-command)
 
-;; @ifnothtml ... @end ifnothtml
+;; @ifnothtml ... @end ifnothtml (makeinfo 3.11 or later)
 (put 'ifnothtml 'texinfo-format 'texinfo-discard-line)
 (put 'ifnothtml 'texinfo-end 'texinfo-discard-command)
 
-;; @ifnotinfo ... @end ifnotinfo
+;; @ifnotplaintext ... @end ifnotplaintext (makeinfo 4.2 or later)
+(put 'ifnotplaintext 'texinfo-format 'texinfo-discard-line)
+(put 'ifnotplaintext 'texinfo-end 'texinfo-discard-command)
+
+
+;; @ifnotinfo ... @end ifnotinfo (makeinfo 3.11 or later)
 (put 'ifnotinfo 'texinfo-format 'texinfo-format-ifnotinfo)
-(put 'endifnotinfo 'texinfo-format 'texinfo-discard-line)
 (defun-maybe texinfo-format-ifnotinfo ()
   (delete-region texinfo-command-start
                 (progn (re-search-forward "@end ifnotinfo[ \t]*\n")
                        (point))))
 
-;; @html ... @end html
+;; @html ... @end html (makeinfo 3.11 or later)
 (put 'html 'texinfo-format 'texinfo-format-html)
-(put 'endhtml 'texinfo-format 'texinfo-discard-line)
 (defun-maybe texinfo-format-html ()
   (delete-region texinfo-command-start
-                 (progn (re-search-forward "@end html[ \t]*\n")
-                        (point))))
+                (progn (re-search-forward "@end html[ \t]*\n")
+                       (point))))
+
+;; @ifhtml ... @end ifhtml (makeinfo 3.8 or later)
+(put 'ifhtml 'texinfo-format 'texinfo-format-ifhtml)
+(defun texinfo-format-ifhtml ()
+  (delete-region texinfo-command-start
+                (progn (re-search-forward "@end ifhtml[ \t]*\n")
+                       (point))))
+
+;; @ifplaintext ... @end ifplaintext (makeinfo 4.2 or later)
+(put 'ifplaintext 'texinfo-format 'texinfo-format-ifplaintext)
+(defun-maybe texinfo-format-ifplaintext ()
+  (delete-region texinfo-command-start
+                (progn (re-search-forward "@end ifplaintext[ \t]*\n")
+                       (point))))
 
 
 \f
@@ -421,6 +436,21 @@ Insert < ... > around EMAIL-ADDRESS."
   (insert (texinfo-parse-arg-discard))
   (goto-char texinfo-command-start))
 
+;; @.
+(put '\. 'texinfo-format 'texinfo-format-\.)
+(defun-maybe texinfo-format-\. ()
+  (texinfo-discard-command)
+  (insert "."))
+
+;; @:
+(put '\: 'texinfo-format 'texinfo-format-\:)
+(defun-maybe texinfo-format-\: ()
+  (texinfo-discard-command))
+
+;; @-
+(put '\- 'texinfo-format 'texinfo-format-soft-hyphen)
+(defun-maybe texinfo-format-soft-hyphen ()
+  (texinfo-discard-command))
 
 \f
 ;;; Cross References
@@ -454,9 +484,27 @@ otherwise, insert URL-TITLE followed by URL in parentheses."
     (texinfo-discard-command)
     ;; if url-title
     (if (nth 1 args)
-        (insert  (nth 1 args) " (" (nth 0 args) ")")
+       (insert  (nth 1 args) " (" (nth 0 args) ")")
       (insert "`" (nth 0 args) "'"))))
 
+;; @inforef
+(put 'inforef 'texinfo-format 'texinfo-format-inforef)
+(defun-maybe texinfo-format-inforef ()
+  (let ((args (texinfo-format-parse-args)))
+    (texinfo-discard-command)
+    (if (nth 1 args)
+       (insert "*Note " (nth 1 args) ": (" (nth 2 args) ")" (car args))
+      (insert "*Note " "(" (nth 2 args) ")" (car args) "::"))))
+
+
+;; @anchor
+;; don't emulation
+;; If support @anchor for Mule 2.3, We must fix informat.el and info.el:
+;;  - Info-tagify suport @anthor-*-refill.
+;;  - info.el support Ref in Tag table.
+(unless (get 'anchor 'texinfo-format)
+  (put 'anchor 'texinfo-format 'texinfo-discard-command-and-arg))
+
 
 \f
 ;;; New command definition
@@ -477,15 +525,13 @@ otherwise, insert URL-TITLE followed by URL in parentheses."
             texinfo-alias-list))
       (texinfo-discard-command))))
 
-;; @definfoenclose NEWCMD, BEFORE, AFTER
-
-
 \f
 ;;; Special
 ;; @image{FILENAME, [WIDTH], [HEIGHT]}
 (put 'image 'texinfo-format 'texinfo-format-image)
 (defun-maybe texinfo-format-image ()
-  (let ((args (texinfo-format-parse-args)) ; parse FILENAME?
+  ;; I don't know makeinfo parse FILENAME.
+  (let ((args (texinfo-format-parse-args))
        filename)
     (when (null (nth 0 args))
       (error "Invalid image command"))
@@ -756,4 +802,6 @@ This command is executed when texinfmt sees @item inside @multitable."
         (texinfo-sort-region opoint (point))
       (shell-command-on-region opoint (point) "sort -fd" 1))))
 
+(provide 'ptexinfmt)
+
 ;;; ptexinfmt.el ends here