]> code.delx.au - gnu-emacs/blobdiff - lisp/textmodes/texinfmt.el
Merge from trunk.
[gnu-emacs] / lisp / textmodes / texinfmt.el
index 577287c60bcf5511df03312c4917b1ccd3d085d2..d318a97d37731a3cb6256c483fb6be1543d06412 100644 (file)
@@ -1,8 +1,7 @@
 ;;; texinfmt.el --- format Texinfo files into Info files
 
-;; Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
-;;   1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;;   2008, 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1988, 1990-1998, 2000-2012
+;;   Free Software Foundation, Inc.
 
 ;; Maintainer: Robert J. Chassell <bug-texinfo@gnu.org>
 ;; Keywords: maint, tex, docs
@@ -94,7 +93,7 @@ If optional argument HERE is non-nil, insert info at point."
     (@unnumberedsubsubsec . @unnumberedsubsec)
     (@subsubheading . @subheading)
     (@appendixsubsubsec . @appendixsubsec))
-  "*An alist of next higher levels for chapters, sections, etc...
+  "An alist of next higher levels for chapters, sections, etc...
 For example, section to chapter, subsection to section.
 Used by `texinfo-raise-lower-sections'.
 The keys specify types of section; the values correspond to the next
@@ -122,7 +121,7 @@ higher types.")
     (@unnumberedsubsubsec . @unnumberedsubsubsec)
     (@subsubheading . @subsubheading)
     (@appendixsubsubsec . @appendixsubsubsec))
-  "*An alist of next lower levels for chapters, sections, etc...
+  "An alist of next lower levels for chapters, sections, etc...
 For example, chapter to section, section to subsection.
 Used by `texinfo-raise-lower-sections'.
 The keys specify types of section; the values correspond to the next
@@ -175,7 +174,7 @@ and don't split the file if large.  You can use `Info-tagify' and
                         "done.  Now save it." "done.")))))
 
 (defvar texinfo-region-buffer-name "*Info Region*"
-  "*Name of the temporary buffer used by \\[texinfo-format-region].")
+  "Name of the temporary buffer used by \\[texinfo-format-region].")
 
 (defvar texinfo-pre-format-hook nil
   "Hook called before the conversion of the Texinfo file to Info format.
@@ -519,7 +518,7 @@ if large.  You can use `Info-split' to do this manually."
 \f
 ;;; Handle paragraph filling
 
-;; Keep as concatinated lists for ease of maintenance
+;; Keep as concatenated lists for ease of maintenance
 
 (defvar texinfo-no-refill-regexp
   (concat
@@ -621,7 +620,7 @@ if large.  You can use `Info-split' to do this manually."
    "var{\\|"
    "w{\\|"
    "xref{\\|"
-   "@-\\|"    ; @- is a descretionary hyphen (not an accent) (a noop).
+   "@-\\|"    ; @- is a discretionary hyphen (not an accent) (a noop).
    texinfo-accent-commands
    "\\)"
    )
@@ -663,11 +662,12 @@ Do not append @refill to paragraphs containing @w{TEXT} or @*."
         ;; Else
         ;; 3. Do not refill a paragraph containing @w or @*, or ending
         ;;    with @<newline> followed by a newline.
-        (if  (or (>= (point) (point-max))
-                (re-search-forward
-                 "@w{\\|@\\*\\|@\n\n"
-                 (save-excursion (forward-paragraph) (forward-line 1) (point))
-                 t))
+        (if (or (>= (point) (point-max))
+                (re-search-forward
+                 "@w{\\|@\\*\\|@\n\n"
+                 (save-excursion (forward-paragraph)
+                                 (line-beginning-position 2))
+                 t))
             ;; Go to end of paragraph and do nothing.
             (forward-paragraph)
           ;; 4. Else go to end of paragraph and insert @refill
@@ -944,8 +944,8 @@ insert the text with the @insertcopying command."
         (end  (progn (re-search-forward "^@end copying[ \t]*\n") (point))))
     (setq texinfo-copying-text
           (buffer-substring-no-properties
-           (save-excursion (goto-char beg) (forward-line 1) (point))
-           (save-excursion (goto-char end) (forward-line -1) (point))))
+           (save-excursion (goto-char beg) (line-beginning-position 2))
+           (save-excursion (goto-char end) (line-beginning-position 0))))
     (delete-region beg end)))
 
 (defun texinfo-insertcopying ()
@@ -1918,7 +1918,7 @@ Used by @refill indenting command to avoid indenting within lists, etc.")
 ;; Texinfo commands.
 
 (defvar texinfo-extra-inter-column-width 0
-  "*Number of extra spaces between entries (columns) in @multitable.")
+  "Number of extra spaces between entries (columns) in @multitable.")
 
 (defvar texinfo-multitable-buffer-name "*multitable-temporary-buffer*")
 (defvar texinfo-multitable-rectangle-name "texinfo-multitable-temp-")
@@ -2088,11 +2088,11 @@ This command is executed when texinfmt sees @item inside @multitable."
         (table-entry-height 0)
         ;; unformatted row looks like:  A1  @tab  A2  @tab  A3
         ;; extract-row command deletes the source line in the table.
-        (unformated-row (texinfo-multitable-extract-row)))
+        (unformatted-row (texinfo-multitable-extract-row)))
     ;; Use a temporary buffer
     (set-buffer (get-buffer-create texinfo-multitable-buffer-name))
     (delete-region (point-min) (point-max))
-    (insert unformated-row)
+    (insert unformatted-row)
     (goto-char (point-min))
 ;; 1. Check for correct number of @tab in line.
     (let ((tab-number 1))               ; one @tab between two columns
@@ -2194,7 +2194,7 @@ This command is executed when texinfmt sees @item inside @multitable."
 
 (put 'image 'texinfo-format 'texinfo-format-image)
 (defun texinfo-format-image ()
-  "Insert an image from an an file ending in .txt.
+  "Insert an image from a file ending in .txt.
 Use only the FILENAME arg; for Info, ignore the other arguments to @image."
   (let ((args (texinfo-format-parse-args))
        filename)
@@ -3909,11 +3909,11 @@ Default is to leave paragraph indentation as is."
 ;;; @set, @clear, @ifset, @ifclear
 
 ;; If a flag is set with @set FLAG, then text between @ifset and @end
-;; ifset is formatted normally, but if the flag is is cleared with
+;; ifset is formatted normally, but if the flag is cleared with
 ;; @clear FLAG, then the text is not formatted; it is ignored.
 
 ;; If a flag is cleared with @clear FLAG, then text between @ifclear
-;; and @end ifclear is formatted normally, but if the flag is is set with
+;; and @end ifclear is formatted normally, but if the flag is set with
 ;; @set FLAG, then the text is not formatted; it is ignored.  @ifclear
 ;; is the opposite of @ifset.
 
@@ -4238,7 +4238,7 @@ the @ifeq command."
 Must be used only with -batch, and kills Emacs on completion.
 Each file will be processed even if an error occurred previously.
 For example, invoke
-  \"emacs -batch -funcall batch-texinfo-format $docs/ ~/*.texinfo\"."
+  \"emacs -batch -l texinfmt -f batch-texinfo-format $docs/ ~/*.texinfo\"."
   (if (not noninteractive)
       (error "batch-texinfo-format may only be used -batch"))
   (let ((version-control t)
@@ -4297,5 +4297,4 @@ For example, invoke
 ;;; Place `provide' at end of file.
 (provide 'texinfmt)
 
-;; arch-tag: 1e8d9a2d-bca0-40a0-ac6c-dab01bc6f725
 ;;; texinfmt.el ends here