* elmo-vars.el (elmo-imap4-default-mailbox): Abolished.
[elisp/wanderlust.git] / utils / ptexinfmt.el
index 79657ec..57fc205 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 TAKAHASHI Kaoru <kaoru@kaisei.org>
 
 ;; Author: TAKAHASHI Kaoru <kaoru@kaisei.org>
 ;;     Yoshiki Hayashi <yoshiki@xemacs.org>
 (require 'poe)
 (require 'broken)
 
-(provide 'ptexinfmt)
-
 ;;; Broken
-(defvar ptexinfmt-disable-broken-notice t
-  "If non-nil disable notice, when call `broken-facility'.")
+(defvar ptexinfmt-disable-broken-notice-flag t
+  "If non-nil disable notice, when call `broken-facility'.
+This is NO-NOTICE argument in `broken-facility'.")
 
 ;; sort -fd
 (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.
 ;;;       (string< texinfmt-version "2.37 of 24 May 1997")
-          (not (featurep 'meadow)))
+          (boundp 'MULE) (not (featurep 'meadow))) ; Mule for Windows
       nil
     t)
-  ptexinfmt-disable-broken-notice)
+  ptexinfmt-disable-broken-notice-flag)
 
 ;; @var
 (broken-facility texinfo-format-var
@@ -65,7 +65,7 @@
          (texinfo-format-expand-region (point-min) (point-max))
          t))
     (error nil))
-  ptexinfmt-disable-broken-notice)
+  ptexinfmt-disable-broken-notice-flag)
 
 ;; @xref
 (broken-facility texinfo-format-xref
@@ -78,7 +78,7 @@
          (texinfo-format-expand-region (point-min) (point-max))
          t))
     (error nil))
-  ptexinfmt-disable-broken-notice)
+  ptexinfmt-disable-broken-notice-flag)
 
 ;; @uref
 (broken-facility texinfo-format-uref
          (texinfo-format-expand-region (point-min) (point-max))
          t))
     (error nil))
-  ptexinfmt-disable-broken-notice)
+  ptexinfmt-disable-broken-notice-flag)
 
 ;; @multitable
 (broken-facility texinfo-multitable-widths
-  "texinfo-multitable-widths unsupport wide-char."
+  "`texinfo-multitable-widths' unsupport wide-char."
   (if (fboundp 'texinfo-multitable-widths)
       (with-temp-buffer
        (let ((str "\e$BI}9-J8;z\e(B"))
            t)))
     ;; function definition is void
     t)
-  ptexinfmt-disable-broken-notice)
+  ptexinfmt-disable-broken-notice-flag)
 
 (broken-facility texinfo-multitable-item
-  "texinfo-multitable-item unsupport wide-char."
+  "`texinfo-multitable-item' unsupport wide-char."
   (if-broken texinfo-multitable-widths nil t)
-  ptexinfmt-disable-broken-notice)
+  ptexinfmt-disable-broken-notice-flag)
 
 
 ;;; Obsolete
 
 ;; 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
 (defun-maybe texinfo-format-direntry ()
   (texinfo-push-stack 'direntry nil)
   (texinfo-discard-line)
-  (insert "START-INFO-DIR-ENTRY\n\n"))
+  (insert "START-INFO-DIR-ENTRY\n"))
 
 (put 'direntry 'texinfo-end 'texinfo-end-direntry)
 (defun-maybe texinfo-end-direntry ()
 (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))))
+
+;; @cartouche  ... @end cartouche
+(put 'cartouche 'texinfo-format 'texinfo-discard-line)
+(put 'cartouche 'texinfo-end 'texinfo-discard-command)
 
 
 \f
@@ -419,6 +425,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
@@ -452,9 +473,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
@@ -483,7 +522,8 @@ otherwise, insert URL-TITLE followed by URL in parentheses."
 ;; @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"))
@@ -593,7 +633,7 @@ otherwise, insert URL-TITLE followed by URL in parentheses."
      ;; Case 3: Trouble
      (t
       (error
-       "You probably need to specify column widths for @multitable correctly.")))
+       "You probably need to specify column widths for @multitable correctly")))
     ;; Check whether columns fit on page.
     (let ((desired-columns
            (+
@@ -658,7 +698,7 @@ This command is executed when texinfmt sees @item inside @multitable."
       (while (search-forward "@tab" nil t)
         (setq tab-number (1+ tab-number)))
       (if (/= tab-number (length table-widths))
-          (error "Wrong number of @tab's in a @multitable row.")))
+          (error "Wrong number of @tab's in a @multitable row")))
     (goto-char (point-min))
 ;; 2. Format each cell, and copy to a rectangle
     ;; buffer looks like this:    A1  @tab  A2  @tab  A3
@@ -754,4 +794,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