]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/texinfmt.el
(outline-up-heading): Avoid infinite loop at beginning of buffer.
[gnu-emacs] / lisp / textmodes / texinfmt.el
index 885a062590101468c2cf77d71e9c2dda38453d60..90e682f4705c7c31c894ad93e26c51943f9ea00c 100644 (file)
 
 ;;; Emacs lisp functions to convert Texinfo files to Info files.
 
+(or (fboundp 'defgroup)
+    (defmacro defgroup (&rest ignore) nil))
+
+(or (fboundp 'defcustom)
+    (defmacro defcustom (var value doc &rest ignore)
+      `(defvar ,var ,value ,doc)))
+
 (defvar texinfmt-version "2.37 of 24 May 1997")
 
 (defun texinfmt-version (&optional here)
@@ -467,6 +474,7 @@ Info-split to do these manually."
   (concat
    "^@"
    "\\("
+   "direntry\\|"
    "example\\|"
    "smallexample\\|"
    "lisp\\|"
@@ -2370,6 +2378,29 @@ If used within a line, follow `@bullet' with braces."
     (insert "\n     ")))
 
 \f
+;; @direntry and @dircategory
+
+(put 'direntry 'texinfo-format 'texinfo-format-direntry)
+(defun texinfo-format-direntry ()
+  (texinfo-push-stack 'direntry nil)
+  (texinfo-discard-line)
+  (insert "START-INFO-DIR-ENTRY\n\n"))
+
+(put 'direntry 'texinfo-end 'texinfo-end-direntry)
+(defun texinfo-end-direntry ()
+  (texinfo-discard-command)
+  (insert "END-INFO-DIR-ENTRY\n\n")
+  (texinfo-pop-stack 'direntry))
+
+(put 'dircategory 'texinfo-format 'texinfo-format-dircategory)
+(defun texinfo-format-dircategory ()
+  (let ((str (texinfo-parse-arg-discard)))
+    (delete-region (point)
+                  (progn
+                    (skip-chars-forward " ")
+                    (point)))
+    (insert "INFO-DIR-SECTION " str "\n")))
+\f
 ;;; @cartouche 
 
 ;; The @cartouche command is a noop in Info; in a printed manual,
@@ -3940,7 +3971,6 @@ the @ifeq command."
 (put 'shorttitlepage 'texinfo-format 'texinfo-discard-line-with-args)
 (put 'summarycontents 'texinfo-format 'texinfo-discard-line-with-args)
 (put 'input 'texinfo-format 'texinfo-discard-line-with-args)
-(put 'dircategory 'texinfo-format 'texinfo-discard-line-with-args)
 
 \f
 ;;; Some commands cannot be handled