Import from gnus-doc-ja:
[elisp/wanderlust.git] / utils / ptexinfmt.el
index 41690f1..9c98e13 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, 2001, 2002 TAKAHASHI Kaoru <kaoru@kaisei.org>
+;; Copyright (C) 2000 TAKAHASHI Kaoru <kaoru@kaisei.org>
 
 ;; Author: TAKAHASHI Kaoru <kaoru@kaisei.org>
 ;;     Yoshiki Hayashi <yoshiki@xemacs.org>
@@ -24,8 +24,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 
 ;; Modified by Yamaoka not to use APEL functions.
 
+;; Unimplemented command:
+;;  @abbr
+;;  @float, @caption, @shortcaption, @listoffloats
+;;  @deftypecv[x]
+;;  @headitem
+;;  @comma{}
+;;  @quotation (optional arguments)
+;;  @acronym (optional argument)
+;;  @dofirstparagraphindent
+;;  @indent
+;;  @verbatiminclude
+;;  @\
+;;  @definfoenclose
+;;  @deftypeivar
+;;  @deftypeop
+;;  @allowcodebreaks
+;;  @thischapternum
+;;  @quotedblleft @quotedblright
+;;  @quoteleft @quoteright  @quotedblbase @quotesinglbase
+;;  @guillemetleft @guillemetright @guilsinglleft @guilsinglright.
+
 ;;; Code:
 
