]> code.delx.au - gnu-emacs/blob - doc/lispref/two.el
Add 2012 to FSF copyright years for Emacs files (do not merge to trunk)
[gnu-emacs] / doc / lispref / two.el
1 ;; Auxiliary functions for preparing a two volume manual.
2
3 ;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
4 ;; Free Software Foundation, Inc.
5
6 ;; --rjc 30mar92
7
8 ;; This file is free software: you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
12
13 ;; This file is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
17
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this file. If not, see <http://www.gnu.org/licenses/>.
20
21
22 (defun volume-aux-markup (arg)
23 "Append `vol. NUMBER' to page number.
24 Apply to aux file that you save.
25 Then insert marked file into other volume's .aux file."
26 (interactive "sType volume number, 1 or 2: " )
27 (goto-char (point-min))
28 (while (search-forward "-pg" nil t)
29 (end-of-line 1)
30 (delete-backward-char 1 nil)
31 (insert ", vol.'tie" arg "}")))
32
33 (defun volume-index-markup (arg)
34 "Prepend `NUMBER:' to page number. Use Roman Numeral.
35 Apply only to unsorted index file,
36 Then insert marked file into other volume's unsorted index file.
37 Then run texindex on that file and save."
38 (interactive
39 "sType volume number, roman number I or II: " )
40 (goto-char (point-min))
41 (while (search-forward "\\entry" nil t)
42 (search-forward "}{" (save-excursion (end-of-line) (point)) nil)
43 (insert arg ":")))
44
45 (defun volume-numbers-toc-markup (arg)
46 (interactive
47 "sType volume number, roman number I or II: " )
48 (goto-char (point-min))
49 (while (search-forward "chapentry" nil t)
50 (end-of-line)
51 (search-backward "{" nil t)
52 (forward-char 1)
53 (insert arg ":")))
54
55 (defun volume-header-toc-markup ()
56 "Insert Volume I and Volume II text into .toc file.
57 NOTE: this auxiliary function is file specific.
58 This is for the *Elisp Ref Manual*."
59 (interactive)
60 (goto-char (point-min))
61 (insert "\\unnumbchapentry {Volume 1}{}\n\\unnumbchapentry {}{}\n")
62 (search-forward "\\unnumbchapentry {Index}")
63 (forward-line 1)
64 (insert
65 "\\unnumbchapentry {}{}\n\\unnumbchapentry {}{}\n\\unnumbchapentry {}{}\n\\unnumbchapentry {}{}\n\\unnumbchapentry {Volume 2}{}\n\\unnumbchapentry {}{}\n"))
66
67
68 ;;; In batch mode, you cannot call functions with args; hence this kludge:
69
70 (defun volume-aux-markup-1 () (volume-aux-markup "1"))
71 (defun volume-aux-markup-2 () (volume-aux-markup "2"))
72
73 (defun volume-index-markup-I () (volume-index-markup "I"))
74 (defun volume-index-markup-II () (volume-index-markup "II"))
75
76 (defun volume-numbers-toc-markup-I () (volume-numbers-toc-markup "I"))
77 (defun volume-numbers-toc-markup-II () (volume-numbers-toc-markup "II"))
78
79 ;; arch-tag: 848955fe-e9cf-45e7-a2f1-570ef156d6a5
80 ;;; two.el ends here