Add 2011 to FSF/AIST copyright years.
[bpt/emacs.git] / doc / lispref / two.el
CommitLineData
a05074b9
GM
1;; Auxiliary functions for preparing a two volume manual.
2
5df4f04c 3;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
a05074b9
GM
4;; Free Software Foundation, Inc.
5
9f8bbf0f
EZ
6;; --rjc 30mar92
7
352c8b4a 8;; This file is free software: you can redistribute it and/or modify
a05074b9 9;; it under the terms of the GNU General Public License as published by
352c8b4a
GM
10;; the Free Software Foundation, either version 3 of the License, or
11;; (at your option) any later version.
a05074b9
GM
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
352c8b4a
GM
19;; along with this file. If not, see <http://www.gnu.org/licenses/>.
20
a05074b9 21
9f8bbf0f
EZ
22(defun volume-aux-markup (arg)
23 "Append `vol. NUMBER' to page number.
24Apply to aux file that you save.
25Then 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.
177c0ea7 35Apply only to unsorted index file,
9f8bbf0f
EZ
36Then insert marked file into other volume's unsorted index file.
37Then 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.
4963739e
JB
57NOTE: this auxiliary function is file specific.
58This is for the *Elisp Ref Manual*."
9f8bbf0f
EZ
59 (interactive)
60 (goto-char (point-min))
61 (insert "\\unnumbchapentry {Volume 1}{}\n\\unnumbchapentry {}{}\n")
62 (search-forward "\\unnumbchapentry {Index}")
63 (forward-line 1)
177c0ea7 64 (insert
9f8bbf0f
EZ
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"))
ab5796a9 78
352c8b4a
GM
79;; arch-tag: 848955fe-e9cf-45e7-a2f1-570ef156d6a5
80;;; two.el ends here