-(require 'backquote)
 (require 'texinfmt)
 
 ;;; Broken
@@ -52,50 +72,50 @@ This is last argument in `ptexinfmt-broken-facility'.")
   "Declare a symbol FACILITY is broken if ASSERTION is nil.
 DOCSTRING will be printed if ASSERTION is nil and
 `ptexinfmt-disable-broken-notice-flag' is nil."
-  (` (let ((facility '(, facility))
-          (docstring (, docstring))
-          (assertion (eval '(, assertion))))
-       (put facility 'broken (not assertion))
-       (if assertion
+  `(let ((facility ',facility)
+        (docstring ,docstring)
+        (assertion (eval ',assertion)))
+     (put facility 'broken (not assertion))
+     (if assertion
+        nil
+       (put facility 'broken-docstring docstring)
+       (if ptexinfmt-disable-broken-notice-flag
           nil
-        (put facility 'broken-docstring docstring)
-        (if ptexinfmt-disable-broken-notice-flag
-            nil
-          (message "BROKEN FACILITY DETECTED: %s" docstring))))))
+        (message "BROKEN FACILITY DETECTED: %s" docstring)))))
 
 (put 'ptexinfmt-defun-if-broken 'lisp-indent-function 'defun)
 (defmacro ptexinfmt-defun-if-broken (&rest args)
   "Redefine a function just like `defun' if it is considered broken."
   (let ((name (list 'quote (car args))))
     (setq args (cdr args))
-    (` (prog1
-          (, name)
-        (if (get (, name) 'broken)
-            (defalias (, name)
-              (function (lambda (,@ args)))))))))
+    `(prog1
+        ,name
+       (if (get ,name 'broken)
+          (defalias ,name
+            (function (lambda ,@args)))))))
 
 (put 'ptexinfmt-defun-if-void 'lisp-indent-function 'defun)
 (defmacro ptexinfmt-defun-if-void (&rest args)
   "Define a function just like `defun' unless it is already defined."
   (let ((name (list 'quote (car args))))
     (setq args (cdr args))
-    (` (prog1
-          (, name)
-        (if (fboundp (, name))
-            nil
-          (defalias (, name)
-            (function (lambda (,@ args)))))))))
+    `(prog1
+        ,name
+       (if (fboundp ,name)
+          nil
+        (defalias ,name
+          (function (lambda ,@args)))))))
 
 (put 'ptexinfmt-defvar-if-void 'lisp-indent-function 'defun)
 (defmacro ptexinfmt-defvar-if-void (&rest args)
   "Define a variable just like `defvar' unless it is already defined."
   (let ((name (car args)))
     (setq args (cdr args))
-    (` (prog1
-          (defvar (, name))
-        (if (boundp '(, name))
-            nil
-          (defvar (, name) (,@ args)))))))
+    `(prog1
+        (defvar ,name)
+       (if (boundp ',name)
+          nil
+        (defvar ,name ,@args)))))
 
 ;; sort -fd
 (ptexinfmt-broken-facility texinfo-format-printindex
@@ -153,10 +173,10 @@ DOCSTRING will be printed if ASSERTION is nil and
          (insert (format " {%s}\n" str))
          (goto-char (point-min))
          (if (= (car (texinfo-multitable-widths)) (length str))
-             nil
-           t)))
+             t
+           nil)))
     ;; function definition is void
-    t))
+    nil))
 
 (ptexinfmt-broken-facility texinfo-multitable-item
   "`texinfo-multitable-item' unsupport wide-char."
@@ -177,6 +197,7 @@ DOCSTRING will be printed if ASSERTION is nil and
 (put 'afourwide 'texinfo-format 'texinfo-discard-line)
 (put 'afivepaper 'texinfo-format 'texinfo-discard-line)
 (put 'pagesizes 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'fonttextsize 'texinfo-format 'texinfo-discard-line-with-args)
 
 ;; style
 (put 'setchapternewpage 'texinfo-format 'texinfo-discard-line-with-args)
@@ -186,6 +207,7 @@ DOCSTRING will be printed if ASSERTION is nil and
 (put 'setcontentsaftertitlepage 'texinfo-format 'texinfo-discard-line)
 (put 'setshortcontentsaftertitlepage 'texinfo-format 'texinfo-discard-line)
 (put 'novalidate 'texinfo-format 'texinfo-discard-line-with-args)
+(put 'frenchspacing 'texinfo-format 'texinfo-discard-line-with-args)
 
 ;; head & foot
 (put 'headings 'texinfo-format 'texinfo-discard-line-with-args)
@@ -200,6 +222,12 @@ DOCSTRING will be printed if ASSERTION is nil and
 (put 'page 'texinfo-format 'texinfo-discard-line)
 (put 'hyphenation 'texinfo-format 'texinfo-discard-command-and-arg)
 
+;; @slanted{} (makeinfo 4.8 or later)
+(put 'slanted 'texinfo-format 'texinfo-format-noop)
+
+;; @sansserif{} (makeinfo 4.8 or later)
+(put 'sansserif 'texinfo-format 'texinfo-format-noop)
+
 ;; @tie{} (makeinfo 4.3 or later)
 (put 'tie 'texinfo-format 'texinfo-format-tie)
 (ptexinfmt-defun-if-void texinfo-format-tie ()
@@ -393,6 +421,12 @@ For example, @verb\{|@|\} results in @ and
   (insert "(R)"))
 
 ;;; Accents and Special characters
+;; @euro{}     ==>     Euro
+(put 'euro 'texinfo-format 'texinfo-format-euro)
+(ptexinfmt-defun-if-void texinfo-format-euro ()
+  (texinfo-parse-arg-discard)
+  (insert "Euro "))
+
 ;; @pounds{}   ==>     #       Pounds Sterling
 (put 'pounds 'texinfo-format 'texinfo-format-pounds)
 (ptexinfmt-defun-if-void texinfo-format-pounds ()
@@ -403,7 +437,7 @@ For example, @verb\{|@|\} results in @ and
 (put 'ordf 'texinfo-format 'texinfo-format-ordf)
 (ptexinfmt-defun-if-void texinfo-format-ordf ()
   (texinfo-parse-arg-discard)
-  (insert "o"))
+  (insert "a"))
 
 ;; @ordm{}     ==>     o       Spanish masculine
 (put 'ordm 'texinfo-format 'texinfo-format-ordm)
@@ -571,6 +605,12 @@ For example, @verb\{|@|\} results in @ and
 (ptexinfmt-defun-if-void texinfo-format-\/ ()
   (texinfo-discard-command))
 
+;; @textdegree
+(put 'textdegree 'texinfo-format 'texinfo-format-textdegree)
+(ptexinfmt-defun-if-void texinfo-format-textdegree ()
+  (insert "o" (texinfo-parse-arg-discard))
+  (goto-char texinfo-command-start))
+
 \f
 ;;; Cross References
 ;; @ref, @xref