annotate lisp/textmodes/texinfmt.el @ 4477:7101a887f80d

(do-auto-fill): Don't keep breaking the line if it doesn't help matters.
author Richard M. Stallman <rms@gnu.org>
date Sat, 07 Aug 1993 08:19:18 +0000
parents 0ab53cbfac0e
children d1b5ca8f5493
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1 ;;;; texinfmt.el
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2 ;;; Copyright (C) 1985, 1986, 1988,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3 ;;; 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
841
2cdce064065f entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 814
diff changeset
4
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
5 ;; Maintainer: Robert J. Chassell <bug-texinfo@prep.ai.mit.edu>
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
6
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
7 ;;; This file is part of GNU Emacs.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
8
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
12 ;; any later version.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
13
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
17 ;; GNU General Public License for more details.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
18
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
21 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
22
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
23 ;;; Code:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
24
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
25 ;;; Emacs lisp functions to convert Texinfo files to Info files.
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
26
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
27 (defvar texinfmt-version "2.30 of 18 May 1993")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
28
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
29 ;;; Variable definitions
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
30
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
31 (require 'texinfo) ; So `texinfo-footnote-style' is defined.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
32 (require 'texnfo-upd) ; So `texinfo-section-types-regexp' is defined.
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 657
diff changeset
33
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
34 (defvar texinfo-format-syntax-table nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
35
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
36 (defvar texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
37 (defvar texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
38 (defvar texinfo-cindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
39 (defvar texinfo-pindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
40 (defvar texinfo-tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
41 (defvar texinfo-kindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
42 (defvar texinfo-last-node)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
43 (defvar texinfo-node-names)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
44 (defvar texinfo-enclosure-list)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
45
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
46
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
47 ;;; Syntax table
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
48
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
49 (if texinfo-format-syntax-table
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
50 nil
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
51 (setq texinfo-format-syntax-table (make-syntax-table))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
52 (modify-syntax-entry ?\" " " texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
53 (modify-syntax-entry ?\\ " " texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
54 (modify-syntax-entry ?@ "\\" texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
55 (modify-syntax-entry ?\^q "\\" texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
56 (modify-syntax-entry ?\[ "." texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
57 (modify-syntax-entry ?\] "." texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
58 (modify-syntax-entry ?\( "." texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
59 (modify-syntax-entry ?\) "." texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
60 (modify-syntax-entry ?{ "(}" texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
61 (modify-syntax-entry ?} "){" texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
62 (modify-syntax-entry ?\' "." texinfo-format-syntax-table))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
63
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
64
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
65 ;;; Top level buffer and region formatting functions
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
66
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
67 (defun texinfo-format-buffer (&optional notagify)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
68 "Process the current buffer as texinfo code, into an Info file.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
69 The Info file output is generated in a buffer visiting the Info file
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
70 names specified in the @setfilename command.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
71
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
72 Non-nil argument (prefix, if interactive) means don't make tag table
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
73 and don't split the file if large. You can use Info-tagify and
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
74 Info-split to do these manually."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
75 (interactive "P")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
76 (let ((lastmessage "Formatting Info file..."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
77 (message lastmessage)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
78 (texinfo-format-buffer-1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
79 (if notagify
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
80 nil
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
81 (if (> (buffer-size) 30000)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
82 (progn
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
83 (message (setq lastmessage "Making tags table for Info file..."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
84 (Info-tagify)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
85 (if (> (buffer-size) 100000)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
86 (progn
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
87 (message (setq lastmessage "Splitting Info file..."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
88 (Info-split))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
89 (message (concat lastmessage
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
90 (if (interactive-p) "done. Now save it." "done.")))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
91
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
92 (defvar texinfo-region-buffer-name "*Info Region*"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
93 "*Name of the temporary buffer used by \\[texinfo-format-region].")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
94
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
95 (defun texinfo-format-region (region-beginning region-end)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
96 "Convert the current region of the Texinfo file to Info format.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
97 This lets you see what that part of the file will look like in Info.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
98 The command is bound to \\[texinfo-format-region]. The text that is
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
99 converted to Info is stored in a temporary buffer."
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
100 (interactive "r")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
101 (message "Converting region to Info format...")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
102 (let (texinfo-command-start
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
103 texinfo-command-end
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
104 texinfo-command-name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
105 texinfo-vindex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
106 texinfo-findex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
107 texinfo-cindex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
108 texinfo-pindex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
109 texinfo-tindex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
110 texinfo-kindex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
111 texinfo-stack
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
112 (texinfo-format-filename "")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
113 texinfo-example-start
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
114 texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
115 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
116 texinfo-node-names
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
117 (texinfo-footnote-number 0)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
118 last-input-buffer
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
119 (fill-column-for-info fill-column)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
120 (input-buffer (current-buffer))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
121 (input-directory default-directory)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
122 (header-text "")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
123 (header-beginning 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
124 (header-end 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
125
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
126 ;;; Copy lines between beginning and end of header lines,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
127 ;;; if any, or else copy the `@setfilename' line, if any.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
128 (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
129 (save-restriction
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
130 (widen)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
131 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
132 (let ((search-end (save-excursion (forward-line 100) (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
133 (if (or
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
134 ;; Either copy header text.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
135 (and
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
136 (prog1
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
137 (search-forward texinfo-start-of-header search-end t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
138 (forward-line 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
139 ;; Mark beginning of header.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
140 (setq header-beginning (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
141 (prog1
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
142 (search-forward texinfo-end-of-header nil t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
143 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
144 ;; Mark end of header
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
145 (setq header-end (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
146 ;; Or copy @filename line.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
147 (prog2
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
148 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
149 (search-forward "@setfilename" search-end t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
150 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
151 (setq header-beginning (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
152 (forward-line 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
153 (setq header-end (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
154
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
155 ;; Copy header
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
156 (setq header-text
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
157 (buffer-substring
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
158 (min header-beginning region-beginning)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
159 header-end))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
160
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
161 ;;; Find a buffer to use.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
162 (switch-to-buffer (get-buffer-create texinfo-region-buffer-name))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
163 (erase-buffer)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
164 ;; Insert the header into the buffer.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
165 (insert header-text)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
166 ;; Insert the region into the buffer.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
167 (insert-buffer-substring
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
168 input-buffer
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
169 (max region-beginning header-end)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
170 region-end)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
171 ;; Make sure region ends in a newline.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
172 (or (= (preceding-char) ?\n)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
173 (insert "\n"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
174
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
175 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
176 (texinfo-mode)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
177 (message "Converting region to Info format...")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
178 (setq fill-column fill-column-for-info)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
179 ;; Install a syntax table useful for scanning command operands.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
180 (set-syntax-table texinfo-format-syntax-table)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
181
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
182 ;; Insert @include files so `texinfo-raise-lower-sections' can
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
183 ;; work on them without losing track of multiple
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
184 ;; @raise/@lowersections commands.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
185 (while (re-search-forward "^@include" nil t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
186 (setq texinfo-command-end (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
187 (let ((filename (concat input-directory
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
188 (texinfo-parse-line-arg))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
189 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
190 (delete-region (point) (save-excursion (forward-line 1) (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
191 (message "Reading included file: %s" filename)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
192 (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
193 (save-restriction
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
194 (narrow-to-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
195 (point)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
196 (+ (point) (car (cdr (insert-file-contents filename)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
197 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
198 ;; Remove `@setfilename' line from included file, if any,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
199 ;; so @setfilename command not duplicated.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
200 (if (re-search-forward
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
201 "^@setfilename" (save-excursion (forward-line 100) (point)) t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
202 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
203 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
204 (delete-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
205 (point) (save-excursion (forward-line 1) (point)))))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
206
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
207 ;; Raise or lower level of each section, if necessary.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
208 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
209 (texinfo-raise-lower-sections)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
210 ;; Append @refill to appropriate paragraphs for filling.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
211 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
212 (texinfo-append-refill)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
213 ;; If the region includes the effective end of the data,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
214 ;; discard everything after that.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
215 (goto-char (point-max))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
216 (if (re-search-backward "^@bye" nil t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
217 (delete-region (point) (point-max)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
218 ;; Make sure buffer ends in a newline.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
219 (or (= (preceding-char) ?\n)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
220 (insert "\n"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
221 ;; Don't use a previous value of texinfo-enclosure-list.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
222 (setq texinfo-enclosure-list nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
223
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
224 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
225 (if (looking-at "\\\\input[ \t]+texinfo")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
226 (delete-region (point) (save-excursion (forward-line 1) (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
227
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
228 ;; Insert Info region title text.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
229 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
230 (if (search-forward
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
231 "@setfilename" (save-excursion (forward-line 100) (point)) t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
232 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
233 (setq texinfo-command-end (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
234 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
235 (setq texinfo-command-start (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
236 (let ((arg (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
237 (insert " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
238 texinfo-region-buffer-name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
239 " buffer for: `")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
240 (insert (file-name-nondirectory (expand-file-name arg)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
241 (insert "', -*-Text-*-\n")))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
242 ;; Else no `@setfilename' line
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
243 (insert " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
244 texinfo-region-buffer-name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
245 " buffer -*-Text-*-\n"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
246 (insert "produced by `texinfo-format-region'\n"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
247 "from a region in: "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
248 (if (buffer-file-name input-buffer)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
249 (concat "`"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
250 (file-name-sans-versions
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
251 (file-name-nondirectory
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
252 (buffer-file-name input-buffer)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
253 "'")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
254 (concat "buffer `" (buffer-name input-buffer) "'"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
255 "\nusing `texinfmt.el' version "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
256 texinfmt-version
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
257 ".\n\n")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
258
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
259 ;; Now convert for real.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
260 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
261 (texinfo-format-scan)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
262 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
263
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
264 (message "Done.")))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
265
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
266
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
267 ;;; Primary internal formatting function for the whole buffer.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
268
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
269 (defun texinfo-format-buffer-1 ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
270 (let (texinfo-format-filename
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
271 texinfo-example-start
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
272 texinfo-command-start
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
273 texinfo-command-end
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
274 texinfo-command-name
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
275 texinfo-last-node
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
276 texinfo-last-node-pos
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
277 texinfo-vindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
278 texinfo-findex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
279 texinfo-cindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
280 texinfo-pindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
281 texinfo-tindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
282 texinfo-kindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
283 texinfo-stack
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
284 texinfo-node-names
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
285 (texinfo-footnote-number 0)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
286 last-input-buffer
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
287 outfile
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
288 (fill-column-for-info fill-column)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
289 (input-buffer (current-buffer))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
290 (input-directory default-directory))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
291 (setq texinfo-enclosure-list nil)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
292 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
293 (goto-char (point-min))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
294 (or (search-forward "@setfilename" nil t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
295 (error "Texinfo file needs an `@setfilename FILENAME' line."))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
296 (setq texinfo-command-end (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
297 (setq outfile (texinfo-parse-line-arg)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
298 (find-file outfile)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
299 (texinfo-mode)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
300 (setq fill-column fill-column-for-info)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
301 (set-syntax-table texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
302 (erase-buffer)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
303 (insert-buffer-substring input-buffer)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
304 (message "Converting %s to Info format..." (buffer-name input-buffer))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
305
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
306 ;; Insert @include files so `texinfo-raise-lower-sections' can
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
307 ;; work on them without losing track of multiple
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
308 ;; @raise/@lowersections commands.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
309 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
310 (while (re-search-forward "^@include" nil t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
311 (setq texinfo-command-end (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
312 (let ((filename (concat input-directory
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
313 (texinfo-parse-line-arg))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
314 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
315 (delete-region (point) (save-excursion (forward-line 1) (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
316 (message "Reading included file: %s" filename)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
317 (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
318 (save-restriction
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
319 (narrow-to-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
320 (point)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
321 (+ (point) (car (cdr (insert-file-contents filename)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
322 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
323 ;; Remove `@setfilename' line from included file, if any,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
324 ;; so @setfilename command not duplicated.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
325 (if (re-search-forward
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
326 "^@setfilename"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
327 (save-excursion (forward-line 100) (point)) t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
328 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
329 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
330 (delete-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
331 (point) (save-excursion (forward-line 1) (point)))))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
332 ;; Raise or lower level of each section, if necessary.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
333 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
334 (texinfo-raise-lower-sections)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
335 ;; Append @refill to appropriate paragraphs
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
336 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
337 (texinfo-append-refill)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
338 (goto-char (point-min))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
339 (search-forward "@setfilename")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
340 (beginning-of-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
341 (delete-region (point-min) (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
342 ;; Remove @bye at end of file, if it is there.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
343 (goto-char (point-max))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
344 (if (search-backward "@bye" nil t)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
345 (delete-region (point) (point-max)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
346 ;; Make sure buffer ends in a newline.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
347 (or (= (preceding-char) ?\n)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
348 (insert "\n"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
349 ;; Scan the whole buffer, converting to Info format.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
350 (texinfo-format-scan)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
351 ;; Return data for indices.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
352 (goto-char (point-min))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
353 (list outfile
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
354 texinfo-vindex texinfo-findex texinfo-cindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
355 texinfo-pindex texinfo-tindex texinfo-kindex)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
356
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
357
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
358 ;;; Perform non-@-command file conversions: quotes and hyphens
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
359
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
360 (defun texinfo-format-convert (min max)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
361 ;; Convert left and right quotes to typewriter font quotes.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
362 (goto-char min)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
363 (while (search-forward "``" max t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
364 (replace-match "\""))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
365 (goto-char min)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
366 (while (search-forward "''" max t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
367 (replace-match "\""))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
368 ;; Convert three hyphens in a row to two.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
369 (goto-char min)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
370 (while (re-search-forward "\\( \\|\\w\\)\\(---\\)\\( \\|\\w\\)" max t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
371 (delete-region (1+ (match-beginning 2)) (+ 2 (match-beginning
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
372 2)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
373
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
374
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
375 ;;; Handle paragraph filling
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
376
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
377 (defvar texinfo-no-refill-regexp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
378 "^@\\(example\\|smallexample\\|lisp\\|smalllisp\\|display\\|format\\|flushleft\\|flushright\\|menu\\|titlepage\\|iftex\\|tex\\)"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
379 "Regexp specifying environments in which paragraphs are not filled.")
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
380
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
381 (defvar texinfo-part-of-para-regexp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
382 "^@\\(b{\\|bullet{\\|cite{\\|code{\\|emph{\\|equiv{\\|error{\\|expansion{\\|file{\\|i{\\|inforef{\\|kbd{\\|key{\\|lisp{\\|minus{\\|point{\\|print{\\|pxref{\\|r{\\|ref{\\|result{\\|samp{\\|sc{\\|t{\\|TeX{\\|today{\\|var{\\|w{\\|xref{\\)"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
383 "Regexp specifying @-commands found within paragraphs.")
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
384
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
385 (defun texinfo-append-refill ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
386 "Append @refill at end of each paragraph that should be filled.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
387 Do not append @refill to paragraphs within @example and similar environments.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
388 Do not append @refill to paragraphs containing @w{TEXT} or @*."
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
389
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
390 ;; It is necessary to append @refill before other processing because
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
391 ;; the other processing removes information that tells Texinfo
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
392 ;; whether the text should or should not be filled.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
393
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
394 (while (< (point) (point-max))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
395 (let ((refill-blank-lines "^[ \t\n]*$")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
396 (case-fold-search nil)) ; Don't confuse @TeX and @tex....
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
397 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
398 ;; 1. Skip over blank lines;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
399 ;; skip over lines beginning with @-commands,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
400 ;; but do not skip over lines
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
401 ;; that are no-refill environments such as @example or
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
402 ;; that begin with within-paragraph @-commands such as @code.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
403 (while (and (looking-at (concat "^@\\|^\\\\\\|" refill-blank-lines))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
404 (not (looking-at
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
405 (concat
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
406 "\\("
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
407 texinfo-no-refill-regexp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
408 "\\|"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
409 texinfo-part-of-para-regexp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
410 "\\)")))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
411 (< (point) (point-max)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
412 (forward-line 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
413 ;; 2. Skip over @example and similar no-refill environments.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
414 (if (looking-at texinfo-no-refill-regexp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
415 (let ((environment
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
416 (buffer-substring (match-beginning 1) (match-end 1))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
417 (progn (re-search-forward (concat "^@end " environment) nil t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
418 (forward-line 1)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
419 ;; 3. Do not refill a paragraph containing @w or @*
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
420 (if (or
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
421 (>= (point) (point-max))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
422 (re-search-forward
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
423 "@w{\\|@\\*" (save-excursion (forward-paragraph) (point)) t))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
424 ;; Go to end of paragraph and do nothing.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
425 (forward-paragraph)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
426 ;; 4. Else go to end of paragraph and insert @refill
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
427 (forward-paragraph)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
428 (forward-line -1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
429 (end-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
430 (delete-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
431 (point)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
432 (save-excursion (skip-chars-backward " \t") (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
433 ;; `looking-at-backward' not available in v. 18.57
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
434 ;; (if (not (looking-at-backward "@refill\\|@bye")) ;)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
435 (if (not (re-search-backward
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
436 "@refill\\|@bye"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
437 (save-excursion (beginning-of-line) (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
438 t))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
439 (insert "@refill"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
440 (forward-line 1))))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
441
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
442
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
443 ;;; Handle `@raisesections' and `@lowersections' commands
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
444
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
445 ;; These commands change the hierarchical level of chapter structuring
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
446 ;; commands.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
447 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
448 ;; @raisesections changes @subsection to @section,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
449 ;; @section to @chapter,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
450 ;; etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
451 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
452 ;; @lowersections changes @chapter to @section
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
453 ;; @subsection to @subsubsection,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
454 ;; etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
455 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
456 ;; An @raisesections/@lowersections command changes only those
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
457 ;; structuring commands that follow the @raisesections/@lowersections
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
458 ;; command.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
459 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
460 ;; Repeated @raisesections/@lowersections continue to raise or lower
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
461 ;; the heading level.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
462 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
463 ;; An @lowersections command cancels an @raisesections command, and
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
464 ;; vice versa.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
465 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
466 ;; You cannot raise or lower "beyond" chapters or subsubsections, but
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
467 ;; trying to do so does not elicit an error---you just get more
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
468 ;; headings that mean the same thing as you keep raising or lowering
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
469 ;; (for example, after a single @raisesections, both @chapter and
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
470 ;; @section produce chapter headings).
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
471
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
472 (defun texinfo-raise-lower-sections ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
473 "Raise or lower the hierarchical level of chapters, sections, etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
474
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
475 This function acts according to `@raisesections' and `@lowersections'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
476 commands in the Texinfo file.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
477
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
478 For example, an `@lowersections' command is useful if you wish to
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
479 include what is written as an outer or standalone Texinfo file in
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
480 another Texinfo file as an inner, included file. The `@lowersections'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
481 command changes chapters to sections, sections to subsections and so
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
482 on.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
483
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
484 @raisesections changes @subsection to @section,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
485 @section to @chapter,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
486 @heading to @chapheading,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
487 etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
488
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
489 @lowersections changes @chapter to @section,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
490 @subsection to @subsubsection,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
491 @heading to @subheading,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
492 etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
493
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
494 An `@raisesections' or `@lowersections' command changes only those
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
495 structuring commands that follow the `@raisesections' or
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
496 `@lowersections' command.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
497
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
498 An `@lowersections' command cancels an `@raisesections' command, and
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
499 vice versa.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
500
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
501 Repeated use of the commands continue to raise or lower the hierarchical
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
502 level a step at a time.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
503
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
504 An attempt to raise above `chapters' reproduces chapter commands; an
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
505 attempt to lower below subsubsections reproduces subsubsection
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
506 commands."
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
507
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
508 ;; `texinfo-section-types-regexp' is defined in `texnfo-upd.el';
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
509 ;; it is a regexp matching chapter, section, other headings
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
510 ;; (but not the top node).
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
511
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
512 (let (type (level 0))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
513 (while
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
514 (re-search-forward
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
515 (concat
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
516 "\\(\\(^@\\(raise\\|lower\\)sections\\)\\|\\("
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
517 texinfo-section-types-regexp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
518 "\\)\\)")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
519 nil t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
520 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
521 (save-excursion (setq type (read (current-buffer))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
522 (cond
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
523
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
524 ;; 1. Increment level
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
525 ((eq type '@raisesections)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
526 (setq level (1+ level))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
527 (delete-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
528 (point) (save-excursion (forward-line 1) (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
529
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
530 ;; 2. Decrement level
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
531 ((eq type '@lowersections)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
532 (setq level (1- level))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
533 (delete-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
534 (point) (save-excursion (forward-line 1) (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
535
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
536 ;; Now handle structuring commands
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
537 ((cond
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
538
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
539 ;; 3. Raise level when positive
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
540 ((> level 0)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
541 (let ((count level)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
542 (new-level type))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
543 (while (> count 0)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
544 (setq new-level
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
545 (cdr (assq new-level texinfo-raisesections-alist)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
546 (setq count (1- count)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
547 (kill-word 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
548 (insert (symbol-name new-level))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
549
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
550 ;; 4. Do nothing except move point when level is zero
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
551 ((= level 0) (forward-line 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
552
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
553 ;; 5. Lower level when positive
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
554 ((< level 0)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
555 (let ((count level)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
556 (new-level type))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
557 (while (< count 0)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
558 (setq new-level
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
559 (cdr (assq new-level texinfo-lowersections-alist)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
560 (setq count (1+ count)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
561 (kill-word 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
562 (insert (symbol-name new-level))))))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
563
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
564 (defvar texinfo-raisesections-alist
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
565 '((@chapter . @chapter) ; Cannot go higher
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
566 (@unnumbered . @unnumbered)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
567
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
568 (@majorheading . @majorheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
569 (@chapheading . @chapheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
570 (@appendix . @appendix)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
571
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
572 (@section . @chapter)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
573 (@unnumberedsec . @unnumbered)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
574 (@heading . @chapheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
575 (@appendixsec . @appendix)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
576
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
577 (@subsection . @section)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
578 (@unnumberedsubsec . @unnumberedsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
579 (@subheading . @heading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
580 (@appendixsubsec . @appendixsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
581
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
582 (@subsubsection . @subsection)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
583 (@unnumberedsubsubsec . @unnumberedsubsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
584 (@subsubheading . @subheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
585 (@appendixsubsubsec . @appendixsubsec))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
586 "*An alist of next higher levels for chapters, sections. etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
587 For example, section to chapter, subsection to section.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
588 Used by `texinfo-raise-lower-sections'.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
589 The keys specify types of section; the values correspond to the next
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
590 higher types.")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
591
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
592 (defvar texinfo-lowersections-alist
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
593 '((@chapter . @section)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
594 (@unnumbered . @unnumberedsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
595 (@majorheading . @heading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
596 (@chapheading . @heading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
597 (@appendix . @appendixsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
598
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
599 (@section . @subsection)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
600 (@unnumberedsec . @unnumberedsubsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
601 (@heading . @subheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
602 (@appendixsec . @appendixsubsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
603
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
604 (@subsection . @subsubsection)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
605 (@unnumberedsubsec . @unnumberedsubsubsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
606 (@subheading . @subsubheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
607 (@appendixsubsec . @appendixsubsubsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
608
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
609 (@subsubsection . @subsubsection) ; Cannot go lower.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
610 (@unnumberedsubsubsec . @unnumberedsubsubsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
611 (@subsubheading . @subsubheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
612 (@appendixsubsubsec . @appendixsubsubsec))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
613 "*An alist of next lower levels for chapters, sections. etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
614 For example, chapter to section, section to subsection.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
615 Used by `texinfo-raise-lower-sections'.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
616 The keys specify types of section; the values correspond to the next
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
617 lower types.")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
618
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
619
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
620 ;;; Perform those texinfo-to-info conversions that apply to the whole input
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
621 ;;; uniformly.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
622
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
623 (defun texinfo-format-scan ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
624 (texinfo-format-convert (point-min) (point-max))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
625 ;; Scan for @-commands.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
626 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
627 (while (search-forward "@" nil t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
628 (if (looking-at "[@{}'` *]")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
629 ;; Handle a few special @-followed-by-one-char commands.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
630 (if (= (following-char) ?*)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
631 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
632 ;; remove command
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
633 (delete-region (1- (point)) (1+ (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
634 ;; insert return if not at end of line;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
635 ;; else line is already broken.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
636 (if (not (= (following-char) ?\n))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
637 (insert ?\n)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
638 ;; The other characters are simply quoted. Delete the @.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
639 (delete-char -1)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
640 (forward-char 1))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
641 ;; @ is followed by a command-word; find the end of the word.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
642 (setq texinfo-command-start (1- (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
643 (if (= (char-syntax (following-char)) ?w)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
644 (forward-word 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
645 (forward-char 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
646 (setq texinfo-command-end (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
647 ;; Call the handler for this command.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
648 (setq texinfo-command-name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
649 (intern (buffer-substring
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
650 (1+ texinfo-command-start) texinfo-command-end)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
651 (let ((enclosure-type
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
652 (assoc
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
653 (symbol-name texinfo-command-name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
654 texinfo-enclosure-list)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
655 (if enclosure-type
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
656 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
657 (insert
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
658 (car (car (cdr enclosure-type)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
659 (texinfo-parse-arg-discard)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
660 (car (cdr (car (cdr enclosure-type)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
661 (goto-char texinfo-command-start))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
662 (let ((cmd (get texinfo-command-name 'texinfo-format)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
663 (if cmd (funcall cmd) (texinfo-unsupported)))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
664
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
665 (cond (texinfo-stack
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
666 (goto-char (nth 2 (car texinfo-stack)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
667 (error "Unterminated @%s" (car (car texinfo-stack))))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
668
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
669 (put 'begin 'texinfo-format 'texinfo-format-begin)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
670 (defun texinfo-format-begin ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
671 (texinfo-format-begin-end 'texinfo-format))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
672
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
673 (put 'end 'texinfo-format 'texinfo-format-end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
674 (defun texinfo-format-end ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
675 (texinfo-format-begin-end 'texinfo-end))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
676
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
677 (defun texinfo-format-begin-end (prop)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
678 (setq texinfo-command-name (intern (texinfo-parse-line-arg)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
679 (setq cmd (get texinfo-command-name prop))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
680 (if cmd (funcall cmd)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
681 (texinfo-unsupported)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
682
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
683 ;;; Parsing functions
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
684
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
685 (defun texinfo-parse-line-arg ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
686 (goto-char texinfo-command-end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
687 (let ((start (point)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
688 (cond ((looking-at " ")
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
689 (skip-chars-forward " ")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
690 (setq start (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
691 (end-of-line)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
692 (skip-chars-backward " ")
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
693 (delete-region (point) (progn (end-of-line) (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
694 (setq texinfo-command-end (1+ (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
695 ((looking-at "{")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
696 (setq start (1+ (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
697 (forward-list 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
698 (setq texinfo-command-end (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
699 (forward-char -1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
700 (t
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
701 (error "Invalid texinfo command arg format")))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
702 (prog1 (buffer-substring start (point))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
703 (if (eolp) (forward-char 1)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
704
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
705 (defun texinfo-parse-expanded-arg ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
706 (goto-char texinfo-command-end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
707 (let ((start (point))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
708 marker)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
709 (cond ((looking-at " ")
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
710 (skip-chars-forward " ")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
711 (setq start (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
712 (end-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
713 (setq texinfo-command-end (1+ (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
714 ((looking-at "{")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
715 (setq start (1+ (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
716 (forward-list 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
717 (setq texinfo-command-end (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
718 (forward-char -1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
719 (t
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
720 (error "Invalid texinfo command arg format")))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
721 (setq marker (move-marker (make-marker) texinfo-command-end))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
722 (texinfo-format-expand-region start (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
723 (setq texinfo-command-end (marker-position marker))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
724 (move-marker marker nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
725 (prog1 (buffer-substring start (point))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
726 (if (eolp) (forward-char 1)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
727
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
728 (defun texinfo-format-expand-region (start end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
729 (save-restriction
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
730 (narrow-to-region start end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
731 (let (texinfo-command-start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
732 texinfo-command-end
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
733 texinfo-command-name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
734 texinfo-stack)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
735 (texinfo-format-scan))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
736 (goto-char (point-max))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
737
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
738 (defun texinfo-parse-arg-discard ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
739 (prog1 (texinfo-parse-line-arg)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
740 (texinfo-discard-command)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
741
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
742 (defun texinfo-discard-command ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
743 (delete-region texinfo-command-start texinfo-command-end))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
744
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
745 (defun texinfo-optional-braces-discard ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
746 "Discard braces following command, if any."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
747 (goto-char texinfo-command-end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
748 (let ((start (point)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
749 (cond ((looking-at "[ \t]*\n")) ; do nothing
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
750 ((looking-at "{") ; remove braces, if any
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
751 (forward-list 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
752 (setq texinfo-command-end (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
753 (t
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
754 (error
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
755 "Invalid `texinfo-optional-braces-discard' format \(need braces?\)")))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
756 (delete-region texinfo-command-start texinfo-command-end)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
757
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
758 (defun texinfo-format-parse-line-args ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
759 (let ((start (1- (point)))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
760 next beg end
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
761 args)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
762 (skip-chars-forward " ")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
763 (while (not (eolp))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
764 (setq beg (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
765 (re-search-forward "[\n,]")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
766 (setq next (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
767 (if (bolp) (setq next (1- next)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
768 (forward-char -1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
769 (skip-chars-backward " ")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
770 (setq end (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
771 (setq args (cons (if (> end beg) (buffer-substring beg end))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
772 args))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
773 (goto-char next)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
774 (skip-chars-forward " "))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
775 (if (eolp) (forward-char 1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
776 (setq texinfo-command-end (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
777 (nreverse args)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
778
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
779 (defun texinfo-format-parse-args ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
780 (let ((start (1- (point)))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
781 next beg end
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
782 args)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
783 (search-forward "{")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
784 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
785 (texinfo-format-expand-region
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
786 (point)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
787 (save-excursion (up-list 1) (1- (point)))))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
788 ;; The following does not handle cross references of the form:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
789 ;; `@xref{bullet, , @code{@@bullet}@{@}}.' because the
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
790 ;; re-search-forward finds the first right brace after the second
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
791 ;; comma.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
792 (while (/= (preceding-char) ?\})
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
793 (skip-chars-forward " \t\n")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
794 (setq beg (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
795 (re-search-forward "[},]")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
796 (setq next (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
797 (forward-char -1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
798 (skip-chars-backward " \t\n")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
799 (setq end (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
800 (cond ((< beg end)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
801 (goto-char beg)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
802 (while (search-forward "\n" end t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
803 (replace-match " "))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
804 (setq args (cons (if (> end beg) (buffer-substring beg end))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
805 args))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
806 (goto-char next))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
807 (if (eolp) (forward-char 1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
808 (setq texinfo-command-end (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
809 (nreverse args)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
810
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
811 (defun texinfo-format-parse-defun-args ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
812 (goto-char texinfo-command-end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
813 (let ((start (point)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
814 (end-of-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
815 (setq texinfo-command-end (1+ (point)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
816 (let ((marker (move-marker (make-marker) texinfo-command-end)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
817 (texinfo-format-expand-region start (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
818 (setq texinfo-command-end (marker-position marker))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
819 (move-marker marker nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
820 (goto-char start)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
821 (let ((args '())
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
822 beg end)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
823 (skip-chars-forward " ")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
824 (while (not (eolp))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
825 (cond ((looking-at "{")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
826 (setq beg (1+ (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
827 (forward-list 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
828 (setq end (1- (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
829 (t
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
830 (setq beg (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
831 (re-search-forward "[\n ]")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
832 (forward-char -1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
833 (setq end (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
834 (setq args (cons (buffer-substring beg end) args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
835 (skip-chars-forward " "))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
836 (forward-char 1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
837 (nreverse args))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
838
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
839 (defun texinfo-discard-line ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
840 (goto-char texinfo-command-end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
841 (skip-chars-forward " \t")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
842 (or (eolp)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
843 (error "Extraneous text at end of command line."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
844 (goto-char texinfo-command-start)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
845 (or (bolp)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
846 (error "Extraneous text at beginning of command line."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
847 (delete-region (point) (progn (forward-line 1) (point))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
848
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
849 (defun texinfo-discard-line-with-args ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
850 (goto-char texinfo-command-start)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
851 (delete-region (point) (progn (forward-line 1) (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
852
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
853
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
854 ;;; @setfilename
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
855
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
856 ;; Only `texinfo-format-buffer' handles @setfilename with this
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
857 ;; definition; `texinfo-format-region' handles @setfilename, if any,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
858 ;; specially.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
859 (put 'setfilename 'texinfo-format 'texinfo-format-setfilename)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
860 (defun texinfo-format-setfilename ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
861 (let ((arg (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
862 (message "Formatting Info file: %s" arg)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
863 (setq texinfo-format-filename
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
864 (file-name-nondirectory (expand-file-name arg)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
865 (insert "Info file: "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
866 texinfo-format-filename ", -*-Text-*-\n"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
867 ;; Date string removed so that regression testing is easier.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
868 ;; "produced on "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
869 ;; (substring (current-time-string) 8 10) " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
870 ;; (substring (current-time-string) 4 7) " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
871 ;; (substring (current-time-string) -4) " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
872 "produced by `texinfo-format-buffer'\n"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
873 "from file"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
874 (if (buffer-file-name input-buffer)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
875 (concat " `"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
876 (file-name-sans-versions
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
877 (file-name-nondirectory
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
878 (buffer-file-name input-buffer)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
879 "'")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
880 (concat "buffer `" (buffer-name input-buffer) "'"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
881 "\nusing `texinfmt.el' version "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
882 texinfmt-version
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
883 ".\n\n")))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
884
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
885 ;;; @node, @menu
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
886
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
887 (put 'node 'texinfo-format 'texinfo-format-node)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
888 (put 'nwnode 'texinfo-format 'texinfo-format-node)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
889 (defun texinfo-format-node ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
890 (let* ((args (texinfo-format-parse-line-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
891 (name (nth 0 args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
892 (next (nth 1 args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
893 (prev (nth 2 args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
894 (up (nth 3 args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
895 (texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
896 (setq texinfo-last-node name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
897 (let ((tem (downcase name)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
898 (if (assoc tem texinfo-node-names)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
899 (error "Duplicate node name: %s" name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
900 (setq texinfo-node-names (cons (list tem) texinfo-node-names))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
901 (setq texinfo-footnote-number 0)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
902 (or (bolp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
903 (insert ?\n))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
904 (insert "\^_\nFile: " texinfo-format-filename
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
905 ", Node: " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
906 (if next
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
907 (insert ", Next: " next))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
908 (if prev
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
909 (insert ", Prev: " prev))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
910 (if up
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
911 (insert ", Up: " up))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
912 (insert ?\n)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
913 (setq texinfo-last-node-pos (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
914
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
915 (put 'menu 'texinfo-format 'texinfo-format-menu)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
916 (defun texinfo-format-menu ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
917 (texinfo-discard-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
918 (insert "* Menu:\n\n"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
919
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
920 (put 'menu 'texinfo-end 'texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
921
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
922
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
923 ;;; Cross references
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
924
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
925 ; @xref {NODE, FNAME, NAME, FILE, DOCUMENT}
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
926 ; -> *Note FNAME: (FILE)NODE
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
927 ; If FILE is missing,
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
928 ; *Note FNAME: NODE
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
929 ; If FNAME is empty and NAME is present
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
930 ; *Note NAME: Node
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
931 ; If both NAME and FNAME are missing
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
932 ; *Note NODE::
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
933 ; texinfo ignores the DOCUMENT argument.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
934 ; -> See section <xref to NODE> [NAME, else NODE], page <xref to NODE>
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
935 ; If FILE is specified, (FILE)NODE is used for xrefs.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
936 ; If fifth argument DOCUMENT is specified, produces
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
937 ; See section <xref to NODE> [NAME, else NODE], page <xref to NODE>
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
938 ; of DOCUMENT
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
939
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
940 ; @ref a reference that does not put `See' or `see' in
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
941 ; the hardcopy and is the same as @xref in Info
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
942 (put 'ref 'texinfo-format 'texinfo-format-xref)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
943
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
944 (put 'xref 'texinfo-format 'texinfo-format-xref)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
945 (defun texinfo-format-xref ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
946 (let ((args (texinfo-format-parse-args)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
947 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
948 (insert "*Note ")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
949 (let ((fname (or (nth 1 args) (nth 2 args))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
950 (if (null (or fname (nth 3 args)))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
951 (insert (car args) "::")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
952 (insert (or fname (car args)) ": ")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
953 (if (nth 3 args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
954 (insert "(" (nth 3 args) ")"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
955 (insert (car args))))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
956
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
957 (put 'pxref 'texinfo-format 'texinfo-format-pxref)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
958 (defun texinfo-format-pxref ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
959 (texinfo-format-xref)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
960 (or (save-excursion
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
961 (forward-char -2)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
962 (looking-at "::"))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
963 (insert ".")))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
964
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
965 ;@inforef{NODE, FNAME, FILE}
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
966 ;Like @xref{NODE, FNAME,,FILE} in texinfo.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
967 ;In Tex, generates "See Info file FILE, node NODE"
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
968 (put 'inforef 'texinfo-format 'texinfo-format-inforef)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
969 (defun texinfo-format-inforef ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
970 (let ((args (texinfo-format-parse-args)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
971 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
972 (if (nth 1 args)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
973 (insert "*Note " (nth 1 args) ": (" (nth 2 args) ")" (car args))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
974 (insert "*Note " "(" (nth 2 args) ")" (car args) "::"))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
975
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
976
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
977 ;;; Section headings
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
978
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
979 (put 'majorheading 'texinfo-format 'texinfo-format-chapter)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
980 (put 'chapheading 'texinfo-format 'texinfo-format-chapter)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
981 (put 'ichapter 'texinfo-format 'texinfo-format-chapter)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
982 (put 'chapter 'texinfo-format 'texinfo-format-chapter)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
983 (put 'iappendix 'texinfo-format 'texinfo-format-chapter)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
984 (put 'appendix 'texinfo-format 'texinfo-format-chapter)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
985 (put 'iunnumbered 'texinfo-format 'texinfo-format-chapter)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
986 (put 'top 'texinfo-format 'texinfo-format-chapter)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
987 (put 'unnumbered 'texinfo-format 'texinfo-format-chapter)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
988 (defun texinfo-format-chapter ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
989 (texinfo-format-chapter-1 ?*))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
990
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
991 (put 'heading 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
992 (put 'isection 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
993 (put 'section 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
994 (put 'iappendixsection 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
995 (put 'appendixsection 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
996 (put 'iappendixsec 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
997 (put 'appendixsec 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
998 (put 'iunnumberedsec 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
999 (put 'unnumberedsec 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1000 (defun texinfo-format-section ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1001 (texinfo-format-chapter-1 ?=))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1002
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1003 (put 'subheading 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1004 (put 'isubsection 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1005 (put 'subsection 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1006 (put 'iappendixsubsec 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1007 (put 'appendixsubsec 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1008 (put 'iunnumberedsubsec 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1009 (put 'unnumberedsubsec 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1010 (defun texinfo-format-subsection ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1011 (texinfo-format-chapter-1 ?-))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1012
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1013 (put 'subsubheading 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1014 (put 'isubsubsection 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1015 (put 'subsubsection 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1016 (put 'iappendixsubsubsec 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1017 (put 'appendixsubsubsec 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1018 (put 'iunnumberedsubsubsec 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1019 (put 'unnumberedsubsubsec 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1020 (defun texinfo-format-subsubsection ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1021 (texinfo-format-chapter-1 ?.))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1022
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1023 (defun texinfo-format-chapter-1 (belowchar)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1024 (let ((arg (texinfo-parse-arg-discard)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1025 (message "Formatting: %s ... " arg) ; So we can see where we are.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1026 (insert ?\n arg ?\n "@SectionPAD " belowchar ?\n)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1027 (forward-line -2)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1028
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1029 (put 'SectionPAD 'texinfo-format 'texinfo-format-sectionpad)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1030 (defun texinfo-format-sectionpad ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1031 (let ((str (texinfo-parse-arg-discard)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1032 (forward-char -1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1033 (let ((column (current-column)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1034 (forward-char 1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1035 (while (> column 0)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1036 (insert str)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1037 (setq column (1- column))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1038 (insert ?\n)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1039
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1040
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1041 ;;; Space controling commands: @. and @:
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1042 (put '\. 'texinfo-format 'texinfo-format-\.)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1043 (defun texinfo-format-\. ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1044 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1045 (insert "."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1046
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1047 (put '\: 'texinfo-format 'texinfo-format-\:)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1048 (defun texinfo-format-\: ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1049 (texinfo-discard-command))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1050
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1051
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1052 ;;; @center, @sp, and @br
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1053
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1054 (put 'center 'texinfo-format 'texinfo-format-center)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1055 (defun texinfo-format-center ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1056 (let ((arg (texinfo-parse-expanded-arg)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1057 (texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1058 (insert arg)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1059 (insert ?\n)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1060 (save-restriction
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1061 (goto-char (1- (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1062 (let ((indent-tabs-mode nil))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1063 (center-line)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1064
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1065 (put 'sp 'texinfo-format 'texinfo-format-sp)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1066 (defun texinfo-format-sp ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1067 (let* ((arg (texinfo-parse-arg-discard))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1068 (num (read arg)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1069 (insert-char ?\n num)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1070
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1071 (put 'br 'texinfo-format 'texinfo-format-paragraph-break)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1072 (defun texinfo-format-paragraph-break ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1073 "Force a paragraph break.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1074 If used within a line, follow `@br' with braces."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1075 (texinfo-optional-braces-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1076 ;; insert one return if at end of line;
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1077 ;; else insert two returns, to generate a blank line.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1078 (if (= (following-char) ?\n)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1079 (insert ?\n)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1080 (insert-char ?\n 2)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1081
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1082
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1083 ;;; @footnote and @footnotestyle
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1084
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1085 ; In Texinfo, footnotes are created with the `@footnote' command.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1086 ; This command is followed immediately by a left brace, then by the text of
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1087 ; the footnote, and then by a terminating right brace. The
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1088 ; template for a footnote is:
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1089 ;
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1090 ; @footnote{TEXT}
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1091 ;
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1092 ; Info has two footnote styles:
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1093 ;
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1094 ; * In the End of node style, all the footnotes for a single node
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1095 ; are placed at the end of that node. The footnotes are
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1096 ; separated from the rest of the node by a line of dashes with
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1097 ; the word `Footnotes' within it.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1098 ;
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1099 ; * In the Separate node style, all the footnotes for a single node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1100 ; are placed in an automatically constructed node of their own.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1101
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1102 ; Footnote style is specified by the @footnotestyle command, either
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1103 ; @footnotestyle separate
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1104 ; or
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1105 ; @footnotestyle end
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1106 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1107 ; The default is separate
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1108
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1109 (defvar texinfo-footnote-style "separate"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1110 "Footnote style, either separate or end.")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1111
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1112 (put 'footnotestyle 'texinfo-format 'texinfo-footnotestyle)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1113 (defun texinfo-footnotestyle ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1114 "Specify whether footnotes are at end of node or in separate nodes.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1115 Argument is either end or separate."
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1116 (setq texinfo-footnote-style (texinfo-parse-arg-discard)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1117
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1118 (defvar texinfo-footnote-number)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1119
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1120 (put 'footnote 'texinfo-format 'texinfo-format-footnote)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1121 (defun texinfo-format-footnote ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1122 "Format a footnote in either end of node or separate node style.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1123 The texinfo-footnote-style variable controls which style is used."
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1124 (setq texinfo-footnote-number (1+ texinfo-footnote-number))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1125 (cond ((string= texinfo-footnote-style "end")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1126 (texinfo-format-end-node))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1127 ((string= texinfo-footnote-style "separate")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1128 (texinfo-format-separate-node))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1129
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1130 (defun texinfo-format-separate-node ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1131 "Format footnote in Separate node style, with notes in own node.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1132 The node is constructed automatically."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1133 (let* (start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1134 (arg (texinfo-parse-line-arg))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1135 (node-name-beginning
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1136 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1137 (re-search-backward
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1138 "^File: \\w+\\(\\w\\|\\s_\\|\\.\\|,\\)*[ \t]+Node:")
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1139 (match-end 0)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1140 (node-name
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1141 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1142 (buffer-substring
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1143 (progn (goto-char node-name-beginning) ; skip over node command
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1144 (skip-chars-forward " \t") ; and over spaces
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1145 (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1146 (if (search-forward
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1147 ","
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1148 (save-excursion (end-of-line) (point)) t) ; bound search
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1149 (1- (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1150 (end-of-line) (point))))))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1151 (texinfo-discard-command) ; remove or insert whitespace, as needed
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1152 (delete-region (save-excursion (skip-chars-backward " \t\n") (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1153 (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1154 (insert (format " (%d) (*Note %s-Footnotes::)"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1155 texinfo-footnote-number node-name))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1156 (fill-paragraph nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1157 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1158 (if (re-search-forward "^@node" nil 'move)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1159 (forward-line -1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1160
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1161 ;; two cases: for the first footnote, we must insert a node header;
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1162 ;; for the second and subsequent footnotes, we need only insert
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1163 ;; the text of the footnote.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1164
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1165 (if (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1166 (re-search-backward
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1167 (concat node-name "-Footnotes, Up: ")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1168 node-name-beginning
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1169 t))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1170 (progn ; already at least one footnote
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1171 (setq start (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1172 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1173 (fill-region start (point)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1174 ;; else not yet a footnote
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1175 (insert "\n\^_\nFile: " texinfo-format-filename
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1176 " Node: " node-name "-Footnotes, Up: " node-name "\n")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1177 (setq start (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1178 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1179 (fill-region start (point))))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1180
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1181 (defun texinfo-format-end-node ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1182 "Format footnote in the End of node style, with notes at end of node."
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1183 (let (start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1184 (arg (texinfo-parse-line-arg)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1185 (texinfo-discard-command) ; remove or insert whitespace, as needed
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1186 (delete-region (save-excursion (skip-chars-backward " \t\n") (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1187 (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1188 (insert (format " (%d) " texinfo-footnote-number))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1189 (fill-paragraph nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1190 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1191 (if (search-forward "\n--------- Footnotes ---------\n" nil t)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1192 (progn ; already have footnote, put new one before end of node
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1193 (if (re-search-forward "^@node" nil 'move)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1194 (forward-line -1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1195 (setq start (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1196 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1197 (fill-region start (point)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1198 ;; else no prior footnote
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1199 (if (re-search-forward "^@node" nil 'move)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1200 (forward-line -1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1201 (insert "\n--------- Footnotes ---------\n")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1202 (setq start (point))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1203 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1204
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1205
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1206 ;;; @itemize, @enumerate, and similar commands
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1207
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1208 ;; @itemize pushes (itemize "COMMANDS" STARTPOS) on texinfo-stack.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1209 ;; @enumerate pushes (enumerate 0 STARTPOS).
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1210 ;; @item dispatches to the texinfo-item prop of the first elt of the list.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1211 ;; For itemize, this puts in and rescans the COMMANDS.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1212 ;; For enumerate, this increments the number and puts it in.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1213 ;; In either case, it puts a Backspace at the front of the line
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1214 ;; which marks it not to be indented later.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1215 ;; All other lines get indented by 5 when the @end is reached.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1216
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1217 (defvar texinfo-stack-depth 0
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1218 "Count of number of unpopped texinfo-push-stack calls.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1219 Used by @refill indenting command to avoid indenting within lists, etc.")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1220
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1221 (defun texinfo-push-stack (check arg)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1222 (setq texinfo-stack-depth (1+ texinfo-stack-depth))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1223 (setq texinfo-stack
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1224 (cons (list check arg texinfo-command-start)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1225 texinfo-stack)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1226
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1227 (defun texinfo-pop-stack (check)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1228 (setq texinfo-stack-depth (1- texinfo-stack-depth))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1229 (if (null texinfo-stack)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1230 (error "Unmatched @end %s" check))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1231 (if (not (eq (car (car texinfo-stack)) check))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1232 (error "@end %s matches @%s"
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1233 check (car (car texinfo-stack))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1234 (prog1 (cdr (car texinfo-stack))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1235 (setq texinfo-stack (cdr texinfo-stack))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1236
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1237 (put 'itemize 'texinfo-format 'texinfo-itemize)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1238 (defun texinfo-itemize ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1239 (texinfo-push-stack
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1240 'itemize
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1241 (progn (skip-chars-forward " \t")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1242 (if (eolp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1243 "@bullet"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1244 (texinfo-parse-line-arg))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1245 (texinfo-discard-line-with-args)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1246 (setq fill-column (- fill-column 5)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1247
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1248 (put 'itemize 'texinfo-end 'texinfo-end-itemize)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1249 (defun texinfo-end-itemize ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1250 (setq fill-column (+ fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1251 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1252 (let ((stacktop
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1253 (texinfo-pop-stack 'itemize)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1254 (texinfo-do-itemize (nth 1 stacktop))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1255
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1256 (put 'enumerate 'texinfo-format 'texinfo-enumerate)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1257 (defun texinfo-enumerate ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1258 (texinfo-push-stack
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1259 'enumerate
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1260 (progn (skip-chars-forward " \t")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1261 (if (eolp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1262 1
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1263 (read (current-buffer)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1264 (if (and (symbolp (car (cdr (car texinfo-stack))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1265 (> 1 (length (symbol-name (car (cdr (car texinfo-stack)))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1266 (error
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1267 "@enumerate: Use a number or letter, eg: 1, A, a, 3, B, or d." ))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1268 (texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1269 (setq fill-column (- fill-column 5)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1270
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1271 (put 'enumerate 'texinfo-end 'texinfo-end-enumerate)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1272 (defun texinfo-end-enumerate ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1273 (setq fill-column (+ fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1274 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1275 (let ((stacktop
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1276 (texinfo-pop-stack 'enumerate)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1277 (texinfo-do-itemize (nth 1 stacktop))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1278
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1279 ;; @alphaenumerate never became a standard part of Texinfo
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1280 (put 'alphaenumerate 'texinfo-format 'texinfo-alphaenumerate)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1281 (defun texinfo-alphaenumerate ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1282 (texinfo-push-stack 'alphaenumerate (1- ?a))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1283 (setq fill-column (- fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1284 (texinfo-discard-line))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1285
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1286 (put 'alphaenumerate 'texinfo-end 'texinfo-end-alphaenumerate)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1287 (defun texinfo-end-alphaenumerate ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1288 (setq fill-column (+ fill-column 5))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1289 (texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1290 (let ((stacktop
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1291 (texinfo-pop-stack 'alphaenumerate)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1292 (texinfo-do-itemize (nth 1 stacktop))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1293
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1294 ;; @capsenumerate never became a standard part of Texinfo
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1295 (put 'capsenumerate 'texinfo-format 'texinfo-capsenumerate)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1296 (defun texinfo-capsenumerate ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1297 (texinfo-push-stack 'capsenumerate (1- ?A))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1298 (setq fill-column (- fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1299 (texinfo-discard-line))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1300
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1301 (put 'capsenumerate 'texinfo-end 'texinfo-end-capsenumerate)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1302 (defun texinfo-end-capsenumerate ()
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1303 (setq fill-column (+ fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1304 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1305 (let ((stacktop
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1306 (texinfo-pop-stack 'capsenumerate)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1307 (texinfo-do-itemize (nth 1 stacktop))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1308
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1309 ;; At the @end, indent all the lines within the construct
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1310 ;; except those marked with backspace. FROM says where
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1311 ;; construct started.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1312 (defun texinfo-do-itemize (from)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1313 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1314 (while (progn (forward-line -1)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1315 (>= (point) from))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1316 (if (= (following-char) ?\b)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1317 (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1318 (delete-char 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1319 (end-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1320 (delete-char 6))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1321 (if (not (looking-at "[ \t]*$"))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1322 (save-excursion (insert " ")))))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1323
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1324 (put 'item 'texinfo-format 'texinfo-item)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1325 (put 'itemx 'texinfo-format 'texinfo-item)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1326 (defun texinfo-item ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1327 (funcall (get (car (car texinfo-stack)) 'texinfo-item)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1328
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1329 (put 'itemize 'texinfo-item 'texinfo-itemize-item)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1330 (defun texinfo-itemize-item ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1331 ;; (texinfo-discard-line) ; Did not handle text on same line as @item.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1332 (delete-region (1+ (point)) (save-excursion (beginning-of-line) (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1333 (if (looking-at "[ \t]*[^ \t\n]+")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1334 ;; Text on same line as @item command.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1335 (insert "\b " (nth 1 (car texinfo-stack)) " \n")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1336 ;; Else text on next line.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1337 (insert "\b " (nth 1 (car texinfo-stack)) " "))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1338 (forward-line -1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1339
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1340 (put 'enumerate 'texinfo-item 'texinfo-enumerate-item)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1341 (defun texinfo-enumerate-item ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1342 (texinfo-discard-line)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1343 (let (enumerating-symbol)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1344 (cond ((integerp (car (cdr (car texinfo-stack))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1345 (setq enumerating-symbol (car (cdr (car texinfo-stack))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1346 (insert ?\b (format "%3d. " enumerating-symbol) ?\n)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1347 (setcar (cdr (car texinfo-stack)) (1+ enumerating-symbol)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1348 ((symbolp (car (cdr (car texinfo-stack))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1349 (setq enumerating-symbol
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1350 (symbol-name (car (cdr (car texinfo-stack)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1351 (if (or (equal ?\[ (string-to-char enumerating-symbol))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1352 (equal ?\{ (string-to-char enumerating-symbol)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1353 (error
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1354 "Too many items in enumerated list; alphabet ends at Z."))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1355 (insert ?\b (format "%3s. " enumerating-symbol) ?\n)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1356 (setcar (cdr (car texinfo-stack))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1357 (make-symbol
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1358 (char-to-string
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1359 (1+
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1360 (string-to-char enumerating-symbol))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1361 (t
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1362 (error
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1363 "@enumerate: Use a number or letter, eg: 1, A, a, 3, B or d." )))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1364 (forward-line -1)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1365
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1366 (put 'alphaenumerate 'texinfo-item 'texinfo-alphaenumerate-item)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1367 (defun texinfo-alphaenumerate-item ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1368 (texinfo-discard-line)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1369 (let ((next (1+ (car (cdr (car texinfo-stack))))))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1370 (if (> next ?z)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1371 (error "More than 26 items in @alphaenumerate; get a bigger alphabet."))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1372 (setcar (cdr (car texinfo-stack)) next)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1373 (insert "\b " next ". \n"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1374 (forward-line -1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1375
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1376 (put 'capsenumerate 'texinfo-item 'texinfo-capsenumerate-item)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1377 (defun texinfo-capsenumerate-item ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1378 (texinfo-discard-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1379 (let ((next (1+ (car (cdr (car texinfo-stack))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1380 (if (> next ?Z)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1381 (error "More than 26 items in @capsenumerate; get a bigger alphabet."))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1382 (setcar (cdr (car texinfo-stack)) next)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1383 (insert "\b " next ". \n"))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1384 (forward-line -1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1385
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1386
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1387 ;;; @table
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1388
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1389 ; The `@table' command produces two-column tables.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1390
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1391 (put 'table 'texinfo-format 'texinfo-table)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1392 (defun texinfo-table ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1393 (texinfo-push-stack
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1394 'table
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1395 (progn (skip-chars-forward " \t")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1396 (if (eolp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1397 "@asis"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1398 (texinfo-parse-line-arg))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1399 (texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1400 (setq fill-column (- fill-column 5)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1401
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1402 (put 'table 'texinfo-item 'texinfo-table-item)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1403 (defun texinfo-table-item ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1404 (let ((arg (texinfo-parse-arg-discard))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1405 (itemfont (car (cdr (car texinfo-stack)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1406 (insert ?\b itemfont ?\{ arg "}\n \n"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1407 (forward-line -2))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1408
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1409 (put 'table 'texinfo-end 'texinfo-end-table)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1410 (defun texinfo-end-table ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1411 (setq fill-column (+ fill-column 5))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1412 (texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1413 (let ((stacktop
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1414 (texinfo-pop-stack 'table)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1415 (texinfo-do-itemize (nth 1 stacktop))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1416
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1417 ;; @description appears to be an undocumented variant on @table that
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1418 ;; does not require an arg. It fails in texinfo.tex 2.58 and is not
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1419 ;; part of makeinfo.c The command appears to be a relic of the past.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1420 (put 'description 'texinfo-end 'texinfo-end-table)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1421 (put 'description 'texinfo-format 'texinfo-description)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1422 (defun texinfo-description ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1423 (texinfo-push-stack 'table "@asis")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1424 (setq fill-column (- fill-column 5))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1425 (texinfo-discard-line))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1426
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1427
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1428 ;;; @ftable, @vtable
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1429
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1430 ; The `@ftable' and `@vtable' commands are like the `@table' command
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1431 ; but they also insert each entry in the first column of the table
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1432 ; into the function or variable index.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1433
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1434 ;; Handle the @ftable and @vtable commands:
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1435
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1436 (put 'ftable 'texinfo-format 'texinfo-ftable)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1437 (put 'vtable 'texinfo-format 'texinfo-vtable)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1438
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1439 (defun texinfo-ftable () (texinfo-indextable 'ftable))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1440 (defun texinfo-vtable () (texinfo-indextable 'vtable))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1441
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1442 (defun texinfo-indextable (table-type)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1443 (texinfo-push-stack table-type (texinfo-parse-arg-discard))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1444 (setq fill-column (- fill-column 5)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1445
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1446 ;; Handle the @item commands within ftable and vtable:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1447
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1448 (put 'ftable 'texinfo-item 'texinfo-ftable-item)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1449 (put 'vtable 'texinfo-item 'texinfo-vtable-item)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1450
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1451 (defun texinfo-ftable-item () (texinfo-indextable-item 'texinfo-findex))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1452 (defun texinfo-vtable-item () (texinfo-indextable-item 'texinfo-vindex))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1453
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1454 (defun texinfo-indextable-item (index-type)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1455 (let ((item (texinfo-parse-arg-discard))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1456 (itemfont (car (cdr (car texinfo-stack))))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1457 (indexvar index-type))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1458 (insert ?\b itemfont ?\{ item "}\n \n")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1459 (set indexvar
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1460 (cons
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1461 (list item texinfo-last-node)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1462 (symbol-value indexvar)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1463 (forward-line -2)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1464
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1465 ;; Handle @end ftable, @end vtable
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1466
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1467 (put 'ftable 'texinfo-end 'texinfo-end-ftable)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1468 (put 'vtable 'texinfo-end 'texinfo-end-vtable)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1469
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1470 (defun texinfo-end-ftable () (texinfo-end-indextable 'ftable))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1471 (defun texinfo-end-vtable () (texinfo-end-indextable 'vtable))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1472
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1473 (defun texinfo-end-indextable (table-type)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1474 (setq fill-column (+ fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1475 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1476 (let ((stacktop
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1477 (texinfo-pop-stack table-type)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1478 (texinfo-do-itemize (nth 1 stacktop))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1479
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1480
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1481 ;;; @ifinfo, @iftex, @tex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1482
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1483 (put 'ifinfo 'texinfo-format 'texinfo-discard-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1484 (put 'ifinfo 'texinfo-end 'texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1485
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1486 (put 'iftex 'texinfo-format 'texinfo-format-iftex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1487 (defun texinfo-format-iftex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1488 (delete-region texinfo-command-start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1489 (progn (re-search-forward "@end iftex[ \t]*\n")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1490 (point))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1491
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1492 (put 'tex 'texinfo-format 'texinfo-format-tex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1493 (defun texinfo-format-tex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1494 (delete-region texinfo-command-start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1495 (progn (re-search-forward "@end tex[ \t]*\n")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1496 (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1497
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1498
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1499 ;;; @titlepage
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1500
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1501 (put 'titlepage 'texinfo-format 'texinfo-format-titlepage)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1502 (defun texinfo-format-titlepage ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1503 (delete-region texinfo-command-start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1504 (progn (re-search-forward "@end titlepage[ \t]*\n")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1505 (point))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1506
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1507 (put 'endtitlepage 'texinfo-format 'texinfo-discard-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1508
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1509 ; @titlespec an alternative titling command; ignored by Info
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1510
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1511 (put 'titlespec 'texinfo-format 'texinfo-format-titlespec)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1512 (defun texinfo-format-titlespec ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1513 (delete-region texinfo-command-start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1514 (progn (re-search-forward "@end titlespec[ \t]*\n")
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1515 (point))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1516
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1517 (put 'endtitlespec 'texinfo-format 'texinfo-discard-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1518
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1519
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1520 ;;; @today
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1521
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1522 (put 'today 'texinfo-format 'texinfo-format-today)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1523
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1524 ; Produces Day Month Year style of output. eg `1 Jan 1900'
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1525 ; The `@today{}' command requires a pair of braces, like `@dots{}'.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1526 (defun texinfo-format-today ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1527 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1528 (insert (format "%s %s %s"
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1529 (substring (current-time-string) 8 10)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1530 (substring (current-time-string) 4 7)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1531 (substring (current-time-string) -4))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1532
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1533
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1534 ;;; @ignore
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1535
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1536 (put 'ignore 'texinfo-format 'texinfo-format-ignore)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1537 (defun texinfo-format-ignore ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1538 (delete-region texinfo-command-start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1539 (progn (re-search-forward "@end ignore[ \t]*\n")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1540 (point))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1541
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1542 (put 'endignore 'texinfo-format 'texinfo-discard-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1543
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1544
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1545 ;;; Define the Info enclosure command: @definfoenclose
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1546
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1547 ; A `@definfoenclose' command may be used to define a highlighting
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1548 ; command for Info, but not for TeX. A command defined using
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1549 ; `@definfoenclose' marks text by enclosing it in strings that precede
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1550 ; and follow the text.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1551 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1552 ; Presumably, if you define a command with `@definfoenclose` for Info,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1553 ; you will also define the same command in the TeX definitions file,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1554 ; `texinfo.tex' in a manner appropriate for typesetting.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1555 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1556 ; Write a `@definfoenclose' command on a line and follow it with three
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1557 ; arguments separated by commas (commas are used as separators in an
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1558 ; `@node' line in the same way). The first argument to
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1559 ; `@definfoenclose' is the @-command name \(without the `@'\); the
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1560 ; second argument is the Info start delimiter string; and the third
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1561 ; argument is the Info end delimiter string. The latter two arguments
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1562 ; enclose the highlighted text in the Info file. A delimiter string
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1563 ; may contain spaces. Neither the start nor end delimiter is
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1564 ; required. However, if you do not provide a start delimiter, you
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1565 ; must follow the command name with two commas in a row; otherwise,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1566 ; the Info formatting commands will misinterpret the end delimiter
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1567 ; string as a start delimiter string.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1568 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1569 ; An enclosure command defined this way takes one argument in braces.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1570 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1571 ; For example, you can write:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1572 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1573 ; @ifinfo
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1574 ; @definfoenclose phoo, //, \\
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1575 ; @end ifinfo
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1576 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1577 ; near the beginning of a Texinfo file at the beginning of the lines
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1578 ; to define `@phoo' as an Info formatting command that inserts `//'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1579 ; before and `\\' after the argument to `@phoo'. You can then write
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1580 ; `@phoo{bar}' wherever you want `//bar\\' highlighted in Info.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1581 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1582 ; Also, for TeX formatting, you could write
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1583 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1584 ; @iftex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1585 ; @global@let@phoo=@i
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1586 ; @end iftex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1587 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1588 ; to define `@phoo' as a command that causes TeX to typeset
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1589 ; the argument to `@phoo' in italics.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1590 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1591 ; Note that each definition applies to its own formatter: one for TeX,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1592 ; the other for texinfo-format-buffer or texinfo-format-region.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1593 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1594 ; Here is another example: write
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1595 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1596 ; @definfoenclose headword, , :
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1597 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1598 ; near the beginning of the file, to define `@headword' as an Info
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1599 ; formatting command that inserts nothing before and a colon after the
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1600 ; argument to `@headword'.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1601
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1602 (put 'definfoenclose 'texinfo-format 'texinfo-define-info-enclosure)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1603 (defun texinfo-define-info-enclosure ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1604 (let* ((args (texinfo-format-parse-line-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1605 (command-name (nth 0 args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1606 (beginning-delimiter (or (nth 1 args) ""))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1607 (end-delimiter (or (nth 2 args) "")))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1608 (texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1609 (setq texinfo-enclosure-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1610 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1611 (list command-name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1612 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1613 beginning-delimiter
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1614 end-delimiter))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1615 texinfo-enclosure-list))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1616
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1617
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1618 ;;; @var, @code and the like
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1619
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1620 (put 'var 'texinfo-format 'texinfo-format-var)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1621 ; @sc a small caps font for TeX; formatted as `var' in Info
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1622 (put 'sc 'texinfo-format 'texinfo-format-var)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1623 (defun texinfo-format-var ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1624 (insert (upcase (texinfo-parse-arg-discard)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1625 (goto-char texinfo-command-start))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1626
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1627 ; various noops
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1628
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1629 (put 'b 'texinfo-format 'texinfo-format-noop)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1630 (put 'i 'texinfo-format 'texinfo-format-noop)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1631 (put 'r 'texinfo-format 'texinfo-format-noop)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1632 (put 't 'texinfo-format 'texinfo-format-noop)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1633 (put 'w 'texinfo-format 'texinfo-format-noop)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1634 (put 'asis 'texinfo-format 'texinfo-format-noop)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1635 (put 'dmn 'texinfo-format 'texinfo-format-noop)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1636 (put 'key 'texinfo-format 'texinfo-format-noop)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1637 (put 'math 'texinfo-format 'texinfo-format-noop)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1638 (put 'titlefont 'texinfo-format 'texinfo-format-noop)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1639 (defun texinfo-format-noop ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1640 (insert (texinfo-parse-arg-discard))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1641 (goto-char texinfo-command-start))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1642
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1643 (put 'cite 'texinfo-format 'texinfo-format-code)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1644 (put 'code 'texinfo-format 'texinfo-format-code)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1645 (put 'file 'texinfo-format 'texinfo-format-code)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1646 (put 'kbd 'texinfo-format 'texinfo-format-code)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1647 (put 'samp 'texinfo-format 'texinfo-format-code)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1648 (defun texinfo-format-code ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1649 (insert "`" (texinfo-parse-arg-discard) "'")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1650 (goto-char texinfo-command-start))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1651
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1652 (put 'emph 'texinfo-format 'texinfo-format-emph)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1653 (put 'strong 'texinfo-format 'texinfo-format-emph)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1654 (defun texinfo-format-emph ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1655 (insert "*" (texinfo-parse-arg-discard) "*")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1656 (goto-char texinfo-command-start))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1657
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1658 (put 'dfn 'texinfo-format 'texinfo-format-defn)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1659 (put 'defn 'texinfo-format 'texinfo-format-defn)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1660 (defun texinfo-format-defn ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1661 (insert "\"" (texinfo-parse-arg-discard) "\"")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1662 (goto-char texinfo-command-start))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1663
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1664 (put 'bullet 'texinfo-format 'texinfo-format-bullet)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1665 (defun texinfo-format-bullet ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1666 "Insert an asterisk.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1667 If used within a line, follow `@bullet' with braces."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1668 (texinfo-optional-braces-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1669 (insert "*"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1670
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1671
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1672 ;;; @example, @lisp, @quotation, @display, @smalllisp, @smallexample
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1673
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1674 (put 'display 'texinfo-format 'texinfo-format-example)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1675 (put 'example 'texinfo-format 'texinfo-format-example)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1676 (put 'lisp 'texinfo-format 'texinfo-format-example)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1677 (put 'quotation 'texinfo-format 'texinfo-format-example)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1678 (put 'smallexample 'texinfo-format 'texinfo-format-example)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1679 (put 'smalllisp 'texinfo-format 'texinfo-format-example)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1680 (defun texinfo-format-example ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1681 (texinfo-push-stack 'example nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1682 (setq fill-column (- fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1683 (texinfo-discard-line))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1684
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1685 (put 'example 'texinfo-end 'texinfo-end-example)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1686 (put 'display 'texinfo-end 'texinfo-end-example)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1687 (put 'lisp 'texinfo-end 'texinfo-end-example)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1688 (put 'quotation 'texinfo-end 'texinfo-end-example)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1689 (put 'smallexample 'texinfo-end 'texinfo-end-example)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1690 (put 'smalllisp 'texinfo-end 'texinfo-end-example)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1691 (defun texinfo-end-example ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1692 (setq fill-column (+ fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1693 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1694 (let ((stacktop
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1695 (texinfo-pop-stack 'example)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1696 (texinfo-do-itemize (nth 1 stacktop))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1697
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1698 (put 'exdent 'texinfo-format 'texinfo-format-exdent)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1699 (defun texinfo-format-exdent ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1700 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1701 (delete-region (point)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1702 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1703 (skip-chars-forward " ")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1704 (point)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1705 (insert ?\b)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1706 ;; Cancel out the deletion that texinfo-do-itemize
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1707 ;; is going to do at the end of this line.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1708 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1709 (end-of-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1710 (insert "\n ")))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1711
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1712
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1713 ;;; @cartouche
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1714
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1715 ; The @cartouche command is a noop in Info; in a printed manual,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1716 ; it makes a box with rounded corners.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1717
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1718 (put 'cartouche 'texinfo-format 'texinfo-discard-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1719 (put 'cartouche 'texinfo-end 'texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1720
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1721
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1722 ;;; @flushleft and @format
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1723
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1724 ; The @flushleft command left justifies every line but leaves the
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1725 ; right end ragged. As far as Info is concerned, @flushleft is a
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1726 ; `do-nothing' command
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1727
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1728 ; The @format command is similar to @example except that it does not
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1729 ; indent; this means that in Info, @format is similar to @flushleft.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1730
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1731 (put 'format 'texinfo-format 'texinfo-format-flushleft)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1732 (put 'flushleft 'texinfo-format 'texinfo-format-flushleft)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1733 (defun texinfo-format-flushleft ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1734 (texinfo-discard-line))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1735
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1736 (put 'format 'texinfo-end 'texinfo-end-flushleft)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1737 (put 'flushleft 'texinfo-end 'texinfo-end-flushleft)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1738 (defun texinfo-end-flushleft ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1739 (texinfo-discard-command))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1740
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1741
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1742 ;;; @flushright
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1743
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1744 ; The @flushright command right justifies every line but leaves the
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1745 ; left end ragged. Spaces and tabs at the right ends of lines are
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1746 ; removed so that visible text lines up on the right side.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1747
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1748 (put 'flushright 'texinfo-format 'texinfo-format-flushright)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1749 (defun texinfo-format-flushright ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1750 (texinfo-push-stack 'flushright nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1751 (texinfo-discard-line))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1752
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1753 (put 'flushright 'texinfo-end 'texinfo-end-flushright)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1754 (defun texinfo-end-flushright ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1755 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1756
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1757 (let ((stacktop
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1758 (texinfo-pop-stack 'flushright)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1759
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1760 (texinfo-do-flushright (nth 1 stacktop))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1761
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1762 (defun texinfo-do-flushright (from)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1763 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1764 (while (progn (forward-line -1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1765 (>= (point) from))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1766
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1767 (beginning-of-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1768 (insert
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1769 (make-string
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1770 (- fill-column
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1771 (save-excursion
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1772 (end-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1773 (skip-chars-backward " \t")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1774 (delete-region (point) (progn (end-of-line) (point)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1775 (current-column)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1776 ? )))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1777
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1778
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1779 ;;; @ctrl, @TeX, @copyright, @minus, @dots
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1780
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1781 (put 'ctrl 'texinfo-format 'texinfo-format-ctrl)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1782 (defun texinfo-format-ctrl ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1783 (let ((str (texinfo-parse-arg-discard)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1784 (insert (logand 31 (aref str 0)))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1785
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1786 (put 'TeX 'texinfo-format 'texinfo-format-TeX)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1787 (defun texinfo-format-TeX ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1788 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1789 (insert "TeX"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1790
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1791 (put 'copyright 'texinfo-format 'texinfo-format-copyright)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1792 (defun texinfo-format-copyright ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1793 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1794 (insert "(C)"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1795
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1796 (put 'minus 'texinfo-format 'texinfo-format-minus)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1797 (defun texinfo-format-minus ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1798 "Insert a minus sign.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1799 If used within a line, follow `@minus' with braces."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1800 (texinfo-optional-braces-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1801 (insert "-"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1802
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1803 (put 'dots 'texinfo-format 'texinfo-format-dots)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1804 (defun texinfo-format-dots ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1805 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1806 (insert "..."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1807
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1808
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1809 ;;; Refilling and indenting: @refill, @paragraphindent, @noindent
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1810
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1811 ;;; Indent only those paragraphs that are refilled as a result of an
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1812 ;;; @refill command.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1813
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1814 ; * If the value is `asis', do not change the existing indentation at
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1815 ; the starts of paragraphs.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1816
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1817 ; * If the value zero, delete any existing indentation.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1818
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1819 ; * If the value is greater than zero, indent each paragraph by that
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1820 ; number of spaces.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1821
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1822 ;;; But do not refill paragraphs with an @refill command that are
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1823 ;;; preceded by @noindent or are part of a table, list, or deffn.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1824
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1825 (defvar texinfo-paragraph-indent "asis"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1826 "Number of spaces for @refill to indent a paragraph; else to leave as is.")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1827
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1828 (put 'paragraphindent 'texinfo-format 'texinfo-paragraphindent)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1829
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1830 (defun texinfo-paragraphindent ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1831 "Specify the number of spaces for @refill to indent a paragraph.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1832 Default is to leave the number of spaces as is."
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1833 (let ((arg (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1834 (if (string= "asis" arg)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1835 (setq texinfo-paragraph-indent "asis")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1836 (setq texinfo-paragraph-indent (string-to-int arg)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1837
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1838 (put 'refill 'texinfo-format 'texinfo-format-refill)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1839 (defun texinfo-format-refill ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1840 "Refill paragraph. Also, indent first line as set by @paragraphindent.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1841 Default is to leave paragraph indentation as is."
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1842 (texinfo-discard-command)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1843 (forward-paragraph -1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1844 (if (looking-at "[ \t\n]*$") (forward-line 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1845 ;; Do not indent if an entry in a list, table, or deffn,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1846 ;; or if paragraph is preceded by @noindent.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1847 ;; Otherwise, indent
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1848 (cond
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1849 ;; delete a @noindent line and do not indent paragraph
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1850 ((save-excursion (forward-line -1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1851 (looking-at "^@noindent"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1852 (forward-line -1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1853 (delete-region (point) (progn (forward-line 1) (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1854 ;; do nothing if "asis"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1855 ((equal texinfo-paragraph-indent "asis"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1856 ;; do no indenting in list, etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1857 ((> texinfo-stack-depth 0))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1858 ;; otherwise delete existing whitespace and indent
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1859 (t
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1860 (delete-region (point) (progn (skip-chars-forward " \t") (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1861 (insert (make-string texinfo-paragraph-indent ? ))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1862 (forward-paragraph 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1863 (forward-line -1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1864 (end-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1865 ;; Do not fill a section title line with asterisks, hyphens, etc. that
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1866 ;; are used to underline it. This could occur if the line following
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1867 ;; the underlining is not an index entry and has text within it.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1868 (let* ((previous-paragraph-separate paragraph-separate)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1869 (paragraph-separate (concat paragraph-separate "\\|^[=*---.]+"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1870 (previous-paragraph-start paragraph-start)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1871 (paragraph-start (concat paragraph-start "\\|^[=*---.]+")))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1872 (unwind-protect
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1873 (fill-paragraph nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1874 (setq paragraph-separate previous-paragraph-separate)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1875 (setq paragraph-start previous-paragraph-start))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1876
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1877 (put 'noindent 'texinfo-format 'texinfo-noindent)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1878 (defun texinfo-noindent ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1879 (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1880 (forward-paragraph 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1881 (if (search-backward "@refill"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1882 (save-excursion (forward-line -1) (point)) t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1883 () ; leave @noindent command so @refill command knows not to indent
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1884 ;; else
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1885 (texinfo-discard-line))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1886
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1887
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1888 ;;; Index generation
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1889
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1890 (put 'vindex 'texinfo-format 'texinfo-format-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1891 (defun texinfo-format-vindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1892 (texinfo-index 'texinfo-vindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1893
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1894 (put 'cindex 'texinfo-format 'texinfo-format-cindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1895 (defun texinfo-format-cindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1896 (texinfo-index 'texinfo-cindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1897
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1898 (put 'findex 'texinfo-format 'texinfo-format-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1899 (defun texinfo-format-findex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1900 (texinfo-index 'texinfo-findex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1901
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1902 (put 'pindex 'texinfo-format 'texinfo-format-pindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1903 (defun texinfo-format-pindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1904 (texinfo-index 'texinfo-pindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1905
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1906 (put 'tindex 'texinfo-format 'texinfo-format-tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1907 (defun texinfo-format-tindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1908 (texinfo-index 'texinfo-tindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1909
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1910 (put 'kindex 'texinfo-format 'texinfo-format-kindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1911 (defun texinfo-format-kindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1912 (texinfo-index 'texinfo-kindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1913
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1914 (defun texinfo-index (indexvar)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1915 (let ((arg (texinfo-parse-expanded-arg)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1916 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1917 (set indexvar
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1918 (cons (list arg
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1919 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1920 ;; Region formatting may not provide last node position.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1921 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1922 (1+ (count-lines texinfo-last-node-pos (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1923 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1924 (symbol-value indexvar)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1925
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1926 (defconst texinfo-indexvar-alist
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1927 '(("cp" . texinfo-cindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1928 ("fn" . texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1929 ("vr" . texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1930 ("tp" . texinfo-tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1931 ("pg" . texinfo-pindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1932 ("ky" . texinfo-kindex)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1933
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1934
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1935 ;;; @defindex @defcodeindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1936 (put 'defindex 'texinfo-format 'texinfo-format-defindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1937 (put 'defcodeindex 'texinfo-format 'texinfo-format-defindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1938
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1939 (defun texinfo-format-defindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1940 (let* ((index-name (texinfo-parse-arg-discard)) ; eg: `aa'
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1941 (indexing-command (intern (concat index-name "index")))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1942 (index-formatting-command ; eg: `texinfo-format-aaindex'
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1943 (intern (concat "texinfo-format-" index-name "index")))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1944 (index-alist-name ; eg: `texinfo-aaindex'
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1945 (intern (concat "texinfo-" index-name "index"))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1946
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1947 (set index-alist-name nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1948
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1949 (put indexing-command ; eg, aaindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1950 'texinfo-format
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1951 index-formatting-command) ; eg, texinfo-format-aaindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1952
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1953 ;; eg: "aa" . texinfo-aaindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1954 (or (assoc index-name texinfo-indexvar-alist)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1955 (setq texinfo-indexvar-alist
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1956 (cons
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1957 (cons index-name
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1958 index-alist-name)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1959 texinfo-indexvar-alist)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1960
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1961 (fset index-formatting-command
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1962 (list 'lambda 'nil
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1963 (list 'texinfo-index
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1964 (list 'quote index-alist-name))))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1965
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1966
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1967 ;;; @synindex @syncodeindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1968
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1969 (put 'synindex 'texinfo-format 'texinfo-format-synindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1970 (put 'syncodeindex 'texinfo-format 'texinfo-format-synindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1971
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1972 (defun texinfo-format-synindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1973 (let* ((args (texinfo-parse-arg-discard))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1974 (second (cdr (read-from-string args)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1975 (joiner (symbol-name (car (read-from-string args))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1976 (joined (symbol-name (car (read-from-string args second)))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1977
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1978 (if (assoc joiner texinfo-short-index-cmds-alist)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1979 (put
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1980 (cdr (assoc joiner texinfo-short-index-cmds-alist))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1981 'texinfo-format
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1982 (or (cdr (assoc joined texinfo-short-index-format-cmds-alist))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1983 (intern (concat "texinfo-format-" joined "index"))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1984 (put
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1985 (intern (concat joiner "index"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1986 'texinfo-format
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1987 (or (cdr(assoc joined texinfo-short-index-format-cmds-alist))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1988 (intern (concat "texinfo-format-" joined "index")))))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1989
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1990 (defconst texinfo-short-index-cmds-alist
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1991 '(("cp" . cindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1992 ("fn" . findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1993 ("vr" . vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1994 ("tp" . tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1995 ("pg" . pindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1996 ("ky" . kindex)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1997
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1998 (defconst texinfo-short-index-format-cmds-alist
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1999 '(("cp" . texinfo-format-cindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2000 ("fn" . texinfo-format-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2001 ("vr" . texinfo-format-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2002 ("tp" . texinfo-format-tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2003 ("pg" . texinfo-format-pindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2004 ("ky" . texinfo-format-kindex)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2005
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2006
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2007 ;;; Sort and index (for VMS)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2008
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2009 ;; Sort an index which is in the current buffer between START and END.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2010 ;; Used on VMS, where the `sort' utility is not available.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2011 (defun texinfo-sort-region (start end)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2012 (require 'sort)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2013 (save-restriction
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2014 (narrow-to-region start end)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2015 (sort-subr nil 'forward-line 'end-of-line 'texinfo-sort-startkeyfun)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2016
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2017 ;; Subroutine for sorting an index.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2018 ;; At start of a line, return a string to sort the line under.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2019 (defun texinfo-sort-startkeyfun ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2020 (let ((line
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2021 (buffer-substring (point) (save-excursion (end-of-line) (point)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2022 ;; Canonicalize whitespace and eliminate funny chars.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2023 (while (string-match "[ \t][ \t]+\\|[^a-z0-9 ]+" line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2024 (setq line (concat (substring line 0 (match-beginning 0))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2025 " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2026 (substring line (match-end 0) (length line)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2027 line))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2028
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2029
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2030 ;;; @printindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2031
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2032 (put 'printindex 'texinfo-format 'texinfo-format-printindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2033
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2034 (defun texinfo-format-printindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2035 (let ((indexelts (symbol-value
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2036 (cdr (assoc (texinfo-parse-arg-discard)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2037 texinfo-indexvar-alist))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2038 opoint)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2039 (insert "\n* Menu:\n\n")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2040 (setq opoint (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2041 (texinfo-print-index nil indexelts)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2042
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2043 (if (eq system-type 'vax-vms)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2044 (texinfo-sort-region opoint (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2045 (shell-command-on-region opoint (point) "sort -fd" 1))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2046
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2047 (defun texinfo-print-index (file indexelts)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2048 (while indexelts
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2049 (if (stringp (car (car indexelts)))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2050 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2051 (insert "* " (car (car indexelts)) ": " )
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2052 (indent-to 32)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2053 (insert
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2054 (if file (concat "(" file ")") "")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2055 (nth 1 (car indexelts)) ".")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2056 (indent-to 54)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2057 (insert
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2058 (if (nth 2 (car indexelts))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2059 (format " %d." (nth 2 (car indexelts)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2060 "")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2061 "\n"))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2062 ;; index entries from @include'd file
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2063 (texinfo-print-index (nth 1 (car indexelts))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2064 (nth 2 (car indexelts))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2065 (setq indexelts (cdr indexelts))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2066
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2067
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2068 ;;; Glyphs: @equiv, @error, etc
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2069
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2070 ;; @equiv to show that two expressions are equivalent
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2071 ;; @error to show an error message
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2072 ;; @expansion to show what a macro expands to
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2073 ;; @point to show the location of point in an example
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2074 ;; @print to show what an evaluated expression prints
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2075 ;; @result to indicate the value returned by an expression
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2076
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2077 (put 'equiv 'texinfo-format 'texinfo-format-equiv)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2078 (defun texinfo-format-equiv ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2079 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2080 (insert "=="))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2081
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2082 (put 'error 'texinfo-format 'texinfo-format-error)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2083 (defun texinfo-format-error ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2084 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2085 (insert "error-->"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2086
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2087 (put 'expansion 'texinfo-format 'texinfo-format-expansion)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2088 (defun texinfo-format-expansion ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2089 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2090 (insert "==>"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2091
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2092 (put 'point 'texinfo-format 'texinfo-format-point)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2093 (defun texinfo-format-point ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2094 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2095 (insert "-!-"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2096
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2097 (put 'print 'texinfo-format 'texinfo-format-print)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2098 (defun texinfo-format-print ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2099 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2100 (insert "-|"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2101
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2102 (put 'result 'texinfo-format 'texinfo-format-result)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2103 (defun texinfo-format-result ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2104 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2105 (insert "=>"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2106
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2107
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2108 ;;; Definition formatting: @deffn, @defun, etc
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2109
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2110 ;; What definition formatting produces:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2111 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2112 ;; @deffn category name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2113 ;; In Info, `Category: name ARGS'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2114 ;; In index: name: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2115 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2116 ;; @defvr category name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2117 ;; In Info, `Category: name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2118 ;; In index: name: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2119 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2120 ;; @deftp category name attributes...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2121 ;; `category name attributes...' Note: @deftp args in lower case.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2122 ;; In index: name: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2123 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2124 ;; Specialized function-like or variable-like entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2125 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2126 ;; @defun, @defmac, @defspec, @defvar, @defopt
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2127 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2128 ;; @defun name args In Info, `Function: name ARGS'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2129 ;; @defmac name args In Info, `Macro: name ARGS'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2130 ;; @defvar name In Info, `Variable: name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2131 ;; etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2132 ;; In index: name: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2133 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2134 ;; Generalized typed-function-like or typed-variable-like entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2135 ;; @deftypefn category data-type name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2136 ;; In Info, `Category: data-type name args...'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2137 ;; @deftypevr category data-type name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2138 ;; In Info, `Category: data-type name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2139 ;; In index: name: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2140 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2141 ;; Specialized typed-function-like or typed-variable-like entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2142 ;; @deftypefun data-type name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2143 ;; In Info, `Function: data-type name ARGS'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2144 ;; In index: name: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2145 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2146 ;; @deftypevar data-type name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2147 ;; In Info, `Variable: data-type name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2148 ;; In index: name: node. line#. but include args after name!?
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2149 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2150 ;; Generalized object oriented entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2151 ;; @defop category class name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2152 ;; In Info, `Category on class: name ARG'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2153 ;; In index: name on class: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2154 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2155 ;; @defcv category class name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2156 ;; In Info, `Category of class: name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2157 ;; In index: name of class: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2158 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2159 ;; Specialized object oriented entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2160 ;; @defmethod class name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2161 ;; In Info, `Method on class: name ARGS'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2162 ;; In index: name on class: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2163 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2164 ;; @defivar class name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2165 ;; In Info, `Instance variable of class: name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2166 ;; In index: name of class: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2167
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2168
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2169 ;;; The definition formatting functions
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2170
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2171 (defun texinfo-format-defun ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2172 (texinfo-push-stack 'defun nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2173 (setq fill-column (- fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2174 (texinfo-format-defun-1 t))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2175
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2176 (defun texinfo-end-defun ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2177 (setq fill-column (+ fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2178 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2179 (let ((start (nth 1 (texinfo-pop-stack 'defun))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2180 (texinfo-do-itemize start)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2181 ;; Delete extra newline inserted after header.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2182 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2183 (goto-char start)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2184 (delete-char -1))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2185
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2186 (defun texinfo-format-defunx ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2187 (texinfo-format-defun-1 nil))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2188
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2189 (defun texinfo-format-defun-1 (first-p)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2190 (let ((parse-args (texinfo-format-parse-defun-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2191 (command-type (get texinfo-command-name 'texinfo-defun-type)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2192 (texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2193 ;; Delete extra newline inserted after previous header line.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2194 (if (not first-p)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2195 (delete-char -1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2196 (funcall
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2197 (get texinfo-command-name 'texinfo-deffn-formatting-property) parse-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2198 ;; Insert extra newline so that paragraph filling does not mess
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2199 ;; with header line.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2200 (insert "\n\n")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2201 (rplaca (cdr (cdr (car texinfo-stack))) (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2202 (funcall
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2203 (get texinfo-command-name 'texinfo-defun-indexing-property) parse-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2204
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2205 ;;; Formatting the first line of a definition
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2206
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2207 ;; @deffn, @defvr, @deftp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2208 (put 'deffn 'texinfo-deffn-formatting-property 'texinfo-format-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2209 (put 'deffnx 'texinfo-deffn-formatting-property 'texinfo-format-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2210 (put 'defvr 'texinfo-deffn-formatting-property 'texinfo-format-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2211 (put 'defvrx 'texinfo-deffn-formatting-property 'texinfo-format-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2212 (put 'deftp 'texinfo-deffn-formatting-property 'texinfo-format-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2213 (put 'deftpx 'texinfo-deffn-formatting-property 'texinfo-format-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2214 (defun texinfo-format-deffn (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2215 ;; Generalized function-like, variable-like, or generic data-type entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2216 ;; @deffn category name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2217 ;; In Info, `Category: name ARGS'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2218 ;; @deftp category name attributes...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2219 ;; `category name attributes...' Note: @deftp args in lower case.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2220 (let ((category (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2221 (name (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2222 (args (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2223 (insert " -- " category ": " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2224 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2225 (insert " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2226 (if (or (= ?& (aref (car args) 0))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2227 (eq (eval (car command-type)) 'deftp-type))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2228 (car args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2229 (upcase (car args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2230 (setq args (cdr args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2231
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2232 ;; @defun, @defmac, @defspec, @defvar, @defopt: Specialized, simple
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2233 (put 'defun 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2234 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2235 (put 'defunx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2236 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2237 (put 'defmac 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2238 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2239 (put 'defmacx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2240 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2241 (put 'defspec 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2242 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2243 (put 'defspecx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2244 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2245 (put 'defvar 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2246 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2247 (put 'defvarx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2248 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2249 (put 'defopt 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2250 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2251 (put 'defoptx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2252 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2253 (defun texinfo-format-specialized-defun (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2254 ;; Specialized function-like or variable-like entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2255 ;; @defun name args In Info, `Function: Name ARGS'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2256 ;; @defmac name args In Info, `Macro: Name ARGS'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2257 ;; @defvar name In Info, `Variable: Name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2258 ;; Use cdr of command-type to determine category:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2259 (let ((category (car (cdr command-type)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2260 (name (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2261 (args (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2262 (insert " -- " category ": " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2263 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2264 (insert " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2265 (if (= ?& (aref (car args) 0))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2266 (car args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2267 (upcase (car args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2268 (setq args (cdr args)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2269
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2270 ;; @deftypefn, @deftypevr: Generalized typed
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2271 (put 'deftypefn 'texinfo-deffn-formatting-property 'texinfo-format-deftypefn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2272 (put 'deftypefnx 'texinfo-deffn-formatting-property 'texinfo-format-deftypefn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2273 (put 'deftypevr 'texinfo-deffn-formatting-property 'texinfo-format-deftypefn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2274 (put 'deftypevrx 'texinfo-deffn-formatting-property 'texinfo-format-deftypefn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2275 (defun texinfo-format-deftypefn (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2276 ;; Generalized typed-function-like or typed-variable-like entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2277 ;; @deftypefn category data-type name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2278 ;; In Info, `Category: data-type name args...'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2279 ;; @deftypevr category data-type name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2280 ;; In Info, `Category: data-type name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2281 ;; Note: args in lower case, unless modified in command line.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2282 (let ((category (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2283 (data-type (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2284 (name (car (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2285 (args (cdr (cdr (cdr parsed-args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2286 (insert " -- " category ": " data-type " " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2287 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2288 (insert " " (car args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2289 (setq args (cdr args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2290
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2291 ;; @deftypefun, @deftypevar: Specialized typed
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2292 (put 'deftypefun 'texinfo-deffn-formatting-property 'texinfo-format-deftypefun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2293 (put 'deftypefunx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2294 'texinfo-format-deftypefun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2295 (put 'deftypevar 'texinfo-deffn-formatting-property 'texinfo-format-deftypefun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2296 (put 'deftypevarx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2297 'texinfo-format-deftypefun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2298 (defun texinfo-format-deftypefun (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2299 ;; Specialized typed-function-like or typed-variable-like entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2300 ;; @deftypefun data-type name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2301 ;; In Info, `Function: data-type name ARGS'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2302 ;; @deftypevar data-type name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2303 ;; In Info, `Variable: data-type name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2304 ;; Note: args in lower case, unless modified in command line.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2305 ;; Use cdr of command-type to determine category:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2306 (let ((category (car (cdr command-type)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2307 (data-type (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2308 (name (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2309 (args (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2310 (insert " -- " category ": " data-type " " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2311 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2312 (insert " " (car args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2313 (setq args (cdr args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2314
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2315 ;; @defop: Generalized object-oriented
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2316 (put 'defop 'texinfo-deffn-formatting-property 'texinfo-format-defop)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2317 (put 'defopx 'texinfo-deffn-formatting-property 'texinfo-format-defop)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2318 (defun texinfo-format-defop (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2319 ;; Generalized object oriented entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2320 ;; @defop category class name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2321 ;; In Info, `Category on class: name ARG'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2322 ;; Note: args in upper case; use of `on'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2323 (let ((category (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2324 (class (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2325 (name (car (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2326 (args (cdr (cdr (cdr parsed-args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2327 (insert " -- " category " on " class ": " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2328 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2329 (insert " " (upcase (car args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2330 (setq args (cdr args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2331
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2332 ;; @defcv: Generalized object-oriented
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2333 (put 'defcv 'texinfo-deffn-formatting-property 'texinfo-format-defcv)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2334 (put 'defcvx 'texinfo-deffn-formatting-property 'texinfo-format-defcv)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2335 (defun texinfo-format-defcv (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2336 ;; Generalized object oriented entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2337 ;; @defcv category class name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2338 ;; In Info, `Category of class: name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2339 ;; Note: args in upper case; use of `of'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2340 (let ((category (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2341 (class (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2342 (name (car (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2343 (args (cdr (cdr (cdr parsed-args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2344 (insert " -- " category " of " class ": " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2345 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2346 (insert " " (upcase (car args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2347 (setq args (cdr args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2348
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2349 ;; @defmethod: Specialized object-oriented
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2350 (put 'defmethod 'texinfo-deffn-formatting-property 'texinfo-format-defmethod)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2351 (put 'defmethodx 'texinfo-deffn-formatting-property 'texinfo-format-defmethod)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2352 (defun texinfo-format-defmethod (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2353 ;; Specialized object oriented entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2354 ;; @defmethod class name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2355 ;; In Info, `Method on class: name ARGS'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2356 ;; Note: args in upper case; use of `on'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2357 ;; Use cdr of command-type to determine category:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2358 (let ((category (car (cdr command-type)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2359 (class (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2360 (name (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2361 (args (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2362 (insert " -- " category " on " class ": " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2363 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2364 (insert " " (upcase (car args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2365 (setq args (cdr args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2366
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2367 ;; @defivar: Specialized object-oriented
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2368 (put 'defivar 'texinfo-deffn-formatting-property 'texinfo-format-defivar)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2369 (put 'defivarx 'texinfo-deffn-formatting-property 'texinfo-format-defivar)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2370 (defun texinfo-format-defivar (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2371 ;; Specialized object oriented entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2372 ;; @defivar class name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2373 ;; In Info, `Instance variable of class: name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2374 ;; Note: args in upper case; use of `of'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2375 ;; Use cdr of command-type to determine category:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2376 (let ((category (car (cdr command-type)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2377 (class (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2378 (name (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2379 (args (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2380 (insert " -- " category " of " class ": " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2381 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2382 (insert " " (upcase (car args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2383 (setq args (cdr args)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2384
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2385
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2386 ;;; Indexing for definitions
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2387
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2388 ;; An index entry has three parts: the `entry proper', the node name, and the
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2389 ;; line number. Depending on the which command is used, the entry is
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2390 ;; formatted differently:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2391 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2392 ;; @defun,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2393 ;; @defmac,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2394 ;; @defspec,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2395 ;; @defvar,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2396 ;; @defopt all use their 1st argument as the entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2397 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2398 ;; @deffn,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2399 ;; @defvr,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2400 ;; @deftp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2401 ;; @deftypefun
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2402 ;; @deftypevar all use their 2nd argument as the entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2403 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2404 ;; @deftypefn,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2405 ;; @deftypevr both use their 3rd argument as the entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2406 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2407 ;; @defmethod uses its 2nd and 1st arguments as an entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2408 ;; formatted: NAME on CLASS
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2409
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2410 ;; @defop uses its 3rd and 2nd arguments as an entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2411 ;; formatted: NAME on CLASS
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2412 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2413 ;; @defivar uses its 2nd and 1st arguments as an entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2414 ;; formatted: NAME of CLASS
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2415 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2416 ;; @defcv uses its 3rd and 2nd argument as an entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2417 ;; formatted: NAME of CLASS
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2418
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2419 (put 'defun 'texinfo-defun-indexing-property 'texinfo-index-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2420 (put 'defunx 'texinfo-defun-indexing-property 'texinfo-index-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2421 (put 'defmac 'texinfo-defun-indexing-property 'texinfo-index-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2422 (put 'defmacx 'texinfo-defun-indexing-property 'texinfo-index-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2423 (put 'defspec 'texinfo-defun-indexing-property 'texinfo-index-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2424 (put 'defspecx 'texinfo-defun-indexing-property 'texinfo-index-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2425 (put 'defvar 'texinfo-defun-indexing-property 'texinfo-index-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2426 (put 'defvarx 'texinfo-defun-indexing-property 'texinfo-index-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2427 (put 'defopt 'texinfo-defun-indexing-property 'texinfo-index-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2428 (put 'defoptx 'texinfo-defun-indexing-property 'texinfo-index-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2429 (defun texinfo-index-defun (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2430 ;; use 1st parsed-arg as entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2431 ;; `index-list' will be texinfo-findex or the like
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2432 (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2433 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2434 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2435 ;; Three elements: entry-proper, node-name, line-number
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2436 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2437 (car parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2438 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2439 ;; Region formatting may not provide last node position.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2440 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2441 (1+ (count-lines texinfo-last-node-pos (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2442 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2443 (symbol-value index-list)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2444
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2445 (put 'deffn 'texinfo-defun-indexing-property 'texinfo-index-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2446 (put 'deffnx 'texinfo-defun-indexing-property 'texinfo-index-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2447 (put 'defvr 'texinfo-defun-indexing-property 'texinfo-index-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2448 (put 'defvrx 'texinfo-defun-indexing-property 'texinfo-index-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2449 (put 'deftp 'texinfo-defun-indexing-property 'texinfo-index-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2450 (put 'deftpx 'texinfo-defun-indexing-property 'texinfo-index-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2451 (put 'deftypefun 'texinfo-defun-indexing-property 'texinfo-index-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2452 (put 'deftypefunx 'texinfo-defun-indexing-property 'texinfo-index-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2453 (put 'deftypevar 'texinfo-defun-indexing-property 'texinfo-index-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2454 (put 'deftypevarx 'texinfo-defun-indexing-property 'texinfo-index-deffn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2455 (defun texinfo-index-deffn (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2456 ;; use 2nd parsed-arg as entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2457 ;; `index-list' will be texinfo-findex or the like
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2458 (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2459 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2460 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2461 ;; Three elements: entry-proper, node-name, line-number
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2462 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2463 (car (cdr parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2464 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2465 ;; Region formatting may not provide last node position.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2466 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2467 (1+ (count-lines texinfo-last-node-pos (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2468 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2469 (symbol-value index-list)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2470
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2471 (put 'deftypefn 'texinfo-defun-indexing-property 'texinfo-index-deftypefn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2472 (put 'deftypefnx 'texinfo-defun-indexing-property 'texinfo-index-deftypefn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2473 (put 'deftypevr 'texinfo-defun-indexing-property 'texinfo-index-deftypefn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2474 (put 'deftypevrx 'texinfo-defun-indexing-property 'texinfo-index-deftypefn)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2475 (defun texinfo-index-deftypefn (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2476 ;; use 3rd parsed-arg as entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2477 ;; `index-list' will be texinfo-findex or the like
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2478 (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2479 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2480 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2481 ;; Three elements: entry-proper, node-name, line-number
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2482 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2483 (car (cdr (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2484 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2485 ;; Region formatting may not provide last node position.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2486 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2487 (1+ (count-lines texinfo-last-node-pos (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2488 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2489 (symbol-value index-list)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2490
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2491 (put 'defmethod 'texinfo-defun-indexing-property 'texinfo-index-defmethod)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2492 (put 'defmethodx 'texinfo-defun-indexing-property 'texinfo-index-defmethod)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2493 (defun texinfo-index-defmethod (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2494 ;; use 2nd on 1st parsed-arg as entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2495 ;; `index-list' will be texinfo-findex or the like
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2496 (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2497 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2498 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2499 ;; Three elements: entry-proper, node-name, line-number
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2500 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2501 (format "%s on %s"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2502 (car (cdr parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2503 (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2504 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2505 ;; Region formatting may not provide last node position.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2506 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2507 (1+ (count-lines texinfo-last-node-pos (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2508 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2509 (symbol-value index-list)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2510
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2511 (put 'defop 'texinfo-defun-indexing-property 'texinfo-index-defop)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2512 (put 'defopx 'texinfo-defun-indexing-property 'texinfo-index-defop)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2513 (defun texinfo-index-defop (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2514 ;; use 3rd on 2nd parsed-arg as entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2515 ;; `index-list' will be texinfo-findex or the like
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2516 (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2517 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2518 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2519 ;; Three elements: entry-proper, node-name, line-number
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2520 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2521 (format "%s on %s"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2522 (car (cdr (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2523 (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2524 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2525 ;; Region formatting may not provide last node position.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2526 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2527 (1+ (count-lines texinfo-last-node-pos (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2528 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2529 (symbol-value index-list)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2530
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2531 (put 'defivar 'texinfo-defun-indexing-property 'texinfo-index-defivar)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2532 (put 'defivarx 'texinfo-defun-indexing-property 'texinfo-index-defivar)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2533 (defun texinfo-index-defivar (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2534 ;; use 2nd of 1st parsed-arg as entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2535 ;; `index-list' will be texinfo-findex or the like
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2536 (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2537 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2538 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2539 ;; Three elements: entry-proper, node-name, line-number
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2540 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2541 (format "%s of %s"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2542 (car (cdr parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2543 (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2544 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2545 ;; Region formatting may not provide last node position.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2546 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2547 (1+ (count-lines texinfo-last-node-pos (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2548 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2549 (symbol-value index-list)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2550
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2551 (put 'defcv 'texinfo-defun-indexing-property 'texinfo-index-defcv)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2552 (put 'defcvx 'texinfo-defun-indexing-property 'texinfo-index-defcv)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2553 (defun texinfo-index-defcv (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2554 ;; use 3rd of 2nd parsed-arg as entry-proper
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2555 ;; `index-list' will be texinfo-findex or the like
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2556 (let ((index-list (get texinfo-command-name 'texinfo-defun-index)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2557 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2558 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2559 ;; Three elements: entry-proper, node-name, line-number
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2560 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2561 (format "%s of %s"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2562 (car (cdr (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2563 (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2564 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2565 ;; Region formatting may not provide last node position.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2566 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2567 (1+ (count-lines texinfo-last-node-pos (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2568 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2569 (symbol-value index-list)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2570
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2571
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2572 ;;; Properties for definitions
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2573
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2574 ;; Each definition command has six properties:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2575 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2576 ;; 1. texinfo-deffn-formatting-property to format definition line
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2577 ;; 2. texinfo-defun-indexing-property to create index entry
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2578 ;; 3. texinfo-format formatting command
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2579 ;; 4. texinfo-end end formatting command
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2580 ;; 5. texinfo-defun-type type of deffn to format
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2581 ;; 6. texinfo-defun-index type of index to use
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2582 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2583 ;; The `x' forms of each definition command are used for the second
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2584 ;; and subsequent header lines.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2585
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2586 ;; The texinfo-deffn-formatting-property and texinfo-defun-indexing-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2587 ;; are listed just before the appropriate formatting and indexing commands.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2588
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2589 (put 'deffn 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2590 (put 'deffnx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2591 (put 'deffn 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2592 (put 'deffn 'texinfo-defun-type '('deffn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2593 (put 'deffnx 'texinfo-defun-type '('deffn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2594 (put 'deffn 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2595 (put 'deffnx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2596
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2597 (put 'defun 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2598 (put 'defunx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2599 (put 'defun 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2600 (put 'defun 'texinfo-defun-type '('defun-type "Function"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2601 (put 'defunx 'texinfo-defun-type '('defun-type "Function"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2602 (put 'defun 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2603 (put 'defunx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2604
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2605 (put 'defmac 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2606 (put 'defmacx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2607 (put 'defmac 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2608 (put 'defmac 'texinfo-defun-type '('defun-type "Macro"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2609 (put 'defmacx 'texinfo-defun-type '('defun-type "Macro"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2610 (put 'defmac 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2611 (put 'defmacx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2612
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2613 (put 'defspec 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2614 (put 'defspecx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2615 (put 'defspec 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2616 (put 'defspec 'texinfo-defun-type '('defun-type "Special form"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2617 (put 'defspecx 'texinfo-defun-type '('defun-type "Special form"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2618 (put 'defspec 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2619 (put 'defspecx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2620
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2621 (put 'defvr 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2622 (put 'defvrx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2623 (put 'defvr 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2624 (put 'defvr 'texinfo-defun-type '('deffn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2625 (put 'defvrx 'texinfo-defun-type '('deffn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2626 (put 'defvr 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2627 (put 'defvrx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2628
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2629 (put 'defvar 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2630 (put 'defvarx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2631 (put 'defvar 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2632 (put 'defvar 'texinfo-defun-type '('defun-type "Variable"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2633 (put 'defvarx 'texinfo-defun-type '('defun-type "Variable"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2634 (put 'defvar 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2635 (put 'defvarx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2636
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2637 (put 'defconst 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2638 (put 'defconstx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2639 (put 'defconst 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2640 (put 'defconst 'texinfo-defun-type '('defun-type "Constant"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2641 (put 'defconstx 'texinfo-defun-type '('defun-type "Constant"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2642 (put 'defconst 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2643 (put 'defconstx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2644
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2645 (put 'defcmd 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2646 (put 'defcmdx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2647 (put 'defcmd 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2648 (put 'defcmd 'texinfo-defun-type '('defun-type "Command"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2649 (put 'defcmdx 'texinfo-defun-type '('defun-type "Command"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2650 (put 'defcmd 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2651 (put 'defcmdx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2652
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2653 (put 'defopt 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2654 (put 'defoptx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2655 (put 'defopt 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2656 (put 'defopt 'texinfo-defun-type '('defun-type "User Option"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2657 (put 'defoptx 'texinfo-defun-type '('defun-type "User Option"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2658 (put 'defopt 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2659 (put 'defoptx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2660
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2661 (put 'deftp 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2662 (put 'deftpx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2663 (put 'deftp 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2664 (put 'deftp 'texinfo-defun-type '('deftp-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2665 (put 'deftpx 'texinfo-defun-type '('deftp-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2666 (put 'deftp 'texinfo-defun-index 'texinfo-tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2667 (put 'deftpx 'texinfo-defun-index 'texinfo-tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2668
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2669 ;;; Object-oriented stuff is a little hairier.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2670
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2671 (put 'defop 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2672 (put 'defopx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2673 (put 'defop 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2674 (put 'defop 'texinfo-defun-type '('defop-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2675 (put 'defopx 'texinfo-defun-type '('defop-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2676 (put 'defop 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2677 (put 'defopx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2678
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2679 (put 'defmethod 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2680 (put 'defmethodx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2681 (put 'defmethod 'texinfo-end 'texinfo-end-defun)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2682 (put 'defmethod 'texinfo-defun-type '('defmethod-type "Method"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2683 (put 'defmethodx 'texinfo-defun-type '('defmethod-type "Method"))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2684 (put 'defmethod 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2685 (put 'defmethodx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2686
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2687 (put 'defcv 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2688 (put 'defcvx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2689 (put 'defcv 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2690 (put 'defcv 'texinfo-defun-type '('defop-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2691 (put 'defcvx 'texinfo-defun-type '('defop-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2692 (put 'defcv 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2693 (put 'defcvx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2694
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2695 (put 'defivar 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2696 (put 'defivarx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2697 (put 'defivar 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2698 (put 'defivar 'texinfo-defun-type '('defmethod-type "Instance variable"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2699 (put 'defivarx 'texinfo-defun-type '('defmethod-type "Instance variable"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2700 (put 'defivar 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2701 (put 'defivarx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2702
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2703 ;;; Typed functions and variables
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2704
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2705 (put 'deftypefn 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2706 (put 'deftypefnx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2707 (put 'deftypefn 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2708 (put 'deftypefn 'texinfo-defun-type '('deftypefn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2709 (put 'deftypefnx 'texinfo-defun-type '('deftypefn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2710 (put 'deftypefn 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2711 (put 'deftypefnx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2712
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2713 (put 'deftypefun 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2714 (put 'deftypefunx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2715 (put 'deftypefun 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2716 (put 'deftypefun 'texinfo-defun-type '('deftypefun-type "Function"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2717 (put 'deftypefunx 'texinfo-defun-type '('deftypefun-type "Function"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2718 (put 'deftypefun 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2719 (put 'deftypefunx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2720
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2721 (put 'deftypevr 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2722 (put 'deftypevrx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2723 (put 'deftypevr 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2724 (put 'deftypevr 'texinfo-defun-type '('deftypefn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2725 (put 'deftypevrx 'texinfo-defun-type '('deftypefn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2726 (put 'deftypevr 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2727 (put 'deftypevrx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2728
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2729 (put 'deftypevar 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2730 (put 'deftypevarx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2731 (put 'deftypevar 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2732 (put 'deftypevar 'texinfo-defun-type '('deftypevar-type "Variable"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2733 (put 'deftypevarx 'texinfo-defun-type '('deftypevar-type "Variable"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2734 (put 'deftypevar 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2735 (put 'deftypevarx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2736
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2737
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2738 ;;; @set, @clear, @ifset, @ifclear
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2739
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2740 ;; If a flag is set with @set FLAG, then text between @ifset and @end
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2741 ;; ifset is formatted normally, but if the flag is is cleared with
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2742 ;; @clear FLAG, then the text is not formatted; it is ignored.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2743
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2744 ;; If a flag is cleared with @clear FLAG, then text between @ifclear
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2745 ;; and @end ifclear is formatted normally, but if the flag is is set with
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2746 ;; @set FLAG, then the text is not formatted; it is ignored. @ifclear
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2747 ;; is the opposite of @ifset.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2748
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2749 ;; If a flag is set to a string with @set FLAG,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2750 ;; replace @value{FLAG} with the string.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2751 ;; If a flag with a value is cleared,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2752 ;; @value{FLAG} is invalid,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2753 ;; as if there had never been any @set FLAG previously.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2754
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2755 (put 'clear 'texinfo-format 'texinfo-clear)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2756 (defun texinfo-clear ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2757 "Clear the value of the flag."
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2758 (let* ((arg (texinfo-parse-arg-discard))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2759 (flag (car (read-from-string arg)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2760 (value (substring arg (cdr (read-from-string arg)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2761 (put flag 'texinfo-whether-setp 'flag-cleared)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2762 (put flag 'texinfo-set-value "")))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2763
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2764 (put 'set 'texinfo-format 'texinfo-set)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2765 (defun texinfo-set ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2766 "Set the value of the flag, optionally to a string.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2767 The command `@set foo This is a string.'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2768 sets flag foo to the value: `This is a string.'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2769 The command `@value{foo}' expands to the value."
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2770 (let* ((arg (texinfo-parse-arg-discard))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2771 (flag (car (read-from-string arg)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2772 (value (substring arg (cdr (read-from-string arg)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2773 (put flag 'texinfo-whether-setp 'flag-set)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2774 (put flag 'texinfo-set-value value)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2775
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2776 (put 'value 'texinfo-format 'texinfo-value)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2777 (defun texinfo-value ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2778 "Insert the string to which the flag is set.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2779 The command `@set foo This is a string.'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2780 sets flag foo to the value: `This is a string.'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2781 The command `@value{foo}' expands to the value."
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2782 (let ((arg (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2783 (cond ((and
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2784 (eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2785 'flag-set)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2786 (get (car (read-from-string arg)) 'texinfo-set-value))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2787 (insert (get (car (read-from-string arg)) 'texinfo-set-value)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2788 ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2789 'flag-cleared)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2790 (insert (format "{No value for \"%s\"}" arg)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2791 ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp) nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2792 (insert (format "{No value for \"%s\"}" arg))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2793
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2794 (put 'ifset 'texinfo-end 'texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2795 (put 'ifset 'texinfo-format 'texinfo-if-set)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2796 (defun texinfo-if-set ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2797 "If set, continue formatting; else do not format region up to @end ifset"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2798 (let ((arg (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2799 (cond
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2800 ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2801 'flag-set)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2802 ;; Format the text (i.e., do not remove it); do nothing here.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2803 ())
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2804 ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2805 'flag-cleared)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2806 ;; Clear region (i.e., cause the text to be ignored).
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2807 (delete-region texinfo-command-start
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2808 (progn (re-search-forward "@end ifset[ \t]*\n")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2809 (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2810 ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2811 nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2812 (error "@ifset flag `%s' is not defined by @set or @clear." arg)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2813
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2814 (put 'ifclear 'texinfo-end 'texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2815 (put 'ifclear 'texinfo-format 'texinfo-if-clear)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2816 (defun texinfo-if-clear ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2817 "If clear, continue formatting; if set, do not format up to @end ifset"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2818 (let ((arg (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2819 (cond
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2820 ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2821 'flag-set)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2822 ;; Clear region (i.e., cause the text to be ignored).
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2823 (delete-region texinfo-command-start
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2824 (progn (re-search-forward "@end ifclear[ \t]*\n")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2825 (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2826 ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2827 'flag-cleared)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2828 ;; Format the text (i.e., do not remove it); do nothing here.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2829 ())
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2830 ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2831 nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2832 (error "@ifclear flag `%s' is not defined by @clear or @set." arg)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2833
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2834
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2835 ;;; Process included files: `@include' command
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2836
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2837 ;; Updated 19 October 1990
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2838 ;; In the original version, include files were ignored by Info but
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2839 ;; incorporated in to the printed manual. To make references to the
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2840 ;; included file, the Texinfo source file has to refer to the included
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2841 ;; files using the `(filename)nodename' format for refering to other
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2842 ;; Info files. Also, the included files had to be formatted on their
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2843 ;; own. It was just like they were another file.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2844
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2845 ;; Currently, include files are inserted into the buffer that is
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2846 ;; formatted for Info. If large, the resulting info file is split and
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2847 ;; tagified. For current include files to work, the master menu must
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2848 ;; refer to all the nodes, and the highest level nodes in the include
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2849 ;; files must have the correct next, prev, and up pointers.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2850
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2851 ;; The included file may have an @setfilename and even an @settitle,
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2852 ;; but not an `\input texinfo' line.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2853
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2854 ;; Updated 24 March 1993
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2855 ;; In order for @raisesections and @lowersections to work, included
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2856 ;; files must be inserted into the buffer holding the outer file
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2857 ;; before other Info formatting takes place. So @include is no longer
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2858 ;; is treated like other @-commands.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2859 (put 'include 'texinfo-format 'texinfo-format-noop)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2860
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2861 ; Original definition:
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2862 ; (defun texinfo-format-include ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2863 ; (let ((filename (texinfo-parse-arg-discard))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2864 ; (default-directory input-directory)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2865 ; subindex)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2866 ; (setq subindex
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2867 ; (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2868 ; (progn (find-file
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2869 ; (cond ((file-readable-p (concat filename ".texinfo"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2870 ; (concat filename ".texinfo"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2871 ; ((file-readable-p (concat filename ".texi"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2872 ; (concat filename ".texi"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2873 ; ((file-readable-p (concat filename ".tex"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2874 ; (concat filename ".tex"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2875 ; ((file-readable-p filename)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2876 ; filename)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2877 ; (t (error "@include'd file %s not found"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2878 ; filename))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2879 ; (texinfo-format-buffer-1))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2880 ; (texinfo-subindex 'texinfo-vindex (car subindex) (nth 1 subindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2881 ; (texinfo-subindex 'texinfo-findex (car subindex) (nth 2 subindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2882 ; (texinfo-subindex 'texinfo-cindex (car subindex) (nth 3 subindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2883 ; (texinfo-subindex 'texinfo-pindex (car subindex) (nth 4 subindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2884 ; (texinfo-subindex 'texinfo-tindex (car subindex) (nth 5 subindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2885 ; (texinfo-subindex 'texinfo-kindex (car subindex) (nth 6 subindex))))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2886 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2887 ;(defun texinfo-subindex (indexvar file content)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2888 ; (set indexvar (cons (list 'recurse file content)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2889 ; (symbol-value indexvar))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2890
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2891 ; Second definition:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2892 ; (put 'include 'texinfo-format 'texinfo-format-include)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2893 ; (defun texinfo-format-include ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2894 ; (let ((filename (concat input-directory
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2895 ; (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2896 ; (default-directory input-directory))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2897 ; (message "Reading: %s" filename)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2898 ; (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2899 ; (save-restriction
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2900 ; (narrow-to-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2901 ; (point)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2902 ; (+ (point) (car (cdr (insert-file-contents filename)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2903 ; (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2904 ; (texinfo-append-refill)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2905 ; (texinfo-format-convert (point-min) (point-max))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2906 ; (setq last-input-buffer input-buffer) ; to bypass setfilename
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2907 ; ))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2908
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2909
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2910 ;;; Numerous commands do nothing in Texinfo
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2911
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2912 ;; These commands are defined in texinfo.tex for printed output.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2913
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2914 (put 'bye 'texinfo-format 'texinfo-discard-line)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2915 (put 'c 'texinfo-format 'texinfo-discard-line-with-args)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2916 (put 'comment 'texinfo-format 'texinfo-discard-line-with-args)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2917 (put 'contents 'texinfo-format 'texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2918 (put 'finalout 'texinfo-format 'texinfo-discard-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2919 (put 'group 'texinfo-end 'texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2920 (put 'group 'texinfo-format 'texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2921 (put 'headings 'texinfo-format 'texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2922 (put 'hsize 'texinfo-format 'texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2923 (put 'itemindent 'texinfo-format 'texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2924 (put 'lispnarrowing 'texinfo-format 'texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2925 (put 'need 'texinfo-format 'texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2926 (put 'nopara 'texinfo-format 'texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2927 (put 'page 'texinfo-format 'texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2928 (put 'parindent 'texinfo-format 'texinfo-discard-line-with-args)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2929 (put 'setchapternewpage 'texinfo-format 'texinfo-discard-line-with-args)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2930 (put 'setq 'texinfo-format 'texinfo-discard-line-with-args)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2931 (put 'settitle 'texinfo-format 'texinfo-discard-line-with-args)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2932 (put 'setx 'texinfo-format 'texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2933 (put 'shortcontents 'texinfo-format 'texinfo-discard-line-with-args)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2934 (put 'smallbook 'texinfo-format 'texinfo-discard-line)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2935 (put 'summarycontents 'texinfo-format 'texinfo-discard-line-with-args)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2936
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2937
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2938 ;;; Some commands cannot be handled
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2939
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2940 (defun texinfo-unsupported ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2941 (error "%s is not handled by texinfo"
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2942 (buffer-substring texinfo-command-start texinfo-command-end)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2943
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2944 ;;; Batch formatting
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2945
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2946 (defun batch-texinfo-format ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2947 "Runs texinfo-format-buffer on the files remaining on the command line.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2948 Must be used only with -batch, and kills emacs on completion.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2949 Each file will be processed even if an error occurred previously.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2950 For example, invoke
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2951 \"emacs -batch -funcall batch-texinfo-format $docs/ ~/*.texinfo\"."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2952 (if (not noninteractive)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2953 (error "batch-texinfo-format may only be used -batch."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2954 (let ((version-control t)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2955 (auto-save-default nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2956 (find-file-run-dired nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2957 (kept-old-versions 259259)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2958 (kept-new-versions 259259))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2959 (let ((error 0)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2960 file
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2961 (files ()))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2962 (while command-line-args-left
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2963 (setq file (expand-file-name (car command-line-args-left)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2964 (cond ((not (file-exists-p file))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2965 (message ">> %s does not exist!" file)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2966 (setq error 1
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2967 command-line-args-left (cdr command-line-args-left)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2968 ((file-directory-p file)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2969 (setq command-line-args-left
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2970 (nconc (directory-files file)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2971 (cdr command-line-args-left))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2972 (t
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2973 (setq files (cons file files)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2974 command-line-args-left (cdr command-line-args-left)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2975 (while files
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2976 (setq file (car files)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2977 files (cdr files))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2978 (condition-case err
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2979 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2980 (if buffer-file-name (kill-buffer (current-buffer)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2981 (find-file file)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2982 (buffer-flush-undo (current-buffer))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2983 (set-buffer-modified-p nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2984 (texinfo-mode)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2985 (message "texinfo formatting %s..." file)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2986 (texinfo-format-buffer nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2987 (if (buffer-modified-p)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2988 (progn (message "Saving modified %s" (buffer-file-name))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2989 (save-buffer))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2990 (error
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2991 (message ">> Error: %s" (prin1-to-string err))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2992 (message ">> point at")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2993 (let ((s (buffer-substring (point)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2994 (min (+ (point) 100)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2995 (point-max))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2996 (tem 0))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2997 (while (setq tem (string-match "\n+" s tem))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2998 (setq s (concat (substring s 0 (match-beginning 0))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2999 "\n>> "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3000 (substring s (match-end 0)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3001 tem (1+ tem)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3002 (message ">> %s" s))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3003 (setq error 1))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3004 (kill-emacs error))))
657
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 258
diff changeset
3005
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3006
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3007 ;;; Place `provide' at end of file.
3456
57089987a2de Provide texinfmt.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
3008 (provide 'texinfmt)
57089987a2de Provide texinfmt.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
3009
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3010 ;;; texinfmt.el ends here.