annotate lisp/textmodes/texinfmt.el @ 10697:d2fd1a6288b4

Personal dictionary save forced when called from menu, Epoch compile support. (ispell-skip-sgml): Added variable for skipping SGML tags & references. (ispell-buffer-local-parsing): Hard wire set of ispell-skip-sgml-tags to sgml-mode. (ispell-pdict-save): Message improvement. (ispell-command-loop): Properly adjust screen with different settings of ispell-choices-win-default-height. (check-ispell-version): Use fundamental-mode as default-major-mode. (ispell-change-dictionary): Remove unnecessary process kills (ispell-region): Fold sgml support in with tib checking. (ispell-message): Skips checking of forwarded messages.
author Richard M. Stallman <rms@gnu.org>
date Wed, 08 Feb 1995 06:09:08 +0000
parents a70b99926339
children d6c5619b7fbc
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
5118
eec34ce70181 (texinfo-if-set, texinfo-if-clear): Act appropriately when flat neither
Robert J. Chassell <bob@rattlesnake.com>
parents: 4982
diff changeset
27 (defvar texinfmt-version "2.32 of 19 November 1993")
4396
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)
9759
ebe611f49450 (texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 9754
diff changeset
45 (defvar texinfo-alias-list)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
46
4868
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
47 (defvar texinfo-command-start)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
48 (defvar texinfo-command-end)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
49 (defvar texinfo-command-name)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
50 (defvar texinfo-defun-type)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
51 (defvar texinfo-last-node-pos)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
52 (defvar texinfo-stack)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
53 (defvar texinfo-short-index-cmds-alist)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
54 (defvar texinfo-short-index-format-cmds-alist)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
55 (defvar texinfo-format-filename)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
56 (defvar texinfo-footnote-number)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
57 (defvar texinfo-start-of-header)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
58 (defvar texinfo-end-of-header)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
59 (defvar texinfo-raisesections-alist)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
60 (defvar texinfo-lowersections-alist)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
61
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
62 ;;; Syntax table
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
63
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
64 (if texinfo-format-syntax-table
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
65 nil
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
66 (setq texinfo-format-syntax-table (make-syntax-table))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
67 (modify-syntax-entry ?\" " " texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
68 (modify-syntax-entry ?\\ " " texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
69 (modify-syntax-entry ?@ "\\" texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
70 (modify-syntax-entry ?\^q "\\" texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
71 (modify-syntax-entry ?\[ "." texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
72 (modify-syntax-entry ?\] "." texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
73 (modify-syntax-entry ?\( "." texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
74 (modify-syntax-entry ?\) "." texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
75 (modify-syntax-entry ?{ "(}" texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
76 (modify-syntax-entry ?} "){" texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
77 (modify-syntax-entry ?\' "." texinfo-format-syntax-table))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
78
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
79
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
80 ;;; 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
81
4769
d1b5ca8f5493 (texinfo-format-region texinfo-format-buffer): Add ###autoload cookies.
Brian Fox <bfox@gnu.org>
parents: 4396
diff changeset
82 ;;;###autoload
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
83 (defun texinfo-format-buffer (&optional notagify)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
84 "Process the current buffer as texinfo code, into an Info file.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
85 The Info file output is generated in a buffer visiting the Info file
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
86 names specified in the @setfilename command.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
87
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
88 Non-nil argument (prefix, if interactive) means don't make tag table
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
89 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
90 Info-split to do these manually."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
91 (interactive "P")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
92 (let ((lastmessage "Formatting Info file..."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
93 (message lastmessage)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
94 (texinfo-format-buffer-1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
95 (if notagify
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
96 nil
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
97 (if (> (buffer-size) 30000)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
98 (progn
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
99 (message (setq lastmessage "Making tags table for Info file..."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
100 (Info-tagify)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
101 (if (> (buffer-size) 100000)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
102 (progn
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
103 (message (setq lastmessage "Splitting Info file..."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
104 (Info-split))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
105 (message (concat lastmessage
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
106 (if (interactive-p) "done. Now save it." "done.")))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
107
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
108 (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
109 "*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
110
4769
d1b5ca8f5493 (texinfo-format-region texinfo-format-buffer): Add ###autoload cookies.
Brian Fox <bfox@gnu.org>
parents: 4396
diff changeset
111 ;;;###autoload
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
112 (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
113 "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
114 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
115 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
116 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
117 (interactive "r")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
118 (message "Converting region to Info format...")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
119 (let (texinfo-command-start
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
120 texinfo-command-end
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
121 texinfo-command-name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
122 texinfo-vindex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
123 texinfo-findex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
124 texinfo-cindex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
125 texinfo-pindex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
126 texinfo-tindex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
127 texinfo-kindex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
128 texinfo-stack
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
129 (texinfo-format-filename "")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
130 texinfo-example-start
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
131 texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
132 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
133 texinfo-node-names
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
134 (texinfo-footnote-number 0)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
135 last-input-buffer
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
136 (fill-column-for-info fill-column)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
137 (input-buffer (current-buffer))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
138 (input-directory default-directory)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
139 (header-text "")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
140 (header-beginning 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
141 (header-end 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
142
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
143 ;;; 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
144 ;;; 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
145 (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
146 (save-restriction
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
147 (widen)
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 (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
150 (if (or
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
151 ;; Either copy header text.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
152 (and
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
153 (prog1
4982
36b78ccd6285 (texinfo-format-region): Change `texinfo-[start
Richard M. Stallman <rms@gnu.org>
parents: 4868
diff changeset
154 (search-forward tex-start-of-header search-end t)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
155 (forward-line 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
156 ;; Mark beginning of header.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
157 (setq header-beginning (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
158 (prog1
4982
36b78ccd6285 (texinfo-format-region): Change `texinfo-[start
Richard M. Stallman <rms@gnu.org>
parents: 4868
diff changeset
159 (search-forward tex-end-of-header nil t)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
160 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
161 ;; Mark end of header
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
162 (setq header-end (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
163 ;; Or copy @filename line.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
164 (prog2
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
165 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
166 (search-forward "@setfilename" search-end t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
167 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
168 (setq header-beginning (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
169 (forward-line 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
170 (setq header-end (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
171
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
172 ;; Copy header
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
173 (setq header-text
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
174 (buffer-substring
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
175 (min header-beginning region-beginning)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
176 header-end))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
177
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
178 ;;; Find a buffer to use.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
179 (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
180 (erase-buffer)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
181 ;; Insert the header into the buffer.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
182 (insert header-text)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
183 ;; Insert the region into the buffer.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
184 (insert-buffer-substring
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
185 input-buffer
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
186 (max region-beginning header-end)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
187 region-end)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
188 ;; 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
189 (or (= (preceding-char) ?\n)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
190 (insert "\n"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
191
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
192 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
193 (texinfo-mode)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
194 (message "Converting region to Info format...")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
195 (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
196 ;; 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
197 (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
198
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
199 ;; 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
200 ;; 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
201 ;; @raise/@lowersections commands.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
202 (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
203 (setq texinfo-command-end (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
204 (let ((filename (concat input-directory
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
205 (texinfo-parse-line-arg))))
9178
0facf5c89fff (texinfo-format-region, texinfo-format-buffer-1):
Richard M. Stallman <rms@gnu.org>
parents: 6309
diff changeset
206 (re-search-backward "^@include")
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
207 (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
208 (message "Reading included file: %s" filename)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
209 (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
210 (save-restriction
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
211 (narrow-to-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
212 (point)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
213 (+ (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
214 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
215 ;; 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
216 ;; so @setfilename command not duplicated.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
217 (if (re-search-forward
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
218 "^@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
219 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
220 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
221 (delete-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
222 (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
223
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
224 ;; 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
225 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
226 (texinfo-raise-lower-sections)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
227 ;; 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
228 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
229 (texinfo-append-refill)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
230 ;; 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
231 ;; discard everything after that.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
232 (goto-char (point-max))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
233 (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
234 (delete-region (point) (point-max)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
235 ;; 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
236 (or (= (preceding-char) ?\n)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
237 (insert "\n"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
238 ;; 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
239 (setq texinfo-enclosure-list nil)
9759
ebe611f49450 (texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 9754
diff changeset
240 (setq texinfo-alias-list nil)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
241
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
242 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
243 (if (looking-at "\\\\input[ \t]+texinfo")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
244 (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
245
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
246 ;; Insert Info region title text.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
247 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
248 (if (search-forward
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
249 "@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
250 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
251 (setq texinfo-command-end (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
252 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
253 (setq texinfo-command-start (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
254 (let ((arg (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
255 (insert " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
256 texinfo-region-buffer-name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
257 " buffer for: `")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
258 (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
259 (insert "', -*-Text-*-\n")))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
260 ;; Else no `@setfilename' line
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
261 (insert " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
262 texinfo-region-buffer-name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
263 " buffer -*-Text-*-\n"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
264 (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
265 "from a region in: "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
266 (if (buffer-file-name input-buffer)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
267 (concat "`"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
268 (file-name-sans-versions
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
269 (file-name-nondirectory
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
270 (buffer-file-name input-buffer)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
271 "'")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
272 (concat "buffer `" (buffer-name input-buffer) "'"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
273 "\nusing `texinfmt.el' version "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
274 texinfmt-version
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
275 ".\n\n")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
276
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
277 ;; Now convert for real.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
278 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
279 (texinfo-format-scan)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
280 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
281
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
282 (message "Done.")))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
283
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
284
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
285 ;;; 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
286
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
287 (defun texinfo-format-buffer-1 ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
288 (let (texinfo-format-filename
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
289 texinfo-example-start
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
290 texinfo-command-start
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
291 texinfo-command-end
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
292 texinfo-command-name
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
293 texinfo-last-node
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
294 texinfo-last-node-pos
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
295 texinfo-vindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
296 texinfo-findex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
297 texinfo-cindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
298 texinfo-pindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
299 texinfo-tindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
300 texinfo-kindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
301 texinfo-stack
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
302 texinfo-node-names
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
303 (texinfo-footnote-number 0)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
304 last-input-buffer
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
305 outfile
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
306 (fill-column-for-info fill-column)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
307 (input-buffer (current-buffer))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
308 (input-directory default-directory))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
309 (setq texinfo-enclosure-list nil)
9759
ebe611f49450 (texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 9754
diff changeset
310 (setq texinfo-alias-list nil)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
311 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
312 (goto-char (point-min))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
313 (or (search-forward "@setfilename" nil t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
314 (error "Texinfo file needs an `@setfilename FILENAME' line."))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
315 (setq texinfo-command-end (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
316 (setq outfile (texinfo-parse-line-arg)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
317 (find-file outfile)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
318 (texinfo-mode)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
319 (setq fill-column fill-column-for-info)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
320 (set-syntax-table texinfo-format-syntax-table)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
321 (erase-buffer)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
322 (insert-buffer-substring input-buffer)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
323 (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
324
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
325 ;; 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
326 ;; 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
327 ;; @raise/@lowersections commands.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
328 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
329 (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
330 (setq texinfo-command-end (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
331 (let ((filename (concat input-directory
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
332 (texinfo-parse-line-arg))))
9178
0facf5c89fff (texinfo-format-region, texinfo-format-buffer-1):
Richard M. Stallman <rms@gnu.org>
parents: 6309
diff changeset
333 (re-search-backward "^@include")
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
334 (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
335 (message "Reading included file: %s" filename)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
336 (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
337 (save-restriction
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
338 (narrow-to-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
339 (point)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
340 (+ (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
341 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
342 ;; 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
343 ;; so @setfilename command not duplicated.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
344 (if (re-search-forward
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
345 "^@setfilename"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
346 (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
347 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
348 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
349 (delete-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
350 (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
351 ;; 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
352 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
353 (texinfo-raise-lower-sections)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
354 ;; Append @refill to appropriate paragraphs
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
355 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
356 (texinfo-append-refill)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
357 (goto-char (point-min))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
358 (search-forward "@setfilename")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
359 (beginning-of-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
360 (delete-region (point-min) (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
361 ;; Remove @bye at end of file, if it is there.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
362 (goto-char (point-max))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
363 (if (search-backward "@bye" nil t)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
364 (delete-region (point) (point-max)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
365 ;; Make sure buffer ends in a newline.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
366 (or (= (preceding-char) ?\n)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
367 (insert "\n"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
368 ;; Scan the whole buffer, converting to Info format.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
369 (texinfo-format-scan)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
370 ;; Return data for indices.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
371 (goto-char (point-min))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
372 (list outfile
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
373 texinfo-vindex texinfo-findex texinfo-cindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
374 texinfo-pindex texinfo-tindex texinfo-kindex)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
375
4396
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 ;;; Perform non-@-command file conversions: quotes and hyphens
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
378
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
379 (defun texinfo-format-convert (min max)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
380 ;; 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
381 (goto-char min)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
382 (while (search-forward "``" max t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
383 (replace-match "\""))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
384 (goto-char min)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
385 (while (search-forward "''" max t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
386 (replace-match "\""))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
387 ;; 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
388 (goto-char min)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
389 (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
390 (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
391 2)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
392
4396
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 ;;; Handle paragraph filling
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
395
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
396 (defvar texinfo-no-refill-regexp
9549
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
397 "^@\\(example\\|smallexample\\|lisp\\|smalllisp\\|display\\|format\\|flushleft\\|flushright\\|menu\\|titlepage\\|iftex\\|ifhtml\\|tex\\|html\\)"
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
398 "Regexp specifying environments in which paragraphs are not filled.")
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
399
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
400 (defvar texinfo-part-of-para-regexp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
401 "^@\\(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
402 "Regexp specifying @-commands found within paragraphs.")
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
403
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
404 (defun texinfo-append-refill ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
405 "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
406 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
407 Do not append @refill to paragraphs containing @w{TEXT} or @*."
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
408
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
409 ;; 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
410 ;; 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
411 ;; 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
412
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
413 (while (< (point) (point-max))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
414 (let ((refill-blank-lines "^[ \t\n]*$")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
415 (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
416 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
417 ;; 1. Skip over blank lines;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
418 ;; skip over lines beginning with @-commands,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
419 ;; but do not skip over lines
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
420 ;; 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
421 ;; 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
422 (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
423 (not (looking-at
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
424 (concat
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
425 "\\("
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
426 texinfo-no-refill-regexp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
427 "\\|"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
428 texinfo-part-of-para-regexp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
429 "\\)")))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
430 (< (point) (point-max)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
431 (forward-line 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
432 ;; 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
433 (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
434 (let ((environment
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
435 (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
436 (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
437 (forward-line 1)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
438 ;; 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
439 (if (or
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
440 (>= (point) (point-max))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
441 (re-search-forward
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
442 "@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
443 ;; 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
444 (forward-paragraph)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
445 ;; 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
446 (forward-paragraph)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
447 (forward-line -1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
448 (end-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
449 (delete-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
450 (point)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
451 (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
452 ;; `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
453 ;; (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
454 (if (not (re-search-backward
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
455 "@refill\\|@bye"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
456 (save-excursion (beginning-of-line) (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
457 t))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
458 (insert "@refill"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
459 (forward-line 1))))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
460
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
461
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
462 ;;; Handle `@raisesections' and `@lowersections' commands
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
463
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
464 ;; 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
465 ;; commands.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
466 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
467 ;; @raisesections changes @subsection to @section,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
468 ;; @section to @chapter,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
469 ;; etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
470 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
471 ;; @lowersections changes @chapter to @section
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
472 ;; @subsection to @subsubsection,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
473 ;; 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 ;; 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
476 ;; 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
477 ;; command.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
478 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
479 ;; 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
480 ;; the heading level.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
481 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
482 ;; 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
483 ;; vice versa.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
484 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
485 ;; 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
486 ;; 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
487 ;; 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
488 ;; (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
489 ;; @section produce chapter headings).
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
490
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
491 (defun texinfo-raise-lower-sections ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
492 "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
493
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
494 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
495 commands in the Texinfo file.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
496
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
497 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
498 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
499 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
500 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
501 on.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
502
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
503 @raisesections changes @subsection to @section,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
504 @section to @chapter,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
505 @heading to @chapheading,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
506 etc.
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 @lowersections changes @chapter to @section,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
509 @subsection to @subsubsection,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
510 @heading to @subheading,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
511 etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
512
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
513 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
514 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
515 `@lowersections' command.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
516
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
517 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
518 vice versa.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
519
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
520 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
521 level a step at a time.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
522
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
523 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
524 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
525 commands."
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
526
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
527 ;; `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
528 ;; 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
529 ;; (but not the top node).
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
530
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
531 (let (type (level 0))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
532 (while
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
533 (re-search-forward
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
534 (concat
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
535 "\\(\\(^@\\(raise\\|lower\\)sections\\)\\|\\("
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
536 texinfo-section-types-regexp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
537 "\\)\\)")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
538 nil t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
539 (beginning-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
540 (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
541 (cond
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
542
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
543 ;; 1. Increment level
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
544 ((eq type '@raisesections)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
545 (setq level (1+ level))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
546 (delete-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
547 (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
548
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
549 ;; 2. Decrement level
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
550 ((eq type '@lowersections)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
551 (setq level (1- level))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
552 (delete-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
553 (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
554
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
555 ;; Now handle structuring commands
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
556 ((cond
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
557
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
558 ;; 3. Raise level when positive
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
559 ((> level 0)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
560 (let ((count level)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
561 (new-level type))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
562 (while (> count 0)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
563 (setq new-level
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
564 (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
565 (setq count (1- count)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
566 (kill-word 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
567 (insert (symbol-name new-level))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
568
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
569 ;; 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
570 ((= level 0) (forward-line 1))
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 ;; 5. Lower level when positive
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
573 ((< level 0)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
574 (let ((count level)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
575 (new-level type))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
576 (while (< count 0)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
577 (setq new-level
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
578 (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
579 (setq count (1+ count)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
580 (kill-word 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
581 (insert (symbol-name new-level))))))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
582
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
583 (defvar texinfo-raisesections-alist
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
584 '((@chapter . @chapter) ; Cannot go higher
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
585 (@unnumbered . @unnumbered)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
586
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
587 (@majorheading . @majorheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
588 (@chapheading . @chapheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
589 (@appendix . @appendix)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
590
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
591 (@section . @chapter)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
592 (@unnumberedsec . @unnumbered)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
593 (@heading . @chapheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
594 (@appendixsec . @appendix)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
595
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
596 (@subsection . @section)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
597 (@unnumberedsubsec . @unnumberedsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
598 (@subheading . @heading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
599 (@appendixsubsec . @appendixsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
600
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
601 (@subsubsection . @subsection)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
602 (@unnumberedsubsubsec . @unnumberedsubsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
603 (@subsubheading . @subheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
604 (@appendixsubsubsec . @appendixsubsec))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
605 "*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
606 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
607 Used by `texinfo-raise-lower-sections'.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
608 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
609 higher types.")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
610
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
611 (defvar texinfo-lowersections-alist
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
612 '((@chapter . @section)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
613 (@unnumbered . @unnumberedsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
614 (@majorheading . @heading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
615 (@chapheading . @heading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
616 (@appendix . @appendixsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
617
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
618 (@section . @subsection)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
619 (@unnumberedsec . @unnumberedsubsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
620 (@heading . @subheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
621 (@appendixsec . @appendixsubsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
622
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
623 (@subsection . @subsubsection)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
624 (@unnumberedsubsec . @unnumberedsubsubsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
625 (@subheading . @subsubheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
626 (@appendixsubsec . @appendixsubsubsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
627
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
628 (@subsubsection . @subsubsection) ; Cannot go lower.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
629 (@unnumberedsubsubsec . @unnumberedsubsubsec)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
630 (@subsubheading . @subsubheading)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
631 (@appendixsubsubsec . @appendixsubsubsec))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
632 "*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
633 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
634 Used by `texinfo-raise-lower-sections'.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
635 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
636 lower types.")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
637
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
638
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
639 ;;; 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
640 ;;; uniformly.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
641
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
642 (defun texinfo-format-scan ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
643 (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
644 ;; Scan for @-commands.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
645 (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
646 (while (search-forward "@" nil t)
9754
7e9b8823755b (texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents: 9549
diff changeset
647 (if (looking-at "[@{}^'` *\"?!]")
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
648 ;; 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
649 (if (= (following-char) ?*)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
650 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
651 ;; remove command
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
652 (delete-region (1- (point)) (1+ (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
653 ;; 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
654 ;; else line is already broken.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
655 (if (not (= (following-char) ?\n))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
656 (insert ?\n)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
657 ;; 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
658 (delete-char -1)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
659 (forward-char 1))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
660 ;; @ 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
661 (setq texinfo-command-start (1- (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
662 (if (= (char-syntax (following-char)) ?w)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
663 (forward-word 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
664 (forward-char 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
665 (setq texinfo-command-end (point))
9759
ebe611f49450 (texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 9754
diff changeset
666 ;; Handle let aliasing
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
667 (setq texinfo-command-name
9759
ebe611f49450 (texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 9754
diff changeset
668 (let (trial
ebe611f49450 (texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 9754
diff changeset
669 (cmdname
ebe611f49450 (texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 9754
diff changeset
670 (buffer-substring
ebe611f49450 (texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 9754
diff changeset
671 (1+ texinfo-command-start) texinfo-command-end)))
ebe611f49450 (texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 9754
diff changeset
672 (while (setq trial (assoc cmdname texinfo-alias-list))
ebe611f49450 (texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 9754
diff changeset
673 (setq cmdname (cdr trial)))
ebe611f49450 (texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 9754
diff changeset
674 (intern cmdname)))
ebe611f49450 (texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 9754
diff changeset
675 ;; Call the handler for this command.
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
676 (let ((enclosure-type
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
677 (assoc
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
678 (symbol-name texinfo-command-name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
679 texinfo-enclosure-list)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
680 (if enclosure-type
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
681 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
682 (insert
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
683 (car (car (cdr enclosure-type)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
684 (texinfo-parse-arg-discard)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
685 (car (cdr (car (cdr enclosure-type)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
686 (goto-char texinfo-command-start))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
687 (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
688 (if cmd (funcall cmd) (texinfo-unsupported)))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
689
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
690 (cond (texinfo-stack
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
691 (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
692 (error "Unterminated @%s" (car (car texinfo-stack))))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
693
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
694 (put 'begin 'texinfo-format 'texinfo-format-begin)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
695 (defun texinfo-format-begin ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
696 (texinfo-format-begin-end 'texinfo-format))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
697
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
698 (put 'end 'texinfo-format 'texinfo-format-end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
699 (defun texinfo-format-end ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
700 (texinfo-format-begin-end 'texinfo-end))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
701
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
702 (defun texinfo-format-begin-end (prop)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
703 (setq texinfo-command-name (intern (texinfo-parse-line-arg)))
4868
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
704 (let ((cmd (get texinfo-command-name prop)))
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
705 (if cmd (funcall cmd)
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
706 (texinfo-unsupported))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
707
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
708 ;;; Parsing functions
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
709
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
710 (defun texinfo-parse-line-arg ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
711 (goto-char texinfo-command-end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
712 (let ((start (point)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
713 (cond ((looking-at " ")
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
714 (skip-chars-forward " ")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
715 (setq start (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
716 (end-of-line)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
717 (skip-chars-backward " ")
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
718 (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
719 (setq texinfo-command-end (1+ (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
720 ((looking-at "{")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
721 (setq start (1+ (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
722 (forward-list 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
723 (setq texinfo-command-end (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
724 (forward-char -1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
725 (t
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
726 (error "Invalid texinfo command arg format")))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
727 (prog1 (buffer-substring start (point))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
728 (if (eolp) (forward-char 1)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
729
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
730 (defun texinfo-parse-expanded-arg ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
731 (goto-char texinfo-command-end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
732 (let ((start (point))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
733 marker)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
734 (cond ((looking-at " ")
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
735 (skip-chars-forward " ")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
736 (setq start (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
737 (end-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
738 (setq texinfo-command-end (1+ (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
739 ((looking-at "{")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
740 (setq start (1+ (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
741 (forward-list 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
742 (setq texinfo-command-end (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
743 (forward-char -1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
744 (t
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
745 (error "Invalid texinfo command arg format")))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
746 (setq marker (move-marker (make-marker) texinfo-command-end))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
747 (texinfo-format-expand-region start (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
748 (setq texinfo-command-end (marker-position marker))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
749 (move-marker marker nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
750 (prog1 (buffer-substring start (point))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
751 (if (eolp) (forward-char 1)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
752
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
753 (defun texinfo-format-expand-region (start end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
754 (save-restriction
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
755 (narrow-to-region start end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
756 (let (texinfo-command-start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
757 texinfo-command-end
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
758 texinfo-command-name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
759 texinfo-stack)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
760 (texinfo-format-scan))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
761 (goto-char (point-max))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
762
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
763 (defun texinfo-parse-arg-discard ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
764 (prog1 (texinfo-parse-line-arg)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
765 (texinfo-discard-command)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
766
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
767 (defun texinfo-discard-command ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
768 (delete-region texinfo-command-start texinfo-command-end))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
769
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
770 (defun texinfo-optional-braces-discard ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
771 "Discard braces following command, if any."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
772 (goto-char texinfo-command-end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
773 (let ((start (point)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
774 (cond ((looking-at "[ \t]*\n")) ; do nothing
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
775 ((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
776 (forward-list 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
777 (setq texinfo-command-end (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
778 (t
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
779 (error
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
780 "Invalid `texinfo-optional-braces-discard' format \(need braces?\)")))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
781 (delete-region texinfo-command-start texinfo-command-end)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
782
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
783 (defun texinfo-format-parse-line-args ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
784 (let ((start (1- (point)))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
785 next beg end
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
786 args)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
787 (skip-chars-forward " ")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
788 (while (not (eolp))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
789 (setq beg (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
790 (re-search-forward "[\n,]")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
791 (setq next (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
792 (if (bolp) (setq next (1- next)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
793 (forward-char -1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
794 (skip-chars-backward " ")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
795 (setq end (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
796 (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
797 args))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
798 (goto-char next)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
799 (skip-chars-forward " "))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
800 (if (eolp) (forward-char 1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
801 (setq texinfo-command-end (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
802 (nreverse args)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
803
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
804 (defun texinfo-format-parse-args ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
805 (let ((start (1- (point)))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
806 next beg end
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
807 args)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
808 (search-forward "{")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
809 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
810 (texinfo-format-expand-region
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
811 (point)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
812 (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
813 ;; 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
814 ;; `@xref{bullet, , @code{@@bullet}@{@}}.' because the
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
815 ;; 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
816 ;; comma.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
817 (while (/= (preceding-char) ?\})
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
818 (skip-chars-forward " \t\n")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
819 (setq beg (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
820 (re-search-forward "[},]")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
821 (setq next (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
822 (forward-char -1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
823 (skip-chars-backward " \t\n")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
824 (setq end (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
825 (cond ((< beg end)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
826 (goto-char beg)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
827 (while (search-forward "\n" end t)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
828 (replace-match " "))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
829 (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
830 args))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
831 (goto-char next))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
832 (if (eolp) (forward-char 1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
833 (setq texinfo-command-end (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
834 (nreverse args)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
835
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
836 (defun texinfo-format-parse-defun-args ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
837 (goto-char texinfo-command-end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
838 (let ((start (point)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
839 (end-of-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
840 (setq texinfo-command-end (1+ (point)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
841 (let ((marker (move-marker (make-marker) texinfo-command-end)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
842 (texinfo-format-expand-region start (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
843 (setq texinfo-command-end (marker-position marker))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
844 (move-marker marker nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
845 (goto-char start)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
846 (let ((args '())
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
847 beg end)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
848 (skip-chars-forward " ")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
849 (while (not (eolp))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
850 (cond ((looking-at "{")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
851 (setq beg (1+ (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
852 (forward-list 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
853 (setq end (1- (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
854 (t
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
855 (setq beg (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
856 (re-search-forward "[\n ]")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
857 (forward-char -1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
858 (setq end (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
859 (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
860 (skip-chars-forward " "))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
861 (forward-char 1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
862 (nreverse args))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
863
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
864 (defun texinfo-discard-line ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
865 (goto-char texinfo-command-end)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
866 (skip-chars-forward " \t")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
867 (or (eolp)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
868 (error "Extraneous text at end of command line."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
869 (goto-char texinfo-command-start)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
870 (or (bolp)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
871 (error "Extraneous text at beginning of command line."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
872 (delete-region (point) (progn (forward-line 1) (point))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
873
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
874 (defun texinfo-discard-line-with-args ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
875 (goto-char texinfo-command-start)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
876 (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
877
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
878
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
879 ;;; @setfilename
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
880
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
881 ;; 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
882 ;; 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
883 ;; specially.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
884 (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
885 (defun texinfo-format-setfilename ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
886 (let ((arg (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
887 (message "Formatting Info file: %s" arg)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
888 (setq texinfo-format-filename
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
889 (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
890 (insert "Info file: "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
891 texinfo-format-filename ", -*-Text-*-\n"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
892 ;; 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
893 ;; "produced on "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
894 ;; (substring (current-time-string) 8 10) " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
895 ;; (substring (current-time-string) 4 7) " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
896 ;; (substring (current-time-string) -4) " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
897 "produced by `texinfo-format-buffer'\n"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
898 "from file"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
899 (if (buffer-file-name input-buffer)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
900 (concat " `"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
901 (file-name-sans-versions
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
902 (file-name-nondirectory
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
903 (buffer-file-name input-buffer)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
904 "'")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
905 (concat "buffer `" (buffer-name input-buffer) "'"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
906 "\nusing `texinfmt.el' version "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
907 texinfmt-version
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
908 ".\n\n")))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
909
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
910 ;;; @node, @menu
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
911
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
912 (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
913 (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
914 (defun texinfo-format-node ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
915 (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
916 (name (nth 0 args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
917 (next (nth 1 args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
918 (prev (nth 2 args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
919 (up (nth 3 args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
920 (texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
921 (setq texinfo-last-node name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
922 (let ((tem (downcase name)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
923 (if (assoc tem texinfo-node-names)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
924 (error "Duplicate node name: %s" name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
925 (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
926 (setq texinfo-footnote-number 0)
9896
a70b99926339 (texinfo-format-node): Insert the node delimiter
Richard M. Stallman <rms@gnu.org>
parents: 9759
diff changeset
927 ;; insert "\n\^_" unconditionally since this is what info is looking for
a70b99926339 (texinfo-format-node): Insert the node delimiter
Richard M. Stallman <rms@gnu.org>
parents: 9759
diff changeset
928 (insert "\n\^_\nFile: " texinfo-format-filename
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
929 ", Node: " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
930 (if next
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
931 (insert ", Next: " next))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
932 (if prev
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
933 (insert ", Prev: " prev))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
934 (if up
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
935 (insert ", Up: " up))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
936 (insert ?\n)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
937 (setq texinfo-last-node-pos (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
938
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
939 (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
940 (defun texinfo-format-menu ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
941 (texinfo-discard-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
942 (insert "* Menu:\n\n"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
943
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
944 (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
945
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
946
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
947 ;;; Cross references
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
948
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
949 ; @xref {NODE, FNAME, NAME, FILE, DOCUMENT}
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
950 ; -> *Note FNAME: (FILE)NODE
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
951 ; If FILE is missing,
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
952 ; *Note FNAME: NODE
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
953 ; If FNAME is empty and NAME is present
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
954 ; *Note NAME: Node
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
955 ; If both NAME and FNAME are missing
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
956 ; *Note NODE::
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
957 ; texinfo ignores the DOCUMENT argument.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
958 ; -> See section <xref to NODE> [NAME, else NODE], page <xref to NODE>
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
959 ; If FILE is specified, (FILE)NODE is used for xrefs.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
960 ; If fifth argument DOCUMENT is specified, produces
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
961 ; See section <xref to NODE> [NAME, else NODE], page <xref to NODE>
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
962 ; of DOCUMENT
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
963
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
964 ; @ref a reference that does not put `See' or `see' in
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
965 ; the hardcopy and is the same as @xref in Info
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
966 (put 'ref 'texinfo-format 'texinfo-format-xref)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
967
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
968 (put 'xref 'texinfo-format 'texinfo-format-xref)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
969 (defun texinfo-format-xref ()
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 (insert "*Note ")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
973 (let ((fname (or (nth 1 args) (nth 2 args))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
974 (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
975 (insert (car args) "::")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
976 (insert (or fname (car args)) ": ")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
977 (if (nth 3 args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
978 (insert "(" (nth 3 args) ")"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
979 (insert (car args))))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
980
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
981 (put 'pxref 'texinfo-format 'texinfo-format-pxref)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
982 (defun texinfo-format-pxref ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
983 (texinfo-format-xref)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
984 (or (save-excursion
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
985 (forward-char -2)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
986 (looking-at "::"))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
987 (insert ".")))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
988
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
989 ;@inforef{NODE, FNAME, FILE}
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
990 ;Like @xref{NODE, FNAME,,FILE} in texinfo.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
991 ;In Tex, generates "See Info file FILE, node NODE"
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
992 (put 'inforef 'texinfo-format 'texinfo-format-inforef)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
993 (defun texinfo-format-inforef ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
994 (let ((args (texinfo-format-parse-args)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
995 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
996 (if (nth 1 args)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
997 (insert "*Note " (nth 1 args) ": (" (nth 2 args) ")" (car args))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
998 (insert "*Note " "(" (nth 2 args) ")" (car args) "::"))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
999
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1000
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1001 ;;; Section headings
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1002
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1003 (put 'majorheading 'texinfo-format 'texinfo-format-chapter)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1004 (put 'chapheading 'texinfo-format 'texinfo-format-chapter)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1005 (put 'ichapter 'texinfo-format 'texinfo-format-chapter)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1006 (put 'chapter 'texinfo-format 'texinfo-format-chapter)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1007 (put 'iappendix 'texinfo-format 'texinfo-format-chapter)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1008 (put 'appendix 'texinfo-format 'texinfo-format-chapter)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1009 (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
1010 (put 'top 'texinfo-format 'texinfo-format-chapter)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1011 (put 'unnumbered 'texinfo-format 'texinfo-format-chapter)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1012 (defun texinfo-format-chapter ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1013 (texinfo-format-chapter-1 ?*))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1014
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1015 (put 'heading 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1016 (put 'isection 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1017 (put 'section 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1018 (put 'iappendixsection 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1019 (put 'appendixsection 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1020 (put 'iappendixsec 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1021 (put 'appendixsec 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1022 (put 'iunnumberedsec 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1023 (put 'unnumberedsec 'texinfo-format 'texinfo-format-section)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1024 (defun texinfo-format-section ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1025 (texinfo-format-chapter-1 ?=))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1026
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1027 (put 'subheading 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1028 (put 'isubsection 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1029 (put 'subsection 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1030 (put 'iappendixsubsec 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1031 (put 'appendixsubsec 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1032 (put 'iunnumberedsubsec 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1033 (put 'unnumberedsubsec 'texinfo-format 'texinfo-format-subsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1034 (defun texinfo-format-subsection ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1035 (texinfo-format-chapter-1 ?-))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1036
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1037 (put 'subsubheading 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1038 (put 'isubsubsection 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1039 (put 'subsubsection 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1040 (put 'iappendixsubsubsec 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1041 (put 'appendixsubsubsec 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1042 (put 'iunnumberedsubsubsec 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1043 (put 'unnumberedsubsubsec 'texinfo-format 'texinfo-format-subsubsection)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1044 (defun texinfo-format-subsubsection ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1045 (texinfo-format-chapter-1 ?.))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1046
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1047 (defun texinfo-format-chapter-1 (belowchar)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1048 (let ((arg (texinfo-parse-arg-discard)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1049 (message "Formatting: %s ... " arg) ; So we can see where we are.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1050 (insert ?\n arg ?\n "@SectionPAD " belowchar ?\n)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1051 (forward-line -2)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1052
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1053 (put 'SectionPAD 'texinfo-format 'texinfo-format-sectionpad)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1054 (defun texinfo-format-sectionpad ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1055 (let ((str (texinfo-parse-arg-discard)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1056 (forward-char -1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1057 (let ((column (current-column)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1058 (forward-char 1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1059 (while (> column 0)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1060 (insert str)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1061 (setq column (1- column))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1062 (insert ?\n)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1063
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1064
9754
7e9b8823755b (texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents: 9549
diff changeset
1065 ;;; Space controlling commands: @. and @:, and the soft hyphen.
7e9b8823755b (texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents: 9549
diff changeset
1066
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1067 (put '\. 'texinfo-format 'texinfo-format-\.)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1068 (defun texinfo-format-\. ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1069 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1070 (insert "."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1071
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1072 (put '\: 'texinfo-format 'texinfo-format-\:)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1073 (defun texinfo-format-\: ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1074 (texinfo-discard-command))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1075
9754
7e9b8823755b (texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents: 9549
diff changeset
1076 (put '\- 'texinfo-format 'texinfo-format-soft-hyphen)
7e9b8823755b (texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents: 9549
diff changeset
1077 (defun texinfo-format-soft-hyphen ()
7e9b8823755b (texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents: 9549
diff changeset
1078 (texinfo-discard-command))
7e9b8823755b (texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents: 9549
diff changeset
1079
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1080
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1081 ;;; @center, @sp, and @br
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1082
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1083 (put 'center 'texinfo-format 'texinfo-format-center)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1084 (defun texinfo-format-center ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1085 (let ((arg (texinfo-parse-expanded-arg)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1086 (texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1087 (insert arg)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1088 (insert ?\n)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1089 (save-restriction
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1090 (goto-char (1- (point)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1091 (let ((indent-tabs-mode nil))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1092 (center-line)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1093
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1094 (put 'sp 'texinfo-format 'texinfo-format-sp)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1095 (defun texinfo-format-sp ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1096 (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
1097 (num (read arg)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1098 (insert-char ?\n num)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1099
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1100 (put 'br 'texinfo-format 'texinfo-format-paragraph-break)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1101 (defun texinfo-format-paragraph-break ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1102 "Force a paragraph break.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1103 If used within a line, follow `@br' with braces."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1104 (texinfo-optional-braces-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1105 ;; insert one return if at end of line;
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1106 ;; else insert two returns, to generate a blank line.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1107 (if (= (following-char) ?\n)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1108 (insert ?\n)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1109 (insert-char ?\n 2)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1110
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1111
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1112 ;;; @footnote and @footnotestyle
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1113
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1114 ; In Texinfo, footnotes are created with the `@footnote' command.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1115 ; 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
1116 ; the footnote, and then by a terminating right brace. The
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1117 ; template for a footnote is:
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1118 ;
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1119 ; @footnote{TEXT}
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1120 ;
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1121 ; Info has two footnote styles:
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1122 ;
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1123 ; * 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
1124 ; are placed at the end of that node. The footnotes are
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1125 ; separated from the rest of the node by a line of dashes with
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1126 ; the word `Footnotes' within it.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1127 ;
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1128 ; * 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
1129 ; are placed in an automatically constructed node of their own.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1130
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1131 ; 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
1132 ; @footnotestyle separate
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1133 ; or
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1134 ; @footnotestyle end
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1135 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1136 ; The default is separate
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1137
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1138 (defvar texinfo-footnote-style "separate"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1139 "Footnote style, either separate or end.")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1140
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1141 (put 'footnotestyle 'texinfo-format 'texinfo-footnotestyle)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1142 (defun texinfo-footnotestyle ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1143 "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
1144 Argument is either end or separate."
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1145 (setq texinfo-footnote-style (texinfo-parse-arg-discard)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1146
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1147 (defvar texinfo-footnote-number)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1148
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1149 (put 'footnote 'texinfo-format 'texinfo-format-footnote)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1150 (defun texinfo-format-footnote ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1151 "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
1152 The texinfo-footnote-style variable controls which style is used."
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1153 (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
1154 (cond ((string= texinfo-footnote-style "end")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1155 (texinfo-format-end-node))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1156 ((string= texinfo-footnote-style "separate")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1157 (texinfo-format-separate-node))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1158
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1159 (defun texinfo-format-separate-node ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1160 "Format footnote in Separate node style, with notes in own node.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1161 The node is constructed automatically."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1162 (let* (start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1163 (arg (texinfo-parse-line-arg))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1164 (node-name-beginning
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1165 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1166 (re-search-backward
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1167 "^File: \\w+\\(\\w\\|\\s_\\|\\.\\|,\\)*[ \t]+Node:")
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1168 (match-end 0)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1169 (node-name
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1170 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1171 (buffer-substring
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1172 (progn (goto-char node-name-beginning) ; skip over node command
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1173 (skip-chars-forward " \t") ; and over spaces
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1174 (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1175 (if (search-forward
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1176 ","
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1177 (save-excursion (end-of-line) (point)) t) ; bound search
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1178 (1- (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1179 (end-of-line) (point))))))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1180 (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
1181 (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
1182 (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1183 (insert (format " (%d) (*Note %s-Footnotes::)"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1184 texinfo-footnote-number node-name))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1185 (fill-paragraph nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1186 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1187 (if (re-search-forward "^@node" nil 'move)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1188 (forward-line -1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1190 ;; two cases: for the first footnote, we must insert a node header;
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1191 ;; for the second and subsequent footnotes, we need only insert
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1192 ;; the text of the footnote.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1193
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1194 (if (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1195 (re-search-backward
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1196 (concat node-name "-Footnotes, Up: ")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1197 node-name-beginning
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1198 t))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1199 (progn ; already at least one footnote
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1200 (setq start (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1201 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1202 (fill-region start (point)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1203 ;; else not yet a footnote
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1204 (insert "\n\^_\nFile: " texinfo-format-filename
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1205 " Node: " node-name "-Footnotes, Up: " node-name "\n")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1206 (setq start (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1207 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1208 (fill-region start (point))))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1209
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1210 (defun texinfo-format-end-node ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1211 "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
1212 (let (start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1213 (arg (texinfo-parse-line-arg)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1214 (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
1215 (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
1216 (point))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1217 (insert (format " (%d) " texinfo-footnote-number))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1218 (fill-paragraph nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1219 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1220 (if (search-forward "\n--------- Footnotes ---------\n" nil t)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1221 (progn ; already have footnote, put new one before end of node
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1222 (if (re-search-forward "^@node" nil 'move)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1223 (forward-line -1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1224 (setq start (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1225 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1226 (fill-region start (point)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1227 ;; else no prior footnote
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1228 (if (re-search-forward "^@node" nil 'move)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1229 (forward-line -1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1230 (insert "\n--------- Footnotes ---------\n")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1231 (setq start (point))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1232 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg))))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1233
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1234
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1235 ;;; @itemize, @enumerate, and similar commands
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1236
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1237 ;; @itemize pushes (itemize "COMMANDS" STARTPOS) on texinfo-stack.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1238 ;; @enumerate pushes (enumerate 0 STARTPOS).
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1239 ;; @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
1240 ;; For itemize, this puts in and rescans the COMMANDS.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1241 ;; For enumerate, this increments the number and puts it in.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1242 ;; In either case, it puts a Backspace at the front of the line
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1243 ;; which marks it not to be indented later.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1244 ;; All other lines get indented by 5 when the @end is reached.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1245
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1246 (defvar texinfo-stack-depth 0
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1247 "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
1248 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
1249
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1250 (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
1251 (setq texinfo-stack-depth (1+ texinfo-stack-depth))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1252 (setq texinfo-stack
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1253 (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
1254 texinfo-stack)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1255
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1256 (defun texinfo-pop-stack (check)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1257 (setq texinfo-stack-depth (1- texinfo-stack-depth))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1258 (if (null texinfo-stack)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1259 (error "Unmatched @end %s" check))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1260 (if (not (eq (car (car texinfo-stack)) check))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1261 (error "@end %s matches @%s"
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1262 check (car (car texinfo-stack))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1263 (prog1 (cdr (car texinfo-stack))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1264 (setq texinfo-stack (cdr texinfo-stack))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1265
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1266 (put 'itemize 'texinfo-format 'texinfo-itemize)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1267 (defun texinfo-itemize ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1268 (texinfo-push-stack
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1269 'itemize
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1270 (progn (skip-chars-forward " \t")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1271 (if (eolp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1272 "@bullet"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1273 (texinfo-parse-line-arg))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1274 (texinfo-discard-line-with-args)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1275 (setq fill-column (- fill-column 5)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1276
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1277 (put 'itemize 'texinfo-end 'texinfo-end-itemize)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1278 (defun texinfo-end-itemize ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1279 (setq fill-column (+ fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1280 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1281 (let ((stacktop
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1282 (texinfo-pop-stack 'itemize)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1283 (texinfo-do-itemize (nth 1 stacktop))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1284
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1285 (put 'enumerate 'texinfo-format 'texinfo-enumerate)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1286 (defun texinfo-enumerate ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1287 (texinfo-push-stack
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1288 'enumerate
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1289 (progn (skip-chars-forward " \t")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1290 (if (eolp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1291 1
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1292 (read (current-buffer)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1293 (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
1294 (> 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
1295 (error
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1296 "@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
1297 (texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1298 (setq fill-column (- fill-column 5)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1299
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1300 (put 'enumerate 'texinfo-end 'texinfo-end-enumerate)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1301 (defun texinfo-end-enumerate ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1302 (setq fill-column (+ fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1303 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1304 (let ((stacktop
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1305 (texinfo-pop-stack 'enumerate)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1306 (texinfo-do-itemize (nth 1 stacktop))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1307
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1308 ;; @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
1309 (put 'alphaenumerate 'texinfo-format 'texinfo-alphaenumerate)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1310 (defun texinfo-alphaenumerate ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1311 (texinfo-push-stack 'alphaenumerate (1- ?a))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1312 (setq fill-column (- fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1313 (texinfo-discard-line))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1314
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1315 (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
1316 (defun texinfo-end-alphaenumerate ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1317 (setq fill-column (+ fill-column 5))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1318 (texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1319 (let ((stacktop
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1320 (texinfo-pop-stack 'alphaenumerate)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1321 (texinfo-do-itemize (nth 1 stacktop))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1322
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1323 ;; @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
1324 (put 'capsenumerate 'texinfo-format 'texinfo-capsenumerate)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1325 (defun texinfo-capsenumerate ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1326 (texinfo-push-stack 'capsenumerate (1- ?A))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1327 (setq fill-column (- fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1328 (texinfo-discard-line))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1329
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1330 (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
1331 (defun texinfo-end-capsenumerate ()
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1332 (setq fill-column (+ fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1333 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1334 (let ((stacktop
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1335 (texinfo-pop-stack 'capsenumerate)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1336 (texinfo-do-itemize (nth 1 stacktop))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1337
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1338 ;; At the @end, indent all the lines within the construct
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1339 ;; except those marked with backspace. FROM says where
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1340 ;; construct started.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1341 (defun texinfo-do-itemize (from)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1342 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1343 (while (progn (forward-line -1)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1344 (>= (point) from))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1345 (if (= (following-char) ?\b)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1346 (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1347 (delete-char 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1348 (end-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1349 (delete-char 6))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1350 (if (not (looking-at "[ \t]*$"))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1351 (save-excursion (insert " ")))))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1352
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1353 (put 'item 'texinfo-format 'texinfo-item)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1354 (put 'itemx 'texinfo-format 'texinfo-item)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1355 (defun texinfo-item ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1356 (funcall (get (car (car texinfo-stack)) 'texinfo-item)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1357
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1358 (put 'itemize 'texinfo-item 'texinfo-itemize-item)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1359 (defun texinfo-itemize-item ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1360 ;; (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
1361 (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
1362 (if (looking-at "[ \t]*[^ \t\n]+")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1363 ;; 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
1364 (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
1365 ;; Else text on next line.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1366 (insert "\b " (nth 1 (car texinfo-stack)) " "))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1367 (forward-line -1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1368
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1369 (put 'enumerate 'texinfo-item 'texinfo-enumerate-item)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1370 (defun texinfo-enumerate-item ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1371 (texinfo-discard-line)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1372 (let (enumerating-symbol)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1373 (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
1374 (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
1375 (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
1376 (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
1377 ((symbolp (car (cdr (car texinfo-stack))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1378 (setq enumerating-symbol
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1379 (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
1380 (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
1381 (equal ?\{ (string-to-char enumerating-symbol)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1382 (error
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1383 "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
1384 (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
1385 (setcar (cdr (car texinfo-stack))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1386 (make-symbol
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1387 (char-to-string
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1388 (1+
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1389 (string-to-char enumerating-symbol))))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1390 (t
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1391 (error
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1392 "@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
1393 (forward-line -1)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1394
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1395 (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
1396 (defun texinfo-alphaenumerate-item ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1397 (texinfo-discard-line)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1398 (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
1399 (if (> next ?z)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1400 (error "More than 26 items in @alphaenumerate; get a bigger alphabet."))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1401 (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
1402 (insert "\b " next ". \n"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1403 (forward-line -1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1404
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1405 (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
1406 (defun texinfo-capsenumerate-item ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1407 (texinfo-discard-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1408 (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
1409 (if (> next ?Z)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1410 (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
1411 (setcar (cdr (car texinfo-stack)) next)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1412 (insert "\b " next ". \n"))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1413 (forward-line -1))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1414
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1415
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1416 ;;; @table
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1417
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1418 ; 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
1419
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1420 (put 'table 'texinfo-format 'texinfo-table)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1421 (defun texinfo-table ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1422 (texinfo-push-stack
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1423 'table
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1424 (progn (skip-chars-forward " \t")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1425 (if (eolp)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1426 "@asis"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1427 (texinfo-parse-line-arg))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1428 (texinfo-discard-line-with-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1429 (setq fill-column (- fill-column 5)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1430
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1431 (put 'table 'texinfo-item 'texinfo-table-item)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1432 (defun texinfo-table-item ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1433 (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
1434 (itemfont (car (cdr (car texinfo-stack)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1435 (insert ?\b itemfont ?\{ arg "}\n \n"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1436 (forward-line -2))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1437
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1438 (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
1439 (defun texinfo-end-table ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1440 (setq fill-column (+ fill-column 5))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1441 (texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1442 (let ((stacktop
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1443 (texinfo-pop-stack 'table)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1444 (texinfo-do-itemize (nth 1 stacktop))))
189
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 ;; @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
1447 ;; 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
1448 ;; 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
1449 (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
1450 (put 'description 'texinfo-format 'texinfo-description)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1451 (defun texinfo-description ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1452 (texinfo-push-stack 'table "@asis")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1453 (setq fill-column (- fill-column 5))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1454 (texinfo-discard-line))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1455
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1456
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1457 ;;; @ftable, @vtable
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1458
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1459 ; 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
1460 ; 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
1461 ; into the function or variable index.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1462
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1463 ;; Handle the @ftable and @vtable commands:
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1464
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1465 (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
1466 (put 'vtable 'texinfo-format 'texinfo-vtable)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1467
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1468 (defun texinfo-ftable () (texinfo-indextable 'ftable))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1469 (defun texinfo-vtable () (texinfo-indextable 'vtable))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1470
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1471 (defun texinfo-indextable (table-type)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1472 (texinfo-push-stack table-type (texinfo-parse-arg-discard))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1473 (setq fill-column (- fill-column 5)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1474
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1475 ;; 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
1476
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1477 (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
1478 (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
1479
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1480 (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
1481 (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
1482
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1483 (defun texinfo-indextable-item (index-type)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1484 (let ((item (texinfo-parse-arg-discard))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1485 (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
1486 (indexvar index-type))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1487 (insert ?\b itemfont ?\{ item "}\n \n")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1488 (set indexvar
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1489 (cons
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1490 (list item texinfo-last-node)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1491 (symbol-value indexvar)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1492 (forward-line -2)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1493
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1494 ;; Handle @end ftable, @end vtable
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1495
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1496 (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
1497 (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
1498
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1499 (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
1500 (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
1501
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1502 (defun texinfo-end-indextable (table-type)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1503 (setq fill-column (+ fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1504 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1505 (let ((stacktop
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1506 (texinfo-pop-stack table-type)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1507 (texinfo-do-itemize (nth 1 stacktop))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1508
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1509
9549
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1510 ;;; @ifinfo, @iftex, @tex, @ifhtml, @html
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1511
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1512 (put 'ifinfo 'texinfo-format 'texinfo-discard-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1513 (put 'ifinfo 'texinfo-end 'texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1514
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1515 (put 'iftex 'texinfo-format 'texinfo-format-iftex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1516 (defun texinfo-format-iftex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1517 (delete-region texinfo-command-start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1518 (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
1519 (point))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1520
9549
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1521 (put 'ifhtml 'texinfo-format 'texinfo-format-ifhtml)
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1522 (defun texinfo-format-ifhtml ()
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1523 (delete-region texinfo-command-start
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1524 (progn (re-search-forward "@end ifhtml[ \t]*\n")
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1525 (point))))
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1526
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1527 (put 'tex 'texinfo-format 'texinfo-format-tex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1528 (defun texinfo-format-tex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1529 (delete-region texinfo-command-start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1530 (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
1531 (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1532
9549
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1533 (put 'html 'texinfo-format 'texinfo-format-html)
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1534 (defun texinfo-format-html ()
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1535 (delete-region texinfo-command-start
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1536 (progn (re-search-forward "@end html[ \t]*\n")
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1537 (point))))
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1538
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1539
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1540 ;;; @titlepage
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 'titlepage 'texinfo-format 'texinfo-format-titlepage)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1543 (defun texinfo-format-titlepage ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1544 (delete-region texinfo-command-start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1545 (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
1546 (point))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1547
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1548 (put 'endtitlepage 'texinfo-format 'texinfo-discard-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1549
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1550 ; @titlespec an alternative titling command; ignored by Info
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1551
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1552 (put 'titlespec 'texinfo-format 'texinfo-format-titlespec)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1553 (defun texinfo-format-titlespec ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1554 (delete-region texinfo-command-start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1555 (progn (re-search-forward "@end titlespec[ \t]*\n")
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1556 (point))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1557
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1558 (put 'endtitlespec 'texinfo-format 'texinfo-discard-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1559
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1560
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1561 ;;; @today
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1562
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1563 (put 'today 'texinfo-format 'texinfo-format-today)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1564
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1565 ; Produces Day Month Year style of output. eg `1 Jan 1900'
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1566 ; The `@today{}' command requires a pair of braces, like `@dots{}'.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1567 (defun texinfo-format-today ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1568 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1569 (insert (format "%s %s %s"
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1570 (substring (current-time-string) 8 10)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1571 (substring (current-time-string) 4 7)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1572 (substring (current-time-string) -4))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1573
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1574
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1575 ;;; @ignore
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1576
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1577 (put 'ignore 'texinfo-format 'texinfo-format-ignore)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1578 (defun texinfo-format-ignore ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1579 (delete-region texinfo-command-start
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1580 (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
1581 (point))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1582
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1583 (put 'endignore 'texinfo-format 'texinfo-discard-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1584
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1585
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1586 ;;; Define the Info enclosure command: @definfoenclose
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 ; 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
1589 ; 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
1590 ; `@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
1591 ; and follow the text.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1592 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1593 ; 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
1594 ; 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
1595 ; `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
1596 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1597 ; 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
1598 ; 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
1599 ; `@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
1600 ; `@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
1601 ; 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
1602 ; 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
1603 ; 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
1604 ; 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
1605 ; 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
1606 ; 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
1607 ; 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
1608 ; string as a start delimiter string.
9344
43cf4ed3f5f0 (texinfo-format-scan): Accept @^, @", @?, @!, @-.
Richard M. Stallman <rms@gnu.org>
parents: 9178
diff changeset
1609 ;
43cf4ed3f5f0 (texinfo-format-scan): Accept @^, @", @?, @!, @-.
Richard M. Stallman <rms@gnu.org>
parents: 9178
diff changeset
1610 ; If you do a @definfoenclose{} on the name of a pre-defined macro (such
43cf4ed3f5f0 (texinfo-format-scan): Accept @^, @", @?, @!, @-.
Richard M. Stallman <rms@gnu.org>
parents: 9178
diff changeset
1611 ; as @emph{}, @strong{}, @tt{}, or @i{}) the enclosure definition will
43cf4ed3f5f0 (texinfo-format-scan): Accept @^, @", @?, @!, @-.
Richard M. Stallman <rms@gnu.org>
parents: 9178
diff changeset
1612 ; override the built-in definition.
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1613 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1614 ; 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
1615 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1616 ; For example, you can write:
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 ; @ifinfo
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1619 ; @definfoenclose phoo, //, \\
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1620 ; @end ifinfo
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1621 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1622 ; 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
1623 ; 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
1624 ; 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
1625 ; `@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
1626 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1627 ; 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
1628 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1629 ; @iftex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1630 ; @global@let@phoo=@i
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1631 ; @end iftex
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1632 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1633 ; 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
1634 ; the argument to `@phoo' in italics.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1635 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1636 ; 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
1637 ; 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
1638 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1639 ; Here is another example: write
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1640 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1641 ; @definfoenclose headword, , :
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1642 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1643 ; 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
1644 ; 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
1645 ; argument to `@headword'.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1646
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1647 (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
1648 (defun texinfo-define-info-enclosure ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1649 (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
1650 (command-name (nth 0 args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1651 (beginning-delimiter (or (nth 1 args) ""))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1652 (end-delimiter (or (nth 2 args) "")))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1653 (texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1654 (setq texinfo-enclosure-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1655 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1656 (list command-name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1657 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1658 beginning-delimiter
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1659 end-delimiter))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1660 texinfo-enclosure-list))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1661
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1662
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1663 ;;; @var, @code and the like
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1664
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1665 (put 'var 'texinfo-format 'texinfo-format-var)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1666 ; @sc a small caps font for TeX; formatted as `var' in Info
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1667 (put 'sc 'texinfo-format 'texinfo-format-var)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1668 (defun texinfo-format-var ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1669 (insert (upcase (texinfo-parse-arg-discard)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1670 (goto-char texinfo-command-start))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1671
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1672 ; various noops
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1673
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1674 (put 'b 'texinfo-format 'texinfo-format-noop)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1675 (put 'i 'texinfo-format 'texinfo-format-noop)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1676 (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
1677 (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
1678 (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
1679 (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
1680 (put 'dmn 'texinfo-format 'texinfo-format-noop)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1681 (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
1682 (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
1683 (put 'titlefont 'texinfo-format 'texinfo-format-noop)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1684 (defun texinfo-format-noop ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1685 (insert (texinfo-parse-arg-discard))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1686 (goto-char texinfo-command-start))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1687
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1688 (put 'cite 'texinfo-format 'texinfo-format-code)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1689 (put 'code 'texinfo-format 'texinfo-format-code)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1690 (put 'file 'texinfo-format 'texinfo-format-code)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1691 (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
1692 (put 'samp 'texinfo-format 'texinfo-format-code)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1693 (defun texinfo-format-code ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1694 (insert "`" (texinfo-parse-arg-discard) "'")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1695 (goto-char texinfo-command-start))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1696
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1697 (put 'emph 'texinfo-format 'texinfo-format-emph)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1698 (put 'strong 'texinfo-format 'texinfo-format-emph)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1699 (defun texinfo-format-emph ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1700 (insert "*" (texinfo-parse-arg-discard) "*")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1701 (goto-char texinfo-command-start))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1702
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1703 (put 'dfn 'texinfo-format 'texinfo-format-defn)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1704 (put 'defn 'texinfo-format 'texinfo-format-defn)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1705 (defun texinfo-format-defn ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1706 (insert "\"" (texinfo-parse-arg-discard) "\"")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1707 (goto-char texinfo-command-start))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1708
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1709 (put 'bullet 'texinfo-format 'texinfo-format-bullet)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1710 (defun texinfo-format-bullet ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1711 "Insert an asterisk.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1712 If used within a line, follow `@bullet' with braces."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1713 (texinfo-optional-braces-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1714 (insert "*"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1715
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1716
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1717 ;;; @example, @lisp, @quotation, @display, @smalllisp, @smallexample
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1718
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1719 (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
1720 (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
1721 (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
1722 (put 'quotation 'texinfo-format 'texinfo-format-example)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1723 (put 'smallexample 'texinfo-format 'texinfo-format-example)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1724 (put 'smalllisp 'texinfo-format 'texinfo-format-example)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1725 (defun texinfo-format-example ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1726 (texinfo-push-stack 'example nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1727 (setq fill-column (- fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1728 (texinfo-discard-line))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1729
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1730 (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
1731 (put 'display 'texinfo-end 'texinfo-end-example)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1732 (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
1733 (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
1734 (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
1735 (put 'smalllisp 'texinfo-end 'texinfo-end-example)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1736 (defun texinfo-end-example ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1737 (setq fill-column (+ fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1738 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1739 (let ((stacktop
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1740 (texinfo-pop-stack 'example)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1741 (texinfo-do-itemize (nth 1 stacktop))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1742
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1743 (put 'exdent 'texinfo-format 'texinfo-format-exdent)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1744 (defun texinfo-format-exdent ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1745 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1746 (delete-region (point)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1747 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1748 (skip-chars-forward " ")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1749 (point)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1750 (insert ?\b)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1751 ;; Cancel out the deletion that texinfo-do-itemize
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1752 ;; is going to do at the end of this line.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1753 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1754 (end-of-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1755 (insert "\n ")))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1756
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1757
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1758 ;;; @cartouche
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1759
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1760 ; 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
1761 ; 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
1762
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1763 (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
1764 (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
1765
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1766
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1767 ;;; @flushleft and @format
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1768
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1769 ; 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
1770 ; 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
1771 ; `do-nothing' command
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1772
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1773 ; 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
1774 ; 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
1775
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1776 (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
1777 (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
1778 (defun texinfo-format-flushleft ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1779 (texinfo-discard-line))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1780
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1781 (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
1782 (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
1783 (defun texinfo-end-flushleft ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1784 (texinfo-discard-command))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1785
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1786
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1787 ;;; @flushright
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1788
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1789 ; 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
1790 ; 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
1791 ; removed so that visible text lines up on the right side.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1792
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1793 (put 'flushright 'texinfo-format 'texinfo-format-flushright)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1794 (defun texinfo-format-flushright ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1795 (texinfo-push-stack 'flushright nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1796 (texinfo-discard-line))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1797
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1798 (put 'flushright 'texinfo-end 'texinfo-end-flushright)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1799 (defun texinfo-end-flushright ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1800 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1801
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1802 (let ((stacktop
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1803 (texinfo-pop-stack 'flushright)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1804
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1805 (texinfo-do-flushright (nth 1 stacktop))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1806
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1807 (defun texinfo-do-flushright (from)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1808 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1809 (while (progn (forward-line -1)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1810 (>= (point) from))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1811
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1812 (beginning-of-line)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1813 (insert
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1814 (make-string
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1815 (- fill-column
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1816 (save-excursion
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1817 (end-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1818 (skip-chars-backward " \t")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1819 (delete-region (point) (progn (end-of-line) (point)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1820 (current-column)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1821 ? )))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1822
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1823
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1824 ;;; @ctrl, @TeX, @copyright, @minus, @dots
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1825
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1826 (put 'ctrl 'texinfo-format 'texinfo-format-ctrl)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1827 (defun texinfo-format-ctrl ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1828 (let ((str (texinfo-parse-arg-discard)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1829 (insert (logand 31 (aref str 0)))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1830
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1831 (put 'TeX 'texinfo-format 'texinfo-format-TeX)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1832 (defun texinfo-format-TeX ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1833 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1834 (insert "TeX"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1835
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1836 (put 'copyright 'texinfo-format 'texinfo-format-copyright)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1837 (defun texinfo-format-copyright ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1838 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1839 (insert "(C)"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1840
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1841 (put 'minus 'texinfo-format 'texinfo-format-minus)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1842 (defun texinfo-format-minus ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1843 "Insert a minus sign.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1844 If used within a line, follow `@minus' with braces."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1845 (texinfo-optional-braces-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1846 (insert "-"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1847
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1848 (put 'dots 'texinfo-format 'texinfo-format-dots)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1849 (defun texinfo-format-dots ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1850 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1851 (insert "..."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1852
9549
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1853 (put 'enddots 'texinfo-format 'texinfo-format-enddots)
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1854 (defun texinfo-format-enddots ()
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1855 (texinfo-parse-arg-discard)
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1856 (insert "...."))
1de7e5bc1ff1 (texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents: 9344
diff changeset
1857
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1858
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1859 ;;; Refilling and indenting: @refill, @paragraphindent, @noindent
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1860
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1861 ;;; 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
1862 ;;; @refill command.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1863
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1864 ; * 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
1865 ; the starts of paragraphs.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1866
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1867 ; * 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
1868
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1869 ; * 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
1870 ; number of spaces.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1871
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1872 ;;; 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
1873 ;;; 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
1874
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1875 (defvar texinfo-paragraph-indent "asis"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1876 "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
1877
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1878 (put 'paragraphindent 'texinfo-format 'texinfo-paragraphindent)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1879
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1880 (defun texinfo-paragraphindent ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1881 "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
1882 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
1883 (let ((arg (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1884 (if (string= "asis" arg)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1885 (setq texinfo-paragraph-indent "asis")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1886 (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
1887
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1888 (put 'refill 'texinfo-format 'texinfo-format-refill)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1889 (defun texinfo-format-refill ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1890 "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
1891 Default is to leave paragraph indentation as is."
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1892 (texinfo-discard-command)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1893 (forward-paragraph -1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1894 (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
1895 ;; 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
1896 ;; 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
1897 ;; Otherwise, indent
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1898 (cond
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1899 ;; 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
1900 ((save-excursion (forward-line -1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1901 (looking-at "^@noindent"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1902 (forward-line -1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1903 (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
1904 ;; do nothing if "asis"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1905 ((equal texinfo-paragraph-indent "asis"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1906 ;; do no indenting in list, etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1907 ((> texinfo-stack-depth 0))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1908 ;; otherwise delete existing whitespace and indent
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1909 (t
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1910 (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
1911 (insert (make-string texinfo-paragraph-indent ? ))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1912 (forward-paragraph 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1913 (forward-line -1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1914 (end-of-line)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1915 ;; 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
1916 ;; 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
1917 ;; 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
1918 (let* ((previous-paragraph-separate paragraph-separate)
6309
9217f29851c2 Don't use triple-hyphen in a character class.
Karl Heuer <kwzh@gnu.org>
parents: 5118
diff changeset
1919 (paragraph-separate (concat paragraph-separate "\\|^[-=*.]+"))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1920 (previous-paragraph-start paragraph-start)
6309
9217f29851c2 Don't use triple-hyphen in a character class.
Karl Heuer <kwzh@gnu.org>
parents: 5118
diff changeset
1921 (paragraph-start (concat paragraph-start "\\|^[-=*.]+")))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1922 (unwind-protect
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1923 (fill-paragraph nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1924 (setq paragraph-separate previous-paragraph-separate)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1925 (setq paragraph-start previous-paragraph-start))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1926
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1927 (put 'noindent 'texinfo-format 'texinfo-noindent)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1928 (defun texinfo-noindent ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1929 (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1930 (forward-paragraph 1)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1931 (if (search-backward "@refill"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1932 (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
1933 () ; 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
1934 ;; else
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1935 (texinfo-discard-line))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1936
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1937
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1938 ;;; Index generation
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1939
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1940 (put 'vindex 'texinfo-format 'texinfo-format-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1941 (defun texinfo-format-vindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1942 (texinfo-index 'texinfo-vindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1943
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1944 (put 'cindex 'texinfo-format 'texinfo-format-cindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1945 (defun texinfo-format-cindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1946 (texinfo-index 'texinfo-cindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1947
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1948 (put 'findex 'texinfo-format 'texinfo-format-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1949 (defun texinfo-format-findex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1950 (texinfo-index 'texinfo-findex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1951
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1952 (put 'pindex 'texinfo-format 'texinfo-format-pindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1953 (defun texinfo-format-pindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1954 (texinfo-index 'texinfo-pindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1955
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1956 (put 'tindex 'texinfo-format 'texinfo-format-tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1957 (defun texinfo-format-tindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1958 (texinfo-index 'texinfo-tindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1959
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1960 (put 'kindex 'texinfo-format 'texinfo-format-kindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1961 (defun texinfo-format-kindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1962 (texinfo-index 'texinfo-kindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1963
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1964 (defun texinfo-index (indexvar)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1965 (let ((arg (texinfo-parse-expanded-arg)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1966 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1967 (set indexvar
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1968 (cons (list arg
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1969 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1970 ;; 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
1971 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1972 (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
1973 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
1974 (symbol-value indexvar)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1975
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1976 (defconst texinfo-indexvar-alist
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1977 '(("cp" . texinfo-cindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1978 ("fn" . texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1979 ("vr" . texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1980 ("tp" . texinfo-tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1981 ("pg" . texinfo-pindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1982 ("ky" . texinfo-kindex)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1983
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1984
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1985 ;;; @defindex @defcodeindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1986 (put 'defindex 'texinfo-format 'texinfo-format-defindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1987 (put 'defcodeindex 'texinfo-format 'texinfo-format-defindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1988
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1989 (defun texinfo-format-defindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1990 (let* ((index-name (texinfo-parse-arg-discard)) ; eg: `aa'
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1991 (indexing-command (intern (concat index-name "index")))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1992 (index-formatting-command ; eg: `texinfo-format-aaindex'
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1993 (intern (concat "texinfo-format-" index-name "index")))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1994 (index-alist-name ; eg: `texinfo-aaindex'
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1995 (intern (concat "texinfo-" index-name "index"))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1996
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1997 (set index-alist-name nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1998
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
1999 (put indexing-command ; eg, aaindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2000 'texinfo-format
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2001 index-formatting-command) ; eg, texinfo-format-aaindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2002
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2003 ;; eg: "aa" . texinfo-aaindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2004 (or (assoc index-name texinfo-indexvar-alist)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2005 (setq texinfo-indexvar-alist
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2006 (cons
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2007 (cons index-name
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2008 index-alist-name)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2009 texinfo-indexvar-alist)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2010
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2011 (fset index-formatting-command
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2012 (list 'lambda 'nil
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2013 (list 'texinfo-index
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2014 (list 'quote index-alist-name))))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2015
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2016
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2017 ;;; @synindex @syncodeindex
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2018
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2019 (put 'synindex 'texinfo-format 'texinfo-format-synindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2020 (put 'syncodeindex 'texinfo-format 'texinfo-format-synindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2021
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2022 (defun texinfo-format-synindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2023 (let* ((args (texinfo-parse-arg-discard))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2024 (second (cdr (read-from-string args)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2025 (joiner (symbol-name (car (read-from-string args))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2026 (joined (symbol-name (car (read-from-string args second)))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2027
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2028 (if (assoc joiner texinfo-short-index-cmds-alist)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2029 (put
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2030 (cdr (assoc joiner texinfo-short-index-cmds-alist))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2031 'texinfo-format
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2032 (or (cdr (assoc joined texinfo-short-index-format-cmds-alist))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2033 (intern (concat "texinfo-format-" joined "index"))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2034 (put
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2035 (intern (concat joiner "index"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2036 'texinfo-format
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2037 (or (cdr(assoc joined texinfo-short-index-format-cmds-alist))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2038 (intern (concat "texinfo-format-" joined "index")))))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2039
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2040 (defconst texinfo-short-index-cmds-alist
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2041 '(("cp" . cindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2042 ("fn" . findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2043 ("vr" . vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2044 ("tp" . tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2045 ("pg" . pindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2046 ("ky" . kindex)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2047
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2048 (defconst texinfo-short-index-format-cmds-alist
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2049 '(("cp" . texinfo-format-cindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2050 ("fn" . texinfo-format-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2051 ("vr" . texinfo-format-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2052 ("tp" . texinfo-format-tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2053 ("pg" . texinfo-format-pindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2054 ("ky" . texinfo-format-kindex)))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2055
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2056
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2057 ;;; Sort and index (for VMS)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2058
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2059 ;; 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
2060 ;; 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
2061 (defun texinfo-sort-region (start end)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2062 (require 'sort)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2063 (save-restriction
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2064 (narrow-to-region start end)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2065 (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
2066
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2067 ;; Subroutine for sorting an index.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2068 ;; 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
2069 (defun texinfo-sort-startkeyfun ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2070 (let ((line
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2071 (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
2072 ;; Canonicalize whitespace and eliminate funny chars.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2073 (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
2074 (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
2075 " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2076 (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
2077 line))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2078
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2079
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2080 ;;; @printindex
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 'printindex 'texinfo-format 'texinfo-format-printindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2083
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2084 (defun texinfo-format-printindex ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2085 (let ((indexelts (symbol-value
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2086 (cdr (assoc (texinfo-parse-arg-discard)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2087 texinfo-indexvar-alist))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2088 opoint)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2089 (insert "\n* Menu:\n\n")
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2090 (setq opoint (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2091 (texinfo-print-index nil indexelts)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2092
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2093 (if (eq system-type 'vax-vms)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2094 (texinfo-sort-region opoint (point))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2095 (shell-command-on-region opoint (point) "sort -fd" 1))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2096
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2097 (defun texinfo-print-index (file indexelts)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2098 (while indexelts
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2099 (if (stringp (car (car indexelts)))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2100 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2101 (insert "* " (car (car indexelts)) ": " )
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2102 (indent-to 32)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2103 (insert
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2104 (if file (concat "(" file ")") "")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2105 (nth 1 (car indexelts)) ".")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2106 (indent-to 54)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2107 (insert
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2108 (if (nth 2 (car indexelts))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2109 (format " %d." (nth 2 (car indexelts)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2110 "")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2111 "\n"))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2112 ;; index entries from @include'd file
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2113 (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
2114 (nth 2 (car indexelts))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2115 (setq indexelts (cdr indexelts))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2116
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2117
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2118 ;;; Glyphs: @equiv, @error, etc
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2119
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2120 ;; @equiv to show that two expressions are equivalent
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2121 ;; @error to show an error message
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2122 ;; @expansion to show what a macro expands to
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2123 ;; @point to show the location of point in an example
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2124 ;; @print to show what an evaluated expression prints
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2125 ;; @result to indicate the value returned by an expression
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2126
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2127 (put 'equiv 'texinfo-format 'texinfo-format-equiv)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2128 (defun texinfo-format-equiv ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2129 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2130 (insert "=="))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2131
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2132 (put 'error 'texinfo-format 'texinfo-format-error)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2133 (defun texinfo-format-error ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2134 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2135 (insert "error-->"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2136
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2137 (put 'expansion 'texinfo-format 'texinfo-format-expansion)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2138 (defun texinfo-format-expansion ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2139 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2140 (insert "==>"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2141
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2142 (put 'point 'texinfo-format 'texinfo-format-point)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2143 (defun texinfo-format-point ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2144 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2145 (insert "-!-"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2146
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2147 (put 'print 'texinfo-format 'texinfo-format-print)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2148 (defun texinfo-format-print ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2149 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2150 (insert "-|"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2151
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2152 (put 'result 'texinfo-format 'texinfo-format-result)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2153 (defun texinfo-format-result ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2154 (texinfo-parse-arg-discard)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2155 (insert "=>"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2156
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2157
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2158 ;;; Definition formatting: @deffn, @defun, etc
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2159
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2160 ;; What definition formatting produces:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2161 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2162 ;; @deffn category name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2163 ;; In Info, `Category: name ARGS'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2164 ;; In index: name: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2165 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2166 ;; @defvr category name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2167 ;; In Info, `Category: name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2168 ;; In index: name: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2169 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2170 ;; @deftp category name attributes...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2171 ;; `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
2172 ;; In index: name: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2173 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2174 ;; 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
2175 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2176 ;; @defun, @defmac, @defspec, @defvar, @defopt
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2177 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2178 ;; @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
2179 ;; @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
2180 ;; @defvar name In Info, `Variable: name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2181 ;; etc.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2182 ;; In index: name: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2183 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2184 ;; 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
2185 ;; @deftypefn category data-type name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2186 ;; 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
2187 ;; @deftypevr category data-type name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2188 ;; In Info, `Category: data-type name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2189 ;; In index: name: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2190 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2191 ;; 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
2192 ;; @deftypefun data-type name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2193 ;; 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
2194 ;; In index: name: node. line#.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2195 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2196 ;; @deftypevar data-type name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2197 ;; In Info, `Variable: data-type name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2198 ;; 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
2199 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2200 ;; Generalized object oriented entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2201 ;; @defop category class name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2202 ;; 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
2203 ;; 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
2204 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2205 ;; @defcv category class name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2206 ;; In Info, `Category of class: name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2207 ;; 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
2208 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2209 ;; Specialized object oriented entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2210 ;; @defmethod class name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2211 ;; 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
2212 ;; 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
2213 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2214 ;; @defivar class name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2215 ;; 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
2216 ;; 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
2217
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2218
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2219 ;;; The definition formatting functions
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2220
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2221 (defun texinfo-format-defun ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2222 (texinfo-push-stack 'defun nil)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2223 (setq fill-column (- fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2224 (texinfo-format-defun-1 t))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2225
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2226 (defun texinfo-end-defun ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2227 (setq fill-column (+ fill-column 5))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2228 (texinfo-discard-command)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2229 (let ((start (nth 1 (texinfo-pop-stack 'defun))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2230 (texinfo-do-itemize start)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2231 ;; Delete extra newline inserted after header.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2232 (save-excursion
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2233 (goto-char start)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2234 (delete-char -1))))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2235
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2236 (defun texinfo-format-defunx ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2237 (texinfo-format-defun-1 nil))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2238
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2239 (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
2240 (let ((parse-args (texinfo-format-parse-defun-args))
4868
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
2241 (texinfo-defun-type (get texinfo-command-name 'texinfo-defun-type)))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2242 (texinfo-discard-command)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2243 ;; 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
2244 (if (not first-p)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2245 (delete-char -1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2246 (funcall
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2247 (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
2248 ;; 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
2249 ;; with header line.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2250 (insert "\n\n")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2251 (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
2252 (funcall
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2253 (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
2254
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2255 ;;; 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
2256
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2257 ;; @deffn, @defvr, @deftp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2258 (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
2259 (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
2260 (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
2261 (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
2262 (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
2263 (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
2264 (defun texinfo-format-deffn (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2265 ;; 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
2266 ;; @deffn category name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2267 ;; In Info, `Category: name ARGS'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2268 ;; @deftp category name attributes...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2269 ;; `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
2270 (let ((category (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2271 (name (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2272 (args (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2273 (insert " -- " category ": " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2274 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2275 (insert " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2276 (if (or (= ?& (aref (car args) 0))
4868
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
2277 (eq (eval (car texinfo-defun-type)) 'deftp-type))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2278 (car args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2279 (upcase (car args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2280 (setq args (cdr args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2281
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2282 ;; @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
2283 (put 'defun 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2284 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2285 (put 'defunx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2286 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2287 (put 'defmac 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2288 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2289 (put 'defmacx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2290 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2291 (put 'defspec 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2292 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2293 (put 'defspecx '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-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2295 (put 'defvar 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2296 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2297 (put 'defvarx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2298 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2299 (put 'defopt 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2300 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2301 (put 'defoptx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2302 'texinfo-format-specialized-defun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2303 (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
2304 ;; 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
2305 ;; @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
2306 ;; @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
2307 ;; @defvar name In Info, `Variable: Name'
4868
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
2308 ;; Use cdr of texinfo-defun-type to determine category:
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
2309 (let ((category (car (cdr texinfo-defun-type)))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2310 (name (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2311 (args (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2312 (insert " -- " category ": " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2313 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2314 (insert " "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2315 (if (= ?& (aref (car args) 0))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2316 (car args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2317 (upcase (car args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2318 (setq args (cdr args)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2319
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2320 ;; @deftypefn, @deftypevr: Generalized typed
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2321 (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
2322 (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
2323 (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
2324 (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
2325 (defun texinfo-format-deftypefn (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2326 ;; 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
2327 ;; @deftypefn category data-type name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2328 ;; 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
2329 ;; @deftypevr category data-type name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2330 ;; In Info, `Category: data-type name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2331 ;; 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
2332 (let ((category (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2333 (data-type (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2334 (name (car (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2335 (args (cdr (cdr (cdr parsed-args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2336 (insert " -- " category ": " data-type " " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2337 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2338 (insert " " (car args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2339 (setq args (cdr args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2340
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2341 ;; @deftypefun, @deftypevar: Specialized typed
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2342 (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
2343 (put 'deftypefunx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2344 'texinfo-format-deftypefun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2345 (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
2346 (put 'deftypevarx 'texinfo-deffn-formatting-property
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2347 'texinfo-format-deftypefun)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2348 (defun texinfo-format-deftypefun (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2349 ;; 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
2350 ;; @deftypefun data-type name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2351 ;; 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
2352 ;; @deftypevar data-type name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2353 ;; In Info, `Variable: data-type name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2354 ;; Note: args in lower case, unless modified in command line.
4868
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
2355 ;; Use cdr of texinfo-defun-type to determine category:
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
2356 (let ((category (car (cdr texinfo-defun-type)))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2357 (data-type (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2358 (name (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2359 (args (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2360 (insert " -- " category ": " data-type " " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2361 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2362 (insert " " (car args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2363 (setq args (cdr args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2364
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2365 ;; @defop: Generalized object-oriented
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2366 (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
2367 (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
2368 (defun texinfo-format-defop (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2369 ;; Generalized object oriented entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2370 ;; @defop category class name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2371 ;; 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
2372 ;; 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
2373 (let ((category (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2374 (class (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2375 (name (car (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2376 (args (cdr (cdr (cdr parsed-args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2377 (insert " -- " category " on " class ": " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2378 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2379 (insert " " (upcase (car args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2380 (setq args (cdr args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2381
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2382 ;; @defcv: Generalized object-oriented
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2383 (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
2384 (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
2385 (defun texinfo-format-defcv (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2386 ;; Generalized object oriented entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2387 ;; @defcv category class name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2388 ;; In Info, `Category of class: name'
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2389 ;; 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
2390 (let ((category (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2391 (class (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2392 (name (car (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2393 (args (cdr (cdr (cdr parsed-args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2394 (insert " -- " category " of " class ": " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2395 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2396 (insert " " (upcase (car args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2397 (setq args (cdr args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2398
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2399 ;; @defmethod: Specialized object-oriented
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2400 (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
2401 (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
2402 (defun texinfo-format-defmethod (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2403 ;; Specialized object oriented entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2404 ;; @defmethod class name args...
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2405 ;; 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
2406 ;; Note: args in upper case; use of `on'
4868
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
2407 ;; Use cdr of texinfo-defun-type to determine category:
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
2408 (let ((category (car (cdr texinfo-defun-type)))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2409 (class (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2410 (name (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2411 (args (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2412 (insert " -- " category " on " class ": " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2413 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2414 (insert " " (upcase (car args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2415 (setq args (cdr args)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2416
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2417 ;; @defivar: Specialized object-oriented
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2418 (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
2419 (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
2420 (defun texinfo-format-defivar (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2421 ;; Specialized object oriented entity:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2422 ;; @defivar class name
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2423 ;; 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
2424 ;; Note: args in upper case; use of `of'
4868
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
2425 ;; Use cdr of texinfo-defun-type to determine category:
6de32c7b6045 (texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents: 4769
diff changeset
2426 (let ((category (car (cdr texinfo-defun-type)))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2427 (class (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2428 (name (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2429 (args (cdr (cdr parsed-args))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2430 (insert " -- " category " of " class ": " name)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2431 (while args
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2432 (insert " " (upcase (car args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2433 (setq args (cdr args)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2434
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2435
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2436 ;;; Indexing for definitions
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2437
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2438 ;; 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
2439 ;; 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
2440 ;; formatted differently:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2441 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2442 ;; @defun,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2443 ;; @defmac,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2444 ;; @defspec,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2445 ;; @defvar,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2446 ;; @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
2447 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2448 ;; @deffn,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2449 ;; @defvr,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2450 ;; @deftp
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2451 ;; @deftypefun
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2452 ;; @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
2453 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2454 ;; @deftypefn,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2455 ;; @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
2456 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2457 ;; @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
2458 ;; formatted: NAME on CLASS
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2459
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2460 ;; @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
2461 ;; formatted: NAME on CLASS
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2462 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2463 ;; @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
2464 ;; formatted: NAME of CLASS
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2465 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2466 ;; @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
2467 ;; formatted: NAME of CLASS
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2468
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2469 (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
2470 (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
2471 (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
2472 (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
2473 (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
2474 (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
2475 (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
2476 (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
2477 (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
2478 (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
2479 (defun texinfo-index-defun (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2480 ;; 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
2481 ;; `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
2482 (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
2483 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2484 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2485 ;; 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
2486 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2487 (car parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2488 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2489 ;; 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
2490 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2491 (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
2492 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2493 (symbol-value index-list)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2494
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2495 (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
2496 (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
2497 (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
2498 (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
2499 (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
2500 (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
2501 (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
2502 (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
2503 (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
2504 (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
2505 (defun texinfo-index-deffn (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2506 ;; 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
2507 ;; `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
2508 (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
2509 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2510 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2511 ;; 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
2512 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2513 (car (cdr parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2514 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2515 ;; 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
2516 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2517 (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
2518 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2519 (symbol-value index-list)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2520
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2521 (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
2522 (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
2523 (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
2524 (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
2525 (defun texinfo-index-deftypefn (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2526 ;; 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
2527 ;; `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
2528 (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
2529 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2530 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2531 ;; 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
2532 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2533 (car (cdr (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2534 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2535 ;; 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
2536 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2537 (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
2538 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2539 (symbol-value index-list)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2540
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2541 (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
2542 (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
2543 (defun texinfo-index-defmethod (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2544 ;; 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
2545 ;; `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
2546 (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
2547 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2548 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2549 ;; 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
2550 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2551 (format "%s on %s"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2552 (car (cdr parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2553 (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2554 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2555 ;; 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
2556 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2557 (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
2558 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2559 (symbol-value index-list)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2560
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2561 (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
2562 (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
2563 (defun texinfo-index-defop (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2564 ;; 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
2565 ;; `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
2566 (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
2567 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2568 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2569 ;; 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
2570 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2571 (format "%s on %s"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2572 (car (cdr (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2573 (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2574 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2575 ;; 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
2576 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2577 (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
2578 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2579 (symbol-value index-list)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2580
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2581 (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
2582 (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
2583 (defun texinfo-index-defivar (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2584 ;; 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
2585 ;; `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
2586 (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
2587 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2588 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2589 ;; 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
2590 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2591 (format "%s of %s"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2592 (car (cdr parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2593 (car parsed-args))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2594 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2595 ;; 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
2596 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2597 (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
2598 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2599 (symbol-value index-list)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2600
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2601 (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
2602 (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
2603 (defun texinfo-index-defcv (parsed-args)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2604 ;; 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
2605 ;; `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
2606 (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
2607 (set index-list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2608 (cons
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2609 ;; 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
2610 (list
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2611 (format "%s of %s"
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2612 (car (cdr (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2613 (car (cdr parsed-args)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2614 texinfo-last-node
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2615 ;; 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
2616 (if texinfo-last-node-pos
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2617 (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
2618 1))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2619 (symbol-value index-list)))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2620
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2621
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2622 ;;; Properties for definitions
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2623
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2624 ;; Each definition command has six properties:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2625 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2626 ;; 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
2627 ;; 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
2628 ;; 3. texinfo-format formatting command
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2629 ;; 4. texinfo-end end formatting command
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2630 ;; 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
2631 ;; 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
2632 ;;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2633 ;; 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
2634 ;; and subsequent header lines.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2635
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2636 ;; 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
2637 ;; are listed just before the appropriate formatting and indexing commands.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2638
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2639 (put 'deffn 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2640 (put 'deffnx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2641 (put 'deffn 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2642 (put 'deffn 'texinfo-defun-type '('deffn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2643 (put 'deffnx 'texinfo-defun-type '('deffn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2644 (put 'deffn 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2645 (put 'deffnx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2646
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2647 (put 'defun 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2648 (put 'defunx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2649 (put 'defun 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2650 (put 'defun 'texinfo-defun-type '('defun-type "Function"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2651 (put 'defunx 'texinfo-defun-type '('defun-type "Function"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2652 (put 'defun 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2653 (put 'defunx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2654
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2655 (put 'defmac 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2656 (put 'defmacx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2657 (put 'defmac 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2658 (put 'defmac 'texinfo-defun-type '('defun-type "Macro"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2659 (put 'defmacx 'texinfo-defun-type '('defun-type "Macro"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2660 (put 'defmac 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2661 (put 'defmacx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2662
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2663 (put 'defspec 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2664 (put 'defspecx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2665 (put 'defspec 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2666 (put 'defspec 'texinfo-defun-type '('defun-type "Special form"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2667 (put 'defspecx 'texinfo-defun-type '('defun-type "Special form"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2668 (put 'defspec 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2669 (put 'defspecx 'texinfo-defun-index 'texinfo-findex)
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 'defvr 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2672 (put 'defvrx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2673 (put 'defvr 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2674 (put 'defvr 'texinfo-defun-type '('deffn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2675 (put 'defvrx 'texinfo-defun-type '('deffn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2676 (put 'defvr 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2677 (put 'defvrx 'texinfo-defun-index 'texinfo-vindex)
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 'defvar 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2680 (put 'defvarx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2681 (put 'defvar 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2682 (put 'defvar 'texinfo-defun-type '('defun-type "Variable"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2683 (put 'defvarx 'texinfo-defun-type '('defun-type "Variable"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2684 (put 'defvar 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2685 (put 'defvarx 'texinfo-defun-index 'texinfo-vindex)
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 'defconst 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2688 (put 'defconstx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2689 (put 'defconst 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2690 (put 'defconst 'texinfo-defun-type '('defun-type "Constant"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2691 (put 'defconstx 'texinfo-defun-type '('defun-type "Constant"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2692 (put 'defconst 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2693 (put 'defconstx '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 'defcmd 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2696 (put 'defcmdx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2697 (put 'defcmd 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2698 (put 'defcmd 'texinfo-defun-type '('defun-type "Command"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2699 (put 'defcmdx 'texinfo-defun-type '('defun-type "Command"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2700 (put 'defcmd 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2701 (put 'defcmdx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2702
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2703 (put 'defopt 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2704 (put 'defoptx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2705 (put 'defopt 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2706 (put 'defopt 'texinfo-defun-type '('defun-type "User Option"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2707 (put 'defoptx 'texinfo-defun-type '('defun-type "User Option"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2708 (put 'defopt 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2709 (put 'defoptx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2710
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2711 (put 'deftp 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2712 (put 'deftpx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2713 (put 'deftp 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2714 (put 'deftp 'texinfo-defun-type '('deftp-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2715 (put 'deftpx 'texinfo-defun-type '('deftp-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2716 (put 'deftp 'texinfo-defun-index 'texinfo-tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2717 (put 'deftpx 'texinfo-defun-index 'texinfo-tindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2718
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2719 ;;; Object-oriented stuff is a little hairier.
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 'defop 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2722 (put 'defopx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2723 (put 'defop 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2724 (put 'defop 'texinfo-defun-type '('defop-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2725 (put 'defopx 'texinfo-defun-type '('defop-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2726 (put 'defop 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2727 (put 'defopx 'texinfo-defun-index 'texinfo-findex)
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 'defmethod 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2730 (put 'defmethodx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2731 (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
2732 (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
2733 (put 'defmethodx 'texinfo-defun-type '('defmethod-type "Method"))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2734 (put 'defmethod 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2735 (put 'defmethodx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2736
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2737 (put 'defcv 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2738 (put 'defcvx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2739 (put 'defcv 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2740 (put 'defcv 'texinfo-defun-type '('defop-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2741 (put 'defcvx 'texinfo-defun-type '('defop-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2742 (put 'defcv 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2743 (put 'defcvx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2744
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2745 (put 'defivar 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2746 (put 'defivarx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2747 (put 'defivar 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2748 (put 'defivar 'texinfo-defun-type '('defmethod-type "Instance variable"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2749 (put 'defivarx 'texinfo-defun-type '('defmethod-type "Instance variable"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2750 (put 'defivar 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2751 (put 'defivarx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2752
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2753 ;;; Typed functions and variables
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2754
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2755 (put 'deftypefn 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2756 (put 'deftypefnx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2757 (put 'deftypefn 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2758 (put 'deftypefn 'texinfo-defun-type '('deftypefn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2759 (put 'deftypefnx 'texinfo-defun-type '('deftypefn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2760 (put 'deftypefn 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2761 (put 'deftypefnx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2762
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2763 (put 'deftypefun 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2764 (put 'deftypefunx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2765 (put 'deftypefun 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2766 (put 'deftypefun 'texinfo-defun-type '('deftypefun-type "Function"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2767 (put 'deftypefunx 'texinfo-defun-type '('deftypefun-type "Function"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2768 (put 'deftypefun 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2769 (put 'deftypefunx 'texinfo-defun-index 'texinfo-findex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2770
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2771 (put 'deftypevr 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2772 (put 'deftypevrx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2773 (put 'deftypevr 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2774 (put 'deftypevr 'texinfo-defun-type '('deftypefn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2775 (put 'deftypevrx 'texinfo-defun-type '('deftypefn-type nil))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2776 (put 'deftypevr 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2777 (put 'deftypevrx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2778
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2779 (put 'deftypevar 'texinfo-format 'texinfo-format-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2780 (put 'deftypevarx 'texinfo-format 'texinfo-format-defunx)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2781 (put 'deftypevar 'texinfo-end 'texinfo-end-defun)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2782 (put 'deftypevar 'texinfo-defun-type '('deftypevar-type "Variable"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2783 (put 'deftypevarx 'texinfo-defun-type '('deftypevar-type "Variable"))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2784 (put 'deftypevar 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2785 (put 'deftypevarx 'texinfo-defun-index 'texinfo-vindex)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2786
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2787
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2788 ;;; @set, @clear, @ifset, @ifclear
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2789
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2790 ;; 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
2791 ;; 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
2792 ;; @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
2793
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2794 ;; 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
2795 ;; 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
2796 ;; @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
2797 ;; is the opposite of @ifset.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2798
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2799 ;; 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
2800 ;; replace @value{FLAG} with the string.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2801 ;; 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
2802 ;; @value{FLAG} is invalid,
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2803 ;; 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
2804
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2805 (put 'clear 'texinfo-format 'texinfo-clear)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2806 (defun texinfo-clear ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2807 "Clear the value of the flag."
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2808 (let* ((arg (texinfo-parse-arg-discard))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2809 (flag (car (read-from-string arg)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2810 (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
2811 (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
2812 (put flag 'texinfo-set-value "")))
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 'set 'texinfo-format 'texinfo-set)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2815 (defun texinfo-set ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2816 "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
2817 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
2818 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
2819 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
2820 (let* ((arg (texinfo-parse-arg-discard))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2821 (flag (car (read-from-string arg)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2822 (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
2823 (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
2824 (put flag 'texinfo-set-value value)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2825
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2826 (put 'value 'texinfo-format 'texinfo-value)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2827 (defun texinfo-value ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2828 "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
2829 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
2830 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
2831 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
2832 (let ((arg (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2833 (cond ((and
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2834 (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
2835 'flag-set)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2836 (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
2837 (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
2838 ((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
2839 'flag-cleared)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2840 (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
2841 ((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
2842 (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
2843
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2844 (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
2845 (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
2846 (defun texinfo-if-set ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2847 "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
2848 (let ((arg (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2849 (cond
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2850 ((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
2851 'flag-set)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2852 ;; 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
2853 ())
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2854 ((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
2855 'flag-cleared)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2856 ;; 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
2857 (delete-region texinfo-command-start
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2858 (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
2859 (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2860 ((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
2861 nil)
5118
eec34ce70181 (texinfo-if-set, texinfo-if-clear): Act appropriately when flat neither
Robert J. Chassell <bob@rattlesnake.com>
parents: 4982
diff changeset
2862 ;; In this case flag is neither set nor cleared.
eec34ce70181 (texinfo-if-set, texinfo-if-clear): Act appropriately when flat neither
Robert J. Chassell <bob@rattlesnake.com>
parents: 4982
diff changeset
2863 ;; Act as if set, i.e. do nothing.
eec34ce70181 (texinfo-if-set, texinfo-if-clear): Act appropriately when flat neither
Robert J. Chassell <bob@rattlesnake.com>
parents: 4982
diff changeset
2864 ()))))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2865
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2866 (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
2867 (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
2868 (defun texinfo-if-clear ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2869 "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
2870 (let ((arg (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2871 (cond
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2872 ((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
2873 'flag-set)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2874 ;; 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
2875 (delete-region texinfo-command-start
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2876 (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
2877 (point))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2878 ((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
2879 'flag-cleared)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2880 ;; 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
2881 ())
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2882 ((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
2883 nil)
5118
eec34ce70181 (texinfo-if-set, texinfo-if-clear): Act appropriately when flat neither
Robert J. Chassell <bob@rattlesnake.com>
parents: 4982
diff changeset
2884 ;; In this case flag is neither set nor cleared.
eec34ce70181 (texinfo-if-set, texinfo-if-clear): Act appropriately when flat neither
Robert J. Chassell <bob@rattlesnake.com>
parents: 4982
diff changeset
2885 ;; Act as if clear, i.e. do nothing.
eec34ce70181 (texinfo-if-set, texinfo-if-clear): Act appropriately when flat neither
Robert J. Chassell <bob@rattlesnake.com>
parents: 4982
diff changeset
2886 ()))))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2887
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2888
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2889 ;;; Process included files: `@include' command
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2890
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2891 ;; Updated 19 October 1990
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2892 ;; In the original version, include files were ignored by Info but
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2893 ;; incorporated in to the printed manual. To make references to the
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2894 ;; 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
2895 ;; files using the `(filename)nodename' format for refering to other
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2896 ;; Info files. Also, the included files had to be formatted on their
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2897 ;; own. It was just like they were another file.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2898
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2899 ;; Currently, include files are inserted into the buffer that is
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2900 ;; formatted for Info. If large, the resulting info file is split and
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2901 ;; tagified. For current include files to work, the master menu must
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2902 ;; refer to all the nodes, and the highest level nodes in the include
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2903 ;; files must have the correct next, prev, and up pointers.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2904
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2905 ;; 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
2906 ;; but not an `\input texinfo' line.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2907
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2908 ;; Updated 24 March 1993
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2909 ;; 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
2910 ;; 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
2911 ;; 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
2912 ;; is treated like other @-commands.
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2913 (put 'include 'texinfo-format 'texinfo-format-noop)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2914
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2915 ; Original definition:
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2916 ; (defun texinfo-format-include ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2917 ; (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
2918 ; (default-directory input-directory)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2919 ; subindex)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2920 ; (setq subindex
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2921 ; (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2922 ; (progn (find-file
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2923 ; (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
2924 ; (concat filename ".texinfo"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2925 ; ((file-readable-p (concat filename ".texi"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2926 ; (concat filename ".texi"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2927 ; ((file-readable-p (concat filename ".tex"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2928 ; (concat filename ".tex"))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2929 ; ((file-readable-p filename)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2930 ; filename)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2931 ; (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
2932 ; filename))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2933 ; (texinfo-format-buffer-1))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2934 ; (texinfo-subindex 'texinfo-vindex (car subindex) (nth 1 subindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2935 ; (texinfo-subindex 'texinfo-findex (car subindex) (nth 2 subindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2936 ; (texinfo-subindex 'texinfo-cindex (car subindex) (nth 3 subindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2937 ; (texinfo-subindex 'texinfo-pindex (car subindex) (nth 4 subindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2938 ; (texinfo-subindex 'texinfo-tindex (car subindex) (nth 5 subindex))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2939 ; (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
2940 ;
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2941 ;(defun texinfo-subindex (indexvar file content)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2942 ; (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
2943 ; (symbol-value indexvar))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2944
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2945 ; Second definition:
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2946 ; (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
2947 ; (defun texinfo-format-include ()
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2948 ; (let ((filename (concat input-directory
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2949 ; (texinfo-parse-arg-discard)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2950 ; (default-directory input-directory))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2951 ; (message "Reading: %s" filename)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2952 ; (save-excursion
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2953 ; (save-restriction
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2954 ; (narrow-to-region
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2955 ; (point)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2956 ; (+ (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
2957 ; (goto-char (point-min))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2958 ; (texinfo-append-refill)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2959 ; (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
2960 ; (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
2961 ; ))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2962
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2963
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2964 ;;; Numerous commands do nothing in Texinfo
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2965
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2966 ;; 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
2967
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2968 (put 'bye 'texinfo-format 'texinfo-discard-line)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2969 (put 'c 'texinfo-format 'texinfo-discard-line-with-args)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2970 (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
2971 (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
2972 (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
2973 (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
2974 (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
2975 (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
2976 (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
2977 (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
2978 (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
2979 (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
2980 (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
2981 (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
2982 (put 'parindent 'texinfo-format 'texinfo-discard-line-with-args)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2983 (put 'setchapternewpage 'texinfo-format 'texinfo-discard-line-with-args)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2984 (put 'setq 'texinfo-format 'texinfo-discard-line-with-args)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2985 (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
2986 (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
2987 (put 'shortcontents 'texinfo-format 'texinfo-discard-line-with-args)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2988 (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
2989 (put 'summarycontents 'texinfo-format 'texinfo-discard-line-with-args)
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2990
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2991
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2992 ;;; Some commands cannot be handled
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2993
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2994 (defun texinfo-unsupported ()
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2995 (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
2996 (buffer-substring texinfo-command-start texinfo-command-end)))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
2997
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2998 ;;; Batch formatting
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
2999
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3000 (defun batch-texinfo-format ()
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3001 "Runs texinfo-format-buffer on the files remaining on the command line.
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3002 Must be used only with -batch, and kills emacs on completion.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3003 Each file will be processed even if an error occurred previously.
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3004 For example, invoke
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3005 \"emacs -batch -funcall batch-texinfo-format $docs/ ~/*.texinfo\"."
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3006 (if (not noninteractive)
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3007 (error "batch-texinfo-format may only be used -batch."))
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3008 (let ((version-control t)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3009 (auto-save-default nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3010 (find-file-run-dired nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3011 (kept-old-versions 259259)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3012 (kept-new-versions 259259))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3013 (let ((error 0)
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3014 file
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3015 (files ()))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3016 (while command-line-args-left
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3017 (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
3018 (cond ((not (file-exists-p file))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3019 (message ">> %s does not exist!" file)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3020 (setq error 1
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3021 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
3022 ((file-directory-p file)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3023 (setq command-line-args-left
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3024 (nconc (directory-files file)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3025 (cdr command-line-args-left))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3026 (t
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3027 (setq files (cons file files)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3028 command-line-args-left (cdr command-line-args-left)))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3029 (while files
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3030 (setq file (car files)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3031 files (cdr files))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3032 (condition-case err
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3033 (progn
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3034 (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
3035 (find-file file)
4769
d1b5ca8f5493 (texinfo-format-region texinfo-format-buffer): Add ###autoload cookies.
Brian Fox <bfox@gnu.org>
parents: 4396
diff changeset
3036 (buffer-disable-undo (current-buffer))
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3037 (set-buffer-modified-p nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3038 (texinfo-mode)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3039 (message "texinfo formatting %s..." file)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3040 (texinfo-format-buffer nil)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3041 (if (buffer-modified-p)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3042 (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
3043 (save-buffer))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3044 (error
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3045 (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
3046 (message ">> point at")
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3047 (let ((s (buffer-substring (point)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3048 (min (+ (point) 100)
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3049 (point-max))))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3050 (tem 0))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3051 (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
3052 (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
3053 "\n>> "
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3054 (substring s (match-end 0)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3055 tem (1+ tem)))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3056 (message ">> %s" s))
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3057 (setq error 1))))
189
70bc47d3c6c9 Initial revision
Brian Preble <rassilon@gnu.org>
parents:
diff changeset
3058 (kill-emacs error))))
657
fec3f9a1e3e5 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 258
diff changeset
3059
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3060
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3061 ;;; Place `provide' at end of file.
3456
57089987a2de Provide texinfmt.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
3062 (provide 'texinfmt)
57089987a2de Provide texinfmt.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
3063
4396
0ab53cbfac0e Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents: 3591
diff changeset
3064 ;;; texinfmt.el ends here.