Mercurial > emacs
annotate lisp/textmodes/texinfmt.el @ 23711:7beb8675e914
Fix previous change:
(fortran-end-prog-re1): Changed.
(fortran-check-end-prog-re): New function.
(beginning-of-fortran-subprogram, end-of-fortran-subprogram): Use
it.
author | Dave Love <fx@gnu.org> |
---|---|
date | Sun, 15 Nov 1998 15:50:30 +0000 |
parents | ac6928a654e1 |
children | 96aef9174003 |
rev | line source |
---|---|
13337 | 1 ;;; texinfmt.el --- format Texinfo files into Info files. |
2 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3 ;; Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4 ;; 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. |
841 | 5 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
6 ;; Maintainer: Robert J. Chassell <bug-texinfo@prep.ai.mit.edu> |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
7 ;; Keywords: maint, tex, docs |
189 | 8 |
13337 | 9 ;; This file is part of GNU Emacs. |
189 | 10 |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; 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
|
13 ;; the Free Software Foundation; either version 2, or (at your option) |
189 | 14 ;; any later version. |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
14169 | 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
189 | 25 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
26 ;;; Code: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
27 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
28 ;;; 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
|
29 |
19630
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
30 (or (fboundp 'defgroup) |
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
31 (defmacro defgroup (&rest ignore) nil)) |
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
32 |
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
33 (or (fboundp 'defcustom) |
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
34 (defmacro defcustom (var value doc &rest ignore) |
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
35 `(defvar ,var ,value ,doc))) |
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
36 |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
37 (defvar texinfmt-version "2.38 of 3 July 1998") |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
38 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
39 (defun texinfmt-version (&optional here) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
40 "Show the version of texinfmt.el in the minibuffer. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
41 If optional argument HERE is non-nil, insert info at point." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
42 (interactive "P") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
43 (let ((version-string |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
44 (format "Version of \`texinfmt.el\': %s" texinfmt-version))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
45 (if here |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
46 (insert version-string) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
47 (if (interactive-p) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
48 (message "%s" version-string) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
49 version-string)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
50 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
51 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
52 ;;; Variable definitions |
189 | 53 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
54 (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
|
55 (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
|
56 |
189 | 57 (defvar texinfo-format-syntax-table nil) |
58 | |
59 (defvar texinfo-vindex) | |
60 (defvar texinfo-findex) | |
61 (defvar texinfo-cindex) | |
62 (defvar texinfo-pindex) | |
63 (defvar texinfo-tindex) | |
64 (defvar texinfo-kindex) | |
65 (defvar texinfo-last-node) | |
66 (defvar texinfo-node-names) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
67 (defvar texinfo-enclosure-list) |
9759
ebe611f49450
(texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9754
diff
changeset
|
68 (defvar texinfo-alias-list) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
69 |
4868
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
70 (defvar texinfo-command-start) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
71 (defvar texinfo-command-end) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
72 (defvar texinfo-command-name) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
73 (defvar texinfo-defun-type) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
74 (defvar texinfo-last-node-pos) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
75 (defvar texinfo-stack) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
76 (defvar texinfo-short-index-cmds-alist) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
77 (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
|
78 (defvar texinfo-format-filename) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
79 (defvar texinfo-footnote-number) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
80 (defvar texinfo-start-of-header) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
81 (defvar texinfo-end-of-header) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
82 (defvar texinfo-raisesections-alist) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
83 (defvar texinfo-lowersections-alist) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
84 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
85 ;;; Syntax table |
189 | 86 |
87 (if texinfo-format-syntax-table | |
88 nil | |
89 (setq texinfo-format-syntax-table (make-syntax-table)) | |
90 (modify-syntax-entry ?\" " " texinfo-format-syntax-table) | |
91 (modify-syntax-entry ?\\ " " texinfo-format-syntax-table) | |
92 (modify-syntax-entry ?@ "\\" texinfo-format-syntax-table) | |
93 (modify-syntax-entry ?\^q "\\" texinfo-format-syntax-table) | |
94 (modify-syntax-entry ?\[ "." texinfo-format-syntax-table) | |
95 (modify-syntax-entry ?\] "." texinfo-format-syntax-table) | |
96 (modify-syntax-entry ?\( "." texinfo-format-syntax-table) | |
97 (modify-syntax-entry ?\) "." texinfo-format-syntax-table) | |
98 (modify-syntax-entry ?{ "(}" texinfo-format-syntax-table) | |
99 (modify-syntax-entry ?} "){" texinfo-format-syntax-table) | |
100 (modify-syntax-entry ?\' "." texinfo-format-syntax-table)) | |
101 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
102 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
103 ;;; 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
|
104 |
4769
d1b5ca8f5493
(texinfo-format-region texinfo-format-buffer): Add ###autoload cookies.
Brian Fox <bfox@gnu.org>
parents:
4396
diff
changeset
|
105 ;;;###autoload |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
106 (defun texinfo-format-buffer (&optional nosplit) |
189 | 107 "Process the current buffer as texinfo code, into an Info file. |
108 The Info file output is generated in a buffer visiting the Info file | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
109 name specified in the @setfilename command. |
189 | 110 |
111 Non-nil argument (prefix, if interactive) means don't make tag table | |
112 and don't split the file if large. You can use Info-tagify and | |
113 Info-split to do these manually." | |
114 (interactive "P") | |
115 (let ((lastmessage "Formatting Info file...")) | |
116 (message lastmessage) | |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
117 (widen) |
189 | 118 (texinfo-format-buffer-1) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
119 (Info-tagify) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
120 (if nosplit |
189 | 121 nil |
122 (if (> (buffer-size) 100000) | |
123 (progn | |
124 (message (setq lastmessage "Splitting Info file...")) | |
125 (Info-split)))) | |
126 (message (concat lastmessage | |
127 (if (interactive-p) "done. Now save it." "done."))))) | |
128 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
129 (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
|
130 "*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
|
131 |
4769
d1b5ca8f5493
(texinfo-format-region texinfo-format-buffer): Add ###autoload cookies.
Brian Fox <bfox@gnu.org>
parents:
4396
diff
changeset
|
132 ;;;###autoload |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
133 (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
|
134 "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
|
135 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
|
136 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
|
137 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
|
138 (interactive "r") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
139 (message "Converting region to Info format...") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
140 (let (texinfo-command-start |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
141 texinfo-command-end |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
142 texinfo-command-name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
143 texinfo-vindex |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
144 texinfo-findex |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
145 texinfo-cindex |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
146 texinfo-pindex |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
147 texinfo-tindex |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
148 texinfo-kindex |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
149 texinfo-stack |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
150 (texinfo-format-filename "") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
151 texinfo-example-start |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
152 texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
153 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
154 texinfo-node-names |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
155 (texinfo-footnote-number 0) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
156 last-input-buffer |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
157 (fill-column-for-info fill-column) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
158 (input-buffer (current-buffer)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
159 (input-directory default-directory) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
160 (header-text "") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
161 (header-beginning 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
162 (header-end 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
163 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
164 ;;; 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
|
165 ;;; 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
|
166 (save-excursion |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
167 (save-restriction |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
168 (widen) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
169 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
170 (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
|
171 (if (or |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
172 ;; Either copy header text. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
173 (and |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
174 (prog1 |
4982
36b78ccd6285
(texinfo-format-region): Change `texinfo-[start
Richard M. Stallman <rms@gnu.org>
parents:
4868
diff
changeset
|
175 (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
|
176 (forward-line 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
177 ;; Mark beginning of header. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
178 (setq header-beginning (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
179 (prog1 |
4982
36b78ccd6285
(texinfo-format-region): Change `texinfo-[start
Richard M. Stallman <rms@gnu.org>
parents:
4868
diff
changeset
|
180 (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
|
181 (beginning-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
182 ;; Mark end of header |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
183 (setq header-end (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
184 ;; Or copy @filename line. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
185 (prog2 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
186 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
187 (search-forward "@setfilename" search-end t) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
188 (beginning-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
189 (setq header-beginning (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
190 (forward-line 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
191 (setq header-end (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
192 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
193 ;; Copy header |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
194 (setq header-text |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
195 (buffer-substring |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
196 (min header-beginning region-beginning) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
197 header-end)))))) |
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 ;;; Find a buffer to use. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
200 (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
|
201 (erase-buffer) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
202 ;; Insert the header into the buffer. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
203 (insert header-text) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
204 ;; Insert the region into the buffer. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
205 (insert-buffer-substring |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
206 input-buffer |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
207 (max region-beginning header-end) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
208 region-end) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
209 ;; 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
|
210 (or (= (preceding-char) ?\n) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
211 (insert "\n")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
212 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
213 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
214 (texinfo-mode) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
215 (message "Converting region to Info format...") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
216 (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
|
217 ;; 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
|
218 (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
|
219 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
220 ;; 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
|
221 ;; 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
|
222 ;; @raise/@lowersections commands. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
223 (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
|
224 (setq texinfo-command-end (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
225 (let ((filename (concat input-directory |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
226 (texinfo-parse-line-arg)))) |
9178
0facf5c89fff
(texinfo-format-region, texinfo-format-buffer-1):
Richard M. Stallman <rms@gnu.org>
parents:
6309
diff
changeset
|
227 (re-search-backward "^@include") |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
228 (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
|
229 (message "Reading included file: %s" filename) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
230 (save-excursion |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
231 (save-restriction |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
232 (narrow-to-region |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
233 (point) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
234 (+ (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
|
235 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
236 ;; 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
|
237 ;; so @setfilename command not duplicated. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
238 (if (re-search-forward |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
239 "^@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
|
240 (progn |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
241 (beginning-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
242 (delete-region |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
243 (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
|
244 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
245 ;; 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
|
246 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
247 (texinfo-raise-lower-sections) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
248 ;; 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
|
249 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
250 (texinfo-append-refill) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
251 ;; 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
|
252 ;; discard everything after that. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
253 (goto-char (point-max)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
254 (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
|
255 (delete-region (point) (point-max))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
256 ;; 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
|
257 (or (= (preceding-char) ?\n) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
258 (insert "\n")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
259 ;; 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
|
260 (setq texinfo-enclosure-list nil) |
9759
ebe611f49450
(texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9754
diff
changeset
|
261 (setq texinfo-alias-list nil) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
262 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
263 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
264 (if (looking-at "\\\\input[ \t]+texinfo") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
265 (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
|
266 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
267 ;; Insert Info region title text. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
268 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
269 (if (search-forward |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
270 "@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
|
271 (progn |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
272 (setq texinfo-command-end (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
273 (beginning-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
274 (setq texinfo-command-start (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
275 (let ((arg (texinfo-parse-arg-discard))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
276 (insert " " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
277 texinfo-region-buffer-name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
278 " buffer for: `") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
279 (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
|
280 (insert "', -*-Text-*-\n"))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
281 ;; Else no `@setfilename' line |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
282 (insert " " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
283 texinfo-region-buffer-name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
284 " buffer -*-Text-*-\n")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
285 (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
|
286 "from a region in: " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
287 (if (buffer-file-name input-buffer) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
288 (concat "`" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
289 (file-name-sans-versions |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
290 (file-name-nondirectory |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
291 (buffer-file-name input-buffer))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
292 "'") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
293 (concat "buffer `" (buffer-name input-buffer) "'")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
294 "\nusing `texinfmt.el' version " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
295 texinfmt-version |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
296 ".\n\n") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
297 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
298 ;; Now convert for real. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
299 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
300 (texinfo-format-scan) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
301 (goto-char (point-min)) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
302 (Info-tagify input-buffer) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
303 (goto-char (point-min)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
304 (message "Done."))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
305 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
306 ;;;###autoload |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
307 (defun texi2info (&optional nosplit) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
308 "Convert the current buffer (written in Texinfo code) into an Info file. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
309 The Info file output is generated in a buffer visiting the Info file |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
310 names specified in the @setfilename command. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
311 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
312 This function automatically updates all node pointers and menus, and |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
313 creates a master menu. This work is done on a temporary buffer that |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
314 is automatically removed when the Info file is created. The original |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
315 Texinfo source buffer is not changed. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
316 |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
317 Non-nil argument (prefix, if interactive) means don't split the file |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
318 if large. You can use Info-split to do this manually." |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
319 (interactive "P") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
320 (let ((temp-buffer (concat "*--" (buffer-name) "--temporary-buffer*" ))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
321 (message "First updating nodes and menus, then creating Info file.") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
322 ;; (sit-for 2) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
323 (copy-to-buffer temp-buffer (point-min) (point-max)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
324 (switch-to-buffer temp-buffer) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
325 (texinfo-master-menu t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
326 (message "Now creating Info file.") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
327 (sit-for 2) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
328 (texinfo-format-buffer nosplit) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
329 (save-buffer) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
330 (kill-buffer temp-buffer))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
331 |
189 | 332 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
333 ;;; 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
|
334 |
189 | 335 (defun texinfo-format-buffer-1 () |
336 (let (texinfo-format-filename | |
337 texinfo-example-start | |
338 texinfo-command-start | |
339 texinfo-command-end | |
340 texinfo-command-name | |
341 texinfo-last-node | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
342 texinfo-last-node-pos |
189 | 343 texinfo-vindex |
344 texinfo-findex | |
345 texinfo-cindex | |
346 texinfo-pindex | |
347 texinfo-tindex | |
348 texinfo-kindex | |
349 texinfo-stack | |
350 texinfo-node-names | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
351 (texinfo-footnote-number 0) |
189 | 352 last-input-buffer |
353 outfile | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
354 (fill-column-for-info fill-column) |
189 | 355 (input-buffer (current-buffer)) |
356 (input-directory default-directory)) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
357 (setq texinfo-enclosure-list nil) |
9759
ebe611f49450
(texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9754
diff
changeset
|
358 (setq texinfo-alias-list nil) |
189 | 359 (save-excursion |
360 (goto-char (point-min)) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
361 (or (search-forward "@setfilename" nil t) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
362 (error "Texinfo file needs an `@setfilename FILENAME' line.")) |
189 | 363 (setq texinfo-command-end (point)) |
364 (setq outfile (texinfo-parse-line-arg))) | |
18818
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
365 |
189 | 366 (find-file outfile) |
367 (texinfo-mode) | |
18818
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
368 (erase-buffer) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
369 |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
370 (message "Formatting Info file: %s" outfile) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
371 (setq texinfo-format-filename |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
372 (file-name-nondirectory (expand-file-name outfile))) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
373 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
374 (setq fill-column fill-column-for-info) |
189 | 375 (set-syntax-table texinfo-format-syntax-table) |
18818
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
376 |
189 | 377 (insert-buffer-substring input-buffer) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
378 (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
|
379 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
380 ;; 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
|
381 ;; 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
|
382 ;; @raise/@lowersections commands. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
383 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
384 (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
|
385 (setq texinfo-command-end (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
386 (let ((filename (concat input-directory |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
387 (texinfo-parse-line-arg)))) |
9178
0facf5c89fff
(texinfo-format-region, texinfo-format-buffer-1):
Richard M. Stallman <rms@gnu.org>
parents:
6309
diff
changeset
|
388 (re-search-backward "^@include") |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
389 (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
|
390 (message "Reading included file: %s" filename) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
391 (save-excursion |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
392 (save-restriction |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
393 (narrow-to-region |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
394 (point) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
395 (+ (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
|
396 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
397 ;; 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
|
398 ;; so @setfilename command not duplicated. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
399 (if (re-search-forward |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
400 "^@setfilename" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
401 (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
|
402 (progn |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
403 (beginning-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
404 (delete-region |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
405 (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
|
406 ;; 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
|
407 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
408 (texinfo-raise-lower-sections) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
409 ;; Append @refill to appropriate paragraphs |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
410 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
411 (texinfo-append-refill) |
189 | 412 (goto-char (point-min)) |
413 (search-forward "@setfilename") | |
414 (beginning-of-line) | |
415 (delete-region (point-min) (point)) | |
416 ;; Remove @bye at end of file, if it is there. | |
417 (goto-char (point-max)) | |
418 (if (search-backward "@bye" nil t) | |
419 (delete-region (point) (point-max))) | |
420 ;; Make sure buffer ends in a newline. | |
421 (or (= (preceding-char) ?\n) | |
422 (insert "\n")) | |
423 ;; Scan the whole buffer, converting to Info format. | |
424 (texinfo-format-scan) | |
18818
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
425 (goto-char (point-min)) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
426 ;; Insert info about how this file was made. |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
427 (insert "Info file: " |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
428 texinfo-format-filename ", -*-Text-*-\n" |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
429 "produced by `texinfo-format-buffer'\n" |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
430 ;; Date string removed so that regression testing is easier. |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
431 ;; "on " |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
432 ;; (insert (format-time-string "%e %b %Y")) " " |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
433 "from file" |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
434 (if (buffer-file-name input-buffer) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
435 (concat " `" |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
436 (file-name-sans-versions |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
437 (file-name-nondirectory |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
438 (buffer-file-name input-buffer))) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
439 "'") |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
440 (concat "buffer `" (buffer-name input-buffer) "'")) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
441 "\nusing `texinfmt.el' version " |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
442 texinfmt-version |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
443 ".\n\n") |
189 | 444 ;; Return data for indices. |
445 (list outfile | |
446 texinfo-vindex texinfo-findex texinfo-cindex | |
447 texinfo-pindex texinfo-tindex texinfo-kindex))) | |
448 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
449 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
450 ;;; Perform non-@-command file conversions: quotes and hyphens |
189 | 451 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
452 (defun texinfo-format-convert (min max) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
453 ;; 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
|
454 (goto-char min) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
455 (while (search-forward "``" max t) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
456 (replace-match "\"")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
457 (goto-char min) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
458 (while (search-forward "''" max t) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
459 (replace-match "\"")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
460 ;; 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
|
461 (goto-char min) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
462 (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
|
463 (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
|
464 2))))) |
189 | 465 |
4396
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 ;;; Handle paragraph filling |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
468 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
469 ;; Keep as concatinated lists for ease of maintenance |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
470 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
471 (defvar texinfo-no-refill-regexp |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
472 (concat |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
473 "^@" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
474 "\\(" |
18884
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
475 "direntry\\|" |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
476 "lisp\\|" |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
477 "smalllisp\\|" |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
478 "example\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
479 "smallexample\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
480 "display\\|" |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
481 "smalldisplay\\|" |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
482 "format\\|" |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
483 "smallformat\\|" |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
484 "flushleft\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
485 "flushright\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
486 "menu\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
487 "multitable\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
488 "titlepage\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
489 "iftex\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
490 "ifhtml\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
491 "tex\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
492 "html" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
493 "\\)") |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
494 "Regexp specifying environments in which paragraphs are not filled.") |
189 | 495 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
496 (defvar texinfo-accent-commands |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
497 (concat |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
498 "@^\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
499 "@`\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
500 "@'\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
501 "@\"\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
502 "@,\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
503 "@=\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
504 "@~\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
505 "@OE{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
506 "@oe{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
507 "@AA{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
508 "@aa{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
509 "@AE{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
510 "@ae{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
511 "@ss{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
512 "@questiondown{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
513 "@exclamdown{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
514 "@L{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
515 "@l{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
516 "@O{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
517 "@o{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
518 "@dotaccent{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
519 "@ubaraccent{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
520 "@d{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
521 "@H{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
522 "@ringaccent{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
523 "@tieaccent{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
524 "@u{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
525 "@v{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
526 "@dotless{" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
527 )) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
528 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
529 (defvar texinfo-part-of-para-regexp |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
530 (concat |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
531 "^@" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
532 "\\(" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
533 "b{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
534 "bullet{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
535 "cite{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
536 "code{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
537 "email{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
538 "emph{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
539 "equiv{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
540 "error{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
541 "expansion{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
542 "file{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
543 "i{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
544 "inforef{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
545 "kbd{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
546 "key{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
547 "lisp{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
548 "minus{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
549 "point{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
550 "print{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
551 "pxref{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
552 "r{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
553 "ref{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
554 "result{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
555 "samp{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
556 "sc{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
557 "t{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
558 "TeX{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
559 "today{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
560 "url{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
561 "var{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
562 "w{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
563 "xref{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
564 "@-\\|" ; @- is a descretionary hyphen (not an accent) (a noop). |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
565 texinfo-accent-commands |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
566 "\\)" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
567 ) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
568 "Regexp specifying @-commands found within paragraphs.") |
189 | 569 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
570 (defun texinfo-append-refill () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
571 "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
|
572 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
|
573 Do not append @refill to paragraphs containing @w{TEXT} or @*." |
189 | 574 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
575 ;; 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
|
576 ;; 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
|
577 ;; 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
|
578 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
579 (while (< (point) (point-max)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
580 (let ((refill-blank-lines "^[ \t\n]*$") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
581 (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
|
582 (beginning-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
583 ;; 1. Skip over blank lines; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
584 ;; skip over lines beginning with @-commands, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
585 ;; but do not skip over lines |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
586 ;; 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
|
587 ;; 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
|
588 (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
|
589 (not (looking-at |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
590 (concat |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
591 "\\(" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
592 texinfo-no-refill-regexp |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
593 "\\|" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
594 texinfo-part-of-para-regexp |
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 (< (point) (point-max))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
597 (forward-line 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
598 ;; 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
|
599 (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
|
600 (let ((environment |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
601 (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
|
602 (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
|
603 (forward-line 1))) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
604 ;; Else |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
605 ;; 3. Do not refill a paragraph containing @w or @*, or ending |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
606 ;; with @<newline> followed by a newline. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
607 (if (or |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
608 (>= (point) (point-max)) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
609 (re-search-forward |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
610 "@w{\\|@\\*\\|@\n\n" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
611 (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
612 (forward-paragraph) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
613 (forward-line 1) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
614 (point)) t)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
615 ;; 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
|
616 (forward-paragraph) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
617 ;; 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
|
618 (forward-paragraph) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
619 (forward-line -1) |
23658 | 620 (let ((line-beg (point))) |
621 (end-of-line) | |
622 (delete-region | |
623 (point) | |
624 (save-excursion (skip-chars-backward " \t") (point))) | |
625 (search-backward "@c" line-beg t) | |
626 (unless (re-search-backward "@refill\\|@bye" line-beg t) | |
627 (insert "@refill"))) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
628 (forward-line 1)))))) |
189 | 629 |
630 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
631 ;;; Handle `@raisesections' and `@lowersections' commands |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
632 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
633 ;; 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
|
634 ;; commands. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
635 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
636 ;; @raisesections changes @subsection to @section, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
637 ;; @section to @chapter, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
638 ;; etc. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
639 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
640 ;; @lowersections changes @chapter to @section |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
641 ;; @subsection to @subsubsection, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
642 ;; etc. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
643 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
644 ;; 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
|
645 ;; 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
|
646 ;; command. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
647 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
648 ;; 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
|
649 ;; the heading level. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
650 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
651 ;; 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
|
652 ;; vice versa. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
653 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
654 ;; 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
|
655 ;; 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
|
656 ;; 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
|
657 ;; (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
|
658 ;; @section produce chapter headings). |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
659 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
660 (defun texinfo-raise-lower-sections () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
661 "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
|
662 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
663 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
|
664 commands in the Texinfo file. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
665 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
666 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
|
667 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
|
668 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
|
669 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
|
670 on. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
671 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
672 @raisesections changes @subsection to @section, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
673 @section to @chapter, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
674 @heading to @chapheading, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
675 etc. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
676 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
677 @lowersections changes @chapter to @section, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
678 @subsection to @subsubsection, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
679 @heading to @subheading, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
680 etc. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
681 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
682 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
|
683 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
|
684 `@lowersections' command. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
685 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
686 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
|
687 vice versa. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
688 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
689 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
|
690 level a step at a time. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
691 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
692 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
|
693 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
|
694 commands." |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
695 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
696 ;; `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
|
697 ;; 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
|
698 ;; (but not the top node). |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
699 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
700 (let (type (level 0)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
701 (while |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
702 (re-search-forward |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
703 (concat |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
704 "\\(\\(^@\\(raise\\|lower\\)sections\\)\\|\\(" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
705 texinfo-section-types-regexp |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
706 "\\)\\)") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
707 nil t) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
708 (beginning-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
709 (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
|
710 (cond |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
711 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
712 ;; 1. Increment level |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
713 ((eq type '@raisesections) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
714 (setq level (1+ level)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
715 (delete-region |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
716 (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
|
717 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
718 ;; 2. Decrement level |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
719 ((eq type '@lowersections) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
720 (setq level (1- level)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
721 (delete-region |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
722 (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
|
723 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
724 ;; Now handle structuring commands |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
725 ((cond |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
726 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
727 ;; 3. Raise level when positive |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
728 ((> level 0) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
729 (let ((count level) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
730 (new-level type)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
731 (while (> count 0) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
732 (setq new-level |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
733 (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
|
734 (setq count (1- count))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
735 (kill-word 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
736 (insert (symbol-name new-level)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
737 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
738 ;; 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
|
739 ((= level 0) (forward-line 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
740 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
741 ;; 5. Lower level when positive |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
742 ((< level 0) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
743 (let ((count level) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
744 (new-level type)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
745 (while (< count 0) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
746 (setq new-level |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
747 (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
|
748 (setq count (1+ count))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
749 (kill-word 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
750 (insert (symbol-name new-level)))))))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
751 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
752 (defvar texinfo-raisesections-alist |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
753 '((@chapter . @chapter) ; Cannot go higher |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
754 (@unnumbered . @unnumbered) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
755 (@centerchap . @unnumbered) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
756 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
757 (@majorheading . @majorheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
758 (@chapheading . @chapheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
759 (@appendix . @appendix) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
760 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
761 (@section . @chapter) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
762 (@unnumberedsec . @unnumbered) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
763 (@heading . @chapheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
764 (@appendixsec . @appendix) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
765 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
766 (@subsection . @section) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
767 (@unnumberedsubsec . @unnumberedsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
768 (@subheading . @heading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
769 (@appendixsubsec . @appendixsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
770 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
771 (@subsubsection . @subsection) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
772 (@unnumberedsubsubsec . @unnumberedsubsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
773 (@subsubheading . @subheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
774 (@appendixsubsubsec . @appendixsubsec)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
775 "*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
|
776 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
|
777 Used by `texinfo-raise-lower-sections'. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
778 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
|
779 higher types.") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
780 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
781 (defvar texinfo-lowersections-alist |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
782 '((@chapter . @section) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
783 (@unnumbered . @unnumberedsec) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
784 (@centerchap . @unnumberedsec) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
785 (@majorheading . @heading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
786 (@chapheading . @heading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
787 (@appendix . @appendixsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
788 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
789 (@section . @subsection) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
790 (@unnumberedsec . @unnumberedsubsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
791 (@heading . @subheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
792 (@appendixsec . @appendixsubsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
793 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
794 (@subsection . @subsubsection) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
795 (@unnumberedsubsec . @unnumberedsubsubsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
796 (@subheading . @subsubheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
797 (@appendixsubsec . @appendixsubsubsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
798 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
799 (@subsubsection . @subsubsection) ; Cannot go lower. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
800 (@unnumberedsubsubsec . @unnumberedsubsubsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
801 (@subsubheading . @subsubheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
802 (@appendixsubsubsec . @appendixsubsubsec)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
803 "*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
|
804 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
|
805 Used by `texinfo-raise-lower-sections'. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
806 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
|
807 lower types.") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
808 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
809 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
810 ;;; 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
|
811 ;;; uniformly. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
812 |
189 | 813 (defun texinfo-format-scan () |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
814 (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
|
815 ;; Scan for @-commands. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
816 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
817 (while (search-forward "@" nil t) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
818 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
819 ;; These are the single-character accent commands: @^ @` @' @" @= @~ |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
820 ;; In Info, they are simply quoted and the @ deleted. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
821 ;; Other single-character commands: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
822 ;; @* forces a line break, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
823 ;; @- is a discretionary hyphenation point; does nothing in Info. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
824 ;; @<space>, @<tab>, @<newline> each produce a single space, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
825 ;; unless followed by a newline. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
826 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
827 ;; Old version 2.34 expression: (looking-at "[@{}^'` *\"?!]") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
828 (if (looking-at "[@{}^'`\"=~ \t\n*?!-]") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
829 ;; @*, causes a line break. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
830 (cond |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
831 ;; @*, a line break |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
832 ((= (following-char) ?*) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
833 ;; remove command |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
834 (delete-region (1- (point)) (1+ (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
835 ;; insert return if not at end of line; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
836 ;; else line is already broken. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
837 (if (not (= (following-char) ?\n)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
838 (insert ?\n))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
839 ;; @-, deleted |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
840 ((= (following-char) ?-) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
841 (delete-region (1- (point)) (1+ (point)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
842 ;; @<space>, @<tab>, @<newline>: produce a single space, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
843 ;; unless followed by a newline. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
844 ((= (following-char) ? ) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
845 (delete-region (1- (point)) (1+ (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
846 ;; insert single space if not at end of line; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
847 ;; else line is already broken. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
848 (if (not (= (following-char) ?\n)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
849 (insert ? ))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
850 ((= (following-char) ?\t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
851 (delete-region (1- (point)) (1+ (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
852 ;; insert single space if not at end of line; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
853 ;; else line is already broken. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
854 (if (not (= (following-char) ?\n)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
855 (insert ? ))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
856 ;; following char is a carriage return |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
857 ((= (following-char) ? |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
858 ) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
859 ;; remove command |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
860 (delete-region (1- (point)) (1+ (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
861 ;; insert single space if not at end of line; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
862 ;; else line is already broken. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
863 (if (not (= (following-char) ?\n)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
864 (insert ? ))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
865 ;; Otherwise: the other characters are simply quoted. Delete the @. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
866 (t |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
867 (delete-char -1) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
868 (forward-char 1))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
869 ;; @ 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
|
870 (setq texinfo-command-start (1- (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
871 (if (= (char-syntax (following-char)) ?w) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
872 (forward-word 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
873 (forward-char 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
874 (setq texinfo-command-end (point)) |
23658 | 875 ;; Detect the case of two @-commands in a row; |
876 ;; process just the first one. | |
877 (goto-char (1+ texinfo-command-start)) | |
878 (skip-chars-forward "^@" texinfo-command-end) | |
879 (setq texinfo-command-end (point)) | |
9759
ebe611f49450
(texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9754
diff
changeset
|
880 ;; Handle let aliasing |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
881 (setq texinfo-command-name |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
882 (let (trial |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
883 (cmdname |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
884 (buffer-substring |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
885 (1+ texinfo-command-start) texinfo-command-end))) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
886 (while (setq trial (assoc cmdname texinfo-alias-list)) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
887 (setq cmdname (cdr trial))) |
9759
ebe611f49450
(texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9754
diff
changeset
|
888 (intern cmdname))) |
ebe611f49450
(texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9754
diff
changeset
|
889 ;; 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
|
890 (let ((enclosure-type |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
891 (assoc |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
892 (symbol-name texinfo-command-name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
893 texinfo-enclosure-list))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
894 (if enclosure-type |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
895 (progn |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
896 (insert |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
897 (car (car (cdr enclosure-type))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
898 (texinfo-parse-arg-discard) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
899 (car (cdr (car (cdr enclosure-type))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
900 (goto-char texinfo-command-start)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
901 (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
|
902 (if cmd (funcall cmd) (texinfo-unsupported))))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
903 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
904 (cond (texinfo-stack |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
905 (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
|
906 (error "Unterminated @%s" (car (car texinfo-stack)))))) |
189 | 907 |
908 (put 'begin 'texinfo-format 'texinfo-format-begin) | |
909 (defun texinfo-format-begin () | |
910 (texinfo-format-begin-end 'texinfo-format)) | |
911 | |
912 (put 'end 'texinfo-format 'texinfo-format-end) | |
913 (defun texinfo-format-end () | |
914 (texinfo-format-begin-end 'texinfo-end)) | |
915 | |
916 (defun texinfo-format-begin-end (prop) | |
917 (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
|
918 (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
|
919 (if cmd (funcall cmd) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
920 (texinfo-unsupported)))) |
189 | 921 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
922 ;;; Parsing functions |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
923 |
189 | 924 (defun texinfo-parse-line-arg () |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
925 "Return argument of @-command as string. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
926 Argument is separated from command either by a space or by a brace. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
927 If a space, return rest of line, with beginning and ending white |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
928 space removed. If a brace, return string between braces. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
929 Leave point after argument." |
189 | 930 (goto-char texinfo-command-end) |
931 (let ((start (point))) | |
932 (cond ((looking-at " ") | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
933 (skip-chars-forward " ") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
934 (setq start (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
935 (end-of-line) |
189 | 936 (skip-chars-backward " ") |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
937 (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
|
938 (setq texinfo-command-end (1+ (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
939 ((looking-at "{") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
940 (setq start (1+ (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
941 (forward-list 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
942 (setq texinfo-command-end (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
943 (forward-char -1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
944 (t |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
945 (error "Invalid texinfo command arg format"))) |
189 | 946 (prog1 (buffer-substring start (point)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
947 (if (eolp) (forward-char 1))))) |
189 | 948 |
949 (defun texinfo-parse-expanded-arg () | |
950 (goto-char texinfo-command-end) | |
951 (let ((start (point)) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
952 marker) |
189 | 953 (cond ((looking-at " ") |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
954 (skip-chars-forward " ") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
955 (setq start (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
956 (end-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
957 (setq texinfo-command-end (1+ (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
958 ((looking-at "{") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
959 (setq start (1+ (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
960 (forward-list 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
961 (setq texinfo-command-end (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
962 (forward-char -1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
963 (t |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
964 (error "Invalid texinfo command arg format"))) |
189 | 965 (setq marker (move-marker (make-marker) texinfo-command-end)) |
966 (texinfo-format-expand-region start (point)) | |
967 (setq texinfo-command-end (marker-position marker)) | |
968 (move-marker marker nil) | |
969 (prog1 (buffer-substring start (point)) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
970 (if (eolp) (forward-char 1))))) |
189 | 971 |
972 (defun texinfo-format-expand-region (start end) | |
973 (save-restriction | |
974 (narrow-to-region start end) | |
975 (let (texinfo-command-start | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
976 texinfo-command-end |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
977 texinfo-command-name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
978 texinfo-stack) |
189 | 979 (texinfo-format-scan)) |
980 (goto-char (point-max)))) | |
981 | |
982 (defun texinfo-parse-arg-discard () | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
983 "Delete command and argument; return argument of command." |
189 | 984 (prog1 (texinfo-parse-line-arg) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
985 (texinfo-discard-command))) |
189 | 986 |
987 (defun texinfo-discard-command () | |
988 (delete-region texinfo-command-start texinfo-command-end)) | |
989 | |
990 (defun texinfo-optional-braces-discard () | |
991 "Discard braces following command, if any." | |
992 (goto-char texinfo-command-end) | |
993 (let ((start (point))) | |
994 (cond ((looking-at "[ \t]*\n")) ; do nothing | |
995 ((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
|
996 (forward-list 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
997 (setq texinfo-command-end (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
998 (t |
189 | 999 (error |
1000 "Invalid `texinfo-optional-braces-discard' format \(need braces?\)"))) | |
1001 (delete-region texinfo-command-start texinfo-command-end))) | |
1002 | |
1003 (defun texinfo-format-parse-line-args () | |
1004 (let ((start (1- (point))) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1005 next beg end |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1006 args) |
189 | 1007 (skip-chars-forward " ") |
1008 (while (not (eolp)) | |
1009 (setq beg (point)) | |
1010 (re-search-forward "[\n,]") | |
1011 (setq next (point)) | |
1012 (if (bolp) (setq next (1- next))) | |
1013 (forward-char -1) | |
1014 (skip-chars-backward " ") | |
1015 (setq end (point)) | |
1016 (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
|
1017 args)) |
189 | 1018 (goto-char next) |
1019 (skip-chars-forward " ")) | |
1020 (if (eolp) (forward-char 1)) | |
1021 (setq texinfo-command-end (point)) | |
1022 (nreverse args))) | |
1023 | |
1024 (defun texinfo-format-parse-args () | |
1025 (let ((start (1- (point))) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1026 next beg end |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1027 args) |
189 | 1028 (search-forward "{") |
1029 (save-excursion | |
1030 (texinfo-format-expand-region | |
1031 (point) | |
1032 (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
|
1033 ;; 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
|
1034 ;; `@xref{bullet, , @code{@@bullet}@{@}}.' because the |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1035 ;; 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
|
1036 ;; comma. |
189 | 1037 (while (/= (preceding-char) ?\}) |
1038 (skip-chars-forward " \t\n") | |
1039 (setq beg (point)) | |
1040 (re-search-forward "[},]") | |
1041 (setq next (point)) | |
1042 (forward-char -1) | |
1043 (skip-chars-backward " \t\n") | |
1044 (setq end (point)) | |
1045 (cond ((< beg end) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1046 (goto-char beg) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1047 (while (search-forward "\n" end t) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1048 (replace-match " ")))) |
189 | 1049 (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
|
1050 args)) |
189 | 1051 (goto-char next)) |
1052 (if (eolp) (forward-char 1)) | |
1053 (setq texinfo-command-end (point)) | |
1054 (nreverse args))) | |
1055 | |
1056 (defun texinfo-format-parse-defun-args () | |
1057 (goto-char texinfo-command-end) | |
1058 (let ((start (point))) | |
1059 (end-of-line) | |
1060 (setq texinfo-command-end (1+ (point))) | |
1061 (let ((marker (move-marker (make-marker) texinfo-command-end))) | |
1062 (texinfo-format-expand-region start (point)) | |
1063 (setq texinfo-command-end (marker-position marker)) | |
1064 (move-marker marker nil)) | |
1065 (goto-char start) | |
1066 (let ((args '()) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1067 beg end) |
189 | 1068 (skip-chars-forward " ") |
1069 (while (not (eolp)) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1070 (cond ((looking-at "{") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1071 (setq beg (1+ (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1072 (forward-list 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1073 (setq end (1- (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1074 (t |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1075 (setq beg (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1076 (re-search-forward "[\n ]") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1077 (forward-char -1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1078 (setq end (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1079 (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
|
1080 (skip-chars-forward " ")) |
189 | 1081 (forward-char 1) |
1082 (nreverse args)))) | |
1083 | |
1084 (defun texinfo-discard-line () | |
1085 (goto-char texinfo-command-end) | |
1086 (skip-chars-forward " \t") | |
1087 (or (eolp) | |
1088 (error "Extraneous text at end of command line.")) | |
1089 (goto-char texinfo-command-start) | |
1090 (or (bolp) | |
1091 (error "Extraneous text at beginning of command line.")) | |
1092 (delete-region (point) (progn (forward-line 1) (point)))) | |
1093 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1094 (defun texinfo-discard-line-with-args () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1095 (goto-char texinfo-command-start) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1096 (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
|
1097 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1098 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1099 ;;; @setfilename |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1100 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1101 ;; 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
|
1102 ;; 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
|
1103 ;; specially. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1104 (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
|
1105 (defun texinfo-format-setfilename () |
18818
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
1106 (texinfo-parse-arg-discard)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1107 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1108 ;;; @node, @menu, @detailmenu |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1109 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1110 (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
|
1111 (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
|
1112 (defun texinfo-format-node () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1113 (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
|
1114 (name (nth 0 args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1115 (next (nth 1 args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1116 (prev (nth 2 args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1117 (up (nth 3 args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1118 (texinfo-discard-command) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1119 (setq texinfo-last-node name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1120 (let ((tem (downcase name))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1121 (if (assoc tem texinfo-node-names) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1122 (error "Duplicate node name: %s" name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1123 (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
|
1124 (setq texinfo-footnote-number 0) |
9896
a70b99926339
(texinfo-format-node): Insert the node delimiter
Richard M. Stallman <rms@gnu.org>
parents:
9759
diff
changeset
|
1125 ;; 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
|
1126 (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
|
1127 ", Node: " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1128 (if next |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1129 (insert ", Next: " next)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1130 (if prev |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1131 (insert ", Prev: " prev)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1132 (if up |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1133 (insert ", Up: " up)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1134 (insert ?\n) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1135 (setq texinfo-last-node-pos (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1136 |
22661
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1137 (put 'anchor 'texinfo-format 'texinfo-anchor) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1138 (defun texinfo-anchor () |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1139 (let (anchor-string |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1140 (here (- (point) 7)) ; save location of beginning of `@anchor' |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1141 (arg (texinfo-parse-arg-discard))) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1142 (delete-char 1) ; since a space is left after -discard |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1143 (forward-paragraph) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1144 (let ((end (point))) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1145 (if (save-excursion |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1146 (backward-word 1) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1147 (search-forward "@refill" end t)) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1148 (setq anchor-string "@anchor-yes-refill") |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1149 (setq anchor-string "@anchor-no-refill"))) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1150 (goto-char here) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1151 (insert anchor-string "{" arg "}"))) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1152 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1153 (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
|
1154 (defun texinfo-format-menu () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1155 (texinfo-discard-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1156 (insert "* Menu:\n\n")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1157 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1158 (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
|
1159 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1160 ;; The @detailmenu should be removed eventually. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1161 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1162 ;; According to Karl Berry, 31 August 1996: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1163 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1164 ;; You don't like, I don't like it. I agree, it would be better just to |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1165 ;; fix the bug [in `makeinfo']. .. At this point, since inserting those |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1166 ;; two commands in the Elisp fn is trivial, I don't especially want to |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1167 ;; expend more effort... |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1168 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1169 ;; I added a couple sentences of documentation to the manual (putting the |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1170 ;; blame on makeinfo where it belongs :-(). |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1171 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1172 (put 'detailmenu 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1173 (put 'detailmenu 'texinfo-end 'texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1174 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1175 ;; (Also see `texnfo-upd.el') |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1176 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1177 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1178 ;;; Cross references |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1179 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1180 ;; @xref {NODE, FNAME, NAME, FILE, DOCUMENT} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1181 ;; -> *Note FNAME: (FILE)NODE |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1182 ;; If FILE is missing, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1183 ;; *Note FNAME: NODE |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1184 ;; If FNAME is empty and NAME is present |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1185 ;; *Note NAME: Node |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1186 ;; If both NAME and FNAME are missing |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1187 ;; *Note NODE:: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1188 ;; texinfo ignores the DOCUMENT argument. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1189 ;; -> See section <xref to NODE> [NAME, else NODE], page <xref to NODE> |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1190 ;; If FILE is specified, (FILE)NODE is used for xrefs. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1191 ;; If fifth argument DOCUMENT is specified, produces |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1192 ;; See section <xref to NODE> [NAME, else NODE], page <xref to NODE> |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1193 ;; of DOCUMENT |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1194 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1195 ;; @ref a reference that does not put `See' or `see' in |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1196 ;; the hardcopy and is the same as @xref in Info |
189 | 1197 (put 'ref 'texinfo-format 'texinfo-format-xref) |
1198 | |
1199 (put 'xref 'texinfo-format 'texinfo-format-xref) | |
1200 (defun texinfo-format-xref () | |
1201 (let ((args (texinfo-format-parse-args))) | |
1202 (texinfo-discard-command) | |
1203 (insert "*Note ") | |
1204 (let ((fname (or (nth 1 args) (nth 2 args)))) | |
1205 (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
|
1206 (insert (car args) "::") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1207 (insert (or fname (car args)) ": ") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1208 (if (nth 3 args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1209 (insert "(" (nth 3 args) ")")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1210 (insert (car args)))))) |
189 | 1211 |
1212 (put 'pxref 'texinfo-format 'texinfo-format-pxref) | |
1213 (defun texinfo-format-pxref () | |
1214 (texinfo-format-xref) | |
1215 (or (save-excursion | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1216 (forward-char -2) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1217 (looking-at "::")) |
189 | 1218 (insert "."))) |
1219 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1220 ;; @inforef{NODE, FNAME, FILE} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1221 ;; Like @xref{NODE, FNAME,,FILE} in texinfo. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1222 ;; In Tex, generates "See Info file FILE, node NODE" |
189 | 1223 (put 'inforef 'texinfo-format 'texinfo-format-inforef) |
1224 (defun texinfo-format-inforef () | |
1225 (let ((args (texinfo-format-parse-args))) | |
1226 (texinfo-discard-command) | |
1227 (if (nth 1 args) | |
1228 (insert "*Note " (nth 1 args) ": (" (nth 2 args) ")" (car args)) | |
1229 (insert "*Note " "(" (nth 2 args) ")" (car args) "::")))) | |
1230 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1231 |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1232 ;;; URL Reference: @uref |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1233 |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1234 ;; @uref produces a reference to a uniform resource locator (URL). |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1235 ;; It takes one mandatory argument, the URL, and one optional argument, |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1236 ;; the text to display (the default is the URL itself). |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1237 |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1238 (put 'uref 'texinfo-format 'texinfo-format-uref) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1239 (defun texinfo-format-uref () |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1240 "Format URL and optional URL-TITLE. |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1241 Insert ` ... ' around URL if no URL-TITLE argument; |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1242 otherwise, insert URL-TITLE followed by URL in parentheses." |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1243 (let ((args (texinfo-format-parse-args))) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1244 (texinfo-discard-command) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1245 ;; if url-title |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1246 (if (nth 1 args) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1247 (insert (nth 1 args) " (" (nth 0 args) ")") |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1248 (insert "`" (nth 0 args) "'")) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1249 (goto-char texinfo-command-start))) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1250 |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1251 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1252 ;;; Section headings |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1253 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1254 (put 'majorheading 'texinfo-format 'texinfo-format-chapter) |
189 | 1255 (put 'chapheading 'texinfo-format 'texinfo-format-chapter) |
1256 (put 'ichapter 'texinfo-format 'texinfo-format-chapter) | |
1257 (put 'chapter 'texinfo-format 'texinfo-format-chapter) | |
1258 (put 'iappendix 'texinfo-format 'texinfo-format-chapter) | |
1259 (put 'appendix 'texinfo-format 'texinfo-format-chapter) | |
1260 (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
|
1261 (put 'top 'texinfo-format 'texinfo-format-chapter) |
189 | 1262 (put 'unnumbered 'texinfo-format 'texinfo-format-chapter) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1263 (put 'centerchap 'texinfo-format 'texinfo-format-chapter) |
189 | 1264 (defun texinfo-format-chapter () |
1265 (texinfo-format-chapter-1 ?*)) | |
1266 | |
1267 (put 'heading 'texinfo-format 'texinfo-format-section) | |
1268 (put 'isection 'texinfo-format 'texinfo-format-section) | |
1269 (put 'section 'texinfo-format 'texinfo-format-section) | |
1270 (put 'iappendixsection 'texinfo-format 'texinfo-format-section) | |
1271 (put 'appendixsection 'texinfo-format 'texinfo-format-section) | |
1272 (put 'iappendixsec 'texinfo-format 'texinfo-format-section) | |
1273 (put 'appendixsec 'texinfo-format 'texinfo-format-section) | |
1274 (put 'iunnumberedsec 'texinfo-format 'texinfo-format-section) | |
1275 (put 'unnumberedsec 'texinfo-format 'texinfo-format-section) | |
1276 (defun texinfo-format-section () | |
1277 (texinfo-format-chapter-1 ?=)) | |
1278 | |
1279 (put 'subheading 'texinfo-format 'texinfo-format-subsection) | |
1280 (put 'isubsection 'texinfo-format 'texinfo-format-subsection) | |
1281 (put 'subsection 'texinfo-format 'texinfo-format-subsection) | |
1282 (put 'iappendixsubsec 'texinfo-format 'texinfo-format-subsection) | |
1283 (put 'appendixsubsec 'texinfo-format 'texinfo-format-subsection) | |
1284 (put 'iunnumberedsubsec 'texinfo-format 'texinfo-format-subsection) | |
1285 (put 'unnumberedsubsec 'texinfo-format 'texinfo-format-subsection) | |
1286 (defun texinfo-format-subsection () | |
1287 (texinfo-format-chapter-1 ?-)) | |
1288 | |
1289 (put 'subsubheading 'texinfo-format 'texinfo-format-subsubsection) | |
1290 (put 'isubsubsection 'texinfo-format 'texinfo-format-subsubsection) | |
1291 (put 'subsubsection 'texinfo-format 'texinfo-format-subsubsection) | |
1292 (put 'iappendixsubsubsec 'texinfo-format 'texinfo-format-subsubsection) | |
1293 (put 'appendixsubsubsec 'texinfo-format 'texinfo-format-subsubsection) | |
1294 (put 'iunnumberedsubsubsec 'texinfo-format 'texinfo-format-subsubsection) | |
1295 (put 'unnumberedsubsubsec 'texinfo-format 'texinfo-format-subsubsection) | |
1296 (defun texinfo-format-subsubsection () | |
1297 (texinfo-format-chapter-1 ?.)) | |
1298 | |
1299 (defun texinfo-format-chapter-1 (belowchar) | |
1300 (let ((arg (texinfo-parse-arg-discard))) | |
1301 (message "Formatting: %s ... " arg) ; So we can see where we are. | |
1302 (insert ?\n arg ?\n "@SectionPAD " belowchar ?\n) | |
1303 (forward-line -2))) | |
1304 | |
1305 (put 'SectionPAD 'texinfo-format 'texinfo-format-sectionpad) | |
1306 (defun texinfo-format-sectionpad () | |
1307 (let ((str (texinfo-parse-arg-discard))) | |
1308 (forward-char -1) | |
1309 (let ((column (current-column))) | |
1310 (forward-char 1) | |
1311 (while (> column 0) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1312 (insert str) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1313 (setq column (1- column)))) |
189 | 1314 (insert ?\n))) |
1315 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1316 |
9754
7e9b8823755b
(texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents:
9549
diff
changeset
|
1317 ;;; 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
|
1318 |
189 | 1319 (put '\. 'texinfo-format 'texinfo-format-\.) |
1320 (defun texinfo-format-\. () | |
1321 (texinfo-discard-command) | |
1322 (insert ".")) | |
1323 | |
1324 (put '\: 'texinfo-format 'texinfo-format-\:) | |
1325 (defun texinfo-format-\: () | |
1326 (texinfo-discard-command)) | |
1327 | |
9754
7e9b8823755b
(texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents:
9549
diff
changeset
|
1328 (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
|
1329 (defun texinfo-format-soft-hyphen () |
7e9b8823755b
(texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents:
9549
diff
changeset
|
1330 (texinfo-discard-command)) |
7e9b8823755b
(texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents:
9549
diff
changeset
|
1331 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1332 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1333 ;;; @center, @sp, and @br |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1334 |
189 | 1335 (put 'center 'texinfo-format 'texinfo-format-center) |
1336 (defun texinfo-format-center () | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1337 (let ((arg (texinfo-parse-expanded-arg))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1338 (texinfo-discard-command) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1339 (insert arg) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1340 (insert ?\n) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1341 (save-restriction |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1342 (goto-char (1- (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1343 (let ((indent-tabs-mode nil)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1344 (center-line))))) |
189 | 1345 |
1346 (put 'sp 'texinfo-format 'texinfo-format-sp) | |
1347 (defun texinfo-format-sp () | |
1348 (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
|
1349 (num (read arg))) |
189 | 1350 (insert-char ?\n num))) |
1351 | |
1352 (put 'br 'texinfo-format 'texinfo-format-paragraph-break) | |
1353 (defun texinfo-format-paragraph-break () | |
1354 "Force a paragraph break. | |
1355 If used within a line, follow `@br' with braces." | |
1356 (texinfo-optional-braces-discard) | |
1357 ;; insert one return if at end of line; | |
1358 ;; else insert two returns, to generate a blank line. | |
1359 (if (= (following-char) ?\n) | |
1360 (insert ?\n) | |
1361 (insert-char ?\n 2))) | |
1362 | |
1363 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1364 ;;; @footnote and @footnotestyle |
189 | 1365 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1366 ;; In Texinfo, footnotes are created with the `@footnote' command. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1367 ;; This command is followed immediately by a left brace, then by the text of |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1368 ;; the footnote, and then by a terminating right brace. The |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1369 ;; template for a footnote is: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1370 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1371 ;; @footnote{TEXT} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1372 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1373 ;; Info has two footnote styles: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1374 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1375 ;; * In the End of node style, all the footnotes for a single node |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1376 ;; are placed at the end of that node. The footnotes are |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1377 ;; separated from the rest of the node by a line of dashes with |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1378 ;; the word `Footnotes' within it. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1379 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1380 ;; * In the Separate node style, all the footnotes for a single node |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1381 ;; are placed in an automatically constructed node of their own. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1382 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1383 ;; Footnote style is specified by the @footnotestyle command, either |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1384 ;; @footnotestyle separate |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1385 ;; or |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1386 ;; @footnotestyle end |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1387 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1388 ;; The default is separate |
189 | 1389 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1390 (defvar texinfo-footnote-style "separate" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1391 "Footnote style, either separate or end.") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1392 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1393 (put 'footnotestyle 'texinfo-format 'texinfo-footnotestyle) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1394 (defun texinfo-footnotestyle () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1395 "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
|
1396 Argument is either end or separate." |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1397 (setq texinfo-footnote-style (texinfo-parse-arg-discard))) |
189 | 1398 |
1399 (defvar texinfo-footnote-number) | |
1400 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1401 (put 'footnote 'texinfo-format 'texinfo-format-footnote) |
189 | 1402 (defun texinfo-format-footnote () |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1403 "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
|
1404 The texinfo-footnote-style variable controls which style is used." |
189 | 1405 (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
|
1406 (cond ((string= texinfo-footnote-style "end") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1407 (texinfo-format-end-node)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1408 ((string= texinfo-footnote-style "separate") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1409 (texinfo-format-separate-node)))) |
189 | 1410 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1411 (defun texinfo-format-separate-node () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1412 "Format footnote in Separate node style, with notes in own node. |
189 | 1413 The node is constructed automatically." |
1414 (let* (start | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1415 (arg (texinfo-parse-line-arg)) |
189 | 1416 (node-name-beginning |
1417 (save-excursion | |
1418 (re-search-backward | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1419 "^File: \\w+\\(\\w\\|\\s_\\|\\.\\|,\\)*[ \t]+Node:") |
189 | 1420 (match-end 0))) |
1421 (node-name | |
1422 (save-excursion | |
1423 (buffer-substring | |
1424 (progn (goto-char node-name-beginning) ; skip over node command | |
1425 (skip-chars-forward " \t") ; and over spaces | |
1426 (point)) | |
1427 (if (search-forward | |
1428 "," | |
1429 (save-excursion (end-of-line) (point)) t) ; bound search | |
1430 (1- (point)) | |
1431 (end-of-line) (point)))))) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1432 (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
|
1433 (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
|
1434 (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1435 (insert (format " (%d) (*Note %s-Footnotes::)" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1436 texinfo-footnote-number node-name)) |
189 | 1437 (fill-paragraph nil) |
1438 (save-excursion | |
1439 (if (re-search-forward "^@node" nil 'move) | |
1440 (forward-line -1)) | |
1441 | |
1442 ;; two cases: for the first footnote, we must insert a node header; | |
1443 ;; for the second and subsequent footnotes, we need only insert | |
1444 ;; the text of the footnote. | |
1445 | |
1446 (if (save-excursion | |
1447 (re-search-backward | |
1448 (concat node-name "-Footnotes, Up: ") | |
1449 node-name-beginning | |
1450 t)) | |
1451 (progn ; already at least one footnote | |
1452 (setq start (point)) | |
1453 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg)) | |
1454 (fill-region start (point))) | |
1455 ;; else not yet a footnote | |
1456 (insert "\n\^_\nFile: " texinfo-format-filename | |
1457 " Node: " node-name "-Footnotes, Up: " node-name "\n") | |
1458 (setq start (point)) | |
1459 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg)) | |
1460 (fill-region start (point)))))) | |
1461 | |
1462 (defun texinfo-format-end-node () | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1463 "Format footnote in the End of node style, with notes at end of node." |
189 | 1464 (let (start |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1465 (arg (texinfo-parse-line-arg))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1466 (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
|
1467 (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
|
1468 (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1469 (insert (format " (%d) " texinfo-footnote-number)) |
189 | 1470 (fill-paragraph nil) |
1471 (save-excursion | |
1472 (if (search-forward "\n--------- Footnotes ---------\n" nil t) | |
1473 (progn ; already have footnote, put new one before end of node | |
1474 (if (re-search-forward "^@node" nil 'move) | |
1475 (forward-line -1)) | |
1476 (setq start (point)) | |
1477 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg)) | |
1478 (fill-region start (point))) | |
1479 ;; else no prior footnote | |
1480 (if (re-search-forward "^@node" nil 'move) | |
1481 (forward-line -1)) | |
1482 (insert "\n--------- Footnotes ---------\n") | |
1483 (setq start (point)) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1484 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg)))))) |
189 | 1485 |
1486 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1487 ;;; @itemize, @enumerate, and similar commands |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1488 |
189 | 1489 ;; @itemize pushes (itemize "COMMANDS" STARTPOS) on texinfo-stack. |
1490 ;; @enumerate pushes (enumerate 0 STARTPOS). | |
1491 ;; @item dispatches to the texinfo-item prop of the first elt of the list. | |
1492 ;; For itemize, this puts in and rescans the COMMANDS. | |
1493 ;; For enumerate, this increments the number and puts it in. | |
1494 ;; In either case, it puts a Backspace at the front of the line | |
1495 ;; which marks it not to be indented later. | |
1496 ;; All other lines get indented by 5 when the @end is reached. | |
1497 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1498 (defvar texinfo-stack-depth 0 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1499 "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
|
1500 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
|
1501 |
189 | 1502 (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
|
1503 (setq texinfo-stack-depth (1+ texinfo-stack-depth)) |
189 | 1504 (setq texinfo-stack |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1505 (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
|
1506 texinfo-stack))) |
189 | 1507 |
1508 (defun texinfo-pop-stack (check) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1509 (setq texinfo-stack-depth (1- texinfo-stack-depth)) |
189 | 1510 (if (null texinfo-stack) |
1511 (error "Unmatched @end %s" check)) | |
1512 (if (not (eq (car (car texinfo-stack)) check)) | |
1513 (error "@end %s matches @%s" | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1514 check (car (car texinfo-stack)))) |
189 | 1515 (prog1 (cdr (car texinfo-stack)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1516 (setq texinfo-stack (cdr texinfo-stack)))) |
189 | 1517 |
1518 (put 'itemize 'texinfo-format 'texinfo-itemize) | |
1519 (defun texinfo-itemize () | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1520 (texinfo-push-stack |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1521 'itemize |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1522 (progn (skip-chars-forward " \t") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1523 (if (eolp) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1524 "@bullet" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1525 (texinfo-parse-line-arg)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1526 (texinfo-discard-line-with-args) |
189 | 1527 (setq fill-column (- fill-column 5))) |
1528 | |
1529 (put 'itemize 'texinfo-end 'texinfo-end-itemize) | |
1530 (defun texinfo-end-itemize () | |
1531 (setq fill-column (+ fill-column 5)) | |
1532 (texinfo-discard-command) | |
1533 (let ((stacktop | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1534 (texinfo-pop-stack 'itemize))) |
189 | 1535 (texinfo-do-itemize (nth 1 stacktop)))) |
1536 | |
1537 (put 'enumerate 'texinfo-format 'texinfo-enumerate) | |
1538 (defun texinfo-enumerate () | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1539 (texinfo-push-stack |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1540 'enumerate |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1541 (progn (skip-chars-forward " \t") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1542 (if (eolp) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1543 1 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1544 (read (current-buffer))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1545 (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
|
1546 (> 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
|
1547 (error |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1548 "@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
|
1549 (texinfo-discard-line-with-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1550 (setq fill-column (- fill-column 5))) |
189 | 1551 |
1552 (put 'enumerate 'texinfo-end 'texinfo-end-enumerate) | |
1553 (defun texinfo-end-enumerate () | |
1554 (setq fill-column (+ fill-column 5)) | |
1555 (texinfo-discard-command) | |
1556 (let ((stacktop | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1557 (texinfo-pop-stack 'enumerate))) |
189 | 1558 (texinfo-do-itemize (nth 1 stacktop)))) |
1559 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1560 ;; @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
|
1561 (put 'alphaenumerate 'texinfo-format 'texinfo-alphaenumerate) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1562 (defun texinfo-alphaenumerate () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1563 (texinfo-push-stack 'alphaenumerate (1- ?a)) |
189 | 1564 (setq fill-column (- fill-column 5)) |
1565 (texinfo-discard-line)) | |
1566 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1567 (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
|
1568 (defun texinfo-end-alphaenumerate () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1569 (setq fill-column (+ fill-column 5)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1570 (texinfo-discard-command) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1571 (let ((stacktop |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1572 (texinfo-pop-stack 'alphaenumerate))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1573 (texinfo-do-itemize (nth 1 stacktop)))) |
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 ;; @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
|
1576 (put 'capsenumerate 'texinfo-format 'texinfo-capsenumerate) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1577 (defun texinfo-capsenumerate () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1578 (texinfo-push-stack 'capsenumerate (1- ?A)) |
189 | 1579 (setq fill-column (- fill-column 5)) |
1580 (texinfo-discard-line)) | |
1581 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1582 (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
|
1583 (defun texinfo-end-capsenumerate () |
189 | 1584 (setq fill-column (+ fill-column 5)) |
1585 (texinfo-discard-command) | |
1586 (let ((stacktop | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1587 (texinfo-pop-stack 'capsenumerate))) |
189 | 1588 (texinfo-do-itemize (nth 1 stacktop)))) |
1589 | |
1590 ;; At the @end, indent all the lines within the construct | |
1591 ;; except those marked with backspace. FROM says where | |
1592 ;; construct started. | |
1593 (defun texinfo-do-itemize (from) | |
1594 (save-excursion | |
1595 (while (progn (forward-line -1) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1596 (>= (point) from)) |
189 | 1597 (if (= (following-char) ?\b) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1598 (save-excursion |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1599 (delete-char 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1600 (end-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1601 (delete-char 6)) |
189 | 1602 (if (not (looking-at "[ \t]*$")) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1603 (save-excursion (insert " "))))))) |
189 | 1604 |
1605 (put 'item 'texinfo-format 'texinfo-item) | |
1606 (put 'itemx 'texinfo-format 'texinfo-item) | |
1607 (defun texinfo-item () | |
1608 (funcall (get (car (car texinfo-stack)) 'texinfo-item))) | |
1609 | |
1610 (put 'itemize 'texinfo-item 'texinfo-itemize-item) | |
1611 (defun texinfo-itemize-item () | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1612 ;; (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
|
1613 (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
|
1614 (if (looking-at "[ \t]*[^ \t\n]+") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1615 ;; 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
|
1616 (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
|
1617 ;; Else text on next line. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1618 (insert "\b " (nth 1 (car texinfo-stack)) " ")) |
189 | 1619 (forward-line -1)) |
1620 | |
1621 (put 'enumerate 'texinfo-item 'texinfo-enumerate-item) | |
1622 (defun texinfo-enumerate-item () | |
1623 (texinfo-discard-line) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1624 (let (enumerating-symbol) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1625 (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
|
1626 (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
|
1627 (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
|
1628 (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
|
1629 ((symbolp (car (cdr (car texinfo-stack)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1630 (setq enumerating-symbol |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1631 (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
|
1632 (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
|
1633 (equal ?\{ (string-to-char enumerating-symbol))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1634 (error |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1635 "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
|
1636 (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
|
1637 (setcar (cdr (car texinfo-stack)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1638 (make-symbol |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1639 (char-to-string |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1640 (1+ |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1641 (string-to-char enumerating-symbol)))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1642 (t |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1643 (error |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1644 "@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
|
1645 (forward-line -1))) |
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 'alphaenumerate 'texinfo-item 'texinfo-alphaenumerate-item) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1648 (defun texinfo-alphaenumerate-item () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1649 (texinfo-discard-line) |
189 | 1650 (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
|
1651 (if (> next ?z) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1652 (error "More than 26 items in @alphaenumerate; get a bigger alphabet.")) |
189 | 1653 (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
|
1654 (insert "\b " next ". \n")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1655 (forward-line -1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1656 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1657 (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
|
1658 (defun texinfo-capsenumerate-item () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1659 (texinfo-discard-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1660 (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
|
1661 (if (> next ?Z) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1662 (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
|
1663 (setcar (cdr (car texinfo-stack)) next) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1664 (insert "\b " next ". \n")) |
189 | 1665 (forward-line -1)) |
1666 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1667 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1668 ;;; @table |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1669 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1670 ;; The `@table' command produces two-column tables. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1671 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1672 (put 'table 'texinfo-format 'texinfo-table) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1673 (defun texinfo-table () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1674 (texinfo-push-stack |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1675 'table |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1676 (progn (skip-chars-forward " \t") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1677 (if (eolp) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1678 "@asis" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1679 (texinfo-parse-line-arg)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1680 (texinfo-discard-line-with-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1681 (setq fill-column (- fill-column 5))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1682 |
189 | 1683 (put 'table 'texinfo-item 'texinfo-table-item) |
1684 (defun texinfo-table-item () | |
1685 (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
|
1686 (itemfont (car (cdr (car texinfo-stack))))) |
189 | 1687 (insert ?\b itemfont ?\{ arg "}\n \n")) |
1688 (forward-line -2)) | |
1689 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1690 (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
|
1691 (defun texinfo-end-table () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1692 (setq fill-column (+ fill-column 5)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1693 (texinfo-discard-command) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1694 (let ((stacktop |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1695 (texinfo-pop-stack 'table))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1696 (texinfo-do-itemize (nth 1 stacktop)))) |
189 | 1697 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1698 ;; @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
|
1699 ;; 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
|
1700 ;; 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
|
1701 (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
|
1702 (put 'description 'texinfo-format 'texinfo-description) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1703 (defun texinfo-description () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1704 (texinfo-push-stack 'table "@asis") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1705 (setq fill-column (- fill-column 5)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1706 (texinfo-discard-line)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1707 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1708 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1709 ;;; @ftable, @vtable |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1710 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1711 ;; The `@ftable' and `@vtable' commands are like the `@table' command |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1712 ;; but they also insert each entry in the first column of the table |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1713 ;; into the function or variable index. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1714 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1715 ;; Handle the @ftable and @vtable commands: |
189 | 1716 |
1717 (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
|
1718 (put 'vtable 'texinfo-format 'texinfo-vtable) |
189 | 1719 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1720 (defun texinfo-ftable () (texinfo-indextable 'ftable)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1721 (defun texinfo-vtable () (texinfo-indextable 'vtable)) |
189 | 1722 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1723 (defun texinfo-indextable (table-type) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1724 (texinfo-push-stack table-type (texinfo-parse-arg-discard)) |
189 | 1725 (setq fill-column (- fill-column 5))) |
1726 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1727 ;; 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
|
1728 |
189 | 1729 (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
|
1730 (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
|
1731 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1732 (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
|
1733 (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
|
1734 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1735 (defun texinfo-indextable-item (index-type) |
189 | 1736 (let ((item (texinfo-parse-arg-discard)) |
1737 (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
|
1738 (indexvar index-type)) |
189 | 1739 (insert ?\b itemfont ?\{ item "}\n \n") |
1740 (set indexvar | |
1741 (cons | |
1742 (list item texinfo-last-node) | |
1743 (symbol-value indexvar))) | |
1744 (forward-line -2))) | |
1745 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1746 ;; Handle @end ftable, @end vtable |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1747 |
189 | 1748 (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
|
1749 (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
|
1750 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1751 (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
|
1752 (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
|
1753 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1754 (defun texinfo-end-indextable (table-type) |
189 | 1755 (setq fill-column (+ fill-column 5)) |
1756 (texinfo-discard-command) | |
1757 (let ((stacktop | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1758 (texinfo-pop-stack table-type))) |
189 | 1759 (texinfo-do-itemize (nth 1 stacktop)))) |
1760 | |
1761 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1762 ;;; @multitable ... @end multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1763 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1764 ;; Produce a multi-column table, with as many columns as desired. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1765 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1766 ;; A multi-column table has this template: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1767 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1768 ;; @multitable {A1} {A2} {A3} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1769 ;; @item A1 @tab A2 @tab A3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1770 ;; @item B1 @tab B2 @tab B3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1771 ;; @item C1 @tab C2 @tab C3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1772 ;; @end multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1773 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1774 ;; where the width of the text in brackets specifies the width of the |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1775 ;; respective column. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1776 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1777 ;; Or else: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1778 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1779 ;; @multitable @columnfractions .25 .3 .45 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1780 ;; @item A1 @tab A2 @tab A3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1781 ;; @item B1 @tab B2 @tab B3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1782 ;; @end multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1783 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1784 ;; where the fractions specify the width of each column as a percent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1785 ;; of the current width of the text (i.e., of the fill-column). |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1786 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1787 ;; Long lines of text are filled within columns. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1788 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1789 ;; Using the Emacs Lisp formatter, texinfmt.el, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1790 ;; the whitespace between columns can be increased by setting |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1791 ;; `texinfo-extra-inter-column-width' to a value greater than 0. By default, |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1792 ;; there is at least one blank space between columns. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1793 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1794 ;; The Emacs Lisp formatter, texinfmt.el, ignores the following four |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1795 ;; commands that are defined in texinfo.tex for printed output. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1796 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1797 ;; @multitableparskip, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1798 ;; @multitableparindent, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1799 ;; @multitablecolmargin, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1800 ;; @multitablelinespace. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1801 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1802 ;; How @multitable works. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1803 ;; ===================== |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1804 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1805 ;; `texinfo-multitable' reads the @multitable line and determines from it |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1806 ;; how wide each column should be. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1807 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1808 ;; Also, it pushes this information, along with an identifying symbol, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1809 ;; onto the `texinfo-stack'. At the @end multitable command, the stack |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1810 ;; is checked for its matching @multitable command, and then popped, or |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1811 ;; else an error is signaled. Also, this command pushes the location of |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1812 ;; the start of the table onto the stack. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1813 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1814 ;; `texinfo-end-multitable' checks the `texinfo-stack' that the @end |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1815 ;; multitable truly is ending a corresponding beginning, and if it is, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1816 ;; pops the stack. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1817 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1818 ;; `texinfo-multitable-widths' is called by `texinfo-multitable'. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1819 ;; The function returns a list of the widths of each column in a |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1820 ;; multi-column table, based on the information supplied by the arguments |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1821 ;; to the @multitable command (by arguments, I mean the text on the rest |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1822 ;; of the @multitable line, not the remainder of the multi-column table |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1823 ;; environment). |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1824 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1825 ;; `texinfo-multitable-item' formats a row within a multicolumn table. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1826 ;; This command is executed when texinfmt sees @item inside @multitable. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1827 ;; Cells in row are separated by `@tab's. Widths of cells are specified |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1828 ;; by the arguments in the @multitable line. Cells are filled. All cells |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1829 ;; are made to be the same height by padding their bottoms, as needed, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1830 ;; with blanks. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1831 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1832 ;; `texinfo-multitable-extract-row' is called by `texinfo-multitable-item'. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1833 ;; This function returns the text in a multitable row, as a string. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1834 ;; The start of a row is marked by an @item and the end of row is the |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1835 ;; beginning of next @item or beginning of the @end multitable line. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1836 ;; Cells within a row are separated by @tab. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1837 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1838 ;; Note that @tab, the cell separators, are not treated as independent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1839 ;; Texinfo commands. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1840 |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1841 (defvar texinfo-extra-inter-column-width 0 |
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1842 "*Number of extra spaces between entries (columns) in @multitable.") |
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1843 |
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1844 (defvar texinfo-multitable-buffer-name "*multitable-temporary-buffer*") |
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1845 (defvar texinfo-multitable-rectangle-name "texinfo-multitable-temp-") |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1846 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1847 ;; These commands are defined in texinfo.tex for printed output. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1848 (put 'multitableparskip 'texinfo-format 'texinfo-discard-line-with-args) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1849 (put 'multitableparindent 'texinfo-format 'texinfo-discard-line-with-args) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1850 (put 'multitablecolmargin 'texinfo-format 'texinfo-discard-line-with-args) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1851 (put 'multitablelinespace 'texinfo-format 'texinfo-discard-line-with-args) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1852 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1853 (put 'multitable 'texinfo-format 'texinfo-multitable) |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1854 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1855 (defun texinfo-multitable () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1856 "Produce multi-column tables. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1857 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1858 A multi-column table has this template: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1859 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1860 @multitable {A1} {A2} {A3} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1861 @item A1 @tab A2 @tab A3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1862 @item B1 @tab B2 @tab B3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1863 @item C1 @tab C2 @tab C3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1864 @end multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1865 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1866 where the width of the text in brackets specifies the width of the |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1867 respective column. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1868 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1869 Or else: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1870 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1871 @multitable @columnfractions .25 .3 .45 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1872 @item A1 @tab A2 @tab A3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1873 @item B1 @tab B2 @tab B3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1874 @end multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1875 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1876 where the fractions specify the width of each column as a percent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1877 of the current width of the text (i.e., of the fill-column). |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1878 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1879 Long lines of text are filled within columns. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1880 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1881 Using the Emacs Lisp formatter, texinfmt.el, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1882 the whitespace between columns can be increased by setting |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1883 `texinfo-extra-inter-column-width' to a value greater than 0. By default, |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1884 there is at least one blank space between columns. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1885 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1886 The Emacs Lisp formatter, texinfmt.el, ignores the following four |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1887 commands that are defined in texinfo.tex for printed output. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1888 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1889 @multitableparskip, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1890 @multitableparindent, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1891 @multitablecolmargin, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1892 @multitablelinespace." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1893 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1894 ;; This function pushes information onto the `texinfo-stack'. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1895 ;; A stack element consists of: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1896 ;; - type-of-command, i.e., multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1897 ;; - the information about column widths, and |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1898 ;; - the position of texinfo-command-start. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1899 ;; e.g., ('multitable (1 2 3 4) 123) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1900 ;; The command line is then deleted. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1901 (texinfo-push-stack |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1902 'multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1903 ;; push width information on stack |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1904 (texinfo-multitable-widths)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1905 (texinfo-discard-line-with-args)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1906 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1907 (put 'multitable 'texinfo-end 'texinfo-end-multitable) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1908 (defun texinfo-end-multitable () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1909 "Discard the @end multitable line and pop the stack of multitable." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1910 (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1911 (texinfo-pop-stack 'multitable)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1912 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1913 (defun texinfo-multitable-widths () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1914 "Return list of widths of each column in a multi-column table." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1915 (let (texinfo-multitable-width-list) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1916 ;; Fractions format: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1917 ;; @multitable @columnfractions .25 .3 .45 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1918 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1919 ;; Template format: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1920 ;; @multitable {Column 1 template} {Column 2} {Column 3 example} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1921 ;; Place point before first argument |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1922 (skip-chars-forward " \t") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1923 (cond |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1924 ;; Check for common misspelling |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1925 ((looking-at "@columnfraction ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1926 (error "In @multitable, @columnfractions misspelled")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1927 ;; Case 1: @columnfractions .25 .3 .45 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1928 ((looking-at "@columnfractions") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1929 (forward-word 1) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1930 (while (not (eolp)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1931 (setq texinfo-multitable-width-list |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1932 (cons |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1933 (truncate |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1934 (1- |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1935 (* fill-column (read (get-buffer (current-buffer)))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1936 texinfo-multitable-width-list)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1937 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1938 ;; Case 2: {Column 1 template} {Column 2} {Column 3 example} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1939 ((looking-at "{") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1940 (let ((start-of-templates (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1941 (while (not (eolp)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1942 (skip-chars-forward " \t") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1943 (let* ((start-of-template (1+ (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1944 (end-of-template |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1945 ;; forward-sexp works with braces in Texinfo mode |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1946 (progn (forward-sexp 1) (1- (point))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1947 (setq texinfo-multitable-width-list |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1948 (cons (- end-of-template start-of-template) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1949 texinfo-multitable-width-list)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1950 ;; Remove carriage return from within a template, if any. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1951 ;; This helps those those who want to use more than |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1952 ;; one line's worth of words in @multitable line. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1953 (narrow-to-region start-of-template end-of-template) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1954 (goto-char (point-min)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1955 (while (search-forward " |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1956 " nil t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1957 (delete-char -1)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1958 (goto-char (point-max)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1959 (widen) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1960 (forward-char 1))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1961 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1962 ;; Case 3: Trouble |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1963 (t |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1964 (error |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1965 "You probably need to specify column widths for @multitable correctly."))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1966 ;; Check whether columns fit on page. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1967 (let ((desired-columns |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1968 (+ |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1969 ;; between column spaces |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1970 (length texinfo-multitable-width-list) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1971 ;; additional between column spaces, if any |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1972 texinfo-extra-inter-column-width |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1973 ;; sum of spaces for each entry |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1974 (apply '+ texinfo-multitable-width-list)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1975 (if (> desired-columns fill-column) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1976 (error |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1977 (format |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1978 "Multi-column table width, %d chars, is greater than page width, %d chars." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1979 desired-columns fill-column)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1980 texinfo-multitable-width-list)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1981 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1982 ;; @item A1 @tab A2 @tab A3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1983 (defun texinfo-multitable-extract-row () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1984 "Return multitable row, as a string. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1985 End of row is beginning of next @item or beginning of @end. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1986 Cells within rows are separated by @tab." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1987 (skip-chars-forward " \t") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1988 (let* ((start (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1989 (end (progn |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1990 (re-search-forward "@item\\|@end") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1991 (match-beginning 0))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1992 (row (progn (goto-char end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1993 (skip-chars-backward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1994 ;; remove whitespace at end of argument |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1995 (delete-region (point) end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1996 (buffer-substring start (point))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1997 (delete-region texinfo-command-start end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1998 row)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1999 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2000 (put 'multitable 'texinfo-item 'texinfo-multitable-item) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2001 (defun texinfo-multitable-item () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2002 "Format a row within a multicolumn table. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2003 Cells in row are separated by @tab. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2004 Widths of cells are specified by the arguments in the @multitable line. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2005 All cells are made to be the same height. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2006 This command is executed when texinfmt sees @item inside @multitable." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2007 (let ((original-buffer (current-buffer)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2008 (table-widths (reverse (car (cdr (car texinfo-stack))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2009 (existing-fill-column fill-column) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2010 start |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2011 end |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2012 (table-column 0) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2013 (table-entry-height 0) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2014 ;; unformatted row looks like: A1 @tab A2 @tab A3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2015 ;; extract-row command deletes the source line in the table. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2016 (unformated-row (texinfo-multitable-extract-row))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2017 ;; Use a temporary buffer |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2018 (set-buffer (get-buffer-create texinfo-multitable-buffer-name)) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2019 (delete-region (point-min) (point-max)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2020 (insert unformated-row) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2021 (goto-char (point-min)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2022 ;; 1. Check for correct number of @tab in line. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2023 (let ((tab-number 1)) ; one @tab between two columns |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2024 (while (search-forward "@tab" nil t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2025 (setq tab-number (1+ tab-number))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2026 (if (/= tab-number (length table-widths)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2027 (error "Wrong number of @tab's in a @multitable row."))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2028 (goto-char (point-min)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2029 ;; 2. Format each cell, and copy to a rectangle |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2030 ;; buffer looks like this: A1 @tab A2 @tab A3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2031 ;; Cell #1: format up to @tab |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2032 ;; Cell #2: format up to @tab |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2033 ;; Cell #3: format up to eob |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2034 (while (not (eobp)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2035 (setq start (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2036 (setq end (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2037 (if (search-forward "@tab" nil 'move) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2038 ;; Delete the @tab command, including the @-sign |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2039 (delete-region |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2040 (point) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2041 (progn (forward-word -1) (1- (point))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2042 (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2043 ;; Set fill-column *wider* than needed to produce inter-column space |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2044 (setq fill-column (+ 1 |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2045 texinfo-extra-inter-column-width |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2046 (nth table-column table-widths))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2047 (narrow-to-region start end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2048 ;; Remove whitespace before and after entry. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2049 (skip-chars-forward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2050 (delete-region (point) (save-excursion (beginning-of-line) (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2051 (goto-char (point-max)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2052 (skip-chars-backward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2053 (delete-region (point) (save-excursion (end-of-line) (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2054 ;; Temorarily set texinfo-stack to nil so texinfo-format-scan |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2055 ;; does not see an unterminated @multitable. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2056 (let (texinfo-stack) ; nil |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2057 (texinfo-format-scan)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2058 (let (fill-prefix) ; no fill prefix |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2059 (fill-region (point-min) (point-max))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2060 (setq table-entry-height |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2061 (max table-entry-height (count-lines (point-min) (point-max)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2062 ;; 3. Move point to end of bottom line, and pad that line to fill column. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2063 (goto-char (point-min)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2064 (forward-line (1- table-entry-height)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2065 (let* ((beg (point)) ; beginning of line |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2066 ;; add one more space for inter-column spacing |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2067 (needed-whitespace |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2068 (1+ |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2069 (- fill-column |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2070 (- |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2071 (progn (end-of-line) (point)) ; end of existing line |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2072 beg))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2073 (insert (make-string |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2074 (if (> needed-whitespace 0) needed-whitespace 1) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2075 ? ))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2076 ;; now, put formatted cell into a rectangle |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2077 (set (intern (concat texinfo-multitable-rectangle-name |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2078 (int-to-string table-column))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2079 (extract-rectangle (point-min) (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2080 (delete-region (point-min) (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2081 (goto-char (point-max)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2082 (setq table-column (1+ table-column)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2083 (widen)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2084 ;; 4. Add extra lines to rectangles so all are of same height |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2085 (let ((total-number-of-columns table-column) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2086 (column-number 0) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2087 here) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2088 (while (> table-column 0) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2089 (let ((this-rectangle (int-to-string table-column))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2090 (while (< (length this-rectangle) table-entry-height) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2091 (setq this-rectangle (append this-rectangle '(""))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2092 (setq table-column (1- table-column))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2093 ;; 5. Insert formatted rectangles in original buffer |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2094 (switch-to-buffer original-buffer) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2095 (open-line table-entry-height) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2096 (while (< column-number total-number-of-columns) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2097 (setq here (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2098 (insert-rectangle |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2099 (eval (intern |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2100 (concat texinfo-multitable-rectangle-name |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2101 (int-to-string column-number))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2102 (goto-char here) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2103 (end-of-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2104 (setq column-number (1+ column-number)))) |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2105 (kill-buffer texinfo-multitable-buffer-name) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2106 (setq fill-column existing-fill-column))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2107 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2108 |
9549
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2109 ;;; @ifinfo, @iftex, @tex, @ifhtml, @html |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2110 |
189 | 2111 (put 'ifinfo 'texinfo-format 'texinfo-discard-line) |
2112 (put 'ifinfo 'texinfo-end 'texinfo-discard-command) | |
2113 | |
2114 (put 'iftex 'texinfo-format 'texinfo-format-iftex) | |
2115 (defun texinfo-format-iftex () | |
2116 (delete-region texinfo-command-start | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2117 (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
|
2118 (point)))) |
189 | 2119 |
9549
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2120 (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
|
2121 (defun texinfo-format-ifhtml () |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2122 (delete-region texinfo-command-start |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2123 (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
|
2124 (point)))) |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2125 |
189 | 2126 (put 'tex 'texinfo-format 'texinfo-format-tex) |
2127 (defun texinfo-format-tex () | |
2128 (delete-region texinfo-command-start | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2129 (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
|
2130 (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2131 |
9549
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2132 (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
|
2133 (defun texinfo-format-html () |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2134 (delete-region texinfo-command-start |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2135 (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
|
2136 (point)))) |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2137 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2138 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2139 ;;; @titlepage |
189 | 2140 |
2141 (put 'titlepage 'texinfo-format 'texinfo-format-titlepage) | |
2142 (defun texinfo-format-titlepage () | |
2143 (delete-region texinfo-command-start | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2144 (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
|
2145 (point)))) |
189 | 2146 |
2147 (put 'endtitlepage 'texinfo-format 'texinfo-discard-line) | |
2148 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2149 ;; @titlespec an alternative titling command; ignored by Info |
189 | 2150 |
2151 (put 'titlespec 'texinfo-format 'texinfo-format-titlespec) | |
2152 (defun texinfo-format-titlespec () | |
2153 (delete-region texinfo-command-start | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2154 (progn (re-search-forward "@end titlespec[ \t]*\n") |
189 | 2155 (point)))) |
2156 | |
2157 (put 'endtitlespec 'texinfo-format 'texinfo-discard-line) | |
2158 | |
4396
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 ;;; @today |
189 | 2161 |
2162 (put 'today 'texinfo-format 'texinfo-format-today) | |
2163 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2164 ;; Produces Day Month Year style of output. eg `1 Jan 1900' |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2165 ;; The `@today{}' command requires a pair of braces, like `@dots{}'. |
189 | 2166 (defun texinfo-format-today () |
2167 (texinfo-parse-arg-discard) | |
15680
0f1c12e35879
(texinfo-format-today): Avoid race condition by getting current time only once.
Karl Heuer <kwzh@gnu.org>
parents:
14169
diff
changeset
|
2168 (insert (format-time-string "%e %b %Y"))) |
189 | 2169 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2170 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2171 ;;; @timestamp{} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2172 ;; Produce `Day Month Year Hour:Min' style of output. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2173 ;; eg `1 Jan 1900 13:52' |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2174 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2175 (put 'timestamp 'texinfo-format 'texinfo-format-timestamp) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2176 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2177 ;; The `@timestamp{}' command requires a pair of braces, like `@dots{}'. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2178 (defun texinfo-format-timestamp () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2179 "Insert the current local time and date." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2180 (texinfo-parse-arg-discard) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2181 ;; For seconds and time zone, replace format string with "%e %b %Y %T %Z" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2182 (insert (format-time-string "%e %b %Y %R"))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2183 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2184 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2185 ;;; @ignore |
189 | 2186 |
2187 (put 'ignore 'texinfo-format 'texinfo-format-ignore) | |
2188 (defun texinfo-format-ignore () | |
2189 (delete-region texinfo-command-start | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2190 (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
|
2191 (point)))) |
189 | 2192 |
2193 (put 'endignore 'texinfo-format 'texinfo-discard-line) | |
2194 | |
4396
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 ;;; Define the Info enclosure command: @definfoenclose |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2197 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2198 ;; A `@definfoenclose' command may be used to define a highlighting |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2199 ;; command for Info, but not for TeX. A command defined using |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2200 ;; `@definfoenclose' marks text by enclosing it in strings that precede |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2201 ;; and follow the text. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2202 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2203 ;; Presumably, if you define a command with `@definfoenclose` for Info, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2204 ;; you will also define the same command in the TeX definitions file, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2205 ;; `texinfo.tex' in a manner appropriate for typesetting. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2206 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2207 ;; Write a `@definfoenclose' command on a line and follow it with three |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2208 ;; arguments separated by commas (commas are used as separators in an |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2209 ;; `@node' line in the same way). The first argument to |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2210 ;; `@definfoenclose' is the @-command name \(without the `@'\); the |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2211 ;; second argument is the Info start delimiter string; and the third |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2212 ;; argument is the Info end delimiter string. The latter two arguments |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2213 ;; enclose the highlighted text in the Info file. A delimiter string |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2214 ;; may contain spaces. Neither the start nor end delimiter is |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2215 ;; required. However, if you do not provide a start delimiter, you |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2216 ;; must follow the command name with two commas in a row; otherwise, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2217 ;; the Info formatting commands will misinterpret the end delimiter |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2218 ;; string as a start delimiter string. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2219 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2220 ;; If you do a @definfoenclose{} on the name of a pre-defined macro (such |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2221 ;; as @emph{}, @strong{}, @tt{}, or @i{}) the enclosure definition will |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2222 ;; override the built-in definition. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2223 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2224 ;; An enclosure command defined this way takes one argument in braces. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2225 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2226 ;; For example, you can write: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2227 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2228 ;; @ifinfo |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2229 ;; @definfoenclose phoo, //, \\ |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2230 ;; @end ifinfo |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2231 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2232 ;; near the beginning of a Texinfo file at the beginning of the lines |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2233 ;; to define `@phoo' as an Info formatting command that inserts `//' |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2234 ;; before and `\\' after the argument to `@phoo'. You can then write |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2235 ;; `@phoo{bar}' wherever you want `//bar\\' highlighted in Info. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2236 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2237 ;; Also, for TeX formatting, you could write |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2238 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2239 ;; @iftex |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2240 ;; @global@let@phoo=@i |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2241 ;; @end iftex |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2242 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2243 ;; to define `@phoo' as a command that causes TeX to typeset |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2244 ;; the argument to `@phoo' in italics. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2245 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2246 ;; Note that each definition applies to its own formatter: one for TeX, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2247 ;; the other for texinfo-format-buffer or texinfo-format-region. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2248 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2249 ;; Here is another example: write |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2250 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2251 ;; @definfoenclose headword, , : |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2252 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2253 ;; near the beginning of the file, to define `@headword' as an Info |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2254 ;; formatting command that inserts nothing before and a colon after the |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2255 ;; argument to `@headword'. |
4396
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 (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
|
2258 (defun texinfo-define-info-enclosure () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2259 (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
|
2260 (command-name (nth 0 args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2261 (beginning-delimiter (or (nth 1 args) "")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2262 (end-delimiter (or (nth 2 args) ""))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2263 (texinfo-discard-command) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2264 (setq texinfo-enclosure-list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2265 (cons |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2266 (list command-name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2267 (list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2268 beginning-delimiter |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2269 end-delimiter)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2270 texinfo-enclosure-list)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2271 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2272 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2273 ;;; @var, @code and the like |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2274 |
189 | 2275 (put 'var 'texinfo-format 'texinfo-format-var) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2276 ;; @sc a small caps font for TeX; formatted as `var' in Info |
189 | 2277 (put 'sc 'texinfo-format 'texinfo-format-var) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2278 ;; @acronym for abbreviations in all caps, such as `NASA'. |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2279 ;; Convert all letters to uppercase if they are not already. |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2280 (put 'acronym 'texinfo-format 'texinfo-format-var) |
189 | 2281 (defun texinfo-format-var () |
2282 (insert (upcase (texinfo-parse-arg-discard))) | |
2283 (goto-char texinfo-command-start)) | |
2284 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2285 (put 'cite 'texinfo-format 'texinfo-format-code) |
189 | 2286 (put 'code 'texinfo-format 'texinfo-format-code) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2287 ;; @command (for command names) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2288 (put 'command 'texinfo-format 'texinfo-format-code) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2289 ;; @env (for environment variables) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2290 (put 'env 'texinfo-format 'texinfo-format-code) |
189 | 2291 (put 'file 'texinfo-format 'texinfo-format-code) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2292 (put 'samp 'texinfo-format 'texinfo-format-code) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2293 (put 'url 'texinfo-format 'texinfo-format-code) |
189 | 2294 (defun texinfo-format-code () |
2295 (insert "`" (texinfo-parse-arg-discard) "'") | |
2296 (goto-char texinfo-command-start)) | |
2297 | |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2298 ;; @option (for command-line options) must be different from @code |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2299 ;; because of its special formatting in @table; namely that it does |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2300 ;; not lead to inserted ` ... ' in a table, but does elsewhere. |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2301 (put 'option 'texinfo-format 'texinfo-format-option) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2302 (defun texinfo-format-option () |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2303 "Insert ` ... ' around arg unless inside a table; in that case, no quotes." |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2304 ;; `looking-at-backward' not available in v. 18.57, 20.2 |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2305 (if (not (search-backward "" ; searched-for character is a control-H |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2306 (save-excursion (beginning-of-line) (point)) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2307 t)) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2308 (insert "`" (texinfo-parse-arg-discard) "'") |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2309 (insert (texinfo-parse-arg-discard))) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2310 (goto-char texinfo-command-start)) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2311 |
189 | 2312 (put 'emph 'texinfo-format 'texinfo-format-emph) |
2313 (put 'strong 'texinfo-format 'texinfo-format-emph) | |
2314 (defun texinfo-format-emph () | |
2315 (insert "*" (texinfo-parse-arg-discard) "*") | |
2316 (goto-char texinfo-command-start)) | |
2317 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2318 (put 'dfn 'texinfo-format 'texinfo-format-defn) |
189 | 2319 (put 'defn 'texinfo-format 'texinfo-format-defn) |
2320 (defun texinfo-format-defn () | |
2321 (insert "\"" (texinfo-parse-arg-discard) "\"") | |
2322 (goto-char texinfo-command-start)) | |
2323 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2324 (put 'email 'texinfo-format 'texinfo-format-key) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2325 (put 'key 'texinfo-format 'texinfo-format-key) |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2326 ;; I've decided not want to have angle brackets around these -- rms. |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2327 (defun texinfo-format-key () |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2328 (insert (texinfo-parse-arg-discard)) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2329 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2330 |
189 | 2331 (put 'bullet 'texinfo-format 'texinfo-format-bullet) |
2332 (defun texinfo-format-bullet () | |
2333 "Insert an asterisk. | |
2334 If used within a line, follow `@bullet' with braces." | |
2335 (texinfo-optional-braces-discard) | |
2336 (insert "*")) | |
2337 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2338 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2339 ;;; @kbd |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2340 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2341 ;; Inside of @example ... @end example and similar environments, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2342 ;; @kbd does nothing; but outside of such environments, it places |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2343 ;; single quotation markes around its argument. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2344 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2345 (defvar texinfo-format-kbd-regexp |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2346 (concat |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2347 "^@" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2348 "\\(" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2349 "example\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2350 "smallexample\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2351 "lisp\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2352 "smalllisp" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2353 "\\)") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2354 "Regexp specifying environments in which @kbd does not put `...' |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2355 around argument.") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2356 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2357 (defvar texinfo-format-kbd-end-regexp |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2358 (concat |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2359 "^@end " |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2360 "\\(" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2361 "example\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2362 "smallexample\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2363 "lisp\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2364 "smalllisp" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2365 "\\)") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2366 "Regexp specifying end of environments in which @kbd does not put `...' |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2367 around argument. (See `texinfo-format-kbd-regexp')") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2368 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2369 (put 'kbd 'texinfo-format 'texinfo-format-kbd) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2370 (defun texinfo-format-kbd () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2371 "Place single quote marks around arg, except in @example and similar." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2372 ;; Search forward for @end example closer than an @example. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2373 ;; Can stop search at nearest @node or texinfo-section-types-regexp |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2374 (let* ((stop |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2375 (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2376 (re-search-forward |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2377 (concat "^@node\\|\\(" texinfo-section-types-regexp "\\)") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2378 nil |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2379 'move-to-end) ; if necessary, return point at end of buffer |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2380 (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2381 (example-location |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2382 (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2383 (re-search-forward texinfo-format-kbd-regexp stop 'move-to-end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2384 (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2385 (end-example-location |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2386 (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2387 (re-search-forward texinfo-format-kbd-end-regexp stop 'move-to-end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2388 (point)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2389 ;; If inside @example, @end example will be closer than @example |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2390 ;; or end of search i.e., end-example-location less than example-location |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2391 (if (>= end-example-location example-location) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2392 ;; outside an @example or equivalent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2393 (insert "`" (texinfo-parse-arg-discard) "'") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2394 ;; else, in @example; do not surround with `...' |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2395 (insert (texinfo-parse-arg-discard))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2396 (goto-char texinfo-command-start))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2397 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2398 |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2399 ;;; @example, @lisp, @quotation, @display, @smalllisp, @smallexample, |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2400 ;; @smalldisplay |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2401 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2402 (put 'display 'texinfo-format 'texinfo-format-example) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2403 (put 'smalldisplay 'texinfo-format 'texinfo-format-example) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2404 (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
|
2405 (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
|
2406 (put 'quotation 'texinfo-format 'texinfo-format-example) |
189 | 2407 (put 'smallexample 'texinfo-format 'texinfo-format-example) |
2408 (put 'smalllisp 'texinfo-format 'texinfo-format-example) | |
2409 (defun texinfo-format-example () | |
2410 (texinfo-push-stack 'example nil) | |
2411 (setq fill-column (- fill-column 5)) | |
2412 (texinfo-discard-line)) | |
2413 | |
2414 (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
|
2415 (put 'display 'texinfo-end 'texinfo-end-example) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2416 (put 'smalldisplay 'texinfo-end 'texinfo-end-example) |
189 | 2417 (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
|
2418 (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
|
2419 (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
|
2420 (put 'smalllisp 'texinfo-end 'texinfo-end-example) |
189 | 2421 (defun texinfo-end-example () |
2422 (setq fill-column (+ fill-column 5)) | |
2423 (texinfo-discard-command) | |
2424 (let ((stacktop | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2425 (texinfo-pop-stack 'example))) |
189 | 2426 (texinfo-do-itemize (nth 1 stacktop)))) |
2427 | |
2428 (put 'exdent 'texinfo-format 'texinfo-format-exdent) | |
2429 (defun texinfo-format-exdent () | |
2430 (texinfo-discard-command) | |
2431 (delete-region (point) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2432 (progn |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2433 (skip-chars-forward " ") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2434 (point))) |
189 | 2435 (insert ?\b) |
2436 ;; Cancel out the deletion that texinfo-do-itemize | |
2437 ;; is going to do at the end of this line. | |
2438 (save-excursion | |
2439 (end-of-line) | |
2440 (insert "\n "))) | |
2441 | |
2442 | |
18884
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2443 ;; @direntry and @dircategory |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2444 |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2445 (put 'direntry 'texinfo-format 'texinfo-format-direntry) |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2446 (defun texinfo-format-direntry () |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2447 (texinfo-push-stack 'direntry nil) |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2448 (texinfo-discard-line) |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2449 (insert "START-INFO-DIR-ENTRY\n\n")) |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2450 |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2451 (put 'direntry 'texinfo-end 'texinfo-end-direntry) |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2452 (defun texinfo-end-direntry () |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2453 (texinfo-discard-command) |
18908
a5e6856e865e
(dircategory): Delete obsolete mistaken `put'.
Richard M. Stallman <rms@gnu.org>
parents:
18884
diff
changeset
|
2454 (insert "END-INFO-DIR-ENTRY\n\n") |
18884
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2455 (texinfo-pop-stack 'direntry)) |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2456 |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2457 (put 'dircategory 'texinfo-format 'texinfo-format-dircategory) |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2458 (defun texinfo-format-dircategory () |
18908
a5e6856e865e
(dircategory): Delete obsolete mistaken `put'.
Richard M. Stallman <rms@gnu.org>
parents:
18884
diff
changeset
|
2459 (let ((str (texinfo-parse-arg-discard))) |
a5e6856e865e
(dircategory): Delete obsolete mistaken `put'.
Richard M. Stallman <rms@gnu.org>
parents:
18884
diff
changeset
|
2460 (delete-region (point) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2461 (progn |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2462 (skip-chars-forward " ") |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2463 (point))) |
18908
a5e6856e865e
(dircategory): Delete obsolete mistaken `put'.
Richard M. Stallman <rms@gnu.org>
parents:
18884
diff
changeset
|
2464 (insert "INFO-DIR-SECTION " str "\n"))) |
18884
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2465 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2466 ;;; @cartouche |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2467 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2468 ;; The @cartouche command is a noop in Info; in a printed manual, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2469 ;; it makes a box with rounded corners. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2470 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2471 (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
|
2472 (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
|
2473 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2474 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2475 ;;; @flushleft and @format |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2476 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2477 ;; The @flushleft command left justifies every line but leaves the |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2478 ;; right end ragged. As far as Info is concerned, @flushleft is a |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2479 ;; `do-nothing' command |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2480 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2481 ;; The @format command is similar to @example except that it does not |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2482 ;; indent; this means that in Info, @format is similar to @flushleft. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2483 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2484 (put 'format 'texinfo-format 'texinfo-format-flushleft) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2485 (put 'smallformat 'texinfo-format 'texinfo-format-flushleft) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2486 (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
|
2487 (defun texinfo-format-flushleft () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2488 (texinfo-discard-line)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2489 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2490 (put 'format 'texinfo-end 'texinfo-end-flushleft) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2491 (put 'smallformat 'texinfo-end 'texinfo-end-flushleft) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2492 (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
|
2493 (defun texinfo-end-flushleft () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2494 (texinfo-discard-command)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2495 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2496 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2497 ;;; @flushright |
189 | 2498 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2499 ;; The @flushright command right justifies every line but leaves the |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2500 ;; left end ragged. Spaces and tabs at the right ends of lines are |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2501 ;; removed so that visible text lines up on the right side. |
189 | 2502 |
2503 (put 'flushright 'texinfo-format 'texinfo-format-flushright) | |
2504 (defun texinfo-format-flushright () | |
2505 (texinfo-push-stack 'flushright nil) | |
2506 (texinfo-discard-line)) | |
2507 | |
2508 (put 'flushright 'texinfo-end 'texinfo-end-flushright) | |
2509 (defun texinfo-end-flushright () | |
2510 (texinfo-discard-command) | |
2511 | |
2512 (let ((stacktop | |
2513 (texinfo-pop-stack 'flushright))) | |
2514 | |
2515 (texinfo-do-flushright (nth 1 stacktop)))) | |
2516 | |
2517 (defun texinfo-do-flushright (from) | |
2518 (save-excursion | |
2519 (while (progn (forward-line -1) | |
2520 (>= (point) from)) | |
2521 | |
2522 (beginning-of-line) | |
2523 (insert | |
2524 (make-string | |
2525 (- fill-column | |
2526 (save-excursion | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2527 (end-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2528 (skip-chars-backward " \t") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2529 (delete-region (point) (progn (end-of-line) (point))) |
189 | 2530 (current-column))) |
2531 ? ))))) | |
2532 | |
2533 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2534 ;;; @ctrl, @TeX, @copyright, @minus, @dots, @enddots, @pounds |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2535 |
189 | 2536 (put 'ctrl 'texinfo-format 'texinfo-format-ctrl) |
2537 (defun texinfo-format-ctrl () | |
2538 (let ((str (texinfo-parse-arg-discard))) | |
2539 (insert (logand 31 (aref str 0))))) | |
2540 | |
2541 (put 'TeX 'texinfo-format 'texinfo-format-TeX) | |
2542 (defun texinfo-format-TeX () | |
2543 (texinfo-parse-arg-discard) | |
2544 (insert "TeX")) | |
2545 | |
2546 (put 'copyright 'texinfo-format 'texinfo-format-copyright) | |
2547 (defun texinfo-format-copyright () | |
2548 (texinfo-parse-arg-discard) | |
2549 (insert "(C)")) | |
2550 | |
2551 (put 'minus 'texinfo-format 'texinfo-format-minus) | |
2552 (defun texinfo-format-minus () | |
2553 "Insert a minus sign. | |
2554 If used within a line, follow `@minus' with braces." | |
2555 (texinfo-optional-braces-discard) | |
2556 (insert "-")) | |
2557 | |
2558 (put 'dots 'texinfo-format 'texinfo-format-dots) | |
2559 (defun texinfo-format-dots () | |
2560 (texinfo-parse-arg-discard) | |
2561 (insert "...")) | |
2562 | |
9549
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2563 (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
|
2564 (defun texinfo-format-enddots () |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2565 (texinfo-parse-arg-discard) |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2566 (insert "....")) |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2567 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2568 (put 'pounds 'texinfo-format 'texinfo-format-pounds) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2569 (defun texinfo-format-pounds () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2570 (texinfo-parse-arg-discard) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2571 (insert "#")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2572 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2573 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2574 ;;; Refilling and indenting: @refill, @paragraphindent, @noindent |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2575 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2576 ;;; 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
|
2577 ;;; @refill command. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2578 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2579 ;; * If the value is `asis', do not change the existing indentation at |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2580 ;; the starts of paragraphs. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2581 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2582 ;; * If the value zero, delete any existing indentation. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2583 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2584 ;; * If the value is greater than zero, indent each paragraph by that |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2585 ;; number of spaces. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2586 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2587 ;;; 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
|
2588 ;;; 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
|
2589 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2590 (defvar texinfo-paragraph-indent "asis" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2591 "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
|
2592 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2593 (put 'paragraphindent 'texinfo-format 'texinfo-paragraphindent) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2594 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2595 (defun texinfo-paragraphindent () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2596 "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
|
2597 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
|
2598 (let ((arg (texinfo-parse-arg-discard))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2599 (if (string= "asis" arg) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2600 (setq texinfo-paragraph-indent "asis") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2601 (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
|
2602 |
189 | 2603 (put 'refill 'texinfo-format 'texinfo-format-refill) |
2604 (defun texinfo-format-refill () | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2605 "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
|
2606 Default is to leave paragraph indentation as is." |
189 | 2607 (texinfo-discard-command) |
23658 | 2608 (let ((position (point-marker))) |
2609 (forward-paragraph -1) | |
2610 (if (looking-at "[ \t\n]*$") (forward-line 1)) | |
2611 ;; Do not indent if an entry in a list, table, or deffn, | |
2612 ;; or if paragraph is preceded by @noindent. | |
2613 ;; Otherwise, indent | |
2614 (cond | |
2615 ;; delete a @noindent line and do not indent paragraph | |
2616 ((save-excursion (forward-line -1) | |
2617 (looking-at "^@noindent")) | |
2618 (forward-line -1) | |
2619 (delete-region (point) (progn (forward-line 1) (point)))) | |
2620 ;; do nothing if "asis" | |
2621 ((equal texinfo-paragraph-indent "asis")) | |
2622 ;; do no indenting in list, etc. | |
2623 ((> texinfo-stack-depth 0)) | |
2624 ;; otherwise delete existing whitespace and indent | |
2625 (t | |
2626 (delete-region (point) (progn (skip-chars-forward " \t") (point))) | |
2627 (insert (make-string texinfo-paragraph-indent ? )))) | |
2628 (forward-paragraph 1) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2629 (forward-line -1) |
23658 | 2630 (end-of-line) |
2631 ;; Do not fill a section title line with asterisks, hyphens, etc. that | |
2632 ;; are used to underline it. This could occur if the line following | |
2633 ;; the underlining is not an index entry and has text within it. | |
2634 (let* ((previous-paragraph-separate paragraph-separate) | |
2635 (paragraph-separate | |
2636 (concat paragraph-separate "\\|[-=.]+\\|\\*\\*+")) | |
2637 (previous-paragraph-start paragraph-start) | |
2638 (paragraph-start | |
2639 (concat paragraph-start "\\|[-=.]+\\|\\*\\*+"))) | |
2640 (unwind-protect | |
2641 (fill-paragraph nil) | |
2642 (setq paragraph-separate previous-paragraph-separate) | |
2643 (setq paragraph-start previous-paragraph-start))) | |
2644 (goto-char position))) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2645 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2646 (put 'noindent 'texinfo-format 'texinfo-noindent) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2647 (defun texinfo-noindent () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2648 (save-excursion |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2649 (forward-paragraph 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2650 (if (search-backward "@refill" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2651 (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
|
2652 () ; 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
|
2653 ;; else |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2654 (texinfo-discard-line)))) |
189 | 2655 |
2656 | |
2657 ;;; Index generation | |
2658 | |
2659 (put 'vindex 'texinfo-format 'texinfo-format-vindex) | |
2660 (defun texinfo-format-vindex () | |
2661 (texinfo-index 'texinfo-vindex)) | |
2662 | |
2663 (put 'cindex 'texinfo-format 'texinfo-format-cindex) | |
2664 (defun texinfo-format-cindex () | |
2665 (texinfo-index 'texinfo-cindex)) | |
2666 | |
2667 (put 'findex 'texinfo-format 'texinfo-format-findex) | |
2668 (defun texinfo-format-findex () | |
2669 (texinfo-index 'texinfo-findex)) | |
2670 | |
2671 (put 'pindex 'texinfo-format 'texinfo-format-pindex) | |
2672 (defun texinfo-format-pindex () | |
2673 (texinfo-index 'texinfo-pindex)) | |
2674 | |
2675 (put 'tindex 'texinfo-format 'texinfo-format-tindex) | |
2676 (defun texinfo-format-tindex () | |
2677 (texinfo-index 'texinfo-tindex)) | |
2678 | |
2679 (put 'kindex 'texinfo-format 'texinfo-format-kindex) | |
2680 (defun texinfo-format-kindex () | |
2681 (texinfo-index 'texinfo-kindex)) | |
2682 | |
2683 (defun texinfo-index (indexvar) | |
2684 (let ((arg (texinfo-parse-expanded-arg))) | |
2685 (texinfo-discard-command) | |
2686 (set indexvar | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2687 (cons (list arg |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2688 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2689 ;; 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
|
2690 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2691 (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
|
2692 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2693 (symbol-value indexvar))))) |
189 | 2694 |
2695 (defconst texinfo-indexvar-alist | |
2696 '(("cp" . texinfo-cindex) | |
2697 ("fn" . texinfo-findex) | |
2698 ("vr" . texinfo-vindex) | |
2699 ("tp" . texinfo-tindex) | |
2700 ("pg" . texinfo-pindex) | |
2701 ("ky" . texinfo-kindex))) | |
2702 | |
2703 | |
2704 ;;; @defindex @defcodeindex | |
2705 (put 'defindex 'texinfo-format 'texinfo-format-defindex) | |
2706 (put 'defcodeindex 'texinfo-format 'texinfo-format-defindex) | |
2707 | |
2708 (defun texinfo-format-defindex () | |
2709 (let* ((index-name (texinfo-parse-arg-discard)) ; eg: `aa' | |
2710 (indexing-command (intern (concat index-name "index"))) | |
2711 (index-formatting-command ; eg: `texinfo-format-aaindex' | |
2712 (intern (concat "texinfo-format-" index-name "index"))) | |
2713 (index-alist-name ; eg: `texinfo-aaindex' | |
2714 (intern (concat "texinfo-" index-name "index")))) | |
2715 | |
2716 (set index-alist-name nil) | |
2717 | |
2718 (put indexing-command ; eg, aaindex | |
2719 'texinfo-format | |
2720 index-formatting-command) ; eg, texinfo-format-aaindex | |
2721 | |
2722 ;; eg: "aa" . texinfo-aaindex | |
2723 (or (assoc index-name texinfo-indexvar-alist) | |
2724 (setq texinfo-indexvar-alist | |
2725 (cons | |
2726 (cons index-name | |
2727 index-alist-name) | |
2728 texinfo-indexvar-alist))) | |
2729 | |
2730 (fset index-formatting-command | |
2731 (list 'lambda 'nil | |
2732 (list 'texinfo-index | |
2733 (list 'quote index-alist-name)))))) | |
2734 | |
2735 | |
2736 ;;; @synindex @syncodeindex | |
2737 | |
2738 (put 'synindex 'texinfo-format 'texinfo-format-synindex) | |
2739 (put 'syncodeindex 'texinfo-format 'texinfo-format-synindex) | |
2740 | |
2741 (defun texinfo-format-synindex () | |
2742 (let* ((args (texinfo-parse-arg-discard)) | |
2743 (second (cdr (read-from-string args))) | |
2744 (joiner (symbol-name (car (read-from-string args)))) | |
2745 (joined (symbol-name (car (read-from-string args second))))) | |
2746 | |
2747 (if (assoc joiner texinfo-short-index-cmds-alist) | |
2748 (put | |
2749 (cdr (assoc joiner texinfo-short-index-cmds-alist)) | |
2750 'texinfo-format | |
2751 (or (cdr (assoc joined texinfo-short-index-format-cmds-alist)) | |
2752 (intern (concat "texinfo-format-" joined "index")))) | |
2753 (put | |
2754 (intern (concat joiner "index")) | |
2755 'texinfo-format | |
2756 (or (cdr(assoc joined texinfo-short-index-format-cmds-alist)) | |
2757 (intern (concat "texinfo-format-" joined "index"))))))) | |
2758 | |
2759 (defconst texinfo-short-index-cmds-alist | |
2760 '(("cp" . cindex) | |
2761 ("fn" . findex) | |
2762 ("vr" . vindex) | |
2763 ("tp" . tindex) | |
2764 ("pg" . pindex) | |
2765 ("ky" . kindex))) | |
2766 | |
2767 (defconst texinfo-short-index-format-cmds-alist | |
2768 '(("cp" . texinfo-format-cindex) | |
2769 ("fn" . texinfo-format-findex) | |
2770 ("vr" . texinfo-format-vindex) | |
2771 ("tp" . texinfo-format-tindex) | |
2772 ("pg" . texinfo-format-pindex) | |
2773 ("ky" . texinfo-format-kindex))) | |
2774 | |
2775 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2776 ;;; Sort and index (for VMS) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2777 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2778 ;; 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
|
2779 ;; 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
|
2780 (defun texinfo-sort-region (start end) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2781 (require 'sort) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2782 (save-restriction |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2783 (narrow-to-region start end) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2784 (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
|
2785 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2786 ;; Subroutine for sorting an index. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2787 ;; 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
|
2788 (defun texinfo-sort-startkeyfun () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2789 (let ((line |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2790 (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
|
2791 ;; Canonicalize whitespace and eliminate funny chars. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2792 (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
|
2793 (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
|
2794 " " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2795 (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
|
2796 line)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2797 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2798 |
189 | 2799 ;;; @printindex |
2800 | |
2801 (put 'printindex 'texinfo-format 'texinfo-format-printindex) | |
2802 | |
2803 (defun texinfo-format-printindex () | |
2804 (let ((indexelts (symbol-value | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2805 (cdr (assoc (texinfo-parse-arg-discard) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2806 texinfo-indexvar-alist)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2807 opoint) |
189 | 2808 (insert "\n* Menu:\n\n") |
2809 (setq opoint (point)) | |
2810 (texinfo-print-index nil indexelts) | |
2811 | |
15985
eb812636dcb5
(texinfo-format-printindex):
Richard M. Stallman <rms@gnu.org>
parents:
15680
diff
changeset
|
2812 (if (memq system-type '(vax-vms windows-nt ms-dos)) |
189 | 2813 (texinfo-sort-region opoint (point)) |
2814 (shell-command-on-region opoint (point) "sort -fd" 1)))) | |
2815 | |
2816 (defun texinfo-print-index (file indexelts) | |
2817 (while indexelts | |
2818 (if (stringp (car (car indexelts))) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2819 (progn |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2820 (insert "* " (car (car indexelts)) ": " ) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2821 (indent-to 32) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2822 (insert |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2823 (if file (concat "(" file ")") "") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2824 (nth 1 (car indexelts)) ".") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2825 (indent-to 54) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2826 (insert |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2827 (if (nth 2 (car indexelts)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2828 (format " %d." (nth 2 (car indexelts))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2829 "") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2830 "\n")) |
189 | 2831 ;; index entries from @include'd file |
2832 (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
|
2833 (nth 2 (car indexelts)))) |
189 | 2834 (setq indexelts (cdr indexelts)))) |
2835 | |
2836 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2837 ;;; Glyphs: @equiv, @error, etc |
189 | 2838 |
2839 ;; @equiv to show that two expressions are equivalent | |
2840 ;; @error to show an error message | |
2841 ;; @expansion to show what a macro expands to | |
2842 ;; @point to show the location of point in an example | |
2843 ;; @print to show what an evaluated expression prints | |
2844 ;; @result to indicate the value returned by an expression | |
2845 | |
2846 (put 'equiv 'texinfo-format 'texinfo-format-equiv) | |
2847 (defun texinfo-format-equiv () | |
2848 (texinfo-parse-arg-discard) | |
2849 (insert "==")) | |
2850 | |
2851 (put 'error 'texinfo-format 'texinfo-format-error) | |
2852 (defun texinfo-format-error () | |
2853 (texinfo-parse-arg-discard) | |
2854 (insert "error-->")) | |
2855 | |
2856 (put 'expansion 'texinfo-format 'texinfo-format-expansion) | |
2857 (defun texinfo-format-expansion () | |
2858 (texinfo-parse-arg-discard) | |
2859 (insert "==>")) | |
2860 | |
2861 (put 'point 'texinfo-format 'texinfo-format-point) | |
2862 (defun texinfo-format-point () | |
2863 (texinfo-parse-arg-discard) | |
2864 (insert "-!-")) | |
2865 | |
2866 (put 'print 'texinfo-format 'texinfo-format-print) | |
2867 (defun texinfo-format-print () | |
2868 (texinfo-parse-arg-discard) | |
2869 (insert "-|")) | |
2870 | |
2871 (put 'result 'texinfo-format 'texinfo-format-result) | |
2872 (defun texinfo-format-result () | |
2873 (texinfo-parse-arg-discard) | |
2874 (insert "=>")) | |
2875 | |
2876 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2877 ;;; Accent commands |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2878 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2879 ;; Info presumes a plain ASCII output, so the accented characters do |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2880 ;; not look as they would if typeset, or output with a different |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2881 ;; character set. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2882 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2883 ;; See the `texinfo-accent-commands' variable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2884 ;; in the section for `texinfo-append-refill'. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2885 ;; Also, see the defun for `texinfo-format-scan' |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2886 ;; for single-character accent commands. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2887 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2888 ;; Command Info output Name |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2889 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2890 ;; These do not have braces: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2891 ;; @^ ==> ^ circumflex accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2892 ;; @` ==> ` grave accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2893 ;; @' ==> ' acute accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2894 ;; @" ==> " umlaut accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2895 ;; @= ==> = overbar accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2896 ;; @~ ==> ~ tilde accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2897 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2898 ;; These have braces, but take no argument: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2899 ;; @OE{} ==> OE French-OE-ligature |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2900 ;; @oe{} ==> oe |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2901 ;; @AA{} ==> AA Scandinavian-A-with-circle |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2902 ;; @aa{} ==> aa |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2903 ;; @AE{} ==> AE Latin-Scandinavian-AE |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2904 ;; @ae{} ==> ae |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2905 ;; @ss{} ==> ss German-sharp-S |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2906 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2907 ;; @questiondown{} ==> ? upside-down-question-mark |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2908 ;; @exclamdown{} ==> ! upside-down-exclamation-mark |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2909 ;; @L{} ==> L/ Polish suppressed-L (Lslash) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2910 ;; @l{} ==> l/ Polish suppressed-L (Lslash) (lower case) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2911 ;; @O{} ==> O/ Scandinavian O-with-slash |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2912 ;; @o{} ==> o/ Scandinavian O-with-slash (lower case) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2913 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2914 ;; These have braces, and take an argument: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2915 ;; @,{c} ==> c, cedilla accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2916 ;; @dotaccent{o} ==> .o overdot-accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2917 ;; @ubaraccent{o} ==> _o underbar-accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2918 ;; @udotaccent{o} ==> o-. underdot-accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2919 ;; @H{o} ==> ""o long Hungarian umlaut |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2920 ;; @ringaccent{o} ==> *o ring accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2921 ;; @tieaccent{oo} ==> [oo tie after accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2922 ;; @u{o} ==> (o breve accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2923 ;; @v{o} ==> <o hacek accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2924 ;; @dotless{i} ==> i dotless i and dotless j |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2925 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2926 ;; ========== |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2927 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2928 ;; Note: The defun texinfo-format-scan |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2929 ;; looks at "[@{}^'`\",=~ *?!-]" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2930 ;; In the case of @*, a line break is inserted; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2931 ;; in the other cases, the characters are simply quoted and the @ is deleted. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2932 ;; Thus, `texinfo-format-scan' handles the following |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2933 ;; single-character accent commands: @^ @` @' @" @, @- @= @~ |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2934 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2935 ;; @^ ==> ^ circumflex accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2936 ;; (put '^ 'texinfo-format 'texinfo-format-circumflex-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2937 ;; (defun texinfo-format-circumflex-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2938 ;; (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2939 ;; (insert "^")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2940 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2941 ;; @` ==> ` grave accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2942 ;; (put '\` 'texinfo-format 'texinfo-format-grave-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2943 ;; (defun texinfo-format-grave-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2944 ;; (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2945 ;; (insert "\`")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2946 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2947 ;; @' ==> ' acute accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2948 ;; (put '\' 'texinfo-format 'texinfo-format-acute-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2949 ;; (defun texinfo-format-acute-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2950 ;; (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2951 ;; (insert "'")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2952 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2953 ;; @" ==> " umlaut accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2954 ;; (put '\" 'texinfo-format 'texinfo-format-umlaut-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2955 ;; (defun texinfo-format-umlaut-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2956 ;; (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2957 ;; (insert "\"")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2958 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2959 ;; @= ==> = overbar accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2960 ;; (put '= 'texinfo-format 'texinfo-format-overbar-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2961 ;; (defun texinfo-format-overbar-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2962 ;; (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2963 ;; (insert "=")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2964 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2965 ;; @~ ==> ~ tilde accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2966 ;; (put '~ 'texinfo-format 'texinfo-format-tilde-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2967 ;; (defun texinfo-format-tilde-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2968 ;; (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2969 ;; (insert "~")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2970 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2971 ;; @OE{} ==> OE French-OE-ligature |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2972 (put 'OE 'texinfo-format 'texinfo-format-French-OE-ligature) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2973 (defun texinfo-format-French-OE-ligature () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2974 (insert "OE" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2975 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2976 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2977 ;; @oe{} ==> oe |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2978 (put 'oe 'texinfo-format 'texinfo-format-French-oe-ligature) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2979 (defun texinfo-format-French-oe-ligature () ; lower case |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2980 (insert "oe" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2981 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2982 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2983 ;; @AA{} ==> AA Scandinavian-A-with-circle |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2984 (put 'AA 'texinfo-format 'texinfo-format-Scandinavian-A-with-circle) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2985 (defun texinfo-format-Scandinavian-A-with-circle () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2986 (insert "AA" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2987 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2988 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2989 ;; @aa{} ==> aa |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2990 (put 'aa 'texinfo-format 'texinfo-format-Scandinavian-a-with-circle) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2991 (defun texinfo-format-Scandinavian-a-with-circle () ; lower case |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2992 (insert "aa" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2993 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2994 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2995 ;; @AE{} ==> AE Latin-Scandinavian-AE |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2996 (put 'AE 'texinfo-format 'texinfo-format-Latin-Scandinavian-AE) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2997 (defun texinfo-format-Latin-Scandinavian-AE () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2998 (insert "AE" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2999 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3000 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3001 ;; @ae{} ==> ae |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3002 (put 'ae 'texinfo-format 'texinfo-format-Latin-Scandinavian-ae) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3003 (defun texinfo-format-Latin-Scandinavian-ae () ; lower case |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3004 (insert "ae" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3005 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3006 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3007 ;; @ss{} ==> ss German-sharp-S |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3008 (put 'ss 'texinfo-format 'texinfo-format-German-sharp-S) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3009 (defun texinfo-format-German-sharp-S () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3010 (insert "ss" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3011 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3012 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3013 ;; @questiondown{} ==> ? upside-down-question-mark |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3014 (put 'questiondown 'texinfo-format 'texinfo-format-upside-down-question-mark) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3015 (defun texinfo-format-upside-down-question-mark () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3016 (insert "?" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3017 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3018 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3019 ;; @exclamdown{} ==> ! upside-down-exclamation-mark |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3020 (put 'exclamdown 'texinfo-format 'texinfo-format-upside-down-exclamation-mark) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3021 (defun texinfo-format-upside-down-exclamation-mark () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3022 (insert "!" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3023 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3024 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3025 ;; @L{} ==> L/ Polish suppressed-L (Lslash) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3026 (put 'L 'texinfo-format 'texinfo-format-Polish-suppressed-L) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3027 (defun texinfo-format-Polish-suppressed-L () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3028 (insert (texinfo-parse-arg-discard) "/L") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3029 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3030 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3031 ;; @l{} ==> l/ Polish suppressed-L (Lslash) (lower case) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3032 (put 'l 'texinfo-format 'texinfo-format-Polish-suppressed-l-lower-case) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3033 (defun texinfo-format-Polish-suppressed-l-lower-case () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3034 (insert (texinfo-parse-arg-discard) "/l") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3035 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3036 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3037 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3038 ;; @O{} ==> O/ Scandinavian O-with-slash |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3039 (put 'O 'texinfo-format 'texinfo-format-Scandinavian-O-with-slash) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3040 (defun texinfo-format-Scandinavian-O-with-slash () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3041 (insert (texinfo-parse-arg-discard) "O/") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3042 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3043 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3044 ;; @o{} ==> o/ Scandinavian O-with-slash (lower case) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3045 (put 'o 'texinfo-format 'texinfo-format-Scandinavian-o-with-slash-lower-case) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3046 (defun texinfo-format-Scandinavian-o-with-slash-lower-case () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3047 (insert (texinfo-parse-arg-discard) "o/") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3048 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3049 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3050 ;; Take arguments |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3051 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3052 ;; @,{c} ==> c, cedilla accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3053 (put ', 'texinfo-format 'texinfo-format-cedilla-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3054 (defun texinfo-format-cedilla-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3055 (insert (texinfo-parse-arg-discard) ",") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3056 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3057 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3058 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3059 ;; @dotaccent{o} ==> .o overdot-accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3060 (put 'dotaccent 'texinfo-format 'texinfo-format-overdot-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3061 (defun texinfo-format-overdot-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3062 (insert "." (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3063 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3064 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3065 ;; @ubaraccent{o} ==> _o underbar-accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3066 (put 'ubaraccent 'texinfo-format 'texinfo-format-underbar-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3067 (defun texinfo-format-underbar-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3068 (insert "_" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3069 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3070 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3071 ;; @udotaccent{o} ==> o-. underdot-accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3072 (put 'udotaccent 'texinfo-format 'texinfo-format-underdot-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3073 (defun texinfo-format-underdot-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3074 (insert (texinfo-parse-arg-discard) "-.") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3075 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3076 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3077 ;; @H{o} ==> ""o long Hungarian umlaut |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3078 (put 'H 'texinfo-format 'texinfo-format-long-Hungarian-umlaut) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3079 (defun texinfo-format-long-Hungarian-umlaut () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3080 (insert "\"\"" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3081 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3082 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3083 ;; @ringaccent{o} ==> *o ring accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3084 (put 'ringaccent 'texinfo-format 'texinfo-format-ring-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3085 (defun texinfo-format-ring-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3086 (insert "*" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3087 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3088 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3089 ;; @tieaccent{oo} ==> [oo tie after accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3090 (put 'tieaccent 'texinfo-format 'texinfo-format-tie-after-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3091 (defun texinfo-format-tie-after-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3092 (insert "[" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3093 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3094 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3095 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3096 ;; @u{o} ==> (o breve accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3097 (put 'u 'texinfo-format 'texinfo-format-breve-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3098 (defun texinfo-format-breve-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3099 (insert "(" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3100 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3101 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3102 ;; @v{o} ==> <o hacek accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3103 (put 'v 'texinfo-format 'texinfo-format-hacek-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3104 (defun texinfo-format-hacek-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3105 (insert "<" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3106 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3107 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3108 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3109 ;; @dotless{i} ==> i dotless i and dotless j |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3110 (put 'dotless 'texinfo-format 'texinfo-format-dotless) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3111 (defun texinfo-format-dotless () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3112 (insert (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3113 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3114 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3115 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3116 ;;; Definition formatting: @deffn, @defun, etc |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3117 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3118 ;; What definition formatting produces: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3119 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3120 ;; @deffn category name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3121 ;; In Info, `Category: name ARGS' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3122 ;; In index: name: node. line#. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3123 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3124 ;; @defvr category name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3125 ;; In Info, `Category: name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3126 ;; In index: name: node. line#. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3127 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3128 ;; @deftp category name attributes... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3129 ;; `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
|
3130 ;; In index: name: node. line#. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3131 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3132 ;; 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
|
3133 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3134 ;; @defun, @defmac, @defspec, @defvar, @defopt |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3135 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3136 ;; @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
|
3137 ;; @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
|
3138 ;; @defvar name In Info, `Variable: name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3139 ;; etc. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3140 ;; In index: name: node. line#. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3141 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3142 ;; 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
|
3143 ;; @deftypefn category data-type name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3144 ;; 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
|
3145 ;; @deftypevr category data-type name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3146 ;; In Info, `Category: data-type name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3147 ;; In index: name: node. line#. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3148 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3149 ;; 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
|
3150 ;; @deftypefun data-type name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3151 ;; 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
|
3152 ;; In index: name: node. line#. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3153 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3154 ;; @deftypevar data-type name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3155 ;; In Info, `Variable: data-type name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3156 ;; 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
|
3157 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3158 ;; Generalized object oriented entity: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3159 ;; @defop category class name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3160 ;; 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
|
3161 ;; 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
|
3162 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3163 ;; @defcv category class name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3164 ;; In Info, `Category of class: name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3165 ;; 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
|
3166 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3167 ;; Specialized object oriented entity: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3168 ;; @defmethod class name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3169 ;; 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
|
3170 ;; 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
|
3171 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3172 ;; @defivar class name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3173 ;; 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
|
3174 ;; 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
|
3175 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3176 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3177 ;;; The definition formatting functions |
189 | 3178 |
3179 (defun texinfo-format-defun () | |
3180 (texinfo-push-stack 'defun nil) | |
3181 (setq fill-column (- fill-column 5)) | |
3182 (texinfo-format-defun-1 t)) | |
3183 | |
3184 (defun texinfo-end-defun () | |
3185 (setq fill-column (+ fill-column 5)) | |
3186 (texinfo-discard-command) | |
3187 (let ((start (nth 1 (texinfo-pop-stack 'defun)))) | |
3188 (texinfo-do-itemize start) | |
3189 ;; Delete extra newline inserted after header. | |
3190 (save-excursion | |
3191 (goto-char start) | |
3192 (delete-char -1)))) | |
3193 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3194 (defun texinfo-format-defunx () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3195 (texinfo-format-defun-1 nil)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3196 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3197 (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
|
3198 (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
|
3199 (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
|
3200 (texinfo-discard-command) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3201 ;; 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
|
3202 (if (not first-p) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3203 (delete-char -1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3204 (funcall |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3205 (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
|
3206 ;; 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
|
3207 ;; with header line. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3208 (insert "\n\n") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3209 (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
|
3210 (funcall |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3211 (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
|
3212 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3213 ;;; 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
|
3214 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3215 ;; @deffn, @defvr, @deftp |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3216 (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
|
3217 (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
|
3218 (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
|
3219 (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
|
3220 (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
|
3221 (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
|
3222 (defun texinfo-format-deffn (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3223 ;; 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
|
3224 ;; @deffn category name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3225 ;; In Info, `Category: name ARGS' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3226 ;; @deftp category name attributes... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3227 ;; `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
|
3228 (let ((category (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3229 (name (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3230 (args (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3231 (insert " -- " category ": " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3232 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3233 (insert " " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3234 (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
|
3235 (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
|
3236 (car args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3237 (upcase (car args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3238 (setq args (cdr args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3239 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3240 ;; @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
|
3241 (put 'defun 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3242 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3243 (put 'defunx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3244 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3245 (put 'defmac 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3246 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3247 (put 'defmacx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3248 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3249 (put 'defspec 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3250 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3251 (put 'defspecx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3252 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3253 (put 'defvar 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3254 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3255 (put 'defvarx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3256 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3257 (put 'defopt 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3258 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3259 (put 'defoptx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3260 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3261 (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
|
3262 ;; 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
|
3263 ;; @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
|
3264 ;; @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
|
3265 ;; @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
|
3266 ;; 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
|
3267 (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
|
3268 (name (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3269 (args (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3270 (insert " -- " category ": " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3271 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3272 (insert " " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3273 (if (= ?& (aref (car args) 0)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3274 (car args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3275 (upcase (car args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3276 (setq args (cdr args))))) |
189 | 3277 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3278 ;; @deftypefn, @deftypevr: Generalized typed |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3279 (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
|
3280 (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
|
3281 (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
|
3282 (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
|
3283 (defun texinfo-format-deftypefn (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3284 ;; 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
|
3285 ;; @deftypefn category data-type name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3286 ;; 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
|
3287 ;; @deftypevr category data-type name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3288 ;; In Info, `Category: data-type name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3289 ;; 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
|
3290 (let ((category (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3291 (data-type (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3292 (name (car (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3293 (args (cdr (cdr (cdr parsed-args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3294 (insert " -- " category ": " data-type " " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3295 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3296 (insert " " (car args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3297 (setq args (cdr args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3298 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3299 ;; @deftypefun, @deftypevar: Specialized typed |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3300 (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
|
3301 (put 'deftypefunx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3302 'texinfo-format-deftypefun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3303 (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
|
3304 (put 'deftypevarx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3305 'texinfo-format-deftypefun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3306 (defun texinfo-format-deftypefun (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3307 ;; 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
|
3308 ;; @deftypefun data-type name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3309 ;; 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
|
3310 ;; @deftypevar data-type name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3311 ;; In Info, `Variable: data-type name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3312 ;; 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
|
3313 ;; 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
|
3314 (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
|
3315 (data-type (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3316 (name (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3317 (args (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3318 (insert " -- " category ": " data-type " " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3319 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3320 (insert " " (car args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3321 (setq args (cdr args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3322 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3323 ;; @defop: Generalized object-oriented |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3324 (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
|
3325 (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
|
3326 (defun texinfo-format-defop (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3327 ;; Generalized object oriented entity: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3328 ;; @defop category class name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3329 ;; 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
|
3330 ;; 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
|
3331 (let ((category (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3332 (class (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3333 (name (car (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3334 (args (cdr (cdr (cdr parsed-args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3335 (insert " -- " category " on " class ": " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3336 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3337 (insert " " (upcase (car args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3338 (setq args (cdr args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3339 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3340 ;; @defcv: Generalized object-oriented |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3341 (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
|
3342 (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
|
3343 (defun texinfo-format-defcv (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3344 ;; Generalized object oriented entity: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3345 ;; @defcv category class name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3346 ;; In Info, `Category of class: name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3347 ;; 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
|
3348 (let ((category (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3349 (class (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3350 (name (car (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3351 (args (cdr (cdr (cdr parsed-args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3352 (insert " -- " category " of " class ": " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3353 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3354 (insert " " (upcase (car args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3355 (setq args (cdr args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3356 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3357 ;; @defmethod: Specialized object-oriented |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3358 (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
|
3359 (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
|
3360 (defun texinfo-format-defmethod (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3361 ;; Specialized object oriented entity: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3362 ;; @defmethod class name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3363 ;; 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
|
3364 ;; 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
|
3365 ;; 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
|
3366 (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
|
3367 (class (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3368 (name (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3369 (args (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3370 (insert " -- " category " on " class ": " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3371 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3372 (insert " " (upcase (car args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3373 (setq args (cdr args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3374 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3375 ;; @defivar: Specialized object-oriented |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3376 (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
|
3377 (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
|
3378 (defun texinfo-format-defivar (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3379 ;; Specialized object oriented entity: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3380 ;; @defivar class name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3381 ;; 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
|
3382 ;; 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
|
3383 ;; 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
|
3384 (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
|
3385 (class (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3386 (name (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3387 (args (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3388 (insert " -- " category " of " class ": " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3389 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3390 (insert " " (upcase (car args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3391 (setq args (cdr args))))) |
189 | 3392 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3393 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3394 ;;; Indexing for definitions |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3395 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3396 ;; 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
|
3397 ;; 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
|
3398 ;; formatted differently: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3399 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3400 ;; @defun, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3401 ;; @defmac, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3402 ;; @defspec, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3403 ;; @defvar, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3404 ;; @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
|
3405 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3406 ;; @deffn, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3407 ;; @defvr, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3408 ;; @deftp |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3409 ;; @deftypefun |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3410 ;; @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
|
3411 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3412 ;; @deftypefn, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3413 ;; @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
|
3414 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3415 ;; @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
|
3416 ;; formatted: NAME on CLASS |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3417 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3418 ;; @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
|
3419 ;; formatted: NAME on CLASS |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3420 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3421 ;; @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
|
3422 ;; formatted: NAME of CLASS |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3423 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3424 ;; @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
|
3425 ;; formatted: NAME of CLASS |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3426 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3427 (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
|
3428 (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
|
3429 (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
|
3430 (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
|
3431 (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
|
3432 (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
|
3433 (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
|
3434 (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
|
3435 (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
|
3436 (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
|
3437 (defun texinfo-index-defun (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3438 ;; 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
|
3439 ;; `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
|
3440 (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
|
3441 (set index-list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3442 (cons |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3443 ;; 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
|
3444 (list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3445 (car parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3446 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3447 ;; 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
|
3448 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3449 (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
|
3450 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3451 (symbol-value index-list))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3452 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3453 (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
|
3454 (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
|
3455 (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
|
3456 (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
|
3457 (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
|
3458 (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
|
3459 (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
|
3460 (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
|
3461 (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
|
3462 (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
|
3463 (defun texinfo-index-deffn (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3464 ;; 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
|
3465 ;; `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
|
3466 (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
|
3467 (set index-list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3468 (cons |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3469 ;; 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
|
3470 (list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3471 (car (cdr parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3472 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3473 ;; 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
|
3474 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3475 (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
|
3476 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3477 (symbol-value index-list))))) |
189 | 3478 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3479 (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
|
3480 (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
|
3481 (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
|
3482 (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
|
3483 (defun texinfo-index-deftypefn (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3484 ;; 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
|
3485 ;; `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
|
3486 (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
|
3487 (set index-list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3488 (cons |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3489 ;; 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
|
3490 (list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3491 (car (cdr (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3492 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3493 ;; 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
|
3494 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3495 (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
|
3496 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3497 (symbol-value index-list))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3498 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3499 (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
|
3500 (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
|
3501 (defun texinfo-index-defmethod (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3502 ;; 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
|
3503 ;; `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
|
3504 (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
|
3505 (set index-list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3506 (cons |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3507 ;; 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
|
3508 (list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3509 (format "%s on %s" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3510 (car (cdr parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3511 (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3512 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3513 ;; 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
|
3514 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3515 (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
|
3516 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3517 (symbol-value index-list))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3518 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3519 (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
|
3520 (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
|
3521 (defun texinfo-index-defop (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3522 ;; 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
|
3523 ;; `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
|
3524 (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
|
3525 (set index-list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3526 (cons |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3527 ;; 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
|
3528 (list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3529 (format "%s on %s" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3530 (car (cdr (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3531 (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3532 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3533 ;; 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
|
3534 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3535 (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
|
3536 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3537 (symbol-value index-list))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3538 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3539 (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
|
3540 (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
|
3541 (defun texinfo-index-defivar (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3542 ;; 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
|
3543 ;; `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
|
3544 (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
|
3545 (set index-list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3546 (cons |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3547 ;; 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
|
3548 (list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3549 (format "%s of %s" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3550 (car (cdr parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3551 (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3552 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3553 ;; 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
|
3554 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3555 (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
|
3556 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3557 (symbol-value index-list))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3558 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3559 (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
|
3560 (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
|
3561 (defun texinfo-index-defcv (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3562 ;; 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
|
3563 ;; `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
|
3564 (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
|
3565 (set index-list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3566 (cons |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3567 ;; 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
|
3568 (list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3569 (format "%s of %s" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3570 (car (cdr (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3571 (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3572 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3573 ;; 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
|
3574 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3575 (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
|
3576 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3577 (symbol-value index-list))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3578 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3579 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3580 ;;; Properties for definitions |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3581 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3582 ;; Each definition command has six properties: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3583 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3584 ;; 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
|
3585 ;; 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
|
3586 ;; 3. texinfo-format formatting command |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3587 ;; 4. texinfo-end end formatting command |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3588 ;; 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
|
3589 ;; 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
|
3590 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3591 ;; 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
|
3592 ;; and subsequent header lines. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3593 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3594 ;; 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
|
3595 ;; are listed just before the appropriate formatting and indexing commands. |
189 | 3596 |
3597 (put 'deffn 'texinfo-format 'texinfo-format-defun) | |
3598 (put 'deffnx 'texinfo-format 'texinfo-format-defunx) | |
3599 (put 'deffn 'texinfo-end 'texinfo-end-defun) | |
3600 (put 'deffn 'texinfo-defun-type '('deffn-type nil)) | |
3601 (put 'deffnx 'texinfo-defun-type '('deffn-type nil)) | |
3602 (put 'deffn 'texinfo-defun-index 'texinfo-findex) | |
3603 (put 'deffnx 'texinfo-defun-index 'texinfo-findex) | |
3604 | |
3605 (put 'defun 'texinfo-format 'texinfo-format-defun) | |
3606 (put 'defunx 'texinfo-format 'texinfo-format-defunx) | |
3607 (put 'defun 'texinfo-end 'texinfo-end-defun) | |
3608 (put 'defun 'texinfo-defun-type '('defun-type "Function")) | |
3609 (put 'defunx 'texinfo-defun-type '('defun-type "Function")) | |
3610 (put 'defun 'texinfo-defun-index 'texinfo-findex) | |
3611 (put 'defunx 'texinfo-defun-index 'texinfo-findex) | |
3612 | |
3613 (put 'defmac 'texinfo-format 'texinfo-format-defun) | |
3614 (put 'defmacx 'texinfo-format 'texinfo-format-defunx) | |
3615 (put 'defmac 'texinfo-end 'texinfo-end-defun) | |
3616 (put 'defmac 'texinfo-defun-type '('defun-type "Macro")) | |
3617 (put 'defmacx 'texinfo-defun-type '('defun-type "Macro")) | |
3618 (put 'defmac 'texinfo-defun-index 'texinfo-findex) | |
3619 (put 'defmacx 'texinfo-defun-index 'texinfo-findex) | |
3620 | |
3621 (put 'defspec 'texinfo-format 'texinfo-format-defun) | |
3622 (put 'defspecx 'texinfo-format 'texinfo-format-defunx) | |
3623 (put 'defspec 'texinfo-end 'texinfo-end-defun) | |
3624 (put 'defspec 'texinfo-defun-type '('defun-type "Special form")) | |
3625 (put 'defspecx 'texinfo-defun-type '('defun-type "Special form")) | |
3626 (put 'defspec 'texinfo-defun-index 'texinfo-findex) | |
3627 (put 'defspecx 'texinfo-defun-index 'texinfo-findex) | |
3628 | |
3629 (put 'defvr 'texinfo-format 'texinfo-format-defun) | |
3630 (put 'defvrx 'texinfo-format 'texinfo-format-defunx) | |
3631 (put 'defvr 'texinfo-end 'texinfo-end-defun) | |
3632 (put 'defvr 'texinfo-defun-type '('deffn-type nil)) | |
3633 (put 'defvrx 'texinfo-defun-type '('deffn-type nil)) | |
3634 (put 'defvr 'texinfo-defun-index 'texinfo-vindex) | |
3635 (put 'defvrx 'texinfo-defun-index 'texinfo-vindex) | |
3636 | |
3637 (put 'defvar 'texinfo-format 'texinfo-format-defun) | |
3638 (put 'defvarx 'texinfo-format 'texinfo-format-defunx) | |
3639 (put 'defvar 'texinfo-end 'texinfo-end-defun) | |
3640 (put 'defvar 'texinfo-defun-type '('defun-type "Variable")) | |
3641 (put 'defvarx 'texinfo-defun-type '('defun-type "Variable")) | |
3642 (put 'defvar 'texinfo-defun-index 'texinfo-vindex) | |
3643 (put 'defvarx 'texinfo-defun-index 'texinfo-vindex) | |
3644 | |
3645 (put 'defconst 'texinfo-format 'texinfo-format-defun) | |
3646 (put 'defconstx 'texinfo-format 'texinfo-format-defunx) | |
3647 (put 'defconst 'texinfo-end 'texinfo-end-defun) | |
3648 (put 'defconst 'texinfo-defun-type '('defun-type "Constant")) | |
3649 (put 'defconstx 'texinfo-defun-type '('defun-type "Constant")) | |
3650 (put 'defconst 'texinfo-defun-index 'texinfo-vindex) | |
3651 (put 'defconstx 'texinfo-defun-index 'texinfo-vindex) | |
3652 | |
3653 (put 'defcmd 'texinfo-format 'texinfo-format-defun) | |
3654 (put 'defcmdx 'texinfo-format 'texinfo-format-defunx) | |
3655 (put 'defcmd 'texinfo-end 'texinfo-end-defun) | |
3656 (put 'defcmd 'texinfo-defun-type '('defun-type "Command")) | |
3657 (put 'defcmdx 'texinfo-defun-type '('defun-type "Command")) | |
3658 (put 'defcmd 'texinfo-defun-index 'texinfo-findex) | |
3659 (put 'defcmdx 'texinfo-defun-index 'texinfo-findex) | |
3660 | |
3661 (put 'defopt 'texinfo-format 'texinfo-format-defun) | |
3662 (put 'defoptx 'texinfo-format 'texinfo-format-defunx) | |
3663 (put 'defopt 'texinfo-end 'texinfo-end-defun) | |
3664 (put 'defopt 'texinfo-defun-type '('defun-type "User Option")) | |
3665 (put 'defoptx 'texinfo-defun-type '('defun-type "User Option")) | |
3666 (put 'defopt 'texinfo-defun-index 'texinfo-vindex) | |
3667 (put 'defoptx 'texinfo-defun-index 'texinfo-vindex) | |
3668 | |
3669 (put 'deftp 'texinfo-format 'texinfo-format-defun) | |
3670 (put 'deftpx 'texinfo-format 'texinfo-format-defunx) | |
3671 (put 'deftp 'texinfo-end 'texinfo-end-defun) | |
3672 (put 'deftp 'texinfo-defun-type '('deftp-type nil)) | |
3673 (put 'deftpx 'texinfo-defun-type '('deftp-type nil)) | |
3674 (put 'deftp 'texinfo-defun-index 'texinfo-tindex) | |
3675 (put 'deftpx 'texinfo-defun-index 'texinfo-tindex) | |
3676 | |
3677 ;;; Object-oriented stuff is a little hairier. | |
3678 | |
3679 (put 'defop 'texinfo-format 'texinfo-format-defun) | |
3680 (put 'defopx 'texinfo-format 'texinfo-format-defunx) | |
3681 (put 'defop 'texinfo-end 'texinfo-end-defun) | |
3682 (put 'defop 'texinfo-defun-type '('defop-type nil)) | |
3683 (put 'defopx 'texinfo-defun-type '('defop-type nil)) | |
3684 (put 'defop 'texinfo-defun-index 'texinfo-findex) | |
3685 (put 'defopx 'texinfo-defun-index 'texinfo-findex) | |
3686 | |
3687 (put 'defmethod 'texinfo-format 'texinfo-format-defun) | |
3688 (put 'defmethodx 'texinfo-format 'texinfo-format-defunx) | |
3689 (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
|
3690 (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
|
3691 (put 'defmethodx 'texinfo-defun-type '('defmethod-type "Method")) |
189 | 3692 (put 'defmethod 'texinfo-defun-index 'texinfo-findex) |
3693 (put 'defmethodx 'texinfo-defun-index 'texinfo-findex) | |
3694 | |
3695 (put 'defcv 'texinfo-format 'texinfo-format-defun) | |
3696 (put 'defcvx 'texinfo-format 'texinfo-format-defunx) | |
3697 (put 'defcv 'texinfo-end 'texinfo-end-defun) | |
3698 (put 'defcv 'texinfo-defun-type '('defop-type nil)) | |
3699 (put 'defcvx 'texinfo-defun-type '('defop-type nil)) | |
3700 (put 'defcv 'texinfo-defun-index 'texinfo-vindex) | |
3701 (put 'defcvx 'texinfo-defun-index 'texinfo-vindex) | |
3702 | |
3703 (put 'defivar 'texinfo-format 'texinfo-format-defun) | |
3704 (put 'defivarx 'texinfo-format 'texinfo-format-defunx) | |
3705 (put 'defivar 'texinfo-end 'texinfo-end-defun) | |
3706 (put 'defivar 'texinfo-defun-type '('defmethod-type "Instance variable")) | |
3707 (put 'defivarx 'texinfo-defun-type '('defmethod-type "Instance variable")) | |
3708 (put 'defivar 'texinfo-defun-index 'texinfo-vindex) | |
3709 (put 'defivarx 'texinfo-defun-index 'texinfo-vindex) | |
3710 | |
3711 ;;; Typed functions and variables | |
3712 | |
3713 (put 'deftypefn 'texinfo-format 'texinfo-format-defun) | |
3714 (put 'deftypefnx 'texinfo-format 'texinfo-format-defunx) | |
3715 (put 'deftypefn 'texinfo-end 'texinfo-end-defun) | |
3716 (put 'deftypefn 'texinfo-defun-type '('deftypefn-type nil)) | |
3717 (put 'deftypefnx 'texinfo-defun-type '('deftypefn-type nil)) | |
3718 (put 'deftypefn 'texinfo-defun-index 'texinfo-findex) | |
3719 (put 'deftypefnx 'texinfo-defun-index 'texinfo-findex) | |
3720 | |
3721 (put 'deftypefun 'texinfo-format 'texinfo-format-defun) | |
3722 (put 'deftypefunx 'texinfo-format 'texinfo-format-defunx) | |
3723 (put 'deftypefun 'texinfo-end 'texinfo-end-defun) | |
3724 (put 'deftypefun 'texinfo-defun-type '('deftypefun-type "Function")) | |
3725 (put 'deftypefunx 'texinfo-defun-type '('deftypefun-type "Function")) | |
3726 (put 'deftypefun 'texinfo-defun-index 'texinfo-findex) | |
3727 (put 'deftypefunx 'texinfo-defun-index 'texinfo-findex) | |
3728 | |
3729 (put 'deftypevr 'texinfo-format 'texinfo-format-defun) | |
3730 (put 'deftypevrx 'texinfo-format 'texinfo-format-defunx) | |
3731 (put 'deftypevr 'texinfo-end 'texinfo-end-defun) | |
3732 (put 'deftypevr 'texinfo-defun-type '('deftypefn-type nil)) | |
3733 (put 'deftypevrx 'texinfo-defun-type '('deftypefn-type nil)) | |
3734 (put 'deftypevr 'texinfo-defun-index 'texinfo-vindex) | |
3735 (put 'deftypevrx 'texinfo-defun-index 'texinfo-vindex) | |
3736 | |
3737 (put 'deftypevar 'texinfo-format 'texinfo-format-defun) | |
3738 (put 'deftypevarx 'texinfo-format 'texinfo-format-defunx) | |
3739 (put 'deftypevar 'texinfo-end 'texinfo-end-defun) | |
3740 (put 'deftypevar 'texinfo-defun-type '('deftypevar-type "Variable")) | |
3741 (put 'deftypevarx 'texinfo-defun-type '('deftypevar-type "Variable")) | |
3742 (put 'deftypevar 'texinfo-defun-index 'texinfo-vindex) | |
3743 (put 'deftypevarx 'texinfo-defun-index 'texinfo-vindex) | |
3744 | |
3745 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3746 ;;; @set, @clear, @ifset, @ifclear |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3747 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3748 ;; 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
|
3749 ;; 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
|
3750 ;; @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
|
3751 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3752 ;; 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
|
3753 ;; 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
|
3754 ;; @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
|
3755 ;; is the opposite of @ifset. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3756 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3757 ;; 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
|
3758 ;; replace @value{FLAG} with the string. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3759 ;; 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
|
3760 ;; @value{FLAG} is invalid, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3761 ;; 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
|
3762 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3763 (put 'clear 'texinfo-format 'texinfo-clear) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3764 (defun texinfo-clear () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3765 "Clear the value of the flag." |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3766 (let* ((arg (texinfo-parse-arg-discard)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3767 (flag (car (read-from-string arg))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3768 (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
|
3769 (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
|
3770 (put flag 'texinfo-set-value ""))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3771 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3772 (put 'set 'texinfo-format 'texinfo-set) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3773 (defun texinfo-set () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3774 "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
|
3775 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
|
3776 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
|
3777 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
|
3778 (let* ((arg (texinfo-parse-arg-discard)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3779 (flag (car (read-from-string arg))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3780 (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
|
3781 (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
|
3782 (put flag 'texinfo-set-value value))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3783 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3784 (put 'value 'texinfo-format 'texinfo-value) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3785 (defun texinfo-value () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3786 "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
|
3787 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
|
3788 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
|
3789 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
|
3790 (let ((arg (texinfo-parse-arg-discard))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3791 (cond ((and |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3792 (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
|
3793 'flag-set) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3794 (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
|
3795 (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
|
3796 ((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
|
3797 'flag-cleared) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3798 (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
|
3799 ((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
|
3800 (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
|
3801 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3802 (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
|
3803 (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
|
3804 (defun texinfo-if-set () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3805 "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
|
3806 (let ((arg (texinfo-parse-arg-discard))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3807 (cond |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3808 ((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
|
3809 'flag-set) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3810 ;; 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
|
3811 ()) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3812 ((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
|
3813 'flag-cleared) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3814 ;; 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
|
3815 (delete-region texinfo-command-start |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3816 (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
|
3817 (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3818 ((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
|
3819 nil) |
5118
eec34ce70181
(texinfo-if-set, texinfo-if-clear): Act appropriately when flat neither
Robert J. Chassell <bob@rattlesnake.com>
parents:
4982
diff
changeset
|
3820 ;; 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
|
3821 ;; 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
|
3822 ())))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3823 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3824 (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
|
3825 (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
|
3826 (defun texinfo-if-clear () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3827 "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
|
3828 (let ((arg (texinfo-parse-arg-discard))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3829 (cond |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3830 ((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
|
3831 'flag-set) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3832 ;; 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
|
3833 (delete-region texinfo-command-start |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3834 (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
|
3835 (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3836 ((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
|
3837 'flag-cleared) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3838 ;; 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
|
3839 ()) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3840 ((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
|
3841 nil) |
5118
eec34ce70181
(texinfo-if-set, texinfo-if-clear): Act appropriately when flat neither
Robert J. Chassell <bob@rattlesnake.com>
parents:
4982
diff
changeset
|
3842 ;; 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
|
3843 ;; 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
|
3844 ())))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3845 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3846 ;;; @ifeq |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3847 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3848 (put 'ifeq 'texinfo-format 'texinfo-format-ifeq) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3849 (defun texinfo-format-ifeq () |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
3850 "If ARG1 and ARG2 caselessly string compare to same string, perform COMMAND. |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3851 Otherwise produces no output. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3852 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3853 Thus: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3854 @ifeq{ arg1 , arg1 , @code{foo}} bar |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3855 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3856 ==> `foo' bar. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3857 but |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3858 @ifeq{ arg1 , arg2 , @code{foo}} bar |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3859 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3860 ==> bar |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3861 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3862 Note that the Texinfo command and its arguments must be arguments to |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3863 the @ifeq command." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3864 ;; compare-buffer-substrings does not exist in version 18; don't use |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3865 (goto-char texinfo-command-end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3866 (let* ((case-fold-search t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3867 (stop (save-excursion (forward-sexp 1) (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3868 start end |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3869 ;; @ifeq{arg1, arg2, @command{optional-args}} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3870 (arg1 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3871 (progn |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3872 (forward-char 1) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3873 (skip-chars-forward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3874 (setq start (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3875 (search-forward "," stop t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3876 (skip-chars-backward ", ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3877 (buffer-substring start (point)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3878 (arg2 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3879 (progn |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3880 (search-forward "," stop t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3881 (skip-chars-forward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3882 (setq start (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3883 (search-forward "," stop t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3884 (skip-chars-backward ", ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3885 (buffer-substring start (point)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3886 (texinfo-command |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3887 (progn |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3888 (search-forward "," stop t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3889 (skip-chars-forward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3890 (setq start (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3891 (goto-char (1- stop)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3892 (skip-chars-backward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3893 (buffer-substring start (point))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3894 (delete-region texinfo-command-start stop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3895 (if (equal arg1 arg2) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3896 (insert texinfo-command)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3897 (goto-char texinfo-command-start))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3898 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3899 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3900 ;;; Process included files: `@include' command |
189 | 3901 |
3902 ;; Updated 19 October 1990 | |
3903 ;; In the original version, include files were ignored by Info but | |
3904 ;; incorporated in to the printed manual. To make references to the | |
3905 ;; included file, the Texinfo source file has to refer to the included | |
14040 | 3906 ;; files using the `(filename)nodename' format for referring to other |
189 | 3907 ;; Info files. Also, the included files had to be formatted on their |
3908 ;; own. It was just like they were another file. | |
3909 | |
3910 ;; Currently, include files are inserted into the buffer that is | |
3911 ;; formatted for Info. If large, the resulting info file is split and | |
3912 ;; tagified. For current include files to work, the master menu must | |
3913 ;; refer to all the nodes, and the highest level nodes in the include | |
3914 ;; files must have the correct next, prev, and up pointers. | |
3915 | |
3916 ;; 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
|
3917 ;; but not an `\input texinfo' line. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3918 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3919 ;; Updated 24 March 1993 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3920 ;; 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
|
3921 ;; 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
|
3922 ;; 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
|
3923 ;; is treated like other @-commands. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3924 (put 'include 'texinfo-format 'texinfo-format-noop) |
189 | 3925 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3926 ;; Original definition: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3927 ;; (defun texinfo-format-include () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3928 ;; (let ((filename (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3929 ;; (default-directory input-directory) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3930 ;; subindex) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3931 ;; (setq subindex |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3932 ;; (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3933 ;; (progn (find-file |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3934 ;; (cond ((file-readable-p (concat filename ".texinfo")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3935 ;; (concat filename ".texinfo")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3936 ;; ((file-readable-p (concat filename ".texi")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3937 ;; (concat filename ".texi")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3938 ;; ((file-readable-p (concat filename ".tex")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3939 ;; (concat filename ".tex")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3940 ;; ((file-readable-p filename) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3941 ;; filename) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3942 ;; (t (error "@include'd file %s not found" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3943 ;; filename)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3944 ;; (texinfo-format-buffer-1)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3945 ;; (texinfo-subindex 'texinfo-vindex (car subindex) (nth 1 subindex)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3946 ;; (texinfo-subindex 'texinfo-findex (car subindex) (nth 2 subindex)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3947 ;; (texinfo-subindex 'texinfo-cindex (car subindex) (nth 3 subindex)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3948 ;; (texinfo-subindex 'texinfo-pindex (car subindex) (nth 4 subindex)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3949 ;; (texinfo-subindex 'texinfo-tindex (car subindex) (nth 5 subindex)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3950 ;; (texinfo-subindex 'texinfo-kindex (car subindex) (nth 6 subindex)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3951 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3952 ;;(defun texinfo-subindex (indexvar file content) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3953 ;; (set indexvar (cons (list 'recurse file content) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3954 ;; (symbol-value indexvar)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3955 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3956 ;; Second definition: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3957 ;; (put 'include 'texinfo-format 'texinfo-format-include) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3958 ;; (defun texinfo-format-include () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3959 ;; (let ((filename (concat input-directory |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3960 ;; (texinfo-parse-arg-discard))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3961 ;; (default-directory input-directory)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3962 ;; (message "Reading: %s" filename) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3963 ;; (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3964 ;; (save-restriction |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3965 ;; (narrow-to-region |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3966 ;; (point) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3967 ;; (+ (point) (car (cdr (insert-file-contents filename))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3968 ;; (goto-char (point-min)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3969 ;; (texinfo-append-refill) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3970 ;; (texinfo-format-convert (point-min) (point-max)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3971 ;; (setq last-input-buffer input-buffer) ; to bypass setfilename |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3972 ;; )) |
189 | 3973 |
3974 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3975 ;;; Numerous commands do nothing in Info |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3976 ;; 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
|
3977 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3978 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3979 ;;; various noops, such as @b{foo}, that take arguments in braces |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3980 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3981 (put 'b 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3982 (put 'i 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3983 (put 'r 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3984 (put 't 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3985 (put 'w 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3986 (put 'asis 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3987 (put 'dmn 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3988 (put 'math 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3989 (put 'titlefont 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3990 (defun texinfo-format-noop () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3991 (insert (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3992 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3993 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3994 ;; @hyphenation command discards an argument within braces |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3995 (put 'hyphenation 'texinfo-format 'texinfo-discard-command-and-arg) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3996 (defun texinfo-discard-command-and-arg () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3997 "Discard both @-command and its argument in braces." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3998 (goto-char texinfo-command-end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3999 (forward-list 1) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4000 (setq texinfo-command-end (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4001 (delete-region texinfo-command-start texinfo-command-end)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4002 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4003 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4004 ;;; Do nothing commands, such as @smallbook, that have no args and no braces |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4005 ;; These must appear on a line of their own |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4006 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4007 (put 'bye 'texinfo-format 'texinfo-discard-line) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4008 (put 'smallbook 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4009 (put 'finalout 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4010 (put 'overfullrule 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4011 (put 'smallbreak 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4012 (put 'medbreak 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4013 (put 'bigbreak 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4014 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4015 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4016 ;;; These noop commands discard the rest of the line. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4017 |
189 | 4018 (put 'c 'texinfo-format 'texinfo-discard-line-with-args) |
4019 (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
|
4020 (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
|
4021 (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
|
4022 (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
|
4023 (put 'headings 'texinfo-format 'texinfo-discard-line-with-args) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4024 (put 'setchapterstyle '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
|
4025 (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
|
4026 (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
|
4027 (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
|
4028 (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
|
4029 (put 'nopara 'texinfo-format 'texinfo-discard-line-with-args) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4030 |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4031 ;; @novalidate suppresses cross-reference checking and auxiliary file |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4032 ;; creation with TeX. The Info-validate command checks that every |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4033 ;; node pointer points to an existing node. Since this Info command |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4034 ;; is not invoked automatically, the @novalidate command is irrelevant |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4035 ;; and not supported by texinfmt.el |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4036 (put 'novalidate 'texinfo-format 'texinfo-discard-line-with-args) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4037 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4038 (put 'page 'texinfo-format 'texinfo-discard-line-with-args) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4039 (put 'pagesizes '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
|
4040 (put 'parindent 'texinfo-format 'texinfo-discard-line-with-args) |
189 | 4041 (put 'setchapternewpage 'texinfo-format 'texinfo-discard-line-with-args) |
4042 (put 'setq 'texinfo-format 'texinfo-discard-line-with-args) | |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4043 |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4044 (put 'setcontentsaftertitlepage |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4045 'texinfo-format 'texinfo-discard-line-with-args) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4046 (put 'setshortcontentsaftertitlepage |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4047 'texinfo-format 'texinfo-discard-line-with-args) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4048 |
189 | 4049 (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
|
4050 (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
|
4051 (put 'shortcontents 'texinfo-format 'texinfo-discard-line-with-args) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4052 (put 'shorttitlepage '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
|
4053 (put 'summarycontents 'texinfo-format 'texinfo-discard-line-with-args) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4054 (put 'input 'texinfo-format 'texinfo-discard-line-with-args) |
189 | 4055 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4056 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4057 ;;; Some commands cannot be handled |
189 | 4058 |
4059 (defun texinfo-unsupported () | |
4060 (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
|
4061 (buffer-substring texinfo-command-start texinfo-command-end))) |
189 | 4062 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4063 ;;; Batch formatting |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4064 |
189 | 4065 (defun batch-texinfo-format () |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4066 "Runs texinfo-format-buffer on the files remaining on the command line. |
189 | 4067 Must be used only with -batch, and kills emacs on completion. |
4068 Each file will be processed even if an error occurred previously. | |
4069 For example, invoke | |
4070 \"emacs -batch -funcall batch-texinfo-format $docs/ ~/*.texinfo\"." | |
4071 (if (not noninteractive) | |
4072 (error "batch-texinfo-format may only be used -batch.")) | |
4073 (let ((version-control t) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4074 (auto-save-default nil) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4075 (find-file-run-dired nil) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4076 (kept-old-versions 259259) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4077 (kept-new-versions 259259)) |
189 | 4078 (let ((error 0) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4079 file |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4080 (files ())) |
189 | 4081 (while command-line-args-left |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4082 (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
|
4083 (cond ((not (file-exists-p file)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4084 (message ">> %s does not exist!" file) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4085 (setq error 1 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4086 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
|
4087 ((file-directory-p file) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4088 (setq command-line-args-left |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4089 (nconc (directory-files file) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4090 (cdr command-line-args-left)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4091 (t |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4092 (setq files (cons file files) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4093 command-line-args-left (cdr command-line-args-left))))) |
189 | 4094 (while files |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4095 (setq file (car files) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4096 files (cdr files)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4097 (condition-case err |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4098 (progn |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4099 (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
|
4100 (find-file file) |
4769
d1b5ca8f5493
(texinfo-format-region texinfo-format-buffer): Add ###autoload cookies.
Brian Fox <bfox@gnu.org>
parents:
4396
diff
changeset
|
4101 (buffer-disable-undo (current-buffer)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4102 (set-buffer-modified-p nil) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4103 (texinfo-mode) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4104 (message "texinfo formatting %s..." file) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4105 (texinfo-format-buffer nil) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4106 (if (buffer-modified-p) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4107 (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
|
4108 (save-buffer)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4109 (error |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4110 (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
|
4111 (message ">> point at") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4112 (let ((s (buffer-substring (point) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4113 (min (+ (point) 100) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4114 (point-max)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4115 (tem 0)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4116 (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
|
4117 (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
|
4118 "\n>> " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4119 (substring s (match-end 0))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4120 tem (1+ tem))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4121 (message ">> %s" s)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4122 (setq error 1)))) |
189 | 4123 (kill-emacs error)))) |
657
fec3f9a1e3e5
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
4124 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4125 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4126 ;;; Place `provide' at end of file. |
3456 | 4127 (provide 'texinfmt) |
4128 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4129 ;;; texinfmt.el ends here. |