comparison lisp/textmodes/texinfmt.el @ 71675:e5f36608288b

* textmodes/texinfmt.el (texinfo-format-separate-node): Insert a string before point, which fits documentation, not after. (texinfo-multitable-item): In a multitable row, insert any additional needed @tabs and spaces.
author Robert J. Chassell <bob@rattlesnake.com>
date Fri, 07 Jul 2006 16:36:29 +0000
parents 067115a6e738
children c780a286814a
comparison
equal deleted inserted replaced
71674:c64592812a59 71675:e5f36608288b
1553 ;; else not yet a footnote 1553 ;; else not yet a footnote
1554 (insert "\n\^_\nFile: " texinfo-format-filename 1554 (insert "\n\^_\nFile: " texinfo-format-filename
1555 " Node: " node-name "-Footnotes, Up: " node-name "\n") 1555 " Node: " node-name "-Footnotes, Up: " node-name "\n")
1556 (setq start (point)) 1556 (setq start (point))
1557 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg)) 1557 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))
1558 (fill-region start (point)))))) 1558 (narrow-to-region (save-excursion (goto-char start) (point)) (point))
1559 (fill-region (point-min) (point-max))
1560 (widen)))))
1559 1561
1560 (defun texinfo-format-end-node () 1562 (defun texinfo-format-end-node ()
1561 "Format footnote in the End of node style, with notes at end of node." 1563 "Format footnote in the End of node style, with notes at end of node."
1562 (let (start 1564 (let (start
1563 (arg (texinfo-parse-line-arg))) 1565 (arg (texinfo-parse-line-arg)))
2116 (set-buffer (get-buffer-create texinfo-multitable-buffer-name)) 2118 (set-buffer (get-buffer-create texinfo-multitable-buffer-name))
2117 (delete-region (point-min) (point-max)) 2119 (delete-region (point-min) (point-max))
2118 (insert unformated-row) 2120 (insert unformated-row)
2119 (goto-char (point-min)) 2121 (goto-char (point-min))
2120 ;; 1. Check for correct number of @tab in line. 2122 ;; 1. Check for correct number of @tab in line.
2121 (let ((tab-number 1)) ; one @tab between two columns 2123 (let ((tab-number 1)) ; one @tab between two columns
2122 (while (search-forward "@tab" nil t) 2124 (while (search-forward "@tab" nil t)
2123 (setq tab-number (1+ tab-number))) 2125 (setq tab-number (1+ tab-number)))
2124 (if (/= tab-number (length table-widths)) 2126 (let ((needed-tabs (- (length table-widths) tab-number)))
2125 (error "Wrong number of @tab's in a @multitable row"))) 2127 (when (> needed-tabs 0)
2128 (goto-char (point-min))
2129 (end-of-line)
2130 (while (> needed-tabs 0)
2131 (insert "@w{ }\n@tab")
2132 (setq needed-tabs (1- needed-tabs))
2133 (message
2134 "Added @tabs and empty spaces to a @multitable row")))))
2126 (goto-char (point-min)) 2135 (goto-char (point-min))
2127 ;; 2. Format each cell, and copy to a rectangle 2136 ;; 2. Format each cell, and copy to a rectangle
2128 ;; buffer looks like this: A1 @tab A2 @tab A3 2137 ;; buffer looks like this: A1 @tab A2 @tab A3
2129 ;; Cell #1: format up to @tab 2138 ;; Cell #1: format up to @tab
2130 ;; Cell #2: format up to @tab 2139 ;; Cell #2: format up to @tab