Mercurial > emacs
annotate lisp/textmodes/texinfmt.el @ 69178:9ba5ad019003
(reftex-toc-map): Add `follow-mouse'
binding.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Mon, 27 Feb 2006 07:41:32 +0000 |
parents | 067115a6e738 |
children | e5f36608288b c5406394f567 |
rev | line source |
---|---|
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38044
diff
changeset
|
1 ;;; texinfmt.el --- format Texinfo files into Info files |
13337 | 2 |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3 ;; Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, |
64751
5b1a238fcbb4
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64084
diff
changeset
|
4 ;; 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, |
68648
067115a6e738
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
67582
diff
changeset
|
5 ;; 2004, 2005, 2006 Free Software Foundation, Inc. |
841 | 6 |
43808 | 7 ;; Maintainer: Robert J. Chassell <bug-texinfo@gnu.org> |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
8 ;; Keywords: maint, tex, docs |
189 | 9 |
13337 | 10 ;; This file is part of GNU Emacs. |
189 | 11 |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
13 ;; 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
|
14 ;; the Free Software Foundation; either version 2, or (at your option) |
189 | 15 ;; any later version. |
16 | |
17 ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;; GNU General Public License for more details. | |
21 | |
22 ;; You should have received a copy of the GNU General Public License | |
14169 | 23 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64084 | 24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
25 ;; Boston, MA 02110-1301, USA. | |
189 | 26 |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38044
diff
changeset
|
27 ;;; Commentary: |
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38044
diff
changeset
|
28 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
29 ;;; Code: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
30 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
31 ;;; 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
|
32 |
19630
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
33 (or (fboundp 'defgroup) |
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
34 (defmacro defgroup (&rest ignore) nil)) |
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
35 |
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
36 (or (fboundp 'defcustom) |
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
37 (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
|
38 `(defvar ,var ,value ,doc))) |
95743e18a01c
(defgroup, defcustom): Add Emacs 19 compatibility definitions.
Richard M. Stallman <rms@gnu.org>
parents:
18908
diff
changeset
|
39 |
60372
f46823f3408c
(texinfo-append-refill): Redefine the types of line to which @refill
Robert J. Chassell <bob@rattlesnake.com>
parents:
60327
diff
changeset
|
40 (defvar texinfmt-version "2.41 of 1 Mar 2005") |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
41 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
42 (defun texinfmt-version (&optional here) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
43 "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
|
44 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
|
45 (interactive "P") |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
46 (let ((version-string |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
47 (format "Version of \`texinfmt.el\': %s" texinfmt-version))) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
48 (if here |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
49 (insert version-string) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
50 (if (interactive-p) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
51 (message "%s" version-string) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
52 version-string)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
53 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
54 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
55 ;;; Variable definitions |
189 | 56 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
57 (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
|
58 (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
|
59 |
189 | 60 (defvar texinfo-format-syntax-table nil) |
61 | |
62 (defvar texinfo-vindex) | |
63 (defvar texinfo-findex) | |
64 (defvar texinfo-cindex) | |
65 (defvar texinfo-pindex) | |
66 (defvar texinfo-tindex) | |
67 (defvar texinfo-kindex) | |
68 (defvar texinfo-last-node) | |
69 (defvar texinfo-node-names) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
70 (defvar texinfo-enclosure-list) |
9759
ebe611f49450
(texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9754
diff
changeset
|
71 (defvar texinfo-alias-list) |
24314
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
72 (defvar texinfo-fold-nodename-case nil) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
73 |
4868
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
74 (defvar texinfo-command-start) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
75 (defvar texinfo-command-end) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
76 (defvar texinfo-command-name) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
77 (defvar texinfo-defun-type) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
78 (defvar texinfo-last-node-pos) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
79 (defvar texinfo-stack) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
80 (defvar texinfo-short-index-cmds-alist) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
81 (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
|
82 (defvar texinfo-format-filename) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
83 (defvar texinfo-footnote-number) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
84 (defvar texinfo-start-of-header) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
85 (defvar texinfo-end-of-header) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
86 (defvar texinfo-raisesections-alist) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
87 (defvar texinfo-lowersections-alist) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
88 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
89 ;;; Syntax table |
189 | 90 |
91 (if texinfo-format-syntax-table | |
92 nil | |
93 (setq texinfo-format-syntax-table (make-syntax-table)) | |
38044
d2534bdf1832
(texinfo-format-syntax-table): Revert previous change.
Miles Bader <miles@gnu.org>
parents:
38032
diff
changeset
|
94 (modify-syntax-entry ?\" " " texinfo-format-syntax-table) |
d2534bdf1832
(texinfo-format-syntax-table): Revert previous change.
Miles Bader <miles@gnu.org>
parents:
38032
diff
changeset
|
95 (modify-syntax-entry ?\\ " " texinfo-format-syntax-table) |
189 | 96 (modify-syntax-entry ?@ "\\" texinfo-format-syntax-table) |
97 (modify-syntax-entry ?\^q "\\" 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 (modify-syntax-entry ?\) "." texinfo-format-syntax-table) | |
102 (modify-syntax-entry ?{ "(}" texinfo-format-syntax-table) | |
103 (modify-syntax-entry ?} "){" texinfo-format-syntax-table) | |
104 (modify-syntax-entry ?\' "." texinfo-format-syntax-table)) | |
105 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
106 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
107 ;;; 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
|
108 |
4769
d1b5ca8f5493
(texinfo-format-region texinfo-format-buffer): Add ###autoload cookies.
Brian Fox <bfox@gnu.org>
parents:
4396
diff
changeset
|
109 ;;;###autoload |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
110 (defun texinfo-format-buffer (&optional nosplit) |
189 | 111 "Process the current buffer as texinfo code, into an Info file. |
112 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
|
113 name specified in the @setfilename command. |
189 | 114 |
115 Non-nil argument (prefix, if interactive) means don't make tag table | |
116 and don't split the file if large. You can use Info-tagify and | |
117 Info-split to do these manually." | |
118 (interactive "P") | |
24621
54ef2ebc8494
(texinfo-format-buffer): Bind coding-system-for-write, to avoid hanging when
Karl Heuer <kwzh@gnu.org>
parents:
24453
diff
changeset
|
119 (let ((lastmessage "Formatting Info file...") |
54ef2ebc8494
(texinfo-format-buffer): Bind coding-system-for-write, to avoid hanging when
Karl Heuer <kwzh@gnu.org>
parents:
24453
diff
changeset
|
120 (coding-system-for-write buffer-file-coding-system)) |
189 | 121 (message lastmessage) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
122 (widen) |
189 | 123 (texinfo-format-buffer-1) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
124 (Info-tagify) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
125 (if nosplit |
189 | 126 nil |
127 (if (> (buffer-size) 100000) | |
128 (progn | |
129 (message (setq lastmessage "Splitting Info file...")) | |
130 (Info-split)))) | |
131 (message (concat lastmessage | |
132 (if (interactive-p) "done. Now save it." "done."))))) | |
133 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
134 (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
|
135 "*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
|
136 |
52969
d60ea4b622fe
(texinfo-pre-format-hook): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
52401
diff
changeset
|
137 (defvar texinfo-pre-format-hook nil |
d60ea4b622fe
(texinfo-pre-format-hook): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
52401
diff
changeset
|
138 "Hook called before the conversion of the Texinfo file to Info format. |
d60ea4b622fe
(texinfo-pre-format-hook): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
52401
diff
changeset
|
139 The functions on this hook are called with argument BUFFER, the buffer |
d60ea4b622fe
(texinfo-pre-format-hook): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
52401
diff
changeset
|
140 containing the Texinfo file.") |
d60ea4b622fe
(texinfo-pre-format-hook): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
52401
diff
changeset
|
141 |
48932
faafd2631b67
(tex-start-of-header, tex-end-of-header): Add defvars.
Richard M. Stallman <rms@gnu.org>
parents:
48794
diff
changeset
|
142 ;; These come from tex-mode.el. |
faafd2631b67
(tex-start-of-header, tex-end-of-header): Add defvars.
Richard M. Stallman <rms@gnu.org>
parents:
48794
diff
changeset
|
143 (defvar tex-start-of-header) |
faafd2631b67
(tex-start-of-header, tex-end-of-header): Add defvars.
Richard M. Stallman <rms@gnu.org>
parents:
48794
diff
changeset
|
144 (defvar tex-end-of-header) |
faafd2631b67
(tex-start-of-header, tex-end-of-header): Add defvars.
Richard M. Stallman <rms@gnu.org>
parents:
48794
diff
changeset
|
145 |
4769
d1b5ca8f5493
(texinfo-format-region texinfo-format-buffer): Add ###autoload cookies.
Brian Fox <bfox@gnu.org>
parents:
4396
diff
changeset
|
146 ;;;###autoload |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
147 (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
|
148 "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
|
149 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
|
150 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
|
151 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
|
152 (interactive "r") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
153 (message "Converting region to Info format...") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
154 (let (texinfo-command-start |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
155 texinfo-command-end |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
156 texinfo-command-name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
157 texinfo-vindex |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
158 texinfo-findex |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
159 texinfo-cindex |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
160 texinfo-pindex |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
161 texinfo-tindex |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
162 texinfo-kindex |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
163 texinfo-stack |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
164 (texinfo-format-filename "") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
165 texinfo-example-start |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
166 texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
167 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
168 texinfo-node-names |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
169 (texinfo-footnote-number 0) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
170 last-input-buffer |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
171 (fill-column-for-info fill-column) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
172 (input-buffer (current-buffer)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
173 (input-directory default-directory) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
174 (header-text "") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
175 (header-beginning 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
176 (header-end 1)) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
177 |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
178 ;;; Copy lines between beginning and end of header lines, |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
179 ;;; 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
|
180 (save-excursion |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
181 (save-restriction |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
182 (widen) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
183 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
184 (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
|
185 (if (or |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
186 ;; Either copy header text. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
187 (and |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
188 (prog1 |
4982
36b78ccd6285
(texinfo-format-region): Change `texinfo-[start
Richard M. Stallman <rms@gnu.org>
parents:
4868
diff
changeset
|
189 (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
|
190 (forward-line 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
191 ;; Mark beginning of header. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
192 (setq header-beginning (point))) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
193 (prog1 |
4982
36b78ccd6285
(texinfo-format-region): Change `texinfo-[start
Richard M. Stallman <rms@gnu.org>
parents:
4868
diff
changeset
|
194 (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
|
195 (beginning-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
196 ;; Mark end of header |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
197 (setq header-end (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
198 ;; Or copy @filename line. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
199 (prog2 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
200 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
201 (search-forward "@setfilename" search-end t) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
202 (beginning-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
203 (setq header-beginning (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
204 (forward-line 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
205 (setq header-end (point)))) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
206 |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
207 ;; Copy header |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
208 (setq header-text |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
209 (buffer-substring-no-properties |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
210 (min header-beginning region-beginning) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
211 header-end)))))) |
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 ;;; Find a buffer to use. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
214 (switch-to-buffer (get-buffer-create texinfo-region-buffer-name)) |
67582
cc04cc5f78a8
(texinfo-format-region):
Robert J. Chassell <bob@rattlesnake.com>
parents:
64751
diff
changeset
|
215 (setq buffer-read-only t) |
cc04cc5f78a8
(texinfo-format-region):
Robert J. Chassell <bob@rattlesnake.com>
parents:
64751
diff
changeset
|
216 (let ((inhibit-read-only t)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
217 (erase-buffer) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
218 ;; Insert the header into the buffer. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
219 (insert header-text) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
220 ;; Insert the region into the buffer. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
221 (insert-buffer-substring |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
222 input-buffer |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
223 (max region-beginning header-end) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
224 region-end) |
52969
d60ea4b622fe
(texinfo-pre-format-hook): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
52401
diff
changeset
|
225 (run-hook-with-args 'texinfo-pre-format-hook input-buffer) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
226 ;; 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
|
227 (or (= (preceding-char) ?\n) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
228 (insert "\n")) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
229 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
230 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
231 (texinfo-mode) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
232 (message "Converting region to Info format...") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
233 (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
|
234 ;; 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
|
235 (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
|
236 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
237 ;; 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
|
238 ;; work on them without losing track of multiple |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
239 ;; @raise/@lowersections commands. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
240 (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
|
241 (setq texinfo-command-end (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
242 (let ((filename (concat input-directory |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
243 (texinfo-parse-line-arg)))) |
9178
0facf5c89fff
(texinfo-format-region, texinfo-format-buffer-1):
Richard M. Stallman <rms@gnu.org>
parents:
6309
diff
changeset
|
244 (re-search-backward "^@include") |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
245 (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
|
246 (message "Reading included file: %s" filename) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
247 (save-excursion |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
248 (save-restriction |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
249 (narrow-to-region |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
250 (point) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
251 (+ (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
|
252 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
253 ;; 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
|
254 ;; so @setfilename command not duplicated. |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
255 (if (re-search-forward "^@setfilename" (line-end-position 100) t) |
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
256 (delete-region (line-beginning-position 1) |
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
257 (line-beginning-position 2))))))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
258 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
259 ;; 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
|
260 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
261 (texinfo-raise-lower-sections) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
262 ;; 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
|
263 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
264 (texinfo-append-refill) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
265 ;; 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
|
266 ;; discard everything after that. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
267 (goto-char (point-max)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
268 (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
|
269 (delete-region (point) (point-max))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
270 ;; 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
|
271 (or (= (preceding-char) ?\n) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
272 (insert "\n")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
273 ;; 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
|
274 (setq texinfo-enclosure-list nil) |
9759
ebe611f49450
(texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9754
diff
changeset
|
275 (setq texinfo-alias-list nil) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
276 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
277 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
278 (if (looking-at "\\\\input[ \t]+texinfo") |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
279 (delete-region (point) (line-beginning-position 2))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
280 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
281 ;; Insert Info region title text. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
282 (goto-char (point-min)) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
283 (if (search-forward |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
284 "@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
|
285 (progn |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
286 (setq texinfo-command-end (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
287 (beginning-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
288 (setq texinfo-command-start (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
289 (let ((arg (texinfo-parse-arg-discard))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
290 (insert " " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
291 texinfo-region-buffer-name |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
292 " buffer for: `") |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
293 (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
|
294 (insert "', -*-Text-*-\n"))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
295 ;; Else no `@setfilename' line |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
296 (insert " " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
297 texinfo-region-buffer-name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
298 " buffer -*-Text-*-\n")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
299 (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
|
300 "from a region in: " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
301 (if (buffer-file-name input-buffer) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
302 (concat "`" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
303 (file-name-sans-versions |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
304 (file-name-nondirectory |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
305 (buffer-file-name input-buffer))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
306 "'") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
307 (concat "buffer `" (buffer-name input-buffer) "'")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
308 "\nusing `texinfmt.el' version " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
309 texinfmt-version |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
310 ".\n\n") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
311 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
312 ;; Now convert for real. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
313 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
314 (texinfo-format-scan) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
315 (goto-char (point-min)) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
316 (Info-tagify input-buffer) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
317 (goto-char (point-min)) |
67582
cc04cc5f78a8
(texinfo-format-region):
Robert J. Chassell <bob@rattlesnake.com>
parents:
64751
diff
changeset
|
318 (message "Done.")))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
319 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
320 ;;;###autoload |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
321 (defun texi2info (&optional nosplit) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
322 "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
|
323 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
|
324 names specified in the @setfilename command. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
325 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
326 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
|
327 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
|
328 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
|
329 Texinfo source buffer is not changed. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
330 |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
331 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
|
332 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
|
333 (interactive "P") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
334 (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
|
335 (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
|
336 ;; (sit-for 2) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
337 (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
|
338 (switch-to-buffer temp-buffer) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
339 (texinfo-master-menu t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
340 (message "Now creating Info file.") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
341 (sit-for 2) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
342 (texinfo-format-buffer nosplit) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
343 (save-buffer) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
344 (kill-buffer temp-buffer))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
345 |
189 | 346 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
347 ;;; 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
|
348 |
189 | 349 (defun texinfo-format-buffer-1 () |
350 (let (texinfo-format-filename | |
351 texinfo-example-start | |
352 texinfo-command-start | |
353 texinfo-command-end | |
354 texinfo-command-name | |
355 texinfo-last-node | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
356 texinfo-last-node-pos |
189 | 357 texinfo-vindex |
358 texinfo-findex | |
359 texinfo-cindex | |
360 texinfo-pindex | |
361 texinfo-tindex | |
362 texinfo-kindex | |
363 texinfo-stack | |
364 texinfo-node-names | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
365 (texinfo-footnote-number 0) |
189 | 366 last-input-buffer |
367 outfile | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
368 (fill-column-for-info fill-column) |
189 | 369 (input-buffer (current-buffer)) |
370 (input-directory default-directory)) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
371 (setq texinfo-enclosure-list nil) |
9759
ebe611f49450
(texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9754
diff
changeset
|
372 (setq texinfo-alias-list nil) |
189 | 373 (save-excursion |
374 (goto-char (point-min)) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
375 (or (search-forward "@setfilename" nil t) |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38044
diff
changeset
|
376 (error "Texinfo file needs an `@setfilename FILENAME' line")) |
189 | 377 (setq texinfo-command-end (point)) |
378 (setq outfile (texinfo-parse-line-arg))) | |
18818
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
379 |
189 | 380 (find-file outfile) |
381 (texinfo-mode) | |
18818
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
382 (erase-buffer) |
59115
fb586fbcd93c
(texinfo-format-buffer-1): Call buffer-disable-undo.
Richard M. Stallman <rms@gnu.org>
parents:
55770
diff
changeset
|
383 (buffer-disable-undo) |
18818
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
384 |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
385 (message "Formatting Info file: %s" outfile) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
386 (setq texinfo-format-filename |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
387 (file-name-nondirectory (expand-file-name outfile))) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
388 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
389 (setq fill-column fill-column-for-info) |
189 | 390 (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
|
391 |
189 | 392 (insert-buffer-substring input-buffer) |
52969
d60ea4b622fe
(texinfo-pre-format-hook): New variable.
Eli Zaretskii <eliz@gnu.org>
parents:
52401
diff
changeset
|
393 (run-hook-with-args 'texinfo-pre-format-hook input-buffer) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
394 (message "Converting %s to Info format..." (buffer-name input-buffer)) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
395 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
396 ;; 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
|
397 ;; work on them without losing track of multiple |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
398 ;; @raise/@lowersections commands. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
399 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
400 (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
|
401 (setq texinfo-command-end (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
402 (let ((filename (concat input-directory |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
403 (texinfo-parse-line-arg)))) |
9178
0facf5c89fff
(texinfo-format-region, texinfo-format-buffer-1):
Richard M. Stallman <rms@gnu.org>
parents:
6309
diff
changeset
|
404 (re-search-backward "^@include") |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
405 (delete-region (point) (line-beginning-position 2)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
406 (message "Reading included file: %s" filename) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
407 (save-excursion |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
408 (save-restriction |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
409 (narrow-to-region |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
410 (point) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
411 (+ (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
|
412 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
413 ;; 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
|
414 ;; so @setfilename command not duplicated. |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
415 (if (re-search-forward "^@setfilename" (line-end-position 100) t) |
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
416 (delete-region (line-beginning-position 1) |
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
417 (line-beginning-position 2))))))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
418 ;; 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
|
419 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
420 (texinfo-raise-lower-sections) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
421 ;; Append @refill to appropriate paragraphs |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
422 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
423 (texinfo-append-refill) |
189 | 424 (goto-char (point-min)) |
425 (search-forward "@setfilename") | |
426 (beginning-of-line) | |
427 (delete-region (point-min) (point)) | |
428 ;; Remove @bye at end of file, if it is there. | |
429 (goto-char (point-max)) | |
430 (if (search-backward "@bye" nil t) | |
431 (delete-region (point) (point-max))) | |
432 ;; Make sure buffer ends in a newline. | |
433 (or (= (preceding-char) ?\n) | |
434 (insert "\n")) | |
435 ;; Scan the whole buffer, converting to Info format. | |
436 (texinfo-format-scan) | |
18818
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
437 (goto-char (point-min)) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
438 ;; 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
|
439 (insert "Info file: " |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
440 texinfo-format-filename ", -*-Text-*-\n" |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
441 "produced by `texinfo-format-buffer'\n" |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
442 ;; 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
|
443 ;; "on " |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
444 ;; (insert (format-time-string "%e %b %Y")) " " |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
445 "from file" |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
446 (if (buffer-file-name input-buffer) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
447 (concat " `" |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
448 (file-name-sans-versions |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
449 (file-name-nondirectory |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
450 (buffer-file-name input-buffer))) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
451 "'") |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
452 (concat "buffer `" (buffer-name input-buffer) "'")) |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
453 "\nusing `texinfmt.el' version " |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
454 texinfmt-version |
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
455 ".\n\n") |
189 | 456 ;; Return data for indices. |
457 (list outfile | |
458 texinfo-vindex texinfo-findex texinfo-cindex | |
459 texinfo-pindex texinfo-tindex texinfo-kindex))) | |
460 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
461 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
462 ;;; Perform non-@-command file conversions: quotes and hyphens |
189 | 463 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
464 (defun texinfo-format-convert (min max) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
465 ;; 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
|
466 (goto-char min) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
467 (while (search-forward "``" max t) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
468 (replace-match "\"")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
469 (goto-char min) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
470 (while (search-forward "''" max t) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
471 (replace-match "\"")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
472 ;; 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
|
473 (goto-char min) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
474 (while (re-search-forward "\\( \\|\\w\\)\\(---\\)\\( \\|\\w\\)" max t) |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
475 (delete-region (1+ (match-beginning 2)) (+ 2 (match-beginning 2))))) |
189 | 476 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
477 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
478 ;;; Handle paragraph filling |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
479 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
480 ;; 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
|
481 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
482 (defvar texinfo-no-refill-regexp |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
483 (concat |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
484 "^@" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
485 "\\(" |
48519
ba7e7cf495b0
(texinfo-no-refill-regexp): add "itemize\\|" because of a problem with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48518
diff
changeset
|
486 ;; add "itemize\\|" (from experiment of 2001 Nov 28) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
487 ;; because of a problem with @end itemize@refill |
48519
ba7e7cf495b0
(texinfo-no-refill-regexp): add "itemize\\|" because of a problem with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48518
diff
changeset
|
488 ;; I don't know if this causes other problems. |
ba7e7cf495b0
(texinfo-no-refill-regexp): add "itemize\\|" because of a problem with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48518
diff
changeset
|
489 ;; I suspect itemized lists don't get filled properly and a |
ba7e7cf495b0
(texinfo-no-refill-regexp): add "itemize\\|" because of a problem with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48518
diff
changeset
|
490 ;; more precise fix is required. Bob |
60309
7621f2acbeb0
(texinfo-no-refill-regexp): commented out inclusion of "itemize\\|",
Robert J. Chassell <bob@rattlesnake.com>
parents:
59115
diff
changeset
|
491 ;; commented out on 2005 Feb 28 by Bob |
7621f2acbeb0
(texinfo-no-refill-regexp): commented out inclusion of "itemize\\|",
Robert J. Chassell <bob@rattlesnake.com>
parents:
59115
diff
changeset
|
492 ;; "itemize\\|" |
18884
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
493 "direntry\\|" |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
494 "lisp\\|" |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
495 "smalllisp\\|" |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
496 "example\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
497 "smallexample\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
498 "display\\|" |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
499 "smalldisplay\\|" |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
500 "format\\|" |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
501 "smallformat\\|" |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
502 "flushleft\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
503 "flushright\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
504 "menu\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
505 "multitable\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
506 "titlepage\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
507 "iftex\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
508 "ifhtml\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
509 "tex\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
510 "html" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
511 "\\)") |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
512 "Regexp specifying environments in which paragraphs are not filled.") |
189 | 513 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
514 (defvar texinfo-accent-commands |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
515 (concat |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
516 "@^\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
517 "@`\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
518 "@'\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
519 "@\"\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
520 "@,\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
521 "@=\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
522 "@~\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
523 "@OE{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
524 "@oe{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
525 "@AA{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
526 "@aa{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
527 "@AE{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
528 "@ae{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
529 "@ss{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
530 "@questiondown{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
531 "@exclamdown{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
532 "@L{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
533 "@l{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
534 "@O{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
535 "@o{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
536 "@dotaccent{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
537 "@ubaraccent{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
538 "@d{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
539 "@H{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
540 "@ringaccent{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
541 "@tieaccent{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
542 "@u{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
543 "@v{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
544 "@dotless{" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
545 )) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
546 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
547 (defvar texinfo-part-of-para-regexp |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
548 (concat |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
549 "^@" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
550 "\\(" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
551 "b{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
552 "bullet{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
553 "cite{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
554 "code{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
555 "email{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
556 "emph{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
557 "equiv{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
558 "error{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
559 "expansion{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
560 "file{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
561 "i{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
562 "inforef{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
563 "kbd{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
564 "key{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
565 "lisp{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
566 "minus{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
567 "point{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
568 "print{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
569 "pxref{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
570 "r{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
571 "ref{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
572 "result{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
573 "samp{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
574 "sc{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
575 "t{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
576 "TeX{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
577 "today{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
578 "url{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
579 "var{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
580 "w{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
581 "xref{\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
582 "@-\\|" ; @- 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
|
583 texinfo-accent-commands |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
584 "\\)" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
585 ) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
586 "Regexp specifying @-commands found within paragraphs.") |
189 | 587 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
588 (defun texinfo-append-refill () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
589 "Append @refill at end of each paragraph that should be filled. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
590 Do not append @refill to paragraphs within @example and similar environments. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
591 Do not append @refill to paragraphs containing @w{TEXT} or @*." |
189 | 592 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
593 ;; 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
|
594 ;; 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
|
595 ;; whether the text should or should not be filled. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
596 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
597 (while (< (point) (point-max)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
598 (let ((refill-blank-lines "^[ \t\n]*$") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
599 (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
|
600 (beginning-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
601 ;; 1. Skip over blank lines; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
602 ;; skip over lines beginning with @-commands, |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
603 ;; but do not skip over lines |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
604 ;; 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
|
605 ;; 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
|
606 (while (and (looking-at (concat "^@\\|^\\\\\\|" refill-blank-lines)) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
607 (not (looking-at |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
608 (concat |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
609 "\\(" |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
610 texinfo-no-refill-regexp |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
611 "\\|" |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
612 texinfo-part-of-para-regexp |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
613 "\\)"))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
614 (< (point) (point-max))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
615 (forward-line 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
616 ;; 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
|
617 (if (looking-at texinfo-no-refill-regexp) |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
618 (let ((environment (match-string-no-properties 1))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
619 (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
|
620 (forward-line 1))) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
621 ;; Else |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
622 ;; 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
|
623 ;; with @<newline> followed by a newline. |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
624 (if (or (>= (point) (point-max)) |
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
625 (re-search-forward |
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
626 "@w{\\|@\\*\\|@\n\n" |
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
627 (save-excursion (forward-paragraph) (forward-line 1) (point)) |
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
628 t)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
629 ;; Go to end of paragraph and do nothing. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
630 (forward-paragraph) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
631 ;; 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
|
632 (forward-paragraph) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
633 (forward-line -1) |
23658 | 634 (let ((line-beg (point))) |
635 (end-of-line) | |
636 (delete-region | |
637 (point) | |
638 (save-excursion (skip-chars-backward " \t") (point))) | |
24453
3b8991c22dcd
(texinfo-append-refill): Check @c correctly.
Kenichi Handa <handa@m17n.org>
parents:
24314
diff
changeset
|
639 (forward-char 1) |
3b8991c22dcd
(texinfo-append-refill): Check @c correctly.
Kenichi Handa <handa@m17n.org>
parents:
24314
diff
changeset
|
640 (unless (re-search-backward "@c[ \t\n]\\|@comment[ \t\n]" line-beg t) |
3b8991c22dcd
(texinfo-append-refill): Check @c correctly.
Kenichi Handa <handa@m17n.org>
parents:
24314
diff
changeset
|
641 (forward-char -1)) |
60372
f46823f3408c
(texinfo-append-refill): Redefine the types of line to which @refill
Robert J. Chassell <bob@rattlesnake.com>
parents:
60327
diff
changeset
|
642 (unless (re-search-backward "@refill\\|^[ \t]*@" line-beg t) |
23658 | 643 (insert "@refill"))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
644 (forward-line 1)))))) |
189 | 645 |
646 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
647 ;;; Handle `@raisesections' and `@lowersections' commands |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
648 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
649 ;; These commands change the hierarchical level of chapter structuring |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
650 ;; commands. |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
651 ;; |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
652 ;; @raisesections changes @subsection to @section, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
653 ;; @section to @chapter, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
654 ;; etc. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
655 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
656 ;; @lowersections changes @chapter to @section |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
657 ;; @subsection to @subsubsection, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
658 ;; etc. |
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 ;; 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
|
661 ;; 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
|
662 ;; command. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
663 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
664 ;; 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
|
665 ;; the heading level. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
666 ;; |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
667 ;; 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
|
668 ;; vice versa. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
669 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
670 ;; 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
|
671 ;; 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
|
672 ;; 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
|
673 ;; (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
|
674 ;; @section produce chapter headings). |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
675 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
676 (defun texinfo-raise-lower-sections () |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
677 "Raise or lower the hierarchical level of chapters, sections, etc. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
678 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
679 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
|
680 commands in the Texinfo file. |
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 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
|
683 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
|
684 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
|
685 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
|
686 on. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
687 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
688 @raisesections changes @subsection to @section, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
689 @section to @chapter, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
690 @heading to @chapheading, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
691 etc. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
692 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
693 @lowersections changes @chapter to @section, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
694 @subsection to @subsubsection, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
695 @heading to @subheading, |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
696 etc. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
697 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
698 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
|
699 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
|
700 `@lowersections' command. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
701 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
702 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
|
703 vice versa. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
704 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
705 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
|
706 level a step at a time. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
707 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
708 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
|
709 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
|
710 commands." |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
711 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
712 ;; `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
|
713 ;; 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
|
714 ;; (but not the top node). |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
715 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
716 (let (type (level 0)) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
717 (while |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
718 (re-search-forward |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
719 (concat |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
720 "\\(\\(^@\\(raise\\|lower\\)sections\\)\\|\\(" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
721 texinfo-section-types-regexp |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
722 "\\)\\)") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
723 nil t) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
724 (beginning-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
725 (save-excursion (setq type (read (current-buffer)))) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
726 (cond |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
727 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
728 ;; 1. Increment level |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
729 ((eq type '@raisesections) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
730 (setq level (1+ level)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
731 (delete-region |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
732 (point) (save-excursion (forward-line 1) (point)))) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
733 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
734 ;; 2. Decrement level |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
735 ((eq type '@lowersections) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
736 (setq level (1- level)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
737 (delete-region |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
738 (point) (save-excursion (forward-line 1) (point)))) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
739 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
740 ;; Now handle structuring commands |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
741 ((cond |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
742 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
743 ;; 3. Raise level when positive |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
744 ((> level 0) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
745 (let ((count level) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
746 (new-level type)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
747 (while (> count 0) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
748 (setq new-level |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
749 (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
|
750 (setq count (1- count))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
751 (kill-word 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
752 (insert (symbol-name new-level)))) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
753 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
754 ;; 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
|
755 ((= level 0) (forward-line 1)) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
756 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
757 ;; 5. Lower level when positive |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
758 ((< level 0) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
759 (let ((count level) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
760 (new-level type)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
761 (while (< count 0) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
762 (setq new-level |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
763 (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
|
764 (setq count (1+ count))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
765 (kill-word 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
766 (insert (symbol-name new-level)))))))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
767 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
768 (defvar texinfo-raisesections-alist |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
769 '((@chapter . @chapter) ; Cannot go higher |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
770 (@unnumbered . @unnumbered) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
771 (@centerchap . @unnumbered) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
772 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
773 (@majorheading . @majorheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
774 (@chapheading . @chapheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
775 (@appendix . @appendix) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
776 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
777 (@section . @chapter) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
778 (@unnumberedsec . @unnumbered) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
779 (@heading . @chapheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
780 (@appendixsec . @appendix) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
781 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
782 (@subsection . @section) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
783 (@unnumberedsubsec . @unnumberedsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
784 (@subheading . @heading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
785 (@appendixsubsec . @appendixsec) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
786 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
787 (@subsubsection . @subsection) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
788 (@unnumberedsubsubsec . @unnumberedsubsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
789 (@subsubheading . @subheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
790 (@appendixsubsubsec . @appendixsubsec)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
791 "*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
|
792 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
|
793 Used by `texinfo-raise-lower-sections'. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
794 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
|
795 higher types.") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
796 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
797 (defvar texinfo-lowersections-alist |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
798 '((@chapter . @section) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
799 (@unnumbered . @unnumberedsec) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
800 (@centerchap . @unnumberedsec) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
801 (@majorheading . @heading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
802 (@chapheading . @heading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
803 (@appendix . @appendixsec) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
804 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
805 (@section . @subsection) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
806 (@unnumberedsec . @unnumberedsubsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
807 (@heading . @subheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
808 (@appendixsec . @appendixsubsec) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
809 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
810 (@subsection . @subsubsection) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
811 (@unnumberedsubsec . @unnumberedsubsubsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
812 (@subheading . @subsubheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
813 (@appendixsubsec . @appendixsubsubsec) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
814 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
815 (@subsubsection . @subsubsection) ; Cannot go lower. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
816 (@unnumberedsubsubsec . @unnumberedsubsubsec) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
817 (@subsubheading . @subsubheading) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
818 (@appendixsubsubsec . @appendixsubsubsec)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
819 "*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
|
820 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
|
821 Used by `texinfo-raise-lower-sections'. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
822 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
|
823 lower types.") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
824 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
825 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
826 ;;; 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
|
827 ;;; uniformly. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
828 |
189 | 829 (defun texinfo-format-scan () |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
830 (texinfo-format-convert (point-min) (point-max)) |
48697
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
831 ;; Search for @copying, which has to be first since the |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
832 ;; @insertcopying command then inserts the text elsewhere. |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
833 (goto-char (point-min)) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
834 (when (search-forward "@copying" nil t) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
835 (texinfo-copying)) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
836 (while (search-forward "@insertcopying" nil t) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
837 (delete-region (match-beginning 0) (match-end 0)) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
838 |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
839 (texinfo-insertcopying)) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
840 ;; Scan for other @-commands. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
841 (goto-char (point-min)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
842 (while (search-forward "@" nil t) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
843 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
844 ;; These are the single-character accent commands: @^ @` @' @" @= @~ |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
845 ;; 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
|
846 ;; Other single-character commands: |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
847 ;; @* forces a line break, |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
848 ;; @- 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
|
849 ;; @<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
|
850 ;; unless followed by a newline. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
851 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
852 ;; Old version 2.34 expression: (looking-at "[@{}^'` *\"?!]") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
853 (if (looking-at "[@{}^'`\"=~ \t\n*?!-]") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
854 ;; @*, causes a line break. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
855 (cond |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
856 ;; @*, a line break |
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 ;; remove command |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
859 (delete-region (1- (point)) (1+ (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
860 ;; 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
|
861 ;; else line is already broken. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
862 (if (not (= (following-char) ?\n)) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
863 (insert ?\n))) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
864 ;; @-, deleted |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
865 ((= (following-char) ?-) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
866 (delete-region (1- (point)) (1+ (point)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
867 ;; @<space>, @<tab>, @<newline>: produce a single space, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
868 ;; unless followed by a newline. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
869 ((= (following-char) ? ) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
870 (delete-region (1- (point)) (1+ (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
871 ;; 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
|
872 ;; else line is already broken. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
873 (if (not (= (following-char) ?\n)) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
874 (insert ? ))) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
875 ((= (following-char) ?\t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
876 (delete-region (1- (point)) (1+ (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
877 ;; 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
|
878 ;; else line is already broken. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
879 (if (not (= (following-char) ?\n)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
880 (insert ? ))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
881 ;; following char is a carriage return |
27254
650eddd41858
(texinfo-format-scan): Use ?\n instead
Gerd Moellmann <gerd@gnu.org>
parents:
25278
diff
changeset
|
882 ((= (following-char) ?\n) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
883 ;; remove command |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
884 (delete-region (1- (point)) (1+ (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
885 ;; 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
|
886 ;; else line is already broken. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
887 (if (not (= (following-char) ?\n)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
888 (insert ? ))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
889 ;; 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
|
890 (t |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
891 (delete-char -1) |
36300 | 892 ;; Be compatible with makeinfo: if @' and its ilk are |
36287
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
893 ;; followed by a @ without a brace, barf. |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
894 (if (looking-at "[\"'^`~=]") |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
895 (progn |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
896 (if (= (char-after (1+ (point))) ?@) |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
897 (error "Use braces to give a command as an argument to @%c" |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
898 (following-char))) |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
899 (forward-char 1) |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
900 ;; @' etc. can optionally accept their argument in |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
901 ;; braces (makeinfo supports that). |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
902 (when (looking-at "{") |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
903 (let ((start (point))) |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
904 (forward-list 1) |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
905 (delete-char -1) |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
906 (goto-char start) |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
907 (delete-char 1)))) |
6619db0066d9
(texinfo-format-scan): Signal an error if
Eli Zaretskii <eliz@gnu.org>
parents:
28740
diff
changeset
|
908 (forward-char 1)))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
909 ;; @ 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
|
910 (setq texinfo-command-start (1- (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
911 (if (= (char-syntax (following-char)) ?w) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
912 (forward-word 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
913 (forward-char 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
914 (setq texinfo-command-end (point)) |
23658 | 915 ;; Detect the case of two @-commands in a row; |
916 ;; process just the first one. | |
917 (goto-char (1+ texinfo-command-start)) | |
918 (skip-chars-forward "^@" texinfo-command-end) | |
919 (setq texinfo-command-end (point)) | |
9759
ebe611f49450
(texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9754
diff
changeset
|
920 ;; Handle let aliasing |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
921 (setq texinfo-command-name |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
922 (let (trial |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
923 (cmdname |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
924 (buffer-substring-no-properties |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
925 (1+ texinfo-command-start) texinfo-command-end))) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
926 (while (setq trial (assoc cmdname texinfo-alias-list)) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
927 (setq cmdname (cdr trial))) |
9759
ebe611f49450
(texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9754
diff
changeset
|
928 (intern cmdname))) |
ebe611f49450
(texinfo-alias-list): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
9754
diff
changeset
|
929 ;; 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
|
930 (let ((enclosure-type |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
931 (assoc |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
932 (symbol-name texinfo-command-name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
933 texinfo-enclosure-list))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
934 (if enclosure-type |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
935 (progn |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
936 (insert |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
937 (car (car (cdr enclosure-type))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
938 (texinfo-parse-arg-discard) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
939 (car (cdr (car (cdr enclosure-type))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
940 (goto-char texinfo-command-start)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
941 (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
|
942 (if cmd (funcall cmd) (texinfo-unsupported))))))) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
943 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
944 (cond (texinfo-stack |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
945 (goto-char (nth 2 (car texinfo-stack))) |
48697
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
946 (error "Unterminated @%s" (car (car texinfo-stack))))) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
947 |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
948 ;; Remove excess whitespace |
51550
5ffaa82e4d48
(texinfo-format-scan): Silence `whitespace-cleanup'.
Juanma Barranquero <lekktu@gmail.com>
parents:
49700
diff
changeset
|
949 (let ((whitespace-silent t)) |
5ffaa82e4d48
(texinfo-format-scan): Silence `whitespace-cleanup'.
Juanma Barranquero <lekktu@gmail.com>
parents:
49700
diff
changeset
|
950 (whitespace-cleanup))) |
48697
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
951 |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
952 (defvar texinfo-copying-text "" |
48697
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
953 "Text of the copyright notice and copying permissions.") |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
954 |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
955 (defun texinfo-copying () |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
956 "Copy the copyright notice and copying permissions from the Texinfo file, |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
957 as indicated by the @copying ... @end copying command; |
48697
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
958 insert the text with the @insertcopying command." |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
959 (let ((beg (progn (beginning-of-line) (point))) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
960 (end (progn (re-search-forward "^@end copying[ \t]*\n") (point)))) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
961 (setq texinfo-copying-text |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
962 (buffer-substring-no-properties |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
963 (save-excursion (goto-char beg) (forward-line 1) (point)) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
964 (save-excursion (goto-char end) (forward-line -1) (point)))) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
965 (delete-region beg end))) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
966 |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
967 (defun texinfo-insertcopying () |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
968 "Insert the copyright notice and copying permissions from the Texinfo file, |
48697
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
969 which are indicated by the @copying ... @end copying command." |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
970 (insert (concat "\n" texinfo-copying-text))) |
189 | 971 |
972 (put 'begin 'texinfo-format 'texinfo-format-begin) | |
973 (defun texinfo-format-begin () | |
974 (texinfo-format-begin-end 'texinfo-format)) | |
975 | |
976 (put 'end 'texinfo-format 'texinfo-format-end) | |
977 (defun texinfo-format-end () | |
978 (texinfo-format-begin-end 'texinfo-end)) | |
979 | |
980 (defun texinfo-format-begin-end (prop) | |
981 (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
|
982 (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
|
983 (if cmd (funcall cmd) |
6de32c7b6045
(texinfo-format-begin-end): Bind cmd locally.
Richard M. Stallman <rms@gnu.org>
parents:
4769
diff
changeset
|
984 (texinfo-unsupported)))) |
189 | 985 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
986 ;;; Parsing functions |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
987 |
189 | 988 (defun texinfo-parse-line-arg () |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
989 "Return argument of @-command as string. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
990 Argument is separated from command either by a space or by a brace. |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
991 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
|
992 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
|
993 Leave point after argument." |
189 | 994 (goto-char texinfo-command-end) |
995 (let ((start (point))) | |
996 (cond ((looking-at " ") | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
997 (skip-chars-forward " ") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
998 (setq start (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
999 (end-of-line) |
189 | 1000 (skip-chars-backward " ") |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1001 (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
|
1002 (setq texinfo-command-end (1+ (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1003 ((looking-at "{") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1004 (setq start (1+ (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1005 (forward-list 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1006 (setq texinfo-command-end (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1007 (forward-char -1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1008 (t |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1009 (error "Invalid texinfo command arg format"))) |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
1010 (prog1 (buffer-substring-no-properties start (point)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1011 (if (eolp) (forward-char 1))))) |
189 | 1012 |
1013 (defun texinfo-parse-expanded-arg () | |
1014 (goto-char texinfo-command-end) | |
1015 (let ((start (point)) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1016 marker) |
189 | 1017 (cond ((looking-at " ") |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1018 (skip-chars-forward " ") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1019 (setq start (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1020 (end-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1021 (setq texinfo-command-end (1+ (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1022 ((looking-at "{") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1023 (setq start (1+ (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1024 (forward-list 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1025 (setq texinfo-command-end (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1026 (forward-char -1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1027 (t |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1028 (error "Invalid texinfo command arg format"))) |
189 | 1029 (setq marker (move-marker (make-marker) texinfo-command-end)) |
1030 (texinfo-format-expand-region start (point)) | |
1031 (setq texinfo-command-end (marker-position marker)) | |
1032 (move-marker marker nil) | |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
1033 (prog1 (buffer-substring-no-properties start (point)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1034 (if (eolp) (forward-char 1))))) |
189 | 1035 |
1036 (defun texinfo-format-expand-region (start end) | |
1037 (save-restriction | |
1038 (narrow-to-region start end) | |
1039 (let (texinfo-command-start | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1040 texinfo-command-end |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1041 texinfo-command-name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1042 texinfo-stack) |
189 | 1043 (texinfo-format-scan)) |
1044 (goto-char (point-max)))) | |
1045 | |
1046 (defun texinfo-parse-arg-discard () | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1047 "Delete command and argument; return argument of command." |
189 | 1048 (prog1 (texinfo-parse-line-arg) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1049 (texinfo-discard-command))) |
189 | 1050 |
1051 (defun texinfo-discard-command () | |
1052 (delete-region texinfo-command-start texinfo-command-end)) | |
1053 | |
1054 (defun texinfo-optional-braces-discard () | |
1055 "Discard braces following command, if any." | |
1056 (goto-char texinfo-command-end) | |
1057 (let ((start (point))) | |
1058 (cond ((looking-at "[ \t]*\n")) ; do nothing | |
1059 ((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
|
1060 (forward-list 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1061 (setq texinfo-command-end (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1062 (t |
189 | 1063 (error |
1064 "Invalid `texinfo-optional-braces-discard' format \(need braces?\)"))) | |
1065 (delete-region texinfo-command-start texinfo-command-end))) | |
1066 | |
1067 (defun texinfo-format-parse-line-args () | |
1068 (let ((start (1- (point))) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1069 next beg end |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1070 args) |
189 | 1071 (skip-chars-forward " ") |
1072 (while (not (eolp)) | |
1073 (setq beg (point)) | |
1074 (re-search-forward "[\n,]") | |
1075 (setq next (point)) | |
1076 (if (bolp) (setq next (1- next))) | |
1077 (forward-char -1) | |
1078 (skip-chars-backward " ") | |
1079 (setq end (point)) | |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
1080 (setq args (cons (if (> end beg) (buffer-substring-no-properties beg end)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1081 args)) |
189 | 1082 (goto-char next) |
1083 (skip-chars-forward " ")) | |
1084 (if (eolp) (forward-char 1)) | |
1085 (setq texinfo-command-end (point)) | |
1086 (nreverse args))) | |
1087 | |
1088 (defun texinfo-format-parse-args () | |
1089 (let ((start (1- (point))) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1090 next beg end |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1091 args) |
189 | 1092 (search-forward "{") |
1093 (save-excursion | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1094 (texinfo-format-expand-region |
189 | 1095 (point) |
1096 (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
|
1097 ;; 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
|
1098 ;; `@xref{bullet, , @code{@@bullet}@{@}}.' because the |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1099 ;; re-search-forward finds the first right brace after the second |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1100 ;; comma. |
189 | 1101 (while (/= (preceding-char) ?\}) |
1102 (skip-chars-forward " \t\n") | |
1103 (setq beg (point)) | |
1104 (re-search-forward "[},]") | |
1105 (setq next (point)) | |
1106 (forward-char -1) | |
1107 (skip-chars-backward " \t\n") | |
1108 (setq end (point)) | |
1109 (cond ((< beg end) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1110 (goto-char beg) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1111 (while (search-forward "\n" end t) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1112 (replace-match " ")))) |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
1113 (setq args (cons (if (> end beg) (buffer-substring-no-properties beg end)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1114 args)) |
189 | 1115 (goto-char next)) |
37538
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
1116 ;;(if (eolp) (forward-char 1)) |
189 | 1117 (setq texinfo-command-end (point)) |
1118 (nreverse args))) | |
1119 | |
1120 (defun texinfo-format-parse-defun-args () | |
1121 (goto-char texinfo-command-end) | |
1122 (let ((start (point))) | |
1123 (end-of-line) | |
1124 (setq texinfo-command-end (1+ (point))) | |
1125 (let ((marker (move-marker (make-marker) texinfo-command-end))) | |
1126 (texinfo-format-expand-region start (point)) | |
1127 (setq texinfo-command-end (marker-position marker)) | |
1128 (move-marker marker nil)) | |
1129 (goto-char start) | |
1130 (let ((args '()) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1131 beg end) |
189 | 1132 (skip-chars-forward " ") |
1133 (while (not (eolp)) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1134 (cond ((looking-at "{") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1135 (setq beg (1+ (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1136 (forward-list 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1137 (setq end (1- (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1138 (t |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1139 (setq beg (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1140 (re-search-forward "[\n ]") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1141 (forward-char -1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1142 (setq end (point)))) |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
1143 (setq args (cons (buffer-substring-no-properties beg end) args)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1144 (skip-chars-forward " ")) |
189 | 1145 (forward-char 1) |
1146 (nreverse args)))) | |
1147 | |
1148 (defun texinfo-discard-line () | |
1149 (goto-char texinfo-command-end) | |
1150 (skip-chars-forward " \t") | |
1151 (or (eolp) | |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38044
diff
changeset
|
1152 (error "Extraneous text at end of command line")) |
189 | 1153 (goto-char texinfo-command-start) |
1154 (or (bolp) | |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38044
diff
changeset
|
1155 (error "Extraneous text at beginning of command line")) |
189 | 1156 (delete-region (point) (progn (forward-line 1) (point)))) |
1157 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1158 (defun texinfo-discard-line-with-args () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1159 (goto-char texinfo-command-start) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1160 (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
|
1161 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1162 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1163 ;;; @setfilename |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1164 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1165 ;; 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
|
1166 ;; definition; `texinfo-format-region' handles @setfilename, if any, |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1167 ;; specially. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1168 (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
|
1169 (defun texinfo-format-setfilename () |
18818
3c0dec827888
(texinfo-format-buffer-1): Insert, here,
Richard M. Stallman <rms@gnu.org>
parents:
17939
diff
changeset
|
1170 (texinfo-parse-arg-discard)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1171 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1172 ;;; @node, @menu, @detailmenu |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1173 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1174 (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
|
1175 (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
|
1176 (defun texinfo-format-node () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1177 (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
|
1178 (name (nth 0 args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1179 (next (nth 1 args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1180 (prev (nth 2 args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1181 (up (nth 3 args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1182 (texinfo-discard-command) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1183 (setq texinfo-last-node name) |
24314
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
1184 (let ((tem (if texinfo-fold-nodename-case (downcase name) name))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1185 (if (assoc tem texinfo-node-names) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1186 (error "Duplicate node name: %s" name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1187 (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
|
1188 (setq texinfo-footnote-number 0) |
9896
a70b99926339
(texinfo-format-node): Insert the node delimiter
Richard M. Stallman <rms@gnu.org>
parents:
9759
diff
changeset
|
1189 ;; 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
|
1190 (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
|
1191 ", Node: " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1192 (if next |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1193 (insert ", Next: " next)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1194 (if prev |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1195 (insert ", Prev: " prev)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1196 (if up |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1197 (insert ", Up: " up)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1198 (insert ?\n) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1199 (setq texinfo-last-node-pos (point)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1200 |
22661
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1201 (put 'anchor 'texinfo-format 'texinfo-anchor) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1202 (defun texinfo-anchor () |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1203 (let (anchor-string |
22661
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1204 (here (- (point) 7)) ; save location of beginning of `@anchor' |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1205 (arg (texinfo-parse-arg-discard))) |
24745
aa8417416f03
(texinfo-anchor): Don't delete a non-speace after the @anchor command.
Richard M. Stallman <rms@gnu.org>
parents:
24621
diff
changeset
|
1206 (if (looking-at " ") ; since a space may be left after -discard |
aa8417416f03
(texinfo-anchor): Don't delete a non-speace after the @anchor command.
Richard M. Stallman <rms@gnu.org>
parents:
24621
diff
changeset
|
1207 (delete-char 1)) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1208 (forward-paragraph) |
22661
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1209 (let ((end (point))) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1210 (if (save-excursion |
22661
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1211 (backward-word 1) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1212 (search-forward "@refill" end t)) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1213 (setq anchor-string "@anchor-yes-refill") |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1214 (setq anchor-string "@anchor-no-refill"))) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1215 (goto-char here) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1216 (insert anchor-string "{" arg "}"))) |
90460d1e2c3f
(texinfo-anchor): New function.
Richard M. Stallman <rms@gnu.org>
parents:
19630
diff
changeset
|
1217 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1218 (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
|
1219 (defun texinfo-format-menu () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1220 (texinfo-discard-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1221 (insert "* Menu:\n\n")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1222 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1223 (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
|
1224 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1225 ;; The @detailmenu should be removed eventually. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1226 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1227 ;; According to Karl Berry, 31 August 1996: |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1228 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1229 ;; 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
|
1230 ;; 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
|
1231 ;; 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
|
1232 ;; expend more effort... |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1233 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1234 ;; 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
|
1235 ;; blame on makeinfo where it belongs :-(). |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1236 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1237 (put 'detailmenu 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1238 (put 'detailmenu 'texinfo-end 'texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1239 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1240 ;; (Also see `texnfo-upd.el') |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1241 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1242 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1243 ;;; Cross references |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1244 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1245 ;; @xref {NODE, FNAME, NAME, FILE, DOCUMENT} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1246 ;; -> *Note FNAME: (FILE)NODE |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1247 ;; If FILE is missing, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1248 ;; *Note FNAME: NODE |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1249 ;; 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
|
1250 ;; *Note NAME: Node |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1251 ;; If both NAME and FNAME are missing |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1252 ;; *Note NODE:: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1253 ;; texinfo ignores the DOCUMENT argument. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1254 ;; -> 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
|
1255 ;; 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
|
1256 ;; If fifth argument DOCUMENT is specified, produces |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1257 ;; 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
|
1258 ;; of DOCUMENT |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1259 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1260 ;; @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
|
1261 ;; the hardcopy and is the same as @xref in Info |
189 | 1262 (put 'ref 'texinfo-format 'texinfo-format-xref) |
1263 | |
1264 (put 'xref 'texinfo-format 'texinfo-format-xref) | |
1265 (defun texinfo-format-xref () | |
1266 (let ((args (texinfo-format-parse-args))) | |
1267 (texinfo-discard-command) | |
1268 (insert "*Note ") | |
1269 (let ((fname (or (nth 1 args) (nth 2 args)))) | |
1270 (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
|
1271 (insert (car args) "::") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1272 (insert (or fname (car args)) ": ") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1273 (if (nth 3 args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1274 (insert "(" (nth 3 args) ")")) |
28740
14cc47ddd47a
(texinfo-format-xref): Don't try to insert nil.
Gerd Moellmann <gerd@gnu.org>
parents:
27254
diff
changeset
|
1275 (and (car args) (insert (car args))))))) |
189 | 1276 |
1277 (put 'pxref 'texinfo-format 'texinfo-format-pxref) | |
1278 (defun texinfo-format-pxref () | |
1279 (texinfo-format-xref) | |
1280 (or (save-excursion | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1281 (forward-char -2) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1282 (looking-at "::")) |
189 | 1283 (insert "."))) |
1284 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1285 ;; @inforef{NODE, FNAME, FILE} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1286 ;; Like @xref{NODE, FNAME,,FILE} in texinfo. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1287 ;; In Tex, generates "See Info file FILE, node NODE" |
189 | 1288 (put 'inforef 'texinfo-format 'texinfo-format-inforef) |
1289 (defun texinfo-format-inforef () | |
1290 (let ((args (texinfo-format-parse-args))) | |
1291 (texinfo-discard-command) | |
1292 (if (nth 1 args) | |
1293 (insert "*Note " (nth 1 args) ": (" (nth 2 args) ")" (car args)) | |
1294 (insert "*Note " "(" (nth 2 args) ")" (car args) "::")))) | |
1295 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1296 |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1297 ;;; URL Reference: @uref |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1298 |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1299 ;; @uref produces a reference to a uniform resource locator (URL). |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1300 ;; It takes one mandatory argument, the URL, and one optional argument, |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1301 ;; the text to display (the default is the URL itself). |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1302 |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1303 (put 'uref 'texinfo-format 'texinfo-format-uref) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1304 (defun texinfo-format-uref () |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1305 "Format URL and optional URL-TITLE. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1306 Insert ` ... ' around URL if no URL-TITLE argument; |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1307 otherwise, insert URL-TITLE followed by URL in parentheses." |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1308 (let ((args (texinfo-format-parse-args))) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1309 (texinfo-discard-command) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1310 ;; if url-title |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1311 (if (nth 1 args) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1312 (insert (nth 1 args) " (" (nth 0 args) ")") |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1313 (insert "`" (nth 0 args) "'")) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1314 (goto-char texinfo-command-start))) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1315 |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
1316 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1317 ;;; Section headings |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1318 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1319 (put 'majorheading 'texinfo-format 'texinfo-format-chapter) |
189 | 1320 (put 'chapheading 'texinfo-format 'texinfo-format-chapter) |
1321 (put 'ichapter 'texinfo-format 'texinfo-format-chapter) | |
1322 (put 'chapter 'texinfo-format 'texinfo-format-chapter) | |
1323 (put 'iappendix 'texinfo-format 'texinfo-format-chapter) | |
1324 (put 'appendix 'texinfo-format 'texinfo-format-chapter) | |
1325 (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
|
1326 (put 'top 'texinfo-format 'texinfo-format-chapter) |
189 | 1327 (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
|
1328 (put 'centerchap 'texinfo-format 'texinfo-format-chapter) |
189 | 1329 (defun texinfo-format-chapter () |
1330 (texinfo-format-chapter-1 ?*)) | |
1331 | |
1332 (put 'heading 'texinfo-format 'texinfo-format-section) | |
1333 (put 'isection 'texinfo-format 'texinfo-format-section) | |
1334 (put 'section 'texinfo-format 'texinfo-format-section) | |
1335 (put 'iappendixsection 'texinfo-format 'texinfo-format-section) | |
1336 (put 'appendixsection 'texinfo-format 'texinfo-format-section) | |
1337 (put 'iappendixsec 'texinfo-format 'texinfo-format-section) | |
1338 (put 'appendixsec 'texinfo-format 'texinfo-format-section) | |
1339 (put 'iunnumberedsec 'texinfo-format 'texinfo-format-section) | |
1340 (put 'unnumberedsec 'texinfo-format 'texinfo-format-section) | |
1341 (defun texinfo-format-section () | |
1342 (texinfo-format-chapter-1 ?=)) | |
1343 | |
1344 (put 'subheading 'texinfo-format 'texinfo-format-subsection) | |
1345 (put 'isubsection 'texinfo-format 'texinfo-format-subsection) | |
1346 (put 'subsection 'texinfo-format 'texinfo-format-subsection) | |
1347 (put 'iappendixsubsec 'texinfo-format 'texinfo-format-subsection) | |
1348 (put 'appendixsubsec 'texinfo-format 'texinfo-format-subsection) | |
1349 (put 'iunnumberedsubsec 'texinfo-format 'texinfo-format-subsection) | |
1350 (put 'unnumberedsubsec 'texinfo-format 'texinfo-format-subsection) | |
1351 (defun texinfo-format-subsection () | |
1352 (texinfo-format-chapter-1 ?-)) | |
1353 | |
1354 (put 'subsubheading 'texinfo-format 'texinfo-format-subsubsection) | |
1355 (put 'isubsubsection 'texinfo-format 'texinfo-format-subsubsection) | |
1356 (put 'subsubsection 'texinfo-format 'texinfo-format-subsubsection) | |
1357 (put 'iappendixsubsubsec 'texinfo-format 'texinfo-format-subsubsection) | |
1358 (put 'appendixsubsubsec 'texinfo-format 'texinfo-format-subsubsection) | |
1359 (put 'iunnumberedsubsubsec 'texinfo-format 'texinfo-format-subsubsection) | |
1360 (put 'unnumberedsubsubsec 'texinfo-format 'texinfo-format-subsubsection) | |
1361 (defun texinfo-format-subsubsection () | |
1362 (texinfo-format-chapter-1 ?.)) | |
1363 | |
1364 (defun texinfo-format-chapter-1 (belowchar) | |
1365 (let ((arg (texinfo-parse-arg-discard))) | |
1366 (message "Formatting: %s ... " arg) ; So we can see where we are. | |
1367 (insert ?\n arg ?\n "@SectionPAD " belowchar ?\n) | |
1368 (forward-line -2))) | |
1369 | |
1370 (put 'SectionPAD 'texinfo-format 'texinfo-format-sectionpad) | |
1371 (defun texinfo-format-sectionpad () | |
1372 (let ((str (texinfo-parse-arg-discard))) | |
1373 (forward-char -1) | |
1374 (let ((column (current-column))) | |
1375 (forward-char 1) | |
1376 (while (> column 0) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1377 (insert str) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1378 (setq column (1- column)))) |
189 | 1379 (insert ?\n))) |
1380 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1381 |
9754
7e9b8823755b
(texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents:
9549
diff
changeset
|
1382 ;;; 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
|
1383 |
189 | 1384 (put '\. 'texinfo-format 'texinfo-format-\.) |
1385 (defun texinfo-format-\. () | |
1386 (texinfo-discard-command) | |
1387 (insert ".")) | |
1388 | |
1389 (put '\: 'texinfo-format 'texinfo-format-\:) | |
1390 (defun texinfo-format-\: () | |
1391 (texinfo-discard-command)) | |
1392 | |
9754
7e9b8823755b
(texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents:
9549
diff
changeset
|
1393 (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
|
1394 (defun texinfo-format-soft-hyphen () |
7e9b8823755b
(texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents:
9549
diff
changeset
|
1395 (texinfo-discard-command)) |
7e9b8823755b
(texinfo-format-scan): Make @- vanish; don't insert -.
Richard M. Stallman <rms@gnu.org>
parents:
9549
diff
changeset
|
1396 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1397 |
48794
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1398 ;;; @kbdinputstyle, @vskip, headings & footings |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1399 ;; These commands for not for Info and should never |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1400 ;; appear in an Info environment; but if they do, |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1401 ;; this causes them to be discarded. |
48794
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1402 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1403 ;; @kbdinputstyle |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1404 (put 'kbdinputstyle 'texinfo-format 'texinfo-discard-line-with-args) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1405 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1406 ;; @vskip |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1407 (put 'vskip 'texinfo-format 'texinfo-discard-line-with-args) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1408 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1409 ;; headings & footings |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1410 (put 'evenfooting 'texinfo-format 'texinfo-discard-line-with-args) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1411 (put 'evenheading 'texinfo-format 'texinfo-discard-line-with-args) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1412 (put 'oddfooting 'texinfo-format 'texinfo-discard-line-with-args) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1413 (put 'oddheading 'texinfo-format 'texinfo-discard-line-with-args) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1414 (put 'everyfooting 'texinfo-format 'texinfo-discard-line-with-args) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1415 (put 'everyheading 'texinfo-format 'texinfo-discard-line-with-args) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1416 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1417 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1418 ;;; @documentdescription ... @end documentdescription |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1419 ;; This command is for HTML output and should never |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1420 ;; appear in an Info environment; but if it does, |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1421 ;; this causes it to be discarded. |
48794
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1422 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1423 (put 'documentdescription 'texinfo-format 'texinfo-format-documentdescription) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1424 (defun texinfo-format-documentdescription () |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1425 (delete-region texinfo-command-start |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1426 (progn (re-search-forward "^@end documentdescription[ \t]*\n") |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1427 (point)))) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1428 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1429 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
1430 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1431 ;;; @center, @sp, and @br |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1432 |
189 | 1433 (put 'center 'texinfo-format 'texinfo-format-center) |
1434 (defun texinfo-format-center () | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1435 (let ((arg (texinfo-parse-expanded-arg))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1436 (texinfo-discard-command) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1437 (insert arg) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1438 (insert ?\n) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1439 (save-restriction |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1440 (goto-char (1- (point))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1441 (let ((indent-tabs-mode nil)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1442 (center-line))))) |
189 | 1443 |
1444 (put 'sp 'texinfo-format 'texinfo-format-sp) | |
1445 (defun texinfo-format-sp () | |
1446 (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
|
1447 (num (read arg))) |
189 | 1448 (insert-char ?\n num))) |
1449 | |
1450 (put 'br 'texinfo-format 'texinfo-format-paragraph-break) | |
1451 (defun texinfo-format-paragraph-break () | |
1452 "Force a paragraph break. | |
1453 If used within a line, follow `@br' with braces." | |
1454 (texinfo-optional-braces-discard) | |
1455 ;; insert one return if at end of line; | |
1456 ;; else insert two returns, to generate a blank line. | |
1457 (if (= (following-char) ?\n) | |
1458 (insert ?\n) | |
1459 (insert-char ?\n 2))) | |
1460 | |
1461 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1462 ;;; @footnote and @footnotestyle |
189 | 1463 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1464 ;; 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
|
1465 ;; 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
|
1466 ;; 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
|
1467 ;; template for a footnote is: |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1468 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1469 ;; @footnote{TEXT} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1470 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1471 ;; Info has two footnote styles: |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1472 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1473 ;; * 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
|
1474 ;; 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
|
1475 ;; 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
|
1476 ;; the word `Footnotes' within it. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1477 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1478 ;; * 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
|
1479 ;; 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
|
1480 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1481 ;; 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
|
1482 ;; @footnotestyle separate |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1483 ;; or |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1484 ;; @footnotestyle end |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1485 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1486 ;; The default is separate |
189 | 1487 |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1488 (defvar texinfo-footnote-style "separate" |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1489 "Footnote style, either separate or end.") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1490 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1491 (put 'footnotestyle 'texinfo-format 'texinfo-footnotestyle) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1492 (defun texinfo-footnotestyle () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1493 "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
|
1494 Argument is either end or separate." |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1495 (setq texinfo-footnote-style (texinfo-parse-arg-discard))) |
189 | 1496 |
1497 (defvar texinfo-footnote-number) | |
1498 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1499 (put 'footnote 'texinfo-format 'texinfo-format-footnote) |
189 | 1500 (defun texinfo-format-footnote () |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1501 "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
|
1502 The texinfo-footnote-style variable controls which style is used." |
189 | 1503 (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
|
1504 (cond ((string= texinfo-footnote-style "end") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1505 (texinfo-format-end-node)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1506 ((string= texinfo-footnote-style "separate") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1507 (texinfo-format-separate-node)))) |
189 | 1508 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1509 (defun texinfo-format-separate-node () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1510 "Format footnote in Separate node style, with notes in own node. |
189 | 1511 The node is constructed automatically." |
1512 (let* (start | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1513 (arg (texinfo-parse-line-arg)) |
189 | 1514 (node-name-beginning |
1515 (save-excursion | |
1516 (re-search-backward | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1517 "^File: \\w+\\(\\w\\|\\s_\\|\\.\\|,\\)*[ \t]+Node:") |
189 | 1518 (match-end 0))) |
1519 (node-name | |
1520 (save-excursion | |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
1521 (buffer-substring-no-properties |
189 | 1522 (progn (goto-char node-name-beginning) ; skip over node command |
1523 (skip-chars-forward " \t") ; and over spaces | |
1524 (point)) | |
1525 (if (search-forward | |
1526 "," | |
1527 (save-excursion (end-of-line) (point)) t) ; bound search | |
1528 (1- (point)) | |
1529 (end-of-line) (point)))))) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1530 (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
|
1531 (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
|
1532 (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1533 (insert (format " (%d) (*Note %s-Footnotes::)" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1534 texinfo-footnote-number node-name)) |
189 | 1535 (fill-paragraph nil) |
1536 (save-excursion | |
1537 (if (re-search-forward "^@node" nil 'move) | |
1538 (forward-line -1)) | |
1539 | |
1540 ;; two cases: for the first footnote, we must insert a node header; | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1541 ;; for the second and subsequent footnotes, we need only insert |
189 | 1542 ;; the text of the footnote. |
1543 | |
1544 (if (save-excursion | |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
1545 (search-backward |
189 | 1546 (concat node-name "-Footnotes, Up: ") |
1547 node-name-beginning | |
1548 t)) | |
1549 (progn ; already at least one footnote | |
1550 (setq start (point)) | |
1551 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg)) | |
1552 (fill-region start (point))) | |
1553 ;; else not yet a footnote | |
1554 (insert "\n\^_\nFile: " texinfo-format-filename | |
1555 " Node: " node-name "-Footnotes, Up: " node-name "\n") | |
1556 (setq start (point)) | |
1557 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg)) | |
1558 (fill-region start (point)))))) | |
1559 | |
1560 (defun texinfo-format-end-node () | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1561 "Format footnote in the End of node style, with notes at end of node." |
189 | 1562 (let (start |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1563 (arg (texinfo-parse-line-arg))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1564 (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
|
1565 (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
|
1566 (point)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1567 (insert (format " (%d) " texinfo-footnote-number)) |
189 | 1568 (fill-paragraph nil) |
1569 (save-excursion | |
1570 (if (search-forward "\n--------- Footnotes ---------\n" nil t) | |
1571 (progn ; already have footnote, put new one before end of node | |
1572 (if (re-search-forward "^@node" nil 'move) | |
1573 (forward-line -1)) | |
1574 (setq start (point)) | |
1575 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg)) | |
1576 (fill-region start (point))) | |
1577 ;; else no prior footnote | |
1578 (if (re-search-forward "^@node" nil 'move) | |
1579 (forward-line -1)) | |
1580 (insert "\n--------- Footnotes ---------\n") | |
1581 (setq start (point)) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1582 (insert (format "\n(%d) %s\n" texinfo-footnote-number arg)))))) |
189 | 1583 |
1584 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1585 ;;; @itemize, @enumerate, and similar commands |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1586 |
189 | 1587 ;; @itemize pushes (itemize "COMMANDS" STARTPOS) on texinfo-stack. |
1588 ;; @enumerate pushes (enumerate 0 STARTPOS). | |
1589 ;; @item dispatches to the texinfo-item prop of the first elt of the list. | |
1590 ;; For itemize, this puts in and rescans the COMMANDS. | |
1591 ;; For enumerate, this increments the number and puts it in. | |
1592 ;; In either case, it puts a Backspace at the front of the line | |
1593 ;; which marks it not to be indented later. | |
1594 ;; All other lines get indented by 5 when the @end is reached. | |
1595 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1596 (defvar texinfo-stack-depth 0 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1597 "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
|
1598 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
|
1599 |
189 | 1600 (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
|
1601 (setq texinfo-stack-depth (1+ texinfo-stack-depth)) |
189 | 1602 (setq texinfo-stack |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1603 (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
|
1604 texinfo-stack))) |
189 | 1605 |
1606 (defun texinfo-pop-stack (check) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1607 (setq texinfo-stack-depth (1- texinfo-stack-depth)) |
189 | 1608 (if (null texinfo-stack) |
1609 (error "Unmatched @end %s" check)) | |
1610 (if (not (eq (car (car texinfo-stack)) check)) | |
1611 (error "@end %s matches @%s" | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1612 check (car (car texinfo-stack)))) |
189 | 1613 (prog1 (cdr (car texinfo-stack)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1614 (setq texinfo-stack (cdr texinfo-stack)))) |
189 | 1615 |
1616 (put 'itemize 'texinfo-format 'texinfo-itemize) | |
1617 (defun texinfo-itemize () | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1618 (texinfo-push-stack |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1619 'itemize |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1620 (progn (skip-chars-forward " \t") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1621 (if (eolp) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1622 "@bullet" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1623 (texinfo-parse-line-arg)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1624 (texinfo-discard-line-with-args) |
189 | 1625 (setq fill-column (- fill-column 5))) |
1626 | |
1627 (put 'itemize 'texinfo-end 'texinfo-end-itemize) | |
1628 (defun texinfo-end-itemize () | |
1629 (setq fill-column (+ fill-column 5)) | |
1630 (texinfo-discard-command) | |
1631 (let ((stacktop | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1632 (texinfo-pop-stack 'itemize))) |
189 | 1633 (texinfo-do-itemize (nth 1 stacktop)))) |
1634 | |
1635 (put 'enumerate 'texinfo-format 'texinfo-enumerate) | |
1636 (defun texinfo-enumerate () | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1637 (texinfo-push-stack |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1638 'enumerate |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1639 (progn (skip-chars-forward " \t") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1640 (if (eolp) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1641 1 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1642 (read (current-buffer))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1643 (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
|
1644 (> 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
|
1645 (error |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1646 "@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
|
1647 (texinfo-discard-line-with-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1648 (setq fill-column (- fill-column 5))) |
189 | 1649 |
1650 (put 'enumerate 'texinfo-end 'texinfo-end-enumerate) | |
1651 (defun texinfo-end-enumerate () | |
1652 (setq fill-column (+ fill-column 5)) | |
1653 (texinfo-discard-command) | |
1654 (let ((stacktop | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1655 (texinfo-pop-stack 'enumerate))) |
189 | 1656 (texinfo-do-itemize (nth 1 stacktop)))) |
1657 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1658 ;; @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
|
1659 (put 'alphaenumerate 'texinfo-format 'texinfo-alphaenumerate) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1660 (defun texinfo-alphaenumerate () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1661 (texinfo-push-stack 'alphaenumerate (1- ?a)) |
189 | 1662 (setq fill-column (- fill-column 5)) |
1663 (texinfo-discard-line)) | |
1664 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1665 (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
|
1666 (defun texinfo-end-alphaenumerate () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1667 (setq fill-column (+ fill-column 5)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1668 (texinfo-discard-command) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1669 (let ((stacktop |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1670 (texinfo-pop-stack 'alphaenumerate))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1671 (texinfo-do-itemize (nth 1 stacktop)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1672 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1673 ;; @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
|
1674 (put 'capsenumerate 'texinfo-format 'texinfo-capsenumerate) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1675 (defun texinfo-capsenumerate () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1676 (texinfo-push-stack 'capsenumerate (1- ?A)) |
189 | 1677 (setq fill-column (- fill-column 5)) |
1678 (texinfo-discard-line)) | |
1679 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1680 (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
|
1681 (defun texinfo-end-capsenumerate () |
189 | 1682 (setq fill-column (+ fill-column 5)) |
1683 (texinfo-discard-command) | |
1684 (let ((stacktop | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1685 (texinfo-pop-stack 'capsenumerate))) |
189 | 1686 (texinfo-do-itemize (nth 1 stacktop)))) |
1687 | |
1688 ;; At the @end, indent all the lines within the construct | |
1689 ;; except those marked with backspace. FROM says where | |
1690 ;; construct started. | |
1691 (defun texinfo-do-itemize (from) | |
1692 (save-excursion | |
1693 (while (progn (forward-line -1) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1694 (>= (point) from)) |
189 | 1695 (if (= (following-char) ?\b) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1696 (save-excursion |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1697 (delete-char 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1698 (end-of-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1699 (delete-char 6)) |
189 | 1700 (if (not (looking-at "[ \t]*$")) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1701 (save-excursion (insert " "))))))) |
189 | 1702 |
1703 (put 'item 'texinfo-format 'texinfo-item) | |
1704 (put 'itemx 'texinfo-format 'texinfo-item) | |
1705 (defun texinfo-item () | |
1706 (funcall (get (car (car texinfo-stack)) 'texinfo-item))) | |
1707 | |
1708 (put 'itemize 'texinfo-item 'texinfo-itemize-item) | |
1709 (defun texinfo-itemize-item () | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1710 ;; (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
|
1711 (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
|
1712 (if (looking-at "[ \t]*[^ \t\n]+") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1713 ;; 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
|
1714 (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
|
1715 ;; Else text on next line. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1716 (insert "\b " (nth 1 (car texinfo-stack)) " ")) |
189 | 1717 (forward-line -1)) |
1718 | |
1719 (put 'enumerate 'texinfo-item 'texinfo-enumerate-item) | |
1720 (defun texinfo-enumerate-item () | |
1721 (texinfo-discard-line) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1722 (let (enumerating-symbol) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1723 (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
|
1724 (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
|
1725 (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
|
1726 (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
|
1727 ((symbolp (car (cdr (car texinfo-stack)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1728 (setq enumerating-symbol |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1729 (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
|
1730 (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
|
1731 (equal ?\{ (string-to-char enumerating-symbol))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1732 (error |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1733 "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
|
1734 (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
|
1735 (setcar (cdr (car texinfo-stack)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1736 (make-symbol |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1737 (char-to-string |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1738 (1+ |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1739 (string-to-char enumerating-symbol)))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1740 (t |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1741 (error |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1742 "@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
|
1743 (forward-line -1))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1744 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1745 (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
|
1746 (defun texinfo-alphaenumerate-item () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1747 (texinfo-discard-line) |
189 | 1748 (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
|
1749 (if (> next ?z) |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38044
diff
changeset
|
1750 (error "More than 26 items in @alphaenumerate; get a bigger alphabet")) |
189 | 1751 (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
|
1752 (insert "\b " next ". \n")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1753 (forward-line -1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1754 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1755 (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
|
1756 (defun texinfo-capsenumerate-item () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1757 (texinfo-discard-line) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1758 (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
|
1759 (if (> next ?Z) |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38044
diff
changeset
|
1760 (error "More than 26 items in @capsenumerate; get a bigger alphabet")) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1761 (setcar (cdr (car texinfo-stack)) next) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1762 (insert "\b " next ". \n")) |
189 | 1763 (forward-line -1)) |
1764 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1765 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1766 ;;; @table |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1767 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1768 ;; 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
|
1769 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1770 (put 'table 'texinfo-format 'texinfo-table) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1771 (defun texinfo-table () |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1772 (texinfo-push-stack |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1773 'table |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1774 (progn (skip-chars-forward " \t") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1775 (if (eolp) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1776 "@asis" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1777 (texinfo-parse-line-arg)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1778 (texinfo-discard-line-with-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1779 (setq fill-column (- fill-column 5))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1780 |
189 | 1781 (put 'table 'texinfo-item 'texinfo-table-item) |
1782 (defun texinfo-table-item () | |
1783 (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
|
1784 (itemfont (car (cdr (car texinfo-stack))))) |
189 | 1785 (insert ?\b itemfont ?\{ arg "}\n \n")) |
1786 (forward-line -2)) | |
1787 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1788 (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
|
1789 (defun texinfo-end-table () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1790 (setq fill-column (+ fill-column 5)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1791 (texinfo-discard-command) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1792 (let ((stacktop |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1793 (texinfo-pop-stack 'table))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1794 (texinfo-do-itemize (nth 1 stacktop)))) |
189 | 1795 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1796 ;; @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
|
1797 ;; 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
|
1798 ;; 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
|
1799 (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
|
1800 (put 'description 'texinfo-format 'texinfo-description) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1801 (defun texinfo-description () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1802 (texinfo-push-stack 'table "@asis") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1803 (setq fill-column (- fill-column 5)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1804 (texinfo-discard-line)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1805 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1806 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1807 ;;; @ftable, @vtable |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1808 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1809 ;; 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
|
1810 ;; 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
|
1811 ;; 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
|
1812 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1813 ;; Handle the @ftable and @vtable commands: |
189 | 1814 |
1815 (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
|
1816 (put 'vtable 'texinfo-format 'texinfo-vtable) |
189 | 1817 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1818 (defun texinfo-ftable () (texinfo-indextable 'ftable)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1819 (defun texinfo-vtable () (texinfo-indextable 'vtable)) |
189 | 1820 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1821 (defun texinfo-indextable (table-type) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1822 (texinfo-push-stack table-type (texinfo-parse-arg-discard)) |
189 | 1823 (setq fill-column (- fill-column 5))) |
1824 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1825 ;; 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
|
1826 |
189 | 1827 (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
|
1828 (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
|
1829 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1830 (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
|
1831 (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
|
1832 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1833 (defun texinfo-indextable-item (index-type) |
189 | 1834 (let ((item (texinfo-parse-arg-discard)) |
1835 (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
|
1836 (indexvar index-type)) |
189 | 1837 (insert ?\b itemfont ?\{ item "}\n \n") |
1838 (set indexvar | |
1839 (cons | |
1840 (list item texinfo-last-node) | |
1841 (symbol-value indexvar))) | |
1842 (forward-line -2))) | |
1843 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1844 ;; Handle @end ftable, @end vtable |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1845 |
189 | 1846 (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
|
1847 (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
|
1848 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1849 (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
|
1850 (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
|
1851 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1852 (defun texinfo-end-indextable (table-type) |
189 | 1853 (setq fill-column (+ fill-column 5)) |
1854 (texinfo-discard-command) | |
1855 (let ((stacktop | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
1856 (texinfo-pop-stack table-type))) |
189 | 1857 (texinfo-do-itemize (nth 1 stacktop)))) |
1858 | |
1859 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1860 ;;; @multitable ... @end multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1861 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1862 ;; 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
|
1863 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1864 ;; A multi-column table has this template: |
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 ;; @multitable {A1} {A2} {A3} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1867 ;; @item A1 @tab A2 @tab A3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1868 ;; @item B1 @tab B2 @tab B3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1869 ;; @item C1 @tab C2 @tab C3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1870 ;; @end multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1871 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1872 ;; 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
|
1873 ;; respective column. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1874 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1875 ;; Or else: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1876 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1877 ;; @multitable @columnfractions .25 .3 .45 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1878 ;; @item A1 @tab A2 @tab A3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1879 ;; @item B1 @tab B2 @tab B3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1880 ;; @end multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1881 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1882 ;; 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
|
1883 ;; 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
|
1884 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1885 ;; 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
|
1886 ;; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1887 ;; Using the Emacs Lisp formatter, texinfmt.el, |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1888 ;; 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
|
1889 ;; `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
|
1890 ;; 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
|
1891 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1892 ;; 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
|
1893 ;; commands that are defined in texinfo.tex for printed output. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1894 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1895 ;; @multitableparskip, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1896 ;; @multitableparindent, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1897 ;; @multitablecolmargin, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1898 ;; @multitablelinespace. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1899 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1900 ;; How @multitable works. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1901 ;; ===================== |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1902 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1903 ;; `texinfo-multitable' reads the @multitable line and determines from it |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1904 ;; how wide each column should be. |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1905 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1906 ;; 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
|
1907 ;; 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
|
1908 ;; 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
|
1909 ;; 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
|
1910 ;; the start of the table onto the stack. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1911 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1912 ;; `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
|
1913 ;; 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
|
1914 ;; pops the stack. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1915 ;; |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1916 ;; `texinfo-multitable-widths' is called by `texinfo-multitable'. |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1917 ;; 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
|
1918 ;; 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
|
1919 ;; 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
|
1920 ;; 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
|
1921 ;; environment). |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1922 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1923 ;; `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
|
1924 ;; 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
|
1925 ;; 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
|
1926 ;; 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
|
1927 ;; 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
|
1928 ;; with blanks. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1929 ;; |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1930 ;; `texinfo-multitable-extract-row' is called by `texinfo-multitable-item'. |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1931 ;; 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
|
1932 ;; 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
|
1933 ;; 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
|
1934 ;; Cells within a row are separated by @tab. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1935 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1936 ;; 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
|
1937 ;; Texinfo commands. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1938 |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1939 (defvar texinfo-extra-inter-column-width 0 |
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1940 "*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
|
1941 |
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1942 (defvar texinfo-multitable-buffer-name "*multitable-temporary-buffer*") |
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1943 (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
|
1944 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1945 ;; 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
|
1946 (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
|
1947 (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
|
1948 (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
|
1949 (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
|
1950 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1951 (put 'multitable 'texinfo-format 'texinfo-multitable) |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
1952 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1953 (defun texinfo-multitable () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1954 "Produce multi-column tables. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1955 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1956 A multi-column table has this template: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1957 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1958 @multitable {A1} {A2} {A3} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1959 @item A1 @tab A2 @tab A3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1960 @item B1 @tab B2 @tab B3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1961 @item C1 @tab C2 @tab C3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1962 @end multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1963 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1964 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
|
1965 respective column. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1966 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1967 Or else: |
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 @multitable @columnfractions .25 .3 .45 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1970 @item A1 @tab A2 @tab A3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1971 @item B1 @tab B2 @tab B3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1972 @end multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1973 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1974 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
|
1975 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
|
1976 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1977 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
|
1978 |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
1979 Using the Emacs Lisp formatter, texinfmt.el, |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1980 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
|
1981 `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
|
1982 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
|
1983 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1984 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
|
1985 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
|
1986 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1987 @multitableparskip, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1988 @multitableparindent, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1989 @multitablecolmargin, |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1990 @multitablelinespace." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1991 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1992 ;; 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
|
1993 ;; A stack element consists of: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1994 ;; - type-of-command, i.e., multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1995 ;; - the information about column widths, and |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1996 ;; - the position of texinfo-command-start. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1997 ;; 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
|
1998 ;; The command line is then deleted. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
1999 (texinfo-push-stack |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2000 'multitable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2001 ;; push width information on stack |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2002 (texinfo-multitable-widths)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2003 (texinfo-discard-line-with-args)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2004 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2005 (put 'multitable 'texinfo-end 'texinfo-end-multitable) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2006 (defun texinfo-end-multitable () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2007 "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
|
2008 (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2009 (texinfo-pop-stack 'multitable)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2010 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2011 (defun texinfo-multitable-widths () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2012 "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
|
2013 (let (texinfo-multitable-width-list) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2014 ;; Fractions format: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2015 ;; @multitable @columnfractions .25 .3 .45 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2016 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2017 ;; Template format: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2018 ;; @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
|
2019 ;; Place point before first argument |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2020 (skip-chars-forward " \t") |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2021 (cond |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2022 ;; Check for common misspelling |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2023 ((looking-at "@columnfraction ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2024 (error "In @multitable, @columnfractions misspelled")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2025 ;; Case 1: @columnfractions .25 .3 .45 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2026 ((looking-at "@columnfractions") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2027 (forward-word 1) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2028 (while (not (eolp)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2029 (setq texinfo-multitable-width-list |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2030 (cons |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2031 (truncate |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2032 (1- |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2033 (* fill-column (read (get-buffer (current-buffer)))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2034 texinfo-multitable-width-list)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2035 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2036 ;; 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
|
2037 ((looking-at "{") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2038 (let ((start-of-templates (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2039 (while (not (eolp)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2040 (skip-chars-forward " \t") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2041 (let* ((start-of-template (1+ (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2042 (end-of-template |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2043 ;; 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
|
2044 (progn (forward-sexp 1) (1- (point))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2045 (setq texinfo-multitable-width-list |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2046 (cons (- end-of-template start-of-template) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2047 texinfo-multitable-width-list)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2048 ;; 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
|
2049 ;; 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
|
2050 ;; 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
|
2051 (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
|
2052 (goto-char (point-min)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2053 (while (search-forward " |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2054 " nil t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2055 (delete-char -1)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2056 (goto-char (point-max)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2057 (widen) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2058 (forward-char 1))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2059 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2060 ;; Case 3: Trouble |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2061 (t |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2062 (error |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2063 "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
|
2064 ;; Check whether columns fit on page. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2065 (let ((desired-columns |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2066 (+ |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2067 ;; between column spaces |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2068 (length texinfo-multitable-width-list) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2069 ;; additional between column spaces, if any |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2070 texinfo-extra-inter-column-width |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2071 ;; sum of spaces for each entry |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2072 (apply '+ texinfo-multitable-width-list)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2073 (if (> desired-columns fill-column) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2074 (error |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2075 (format |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2076 "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
|
2077 desired-columns fill-column)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2078 texinfo-multitable-width-list)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2079 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2080 ;; @item A1 @tab A2 @tab A3 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2081 (defun texinfo-multitable-extract-row () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2082 "Return multitable row, as a string. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2083 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
|
2084 Cells within rows are separated by @tab." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2085 (skip-chars-forward " \t") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2086 (let* ((start (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2087 (end (progn |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2088 (re-search-forward "@item\\|@end") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2089 (match-beginning 0))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2090 (row (progn (goto-char end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2091 (skip-chars-backward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2092 ;; remove whitespace at end of argument |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2093 (delete-region (point) end) |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
2094 (buffer-substring-no-properties start (point))))) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2095 (delete-region texinfo-command-start end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2096 row)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2097 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2098 (put 'multitable 'texinfo-item 'texinfo-multitable-item) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2099 (defun texinfo-multitable-item () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2100 "Format a row within a multicolumn table. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2101 Cells in row are separated by @tab. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2102 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
|
2103 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
|
2104 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
|
2105 (let ((original-buffer (current-buffer)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2106 (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
|
2107 (existing-fill-column fill-column) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2108 start |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2109 end |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2110 (table-column 0) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2111 (table-entry-height 0) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2112 ;; 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
|
2113 ;; 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
|
2114 (unformated-row (texinfo-multitable-extract-row))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2115 ;; Use a temporary buffer |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2116 (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
|
2117 (delete-region (point-min) (point-max)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2118 (insert unformated-row) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2119 (goto-char (point-min)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2120 ;; 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
|
2121 (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
|
2122 (while (search-forward "@tab" nil t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2123 (setq tab-number (1+ tab-number))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2124 (if (/= tab-number (length table-widths)) |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38044
diff
changeset
|
2125 (error "Wrong number of @tab's in a @multitable row"))) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2126 (goto-char (point-min)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2127 ;; 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
|
2128 ;; 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
|
2129 ;; Cell #1: format up to @tab |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2130 ;; Cell #2: format up to @tab |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2131 ;; Cell #3: format up to eob |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2132 (while (not (eobp)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2133 (setq start (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2134 (setq end (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2135 (if (search-forward "@tab" nil 'move) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2136 ;; Delete the @tab command, including the @-sign |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2137 (delete-region |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2138 (point) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2139 (progn (forward-word -1) (1- (point))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2140 (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2141 ;; 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
|
2142 (setq fill-column (+ 1 |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2143 texinfo-extra-inter-column-width |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2144 (nth table-column table-widths))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2145 (narrow-to-region start end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2146 ;; Remove whitespace before and after entry. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2147 (skip-chars-forward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2148 (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
|
2149 (goto-char (point-max)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2150 (skip-chars-backward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2151 (delete-region (point) (save-excursion (end-of-line) (point))) |
48568 | 2152 ;; Temporarily set texinfo-stack to nil so texinfo-format-scan |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2153 ;; does not see an unterminated @multitable. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2154 (let (texinfo-stack) ; nil |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2155 (texinfo-format-scan)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2156 (let (fill-prefix) ; no fill prefix |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2157 (fill-region (point-min) (point-max))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2158 (setq table-entry-height |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2159 (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
|
2160 ;; 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
|
2161 (goto-char (point-min)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2162 (forward-line (1- table-entry-height)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2163 (let* ((beg (point)) ; beginning of line |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2164 ;; 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
|
2165 (needed-whitespace |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2166 (1+ |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2167 (- fill-column |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2168 (- |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2169 (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
|
2170 beg))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2171 (insert (make-string |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2172 (if (> needed-whitespace 0) needed-whitespace 1) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2173 ? ))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2174 ;; now, put formatted cell into a rectangle |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2175 (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
|
2176 (int-to-string table-column))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2177 (extract-rectangle (point-min) (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2178 (delete-region (point-min) (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2179 (goto-char (point-max)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2180 (setq table-column (1+ table-column)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2181 (widen)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2182 ;; 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
|
2183 (let ((total-number-of-columns table-column) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2184 (column-number 0) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2185 here) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2186 (while (> table-column 0) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2187 (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
|
2188 (while (< (length this-rectangle) table-entry-height) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2189 (setq this-rectangle (append this-rectangle '(""))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2190 (setq table-column (1- table-column))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2191 ;; 5. Insert formatted rectangles in original buffer |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2192 (switch-to-buffer original-buffer) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2193 (open-line table-entry-height) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2194 (while (< column-number total-number-of-columns) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2195 (setq here (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2196 (insert-rectangle |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2197 (eval (intern |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2198 (concat texinfo-multitable-rectangle-name |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2199 (int-to-string column-number))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2200 (goto-char here) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2201 (end-of-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2202 (setq column-number (1+ column-number)))) |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2203 (kill-buffer texinfo-multitable-buffer-name) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2204 (setq fill-column existing-fill-column))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2205 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2206 |
48794
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2207 ;;; @image |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2208 ;; Use only the FILENAME argument to the command. |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2209 ;; In Info, ignore the other arguments. |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2210 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2211 (put 'image 'texinfo-format 'texinfo-format-image) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2212 (defun texinfo-format-image () |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2213 "Insert an image from an an file ending in .txt. |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2214 Use only the FILENAME arg; for Info, ignore the other arguments to @image." |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2215 (let ((args (texinfo-format-parse-args)) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2216 filename) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2217 (when (null (nth 0 args)) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2218 (error "Invalid image command")) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2219 (texinfo-discard-command) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2220 ;; makeinfo uses FILENAME.txt |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2221 (setq filename (format "%s.txt" (nth 0 args))) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2222 (message "Reading included file: %s" filename) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2223 ;; verbatim for Info output |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2224 (goto-char (+ (point) (cadr (insert-file-contents filename)))) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2225 (message "Reading included file: %s...done" filename))) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2226 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2227 |
48697
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2228 ;;; @ifinfo, @iftex, @tex, @ifhtml, @html, @ifplaintext, @ifxml, @xml |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2229 ;; @ifnottex, @ifnotinfo, @ifnothtml, @ifnotplaintext, @ifnotxml |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2230 |
189 | 2231 (put 'ifinfo 'texinfo-format 'texinfo-discard-line) |
2232 (put 'ifinfo 'texinfo-end 'texinfo-discard-command) | |
2233 | |
2234 (put 'iftex 'texinfo-format 'texinfo-format-iftex) | |
2235 (defun texinfo-format-iftex () | |
2236 (delete-region texinfo-command-start | |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
2237 (re-search-forward "@end iftex[ \t]*\n"))) |
189 | 2238 |
9549
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2239 (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
|
2240 (defun texinfo-format-ifhtml () |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2241 (delete-region texinfo-command-start |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
2242 (re-search-forward "@end ifhtml[ \t]*\n"))) |
9549
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2243 |
48063
4cef5030d270
(texinfo-format-ifplaintext): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
43808
diff
changeset
|
2244 (put 'ifplaintext 'texinfo-format 'texinfo-format-ifplaintext) |
4cef5030d270
(texinfo-format-ifplaintext): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
43808
diff
changeset
|
2245 (defun texinfo-format-ifplaintext () |
4cef5030d270
(texinfo-format-ifplaintext): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
43808
diff
changeset
|
2246 (delete-region texinfo-command-start |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
2247 (re-search-forward "@end ifplaintext[ \t]*\n"))) |
48063
4cef5030d270
(texinfo-format-ifplaintext): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
43808
diff
changeset
|
2248 |
48697
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2249 (put 'ifxml 'texinfo-format 'texinfo-format-ifxml) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2250 (defun texinfo-format-ifxml () |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2251 (delete-region texinfo-command-start |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2252 (progn (re-search-forward "^@end ifxml[ \t]*\n") |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2253 (point)))) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2254 |
189 | 2255 (put 'tex 'texinfo-format 'texinfo-format-tex) |
2256 (defun texinfo-format-tex () | |
2257 (delete-region texinfo-command-start | |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
2258 (re-search-forward "@end tex[ \t]*\n"))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2259 |
9549
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2260 (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
|
2261 (defun texinfo-format-html () |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2262 (delete-region texinfo-command-start |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
2263 (re-search-forward "@end html[ \t]*\n"))) |
9549
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2264 |
48697
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2265 (put 'xml 'texinfo-format 'texinfo-format-xml) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2266 (defun texinfo-format-xml () |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2267 (delete-region texinfo-command-start |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2268 (progn (re-search-forward "^@end xml[ \t]*\n") |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2269 (point)))) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2270 |
40374
fb22b0e18665
No change. Error by bob, not eliz, logging change for wrong file.
Eli Zaretskii <eliz@gnu.org>
parents:
38436
diff
changeset
|
2271 (put 'ifnotinfo 'texinfo-format 'texinfo-format-ifnotinfo) |
fb22b0e18665
No change. Error by bob, not eliz, logging change for wrong file.
Eli Zaretskii <eliz@gnu.org>
parents:
38436
diff
changeset
|
2272 (defun texinfo-format-ifnotinfo () |
fb22b0e18665
No change. Error by bob, not eliz, logging change for wrong file.
Eli Zaretskii <eliz@gnu.org>
parents:
38436
diff
changeset
|
2273 (delete-region texinfo-command-start |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
2274 (re-search-forward "@end ifnotinfo[ \t]*\n"))) |
40374
fb22b0e18665
No change. Error by bob, not eliz, logging change for wrong file.
Eli Zaretskii <eliz@gnu.org>
parents:
38436
diff
changeset
|
2275 |
48063
4cef5030d270
(texinfo-format-ifplaintext): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
43808
diff
changeset
|
2276 (put 'ifnotplaintext 'texinfo-format 'texinfo-discard-line) |
4cef5030d270
(texinfo-format-ifplaintext): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
43808
diff
changeset
|
2277 (put 'ifnotplaintext 'texinfo-end 'texinfo-discard-command) |
4cef5030d270
(texinfo-format-ifplaintext): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
43808
diff
changeset
|
2278 |
25274 | 2279 (put 'ifnottex 'texinfo-format 'texinfo-discard-line) |
2280 (put 'ifnottex 'texinfo-end 'texinfo-discard-command) | |
2281 | |
40374
fb22b0e18665
No change. Error by bob, not eliz, logging change for wrong file.
Eli Zaretskii <eliz@gnu.org>
parents:
38436
diff
changeset
|
2282 (put 'ifnothtml 'texinfo-format 'texinfo-discard-line) |
fb22b0e18665
No change. Error by bob, not eliz, logging change for wrong file.
Eli Zaretskii <eliz@gnu.org>
parents:
38436
diff
changeset
|
2283 (put 'ifnothtml 'texinfo-end 'texinfo-discard-command) |
fb22b0e18665
No change. Error by bob, not eliz, logging change for wrong file.
Eli Zaretskii <eliz@gnu.org>
parents:
38436
diff
changeset
|
2284 |
48697
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2285 (put 'ifnotxml 'texinfo-format 'texinfo-discard-line) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2286 (put 'ifnotxml 'texinfo-end 'texinfo-discard-command) |
880db53196d5
(texinfo-format-scan) Handle new functions for copyright
Robert J. Chassell <bob@rattlesnake.com>
parents:
48568
diff
changeset
|
2287 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2288 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2289 ;;; @titlepage |
189 | 2290 |
2291 (put 'titlepage 'texinfo-format 'texinfo-format-titlepage) | |
2292 (defun texinfo-format-titlepage () | |
2293 (delete-region texinfo-command-start | |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
2294 (re-search-forward "@end titlepage[ \t]*\n"))) |
189 | 2295 |
2296 (put 'endtitlepage 'texinfo-format 'texinfo-discard-line) | |
2297 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2298 ;; @titlespec an alternative titling command; ignored by Info |
189 | 2299 |
2300 (put 'titlespec 'texinfo-format 'texinfo-format-titlespec) | |
2301 (defun texinfo-format-titlespec () | |
2302 (delete-region texinfo-command-start | |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
2303 (re-search-forward "@end titlespec[ \t]*\n"))) |
189 | 2304 |
2305 (put 'endtitlespec 'texinfo-format 'texinfo-discard-line) | |
2306 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2307 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2308 ;;; @today |
189 | 2309 |
2310 (put 'today 'texinfo-format 'texinfo-format-today) | |
2311 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2312 ;; 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
|
2313 ;; The `@today{}' command requires a pair of braces, like `@dots{}'. |
189 | 2314 (defun texinfo-format-today () |
2315 (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
|
2316 (insert (format-time-string "%e %b %Y"))) |
189 | 2317 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2318 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2319 ;;; @timestamp{} |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2320 ;; Produce `Day Month Year Hour:Min' style of output. |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2321 ;; eg `1 Jan 1900 13:52' |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2322 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2323 (put 'timestamp 'texinfo-format 'texinfo-format-timestamp) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2324 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2325 ;; 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
|
2326 (defun texinfo-format-timestamp () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2327 "Insert the current local time and date." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2328 (texinfo-parse-arg-discard) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2329 ;; 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
|
2330 (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
|
2331 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2332 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2333 ;;; @ignore |
189 | 2334 |
2335 (put 'ignore 'texinfo-format 'texinfo-format-ignore) | |
2336 (defun texinfo-format-ignore () | |
2337 (delete-region texinfo-command-start | |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
2338 (re-search-forward "@end ignore[ \t]*\n"))) |
189 | 2339 |
2340 (put 'endignore 'texinfo-format 'texinfo-discard-line) | |
2341 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2342 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2343 ;;; Define the Info enclosure command: @definfoenclose |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2344 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2345 ;; 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
|
2346 ;; 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
|
2347 ;; `@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
|
2348 ;; and follow the text. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2349 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2350 ;; 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
|
2351 ;; 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
|
2352 ;; `texinfo.tex' in a manner appropriate for typesetting. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2353 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2354 ;; 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
|
2355 ;; 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
|
2356 ;; `@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
|
2357 ;; `@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
|
2358 ;; 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
|
2359 ;; 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
|
2360 ;; 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
|
2361 ;; 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
|
2362 ;; 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
|
2363 ;; 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
|
2364 ;; 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
|
2365 ;; string as a start delimiter string. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2366 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2367 ;; 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
|
2368 ;; 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
|
2369 ;; override the built-in definition. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2370 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2371 ;; 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
|
2372 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2373 ;; For example, you can write: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2374 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2375 ;; @ifinfo |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2376 ;; @definfoenclose phoo, //, \\ |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2377 ;; @end ifinfo |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2378 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2379 ;; 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
|
2380 ;; 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
|
2381 ;; 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
|
2382 ;; `@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
|
2383 ;; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2384 ;; Also, for TeX formatting, you could write |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2385 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2386 ;; @iftex |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2387 ;; @global@let@phoo=@i |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2388 ;; @end iftex |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2389 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2390 ;; 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
|
2391 ;; the argument to `@phoo' in italics. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2392 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2393 ;; 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
|
2394 ;; 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
|
2395 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2396 ;; Here is another example: write |
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 ;; @definfoenclose headword, , : |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2399 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2400 ;; 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
|
2401 ;; 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
|
2402 ;; argument to `@headword'. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2403 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2404 (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
|
2405 (defun texinfo-define-info-enclosure () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2406 (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
|
2407 (command-name (nth 0 args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2408 (beginning-delimiter (or (nth 1 args) "")) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2409 (end-delimiter (or (nth 2 args) ""))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2410 (texinfo-discard-command) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2411 (setq texinfo-enclosure-list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2412 (cons |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2413 (list command-name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2414 (list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2415 beginning-delimiter |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2416 end-delimiter)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2417 texinfo-enclosure-list)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2418 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2419 |
24314
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2420 ;;; @alias |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2421 |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2422 (put 'alias 'texinfo-format 'texinfo-alias) |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2423 (defun texinfo-alias () |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2424 (let ((start (1- (point))) |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2425 args) |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2426 (skip-chars-forward " ") |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2427 (save-excursion (end-of-line) (setq texinfo-command-end (point))) |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2428 (if (not (looking-at "\\([^=]+\\)=\\(.*\\)")) |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2429 (error "Invalid alias command") |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2430 (setq texinfo-alias-list |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2431 (cons |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2432 (cons |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
2433 (match-string-no-properties 1) |
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
2434 (match-string-no-properties 2)) |
24314
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2435 texinfo-alias-list)) |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2436 (texinfo-discard-command)) |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2437 ) |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2438 ) |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2439 |
96aef9174003
(texinfo-alias): New function.
Richard M. Stallman <rms@gnu.org>
parents:
23658
diff
changeset
|
2440 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2441 ;;; @var, @code and the like |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2442 |
189 | 2443 (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
|
2444 ;; @sc a small caps font for TeX; formatted as `var' in Info |
189 | 2445 (put 'sc 'texinfo-format 'texinfo-format-var) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2446 ;; @acronym for abbreviations in all caps, such as `NASA'. |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2447 ;; 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
|
2448 (put 'acronym 'texinfo-format 'texinfo-format-var) |
189 | 2449 (defun texinfo-format-var () |
24750
ea9b449cc742
(texinfo-format-var): Handle other nested constructs, using
Richard M. Stallman <rms@gnu.org>
parents:
24745
diff
changeset
|
2450 (let ((arg (texinfo-parse-expanded-arg))) |
ea9b449cc742
(texinfo-format-var): Handle other nested constructs, using
Richard M. Stallman <rms@gnu.org>
parents:
24745
diff
changeset
|
2451 (texinfo-discard-command) |
ea9b449cc742
(texinfo-format-var): Handle other nested constructs, using
Richard M. Stallman <rms@gnu.org>
parents:
24745
diff
changeset
|
2452 (insert (upcase arg)))) |
189 | 2453 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2454 (put 'cite 'texinfo-format 'texinfo-format-code) |
189 | 2455 (put 'code 'texinfo-format 'texinfo-format-code) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2456 ;; @command (for command names) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2457 (put 'command 'texinfo-format 'texinfo-format-code) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2458 ;; @env (for environment variables) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2459 (put 'env 'texinfo-format 'texinfo-format-code) |
189 | 2460 (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
|
2461 (put 'samp 'texinfo-format 'texinfo-format-code) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2462 (put 'url 'texinfo-format 'texinfo-format-code) |
189 | 2463 (defun texinfo-format-code () |
2464 (insert "`" (texinfo-parse-arg-discard) "'") | |
2465 (goto-char texinfo-command-start)) | |
2466 | |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2467 ;; @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
|
2468 ;; 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
|
2469 ;; 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
|
2470 (put 'option 'texinfo-format 'texinfo-format-option) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2471 (defun texinfo-format-option () |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2472 "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
|
2473 ;; `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
|
2474 (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
|
2475 (save-excursion (beginning-of-line) (point)) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2476 t)) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2477 (insert "`" (texinfo-parse-arg-discard) "'") |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2478 (insert (texinfo-parse-arg-discard))) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2479 (goto-char texinfo-command-start)) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2480 |
189 | 2481 (put 'emph 'texinfo-format 'texinfo-format-emph) |
2482 (put 'strong 'texinfo-format 'texinfo-format-emph) | |
2483 (defun texinfo-format-emph () | |
2484 (insert "*" (texinfo-parse-arg-discard) "*") | |
2485 (goto-char texinfo-command-start)) | |
2486 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2487 (put 'dfn 'texinfo-format 'texinfo-format-defn) |
189 | 2488 (put 'defn 'texinfo-format 'texinfo-format-defn) |
2489 (defun texinfo-format-defn () | |
2490 (insert "\"" (texinfo-parse-arg-discard) "\"") | |
2491 (goto-char texinfo-command-start)) | |
2492 | |
37538
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2493 (put 'email 'texinfo-format 'texinfo-format-email) |
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2494 (defun texinfo-format-email () |
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2495 "Format email address and optional following full name. |
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2496 Insert full name, if present, followed by email address |
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2497 surrounded by in angle brackets." |
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2498 (let ((args (texinfo-format-parse-args))) |
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2499 (texinfo-discard-command) |
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2500 ;; if full-name |
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2501 (if (nth 1 args) |
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2502 (insert (nth 1 args) " ")) |
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2503 (insert "<" (nth 0 args) ">"))) |
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2504 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2505 (put 'key 'texinfo-format 'texinfo-format-key) |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2506 ;; 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
|
2507 (defun texinfo-format-key () |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
2508 (insert (texinfo-parse-arg-discard)) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2509 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2510 |
48794
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2511 ;; @verb{<char>TEXT<char>} (in `makeinfo' 4.1 and later) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2512 (put 'verb 'texinfo-format 'texinfo-format-verb) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2513 (defun texinfo-format-verb () |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2514 "Format text between non-quoted unique delimiter characters verbatim. |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2515 Enclose the verbatim text, including the delimiters, in braces. Print |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2516 text exactly as written (but not the delimiters) in a fixed-width. |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2517 |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2518 For example, @verb\{|@|\} results in @ and |
48794
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2519 @verb\{+@'e?`!`+} results in @'e?`!`." |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2520 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2521 (let ((delimiter (buffer-substring-no-properties |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2522 (1+ texinfo-command-end) (+ 2 texinfo-command-end)))) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2523 (unless (looking-at "{") |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2524 (error "Not found: @verb start brace")) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2525 (delete-region texinfo-command-start (+ 2 texinfo-command-end)) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2526 (search-forward delimiter)) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2527 (delete-backward-char 1) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2528 (unless (looking-at "}") |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2529 (error "Not found: @verb end brace")) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2530 (delete-char 1)) |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2531 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2532 ;; as of 2002 Dec 10 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2533 ;; see (texinfo)Block Enclosing Commands |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2534 ;; need: @verbatim |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2535 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2536 ;; as of 2002 Dec 10 |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2537 ;; see (texinfo)verbatiminclude |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2538 ;; need: @verbatiminclude FILENAME |
837d37faadcf
Installed on behalf of TAKAHASHI Kaoru <kaoru@kaisei.org>
Robert J. Chassell <bob@rattlesnake.com>
parents:
48755
diff
changeset
|
2539 |
189 | 2540 (put 'bullet 'texinfo-format 'texinfo-format-bullet) |
2541 (defun texinfo-format-bullet () | |
2542 "Insert an asterisk. | |
2543 If used within a line, follow `@bullet' with braces." | |
2544 (texinfo-optional-braces-discard) | |
2545 (insert "*")) | |
2546 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2547 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2548 ;;; @kbd |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2549 |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2550 ;; Inside of @example ... @end example and similar environments, |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2551 ;; @kbd does nothing; but outside of such environments, it places |
48568 | 2552 ;; single quotation marks around its argument. |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2553 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2554 (defvar texinfo-format-kbd-regexp |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2555 (concat |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2556 "^@" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2557 "\\(" |
37538
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2558 "display\\|" |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2559 "example\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2560 "smallexample\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2561 "lisp\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2562 "smalllisp" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2563 "\\)") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2564 "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
|
2565 around argument.") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2566 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2567 (defvar texinfo-format-kbd-end-regexp |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2568 (concat |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2569 "^@end " |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2570 "\\(" |
37538
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2571 "display\\|" |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2572 "example\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2573 "smallexample\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2574 "lisp\\|" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2575 "smalllisp" |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2576 "\\)") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2577 "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
|
2578 around argument. (See `texinfo-format-kbd-regexp')") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2579 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2580 (put 'kbd 'texinfo-format 'texinfo-format-kbd) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2581 (defun texinfo-format-kbd () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2582 "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
|
2583 ;; 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
|
2584 ;; Can stop search at nearest @node or texinfo-section-types-regexp |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2585 (let* ((stop |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2586 (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2587 (re-search-forward |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2588 (concat "^@node\\|\\(" texinfo-section-types-regexp "\\)") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2589 nil |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2590 '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
|
2591 (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2592 (example-location |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2593 (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2594 (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
|
2595 (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2596 (end-example-location |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2597 (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2598 (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
|
2599 (point)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2600 ;; 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
|
2601 ;; 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
|
2602 (if (>= end-example-location example-location) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2603 ;; outside an @example or equivalent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2604 (insert "`" (texinfo-parse-arg-discard) "'") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2605 ;; else, in @example; do not surround with `...' |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2606 (insert (texinfo-parse-arg-discard))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2607 (goto-char texinfo-command-start))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2608 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2609 |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2610 ;;; @example, @lisp, @quotation, @display, @smalllisp, @smallexample, |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2611 ;; @smalldisplay |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2612 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2613 (put 'display 'texinfo-format 'texinfo-format-example) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2614 (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
|
2615 (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
|
2616 (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
|
2617 (put 'quotation 'texinfo-format 'texinfo-format-example) |
189 | 2618 (put 'smallexample 'texinfo-format 'texinfo-format-example) |
2619 (put 'smalllisp 'texinfo-format 'texinfo-format-example) | |
2620 (defun texinfo-format-example () | |
2621 (texinfo-push-stack 'example nil) | |
2622 (setq fill-column (- fill-column 5)) | |
2623 (texinfo-discard-line)) | |
2624 | |
2625 (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
|
2626 (put 'display 'texinfo-end 'texinfo-end-example) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2627 (put 'smalldisplay 'texinfo-end 'texinfo-end-example) |
189 | 2628 (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
|
2629 (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
|
2630 (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
|
2631 (put 'smalllisp 'texinfo-end 'texinfo-end-example) |
189 | 2632 (defun texinfo-end-example () |
2633 (setq fill-column (+ fill-column 5)) | |
2634 (texinfo-discard-command) | |
2635 (let ((stacktop | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2636 (texinfo-pop-stack 'example))) |
189 | 2637 (texinfo-do-itemize (nth 1 stacktop)))) |
2638 | |
2639 (put 'exdent 'texinfo-format 'texinfo-format-exdent) | |
2640 (defun texinfo-format-exdent () | |
2641 (texinfo-discard-command) | |
2642 (delete-region (point) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2643 (progn |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2644 (skip-chars-forward " ") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2645 (point))) |
189 | 2646 (insert ?\b) |
2647 ;; Cancel out the deletion that texinfo-do-itemize | |
2648 ;; is going to do at the end of this line. | |
2649 (save-excursion | |
2650 (end-of-line) | |
2651 (insert "\n "))) | |
2652 | |
2653 | |
18884
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2654 ;; @direntry and @dircategory |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2655 |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2656 (put 'direntry 'texinfo-format 'texinfo-format-direntry) |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2657 (defun texinfo-format-direntry () |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2658 (texinfo-push-stack 'direntry nil) |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2659 (texinfo-discard-line) |
24792
c4e546aa9dd5
(texinfo-format-direntry): Avoid blank line.
Karl Heuer <kwzh@gnu.org>
parents:
24750
diff
changeset
|
2660 (insert "START-INFO-DIR-ENTRY\n")) |
18884
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2661 |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2662 (put 'direntry 'texinfo-end 'texinfo-end-direntry) |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2663 (defun texinfo-end-direntry () |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2664 (texinfo-discard-command) |
18908
a5e6856e865e
(dircategory): Delete obsolete mistaken `put'.
Richard M. Stallman <rms@gnu.org>
parents:
18884
diff
changeset
|
2665 (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
|
2666 (texinfo-pop-stack 'direntry)) |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2667 |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2668 (put 'dircategory 'texinfo-format 'texinfo-format-dircategory) |
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2669 (defun texinfo-format-dircategory () |
18908
a5e6856e865e
(dircategory): Delete obsolete mistaken `put'.
Richard M. Stallman <rms@gnu.org>
parents:
18884
diff
changeset
|
2670 (let ((str (texinfo-parse-arg-discard))) |
a5e6856e865e
(dircategory): Delete obsolete mistaken `put'.
Richard M. Stallman <rms@gnu.org>
parents:
18884
diff
changeset
|
2671 (delete-region (point) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2672 (progn |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2673 (skip-chars-forward " ") |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2674 (point))) |
18908
a5e6856e865e
(dircategory): Delete obsolete mistaken `put'.
Richard M. Stallman <rms@gnu.org>
parents:
18884
diff
changeset
|
2675 (insert "INFO-DIR-SECTION " str "\n"))) |
18884
04d36f3e7fa6
(texinfo-no-refill-regexp): Add "direntry".
Richard M. Stallman <rms@gnu.org>
parents:
18818
diff
changeset
|
2676 |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2677 ;;; @cartouche |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2678 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2679 ;; 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
|
2680 ;; 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
|
2681 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2682 (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
|
2683 (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
|
2684 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2685 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2686 ;;; @flushleft and @format |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2687 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2688 ;; 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
|
2689 ;; 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
|
2690 ;; `do-nothing' command |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2691 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2692 ;; 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
|
2693 ;; 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
|
2694 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2695 (put 'format 'texinfo-format 'texinfo-format-flushleft) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2696 (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
|
2697 (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
|
2698 (defun texinfo-format-flushleft () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2699 (texinfo-discard-line)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2700 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2701 (put 'format 'texinfo-end 'texinfo-end-flushleft) |
22695
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
2702 (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
|
2703 (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
|
2704 (defun texinfo-end-flushleft () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2705 (texinfo-discard-command)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2706 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2707 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2708 ;;; @flushright |
189 | 2709 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2710 ;; 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
|
2711 ;; 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
|
2712 ;; removed so that visible text lines up on the right side. |
189 | 2713 |
2714 (put 'flushright 'texinfo-format 'texinfo-format-flushright) | |
2715 (defun texinfo-format-flushright () | |
2716 (texinfo-push-stack 'flushright nil) | |
2717 (texinfo-discard-line)) | |
2718 | |
2719 (put 'flushright 'texinfo-end 'texinfo-end-flushright) | |
2720 (defun texinfo-end-flushright () | |
2721 (texinfo-discard-command) | |
2722 | |
2723 (let ((stacktop | |
2724 (texinfo-pop-stack 'flushright))) | |
2725 | |
2726 (texinfo-do-flushright (nth 1 stacktop)))) | |
2727 | |
2728 (defun texinfo-do-flushright (from) | |
2729 (save-excursion | |
2730 (while (progn (forward-line -1) | |
2731 (>= (point) from)) | |
2732 | |
2733 (beginning-of-line) | |
2734 (insert | |
2735 (make-string | |
2736 (- fill-column | |
2737 (save-excursion | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2738 (end-of-line) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2739 (skip-chars-backward " \t") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2740 (delete-region (point) (progn (end-of-line) (point))) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2741 (current-column))) |
189 | 2742 ? ))))) |
2743 | |
2744 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2745 ;;; @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
|
2746 |
189 | 2747 (put 'ctrl 'texinfo-format 'texinfo-format-ctrl) |
2748 (defun texinfo-format-ctrl () | |
2749 (let ((str (texinfo-parse-arg-discard))) | |
2750 (insert (logand 31 (aref str 0))))) | |
2751 | |
2752 (put 'TeX 'texinfo-format 'texinfo-format-TeX) | |
2753 (defun texinfo-format-TeX () | |
2754 (texinfo-parse-arg-discard) | |
2755 (insert "TeX")) | |
2756 | |
2757 (put 'copyright 'texinfo-format 'texinfo-format-copyright) | |
2758 (defun texinfo-format-copyright () | |
2759 (texinfo-parse-arg-discard) | |
2760 (insert "(C)")) | |
2761 | |
2762 (put 'minus 'texinfo-format 'texinfo-format-minus) | |
2763 (defun texinfo-format-minus () | |
2764 "Insert a minus sign. | |
2765 If used within a line, follow `@minus' with braces." | |
2766 (texinfo-optional-braces-discard) | |
2767 (insert "-")) | |
2768 | |
2769 (put 'dots 'texinfo-format 'texinfo-format-dots) | |
2770 (defun texinfo-format-dots () | |
2771 (texinfo-parse-arg-discard) | |
2772 (insert "...")) | |
2773 | |
9549
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2774 (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
|
2775 (defun texinfo-format-enddots () |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2776 (texinfo-parse-arg-discard) |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2777 (insert "....")) |
1de7e5bc1ff1
(texinfo-no-refill-regexp): Recognize @ifhtml, @html.
Richard M. Stallman <rms@gnu.org>
parents:
9344
diff
changeset
|
2778 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2779 (put 'pounds 'texinfo-format 'texinfo-format-pounds) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2780 (defun texinfo-format-pounds () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2781 (texinfo-parse-arg-discard) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2782 (insert "#")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2783 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2784 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2785 ;;; Refilling and indenting: @refill, @paragraphindent, @noindent |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2786 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2787 ;;; Indent only those paragraphs that are refilled as a result of an |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2788 ;;; @refill command. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2789 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2790 ;; * 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
|
2791 ;; the starts of paragraphs. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2792 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2793 ;; * 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
|
2794 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
2795 ;; * 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
|
2796 ;; number of spaces. |
4396
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 ;;; 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
|
2799 ;;; 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
|
2800 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2801 (defvar texinfo-paragraph-indent "asis" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2802 "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
|
2803 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2804 (put 'paragraphindent 'texinfo-format 'texinfo-paragraphindent) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2805 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2806 (defun texinfo-paragraphindent () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2807 "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
|
2808 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
|
2809 (let ((arg (texinfo-parse-arg-discard))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2810 (if (string= "asis" arg) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2811 (setq texinfo-paragraph-indent "asis") |
62402
a7e02ef1e3d6
Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents:
60372
diff
changeset
|
2812 (setq texinfo-paragraph-indent (string-to-number arg))))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2813 |
189 | 2814 (put 'refill 'texinfo-format 'texinfo-format-refill) |
2815 (defun texinfo-format-refill () | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2816 "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
|
2817 Default is to leave paragraph indentation as is." |
189 | 2818 (texinfo-discard-command) |
23658 | 2819 (let ((position (point-marker))) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2820 (forward-paragraph -1) |
23658 | 2821 (if (looking-at "[ \t\n]*$") (forward-line 1)) |
2822 ;; Do not indent if an entry in a list, table, or deffn, | |
2823 ;; or if paragraph is preceded by @noindent. | |
2824 ;; Otherwise, indent | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2825 (cond |
23658 | 2826 ;; delete a @noindent line and do not indent paragraph |
2827 ((save-excursion (forward-line -1) | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2828 (looking-at "^@noindent")) |
23658 | 2829 (forward-line -1) |
2830 (delete-region (point) (progn (forward-line 1) (point)))) | |
2831 ;; do nothing if "asis" | |
2832 ((equal texinfo-paragraph-indent "asis")) | |
2833 ;; do no indenting in list, etc. | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2834 ((> texinfo-stack-depth 0)) |
23658 | 2835 ;; otherwise delete existing whitespace and indent |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2836 (t |
23658 | 2837 (delete-region (point) (progn (skip-chars-forward " \t") (point))) |
2838 (insert (make-string texinfo-paragraph-indent ? )))) | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2839 (forward-paragraph 1) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2840 (forward-line -1) |
23658 | 2841 (end-of-line) |
2842 ;; Do not fill a section title line with asterisks, hyphens, etc. that | |
2843 ;; are used to underline it. This could occur if the line following | |
2844 ;; the underlining is not an index entry and has text within it. | |
2845 (let* ((previous-paragraph-separate paragraph-separate) | |
2846 (paragraph-separate | |
2847 (concat paragraph-separate "\\|[-=.]+\\|\\*\\*+")) | |
2848 (previous-paragraph-start paragraph-start) | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2849 (paragraph-start |
23658 | 2850 (concat paragraph-start "\\|[-=.]+\\|\\*\\*+"))) |
2851 (unwind-protect | |
2852 (fill-paragraph nil) | |
2853 (setq paragraph-separate previous-paragraph-separate) | |
2854 (setq paragraph-start previous-paragraph-start))) | |
2855 (goto-char position))) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2856 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2857 (put 'noindent 'texinfo-format 'texinfo-noindent) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2858 (defun texinfo-noindent () |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2859 (save-excursion |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2860 (forward-paragraph 1) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2861 (if (search-backward "@refill" |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2862 (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
|
2863 () ; 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
|
2864 ;; else |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2865 (texinfo-discard-line)))) |
189 | 2866 |
2867 | |
2868 ;;; Index generation | |
2869 | |
2870 (put 'vindex 'texinfo-format 'texinfo-format-vindex) | |
2871 (defun texinfo-format-vindex () | |
2872 (texinfo-index 'texinfo-vindex)) | |
2873 | |
2874 (put 'cindex 'texinfo-format 'texinfo-format-cindex) | |
2875 (defun texinfo-format-cindex () | |
2876 (texinfo-index 'texinfo-cindex)) | |
2877 | |
2878 (put 'findex 'texinfo-format 'texinfo-format-findex) | |
2879 (defun texinfo-format-findex () | |
2880 (texinfo-index 'texinfo-findex)) | |
2881 | |
2882 (put 'pindex 'texinfo-format 'texinfo-format-pindex) | |
2883 (defun texinfo-format-pindex () | |
2884 (texinfo-index 'texinfo-pindex)) | |
2885 | |
2886 (put 'tindex 'texinfo-format 'texinfo-format-tindex) | |
2887 (defun texinfo-format-tindex () | |
2888 (texinfo-index 'texinfo-tindex)) | |
2889 | |
2890 (put 'kindex 'texinfo-format 'texinfo-format-kindex) | |
2891 (defun texinfo-format-kindex () | |
2892 (texinfo-index 'texinfo-kindex)) | |
2893 | |
2894 (defun texinfo-index (indexvar) | |
2895 (let ((arg (texinfo-parse-expanded-arg))) | |
2896 (texinfo-discard-command) | |
2897 (set indexvar | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2898 (cons (list arg |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2899 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2900 ;; 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
|
2901 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2902 (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
|
2903 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2904 (symbol-value indexvar))))) |
189 | 2905 |
55770
f813d67d717a
(texinfo-indexvar-alist): Declare as variable instead of constant.
John Paul Wallington <jpw@pobox.com>
parents:
55752
diff
changeset
|
2906 (defvar texinfo-indexvar-alist |
189 | 2907 '(("cp" . texinfo-cindex) |
2908 ("fn" . texinfo-findex) | |
2909 ("vr" . texinfo-vindex) | |
2910 ("tp" . texinfo-tindex) | |
2911 ("pg" . texinfo-pindex) | |
2912 ("ky" . texinfo-kindex))) | |
2913 | |
2914 | |
2915 ;;; @defindex @defcodeindex | |
2916 (put 'defindex 'texinfo-format 'texinfo-format-defindex) | |
2917 (put 'defcodeindex 'texinfo-format 'texinfo-format-defindex) | |
2918 | |
2919 (defun texinfo-format-defindex () | |
2920 (let* ((index-name (texinfo-parse-arg-discard)) ; eg: `aa' | |
2921 (indexing-command (intern (concat index-name "index"))) | |
2922 (index-formatting-command ; eg: `texinfo-format-aaindex' | |
2923 (intern (concat "texinfo-format-" index-name "index"))) | |
2924 (index-alist-name ; eg: `texinfo-aaindex' | |
2925 (intern (concat "texinfo-" index-name "index")))) | |
2926 | |
2927 (set index-alist-name nil) | |
2928 | |
2929 (put indexing-command ; eg, aaindex | |
2930 'texinfo-format | |
2931 index-formatting-command) ; eg, texinfo-format-aaindex | |
2932 | |
2933 ;; eg: "aa" . texinfo-aaindex | |
2934 (or (assoc index-name texinfo-indexvar-alist) | |
2935 (setq texinfo-indexvar-alist | |
2936 (cons | |
2937 (cons index-name | |
2938 index-alist-name) | |
2939 texinfo-indexvar-alist))) | |
2940 | |
2941 (fset index-formatting-command | |
2942 (list 'lambda 'nil | |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
2943 (list 'texinfo-index |
189 | 2944 (list 'quote index-alist-name)))))) |
2945 | |
2946 | |
2947 ;;; @synindex @syncodeindex | |
2948 | |
2949 (put 'synindex 'texinfo-format 'texinfo-format-synindex) | |
2950 (put 'syncodeindex 'texinfo-format 'texinfo-format-synindex) | |
2951 | |
2952 (defun texinfo-format-synindex () | |
2953 (let* ((args (texinfo-parse-arg-discard)) | |
2954 (second (cdr (read-from-string args))) | |
2955 (joiner (symbol-name (car (read-from-string args)))) | |
2956 (joined (symbol-name (car (read-from-string args second))))) | |
2957 | |
2958 (if (assoc joiner texinfo-short-index-cmds-alist) | |
2959 (put | |
2960 (cdr (assoc joiner texinfo-short-index-cmds-alist)) | |
2961 'texinfo-format | |
2962 (or (cdr (assoc joined texinfo-short-index-format-cmds-alist)) | |
2963 (intern (concat "texinfo-format-" joined "index")))) | |
2964 (put | |
2965 (intern (concat joiner "index")) | |
2966 'texinfo-format | |
2967 (or (cdr(assoc joined texinfo-short-index-format-cmds-alist)) | |
2968 (intern (concat "texinfo-format-" joined "index"))))))) | |
2969 | |
2970 (defconst texinfo-short-index-cmds-alist | |
2971 '(("cp" . cindex) | |
2972 ("fn" . findex) | |
2973 ("vr" . vindex) | |
2974 ("tp" . tindex) | |
2975 ("pg" . pindex) | |
2976 ("ky" . kindex))) | |
2977 | |
2978 (defconst texinfo-short-index-format-cmds-alist | |
2979 '(("cp" . texinfo-format-cindex) | |
2980 ("fn" . texinfo-format-findex) | |
2981 ("vr" . texinfo-format-vindex) | |
2982 ("tp" . texinfo-format-tindex) | |
2983 ("pg" . texinfo-format-pindex) | |
2984 ("ky" . texinfo-format-kindex))) | |
2985 | |
2986 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2987 ;;; Sort and index (for VMS) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2988 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2989 ;; 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
|
2990 ;; 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
|
2991 (defun texinfo-sort-region (start end) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2992 (require 'sort) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2993 (save-restriction |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2994 (narrow-to-region start end) |
37538
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
2995 (goto-char (point-min)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2996 (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
|
2997 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2998 ;; Subroutine for sorting an index. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
2999 ;; 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
|
3000 (defun texinfo-sort-startkeyfun () |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
3001 (let ((line (buffer-substring-no-properties (point) (line-end-position)))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3002 ;; Canonicalize whitespace and eliminate funny chars. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3003 (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
|
3004 (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
|
3005 " " |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
3006 (substring line (match-end 0))))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3007 line)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3008 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3009 |
189 | 3010 ;;; @printindex |
3011 | |
3012 (put 'printindex 'texinfo-format 'texinfo-format-printindex) | |
3013 | |
3014 (defun texinfo-format-printindex () | |
3015 (let ((indexelts (symbol-value | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3016 (cdr (assoc (texinfo-parse-arg-discard) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3017 texinfo-indexvar-alist)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3018 opoint) |
189 | 3019 (insert "\n* Menu:\n\n") |
3020 (setq opoint (point)) | |
3021 (texinfo-print-index nil indexelts) | |
3022 | |
15985
eb812636dcb5
(texinfo-format-printindex):
Richard M. Stallman <rms@gnu.org>
parents:
15680
diff
changeset
|
3023 (if (memq system-type '(vax-vms windows-nt ms-dos)) |
189 | 3024 (texinfo-sort-region opoint (point)) |
3025 (shell-command-on-region opoint (point) "sort -fd" 1)))) | |
3026 | |
3027 (defun texinfo-print-index (file indexelts) | |
3028 (while indexelts | |
3029 (if (stringp (car (car indexelts))) | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3030 (progn |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3031 (insert "* " (car (car indexelts)) ": " ) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3032 (indent-to 32) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3033 (insert |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3034 (if file (concat "(" file ")") "") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3035 (nth 1 (car indexelts)) ".") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3036 (indent-to 54) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3037 (insert |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3038 (if (nth 2 (car indexelts)) |
55752
a7f7c0fa52a6
(texinfo-print-index): Print index line numbers in the new Texinfo 4.7 format.
Juri Linkov <juri@jurta.org>
parents:
52969
diff
changeset
|
3039 (format " (line %3d)" (1+ (nth 2 (car indexelts)))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3040 "") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3041 "\n")) |
189 | 3042 ;; index entries from @include'd file |
3043 (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
|
3044 (nth 2 (car indexelts)))) |
189 | 3045 (setq indexelts (cdr indexelts)))) |
3046 | |
3047 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3048 ;;; Glyphs: @equiv, @error, etc |
189 | 3049 |
3050 ;; @equiv to show that two expressions are equivalent | |
3051 ;; @error to show an error message | |
3052 ;; @expansion to show what a macro expands to | |
3053 ;; @point to show the location of point in an example | |
3054 ;; @print to show what an evaluated expression prints | |
3055 ;; @result to indicate the value returned by an expression | |
3056 | |
3057 (put 'equiv 'texinfo-format 'texinfo-format-equiv) | |
3058 (defun texinfo-format-equiv () | |
3059 (texinfo-parse-arg-discard) | |
3060 (insert "==")) | |
3061 | |
3062 (put 'error 'texinfo-format 'texinfo-format-error) | |
3063 (defun texinfo-format-error () | |
3064 (texinfo-parse-arg-discard) | |
3065 (insert "error-->")) | |
3066 | |
3067 (put 'expansion 'texinfo-format 'texinfo-format-expansion) | |
3068 (defun texinfo-format-expansion () | |
3069 (texinfo-parse-arg-discard) | |
3070 (insert "==>")) | |
3071 | |
3072 (put 'point 'texinfo-format 'texinfo-format-point) | |
3073 (defun texinfo-format-point () | |
3074 (texinfo-parse-arg-discard) | |
3075 (insert "-!-")) | |
3076 | |
3077 (put 'print 'texinfo-format 'texinfo-format-print) | |
3078 (defun texinfo-format-print () | |
3079 (texinfo-parse-arg-discard) | |
3080 (insert "-|")) | |
3081 | |
3082 (put 'result 'texinfo-format 'texinfo-format-result) | |
3083 (defun texinfo-format-result () | |
3084 (texinfo-parse-arg-discard) | |
3085 (insert "=>")) | |
3086 | |
3087 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3088 ;;; Accent commands |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3089 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3090 ;; 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
|
3091 ;; 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
|
3092 ;; character set. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3093 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3094 ;; See the `texinfo-accent-commands' variable |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3095 ;; in the section for `texinfo-append-refill'. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3096 ;; Also, see the defun for `texinfo-format-scan' |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3097 ;; for single-character accent commands. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3098 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3099 ;; Command Info output Name |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3100 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3101 ;; These do not have braces: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3102 ;; @^ ==> ^ circumflex accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3103 ;; @` ==> ` grave accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3104 ;; @' ==> ' acute accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3105 ;; @" ==> " umlaut accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3106 ;; @= ==> = overbar accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3107 ;; @~ ==> ~ tilde accent |
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 ;; These have braces, but take no argument: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3110 ;; @OE{} ==> OE French-OE-ligature |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3111 ;; @oe{} ==> oe |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3112 ;; @AA{} ==> AA Scandinavian-A-with-circle |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3113 ;; @aa{} ==> aa |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3114 ;; @AE{} ==> AE Latin-Scandinavian-AE |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3115 ;; @ae{} ==> ae |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3116 ;; @ss{} ==> ss German-sharp-S |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3117 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3118 ;; @questiondown{} ==> ? upside-down-question-mark |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3119 ;; @exclamdown{} ==> ! upside-down-exclamation-mark |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3120 ;; @L{} ==> L/ Polish suppressed-L (Lslash) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3121 ;; @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
|
3122 ;; @O{} ==> O/ Scandinavian O-with-slash |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3123 ;; @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
|
3124 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3125 ;; These have braces, and take an argument: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3126 ;; @,{c} ==> c, cedilla accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3127 ;; @dotaccent{o} ==> .o overdot-accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3128 ;; @ubaraccent{o} ==> _o underbar-accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3129 ;; @udotaccent{o} ==> o-. underdot-accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3130 ;; @H{o} ==> ""o long Hungarian umlaut |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3131 ;; @ringaccent{o} ==> *o ring accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3132 ;; @tieaccent{oo} ==> [oo tie after accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3133 ;; @u{o} ==> (o breve accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3134 ;; @v{o} ==> <o hacek accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3135 ;; @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
|
3136 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3137 ;; ========== |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3138 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3139 ;; Note: The defun texinfo-format-scan |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3140 ;; looks at "[@{}^'`\",=~ *?!-]" |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3141 ;; In the case of @*, a line break is inserted; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3142 ;; 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
|
3143 ;; Thus, `texinfo-format-scan' handles the following |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3144 ;; single-character accent commands: @^ @` @' @" @, @- @= @~ |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3145 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3146 ;; @^ ==> ^ circumflex accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3147 ;; (put '^ 'texinfo-format 'texinfo-format-circumflex-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3148 ;; (defun texinfo-format-circumflex-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3149 ;; (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3150 ;; (insert "^")) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3151 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3152 ;; @` ==> ` grave accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3153 ;; (put '\` 'texinfo-format 'texinfo-format-grave-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3154 ;; (defun texinfo-format-grave-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3155 ;; (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3156 ;; (insert "\`")) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3157 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3158 ;; @' ==> ' acute accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3159 ;; (put '\' 'texinfo-format 'texinfo-format-acute-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3160 ;; (defun texinfo-format-acute-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3161 ;; (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3162 ;; (insert "'")) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3163 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3164 ;; @" ==> " umlaut accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3165 ;; (put '\" 'texinfo-format 'texinfo-format-umlaut-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3166 ;; (defun texinfo-format-umlaut-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3167 ;; (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3168 ;; (insert "\"")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3169 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3170 ;; @= ==> = overbar accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3171 ;; (put '= 'texinfo-format 'texinfo-format-overbar-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3172 ;; (defun texinfo-format-overbar-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3173 ;; (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3174 ;; (insert "=")) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3175 ;; |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3176 ;; @~ ==> ~ tilde accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3177 ;; (put '~ 'texinfo-format 'texinfo-format-tilde-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3178 ;; (defun texinfo-format-tilde-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3179 ;; (texinfo-discard-command) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3180 ;; (insert "~")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3181 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3182 ;; @OE{} ==> OE French-OE-ligature |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3183 (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
|
3184 (defun texinfo-format-French-OE-ligature () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3185 (insert "OE" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3186 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3187 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3188 ;; @oe{} ==> oe |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3189 (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
|
3190 (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
|
3191 (insert "oe" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3192 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3193 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3194 ;; @AA{} ==> AA Scandinavian-A-with-circle |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3195 (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
|
3196 (defun texinfo-format-Scandinavian-A-with-circle () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3197 (insert "AA" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3198 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3199 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3200 ;; @aa{} ==> aa |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3201 (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
|
3202 (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
|
3203 (insert "aa" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3204 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3205 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3206 ;; @AE{} ==> AE Latin-Scandinavian-AE |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3207 (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
|
3208 (defun texinfo-format-Latin-Scandinavian-AE () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3209 (insert "AE" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3210 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3211 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3212 ;; @ae{} ==> ae |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3213 (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
|
3214 (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
|
3215 (insert "ae" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3216 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3217 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3218 ;; @ss{} ==> ss German-sharp-S |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3219 (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
|
3220 (defun texinfo-format-German-sharp-S () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3221 (insert "ss" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3222 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3223 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3224 ;; @questiondown{} ==> ? upside-down-question-mark |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3225 (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
|
3226 (defun texinfo-format-upside-down-question-mark () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3227 (insert "?" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3228 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3229 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3230 ;; @exclamdown{} ==> ! upside-down-exclamation-mark |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3231 (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
|
3232 (defun texinfo-format-upside-down-exclamation-mark () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3233 (insert "!" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3234 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3235 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3236 ;; @L{} ==> L/ Polish suppressed-L (Lslash) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3237 (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
|
3238 (defun texinfo-format-Polish-suppressed-L () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3239 (insert (texinfo-parse-arg-discard) "/L") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3240 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3241 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3242 ;; @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
|
3243 (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
|
3244 (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
|
3245 (insert (texinfo-parse-arg-discard) "/l") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3246 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3247 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3248 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3249 ;; @O{} ==> O/ Scandinavian O-with-slash |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3250 (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
|
3251 (defun texinfo-format-Scandinavian-O-with-slash () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3252 (insert (texinfo-parse-arg-discard) "O/") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3253 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3254 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3255 ;; @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
|
3256 (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
|
3257 (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
|
3258 (insert (texinfo-parse-arg-discard) "o/") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3259 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3260 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3261 ;; Take arguments |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3262 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3263 ;; @,{c} ==> c, cedilla accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3264 (put ', 'texinfo-format 'texinfo-format-cedilla-accent) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3265 (defun texinfo-format-cedilla-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3266 (insert (texinfo-parse-arg-discard) ",") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3267 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3268 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3269 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3270 ;; @dotaccent{o} ==> .o overdot-accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3271 (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
|
3272 (defun texinfo-format-overdot-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3273 (insert "." (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3274 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3275 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3276 ;; @ubaraccent{o} ==> _o underbar-accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3277 (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
|
3278 (defun texinfo-format-underbar-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3279 (insert "_" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3280 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3281 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3282 ;; @udotaccent{o} ==> o-. underdot-accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3283 (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
|
3284 (defun texinfo-format-underdot-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3285 (insert (texinfo-parse-arg-discard) "-.") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3286 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3287 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3288 ;; @H{o} ==> ""o long Hungarian umlaut |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3289 (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
|
3290 (defun texinfo-format-long-Hungarian-umlaut () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3291 (insert "\"\"" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3292 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3293 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3294 ;; @ringaccent{o} ==> *o ring accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3295 (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
|
3296 (defun texinfo-format-ring-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3297 (insert "*" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3298 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3299 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3300 ;; @tieaccent{oo} ==> [oo tie after accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3301 (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
|
3302 (defun texinfo-format-tie-after-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3303 (insert "[" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3304 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3305 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3306 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3307 ;; @u{o} ==> (o breve accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3308 (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
|
3309 (defun texinfo-format-breve-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3310 (insert "(" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3311 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3312 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3313 ;; @v{o} ==> <o hacek accent |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3314 (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
|
3315 (defun texinfo-format-hacek-accent () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3316 (insert "<" (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3317 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3318 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3319 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3320 ;; @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
|
3321 (put 'dotless 'texinfo-format 'texinfo-format-dotless) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3322 (defun texinfo-format-dotless () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3323 (insert (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3324 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3325 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
3326 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3327 ;;; Definition formatting: @deffn, @defun, etc |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3328 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3329 ;; What definition formatting produces: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3330 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3331 ;; @deffn category name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3332 ;; In Info, `Category: name ARGS' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3333 ;; In index: name: node. line#. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3334 ;; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3335 ;; @defvr category name |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3336 ;; In Info, `Category: name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3337 ;; In index: name: node. line#. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3338 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3339 ;; @deftp category name attributes... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3340 ;; `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
|
3341 ;; In index: name: node. line#. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3342 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3343 ;; 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
|
3344 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3345 ;; @defun, @defmac, @defspec, @defvar, @defopt |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3346 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3347 ;; @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
|
3348 ;; @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
|
3349 ;; @defvar name In Info, `Variable: name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3350 ;; etc. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3351 ;; In index: name: node. line#. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3352 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3353 ;; 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
|
3354 ;; @deftypefn category data-type name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3355 ;; In Info, `Category: data-type name args...' |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3356 ;; @deftypevr category data-type name |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3357 ;; In Info, `Category: data-type name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3358 ;; In index: name: node. line#. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3359 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3360 ;; 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
|
3361 ;; @deftypefun data-type name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3362 ;; In Info, `Function: data-type name ARGS' |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3363 ;; In index: name: node. line#. |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3364 ;; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3365 ;; @deftypevar data-type name |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3366 ;; In Info, `Variable: data-type name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3367 ;; 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
|
3368 ;; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3369 ;; Generalized object oriented entity: |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3370 ;; @defop category class name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3371 ;; 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
|
3372 ;; 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
|
3373 ;; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3374 ;; @defcv category class name |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3375 ;; In Info, `Category of class: name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3376 ;; 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
|
3377 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3378 ;; Specialized object oriented entity: |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3379 ;; @defmethod class name args... |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3380 ;; 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
|
3381 ;; 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
|
3382 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3383 ;; @defivar class name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3384 ;; 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
|
3385 ;; 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
|
3386 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3387 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3388 ;;; The definition formatting functions |
189 | 3389 |
3390 (defun texinfo-format-defun () | |
3391 (texinfo-push-stack 'defun nil) | |
3392 (setq fill-column (- fill-column 5)) | |
3393 (texinfo-format-defun-1 t)) | |
3394 | |
3395 (defun texinfo-end-defun () | |
3396 (setq fill-column (+ fill-column 5)) | |
3397 (texinfo-discard-command) | |
3398 (let ((start (nth 1 (texinfo-pop-stack 'defun)))) | |
3399 (texinfo-do-itemize start) | |
3400 ;; Delete extra newline inserted after header. | |
3401 (save-excursion | |
3402 (goto-char start) | |
3403 (delete-char -1)))) | |
3404 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3405 (defun texinfo-format-defunx () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3406 (texinfo-format-defun-1 nil)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3407 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3408 (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
|
3409 (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
|
3410 (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
|
3411 (texinfo-discard-command) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3412 ;; 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
|
3413 (if (not first-p) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3414 (delete-char -1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3415 (funcall |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3416 (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
|
3417 ;; 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
|
3418 ;; with header line. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3419 (insert "\n\n") |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3420 (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
|
3421 (funcall |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3422 (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
|
3423 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3424 ;;; 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
|
3425 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3426 ;; @deffn, @defvr, @deftp |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3427 (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
|
3428 (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
|
3429 (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
|
3430 (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
|
3431 (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
|
3432 (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
|
3433 (defun texinfo-format-deffn (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3434 ;; 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
|
3435 ;; @deffn category name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3436 ;; In Info, `Category: name ARGS' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3437 ;; @deftp category name attributes... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3438 ;; `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
|
3439 (let ((category (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3440 (name (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3441 (args (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3442 (insert " -- " category ": " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3443 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3444 (insert " " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3445 (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
|
3446 (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
|
3447 (car args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3448 (upcase (car args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3449 (setq args (cdr args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3450 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3451 ;; @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
|
3452 (put 'defun 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3453 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3454 (put 'defunx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3455 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3456 (put 'defmac 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3457 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3458 (put 'defmacx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3459 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3460 (put 'defspec 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3461 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3462 (put 'defspecx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3463 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3464 (put 'defvar 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3465 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3466 (put 'defvarx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3467 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3468 (put 'defopt 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3469 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3470 (put 'defoptx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3471 'texinfo-format-specialized-defun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3472 (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
|
3473 ;; 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
|
3474 ;; @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
|
3475 ;; @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
|
3476 ;; @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
|
3477 ;; 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
|
3478 (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
|
3479 (name (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3480 (args (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3481 (insert " -- " category ": " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3482 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3483 (insert " " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3484 (if (= ?& (aref (car args) 0)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3485 (car args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3486 (upcase (car args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3487 (setq args (cdr args))))) |
189 | 3488 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3489 ;; @deftypefn, @deftypevr: Generalized typed |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3490 (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
|
3491 (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
|
3492 (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
|
3493 (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
|
3494 (defun texinfo-format-deftypefn (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3495 ;; 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
|
3496 ;; @deftypefn category data-type name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3497 ;; In Info, `Category: data-type name args...' |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3498 ;; @deftypevr category data-type name |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3499 ;; In Info, `Category: data-type name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3500 ;; 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
|
3501 (let ((category (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3502 (data-type (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3503 (name (car (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3504 (args (cdr (cdr (cdr parsed-args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3505 (insert " -- " category ": " data-type " " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3506 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3507 (insert " " (car args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3508 (setq args (cdr args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3509 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3510 ;; @deftypefun, @deftypevar: Specialized typed |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3511 (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
|
3512 (put 'deftypefunx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3513 'texinfo-format-deftypefun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3514 (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
|
3515 (put 'deftypevarx 'texinfo-deffn-formatting-property |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3516 'texinfo-format-deftypefun) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3517 (defun texinfo-format-deftypefun (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3518 ;; 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
|
3519 ;; @deftypefun data-type name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3520 ;; In Info, `Function: data-type name ARGS' |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3521 ;; @deftypevar data-type name |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3522 ;; In Info, `Variable: data-type name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3523 ;; 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
|
3524 ;; 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
|
3525 (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
|
3526 (data-type (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3527 (name (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3528 (args (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3529 (insert " -- " category ": " data-type " " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3530 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3531 (insert " " (car args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3532 (setq args (cdr args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3533 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3534 ;; @defop: Generalized object-oriented |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3535 (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
|
3536 (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
|
3537 (defun texinfo-format-defop (parsed-args) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3538 ;; Generalized object oriented entity: |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3539 ;; @defop category class name args... |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3540 ;; 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
|
3541 ;; 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
|
3542 (let ((category (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3543 (class (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3544 (name (car (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3545 (args (cdr (cdr (cdr parsed-args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3546 (insert " -- " category " on " class ": " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3547 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3548 (insert " " (upcase (car args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3549 (setq args (cdr args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3550 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3551 ;; @defcv: Generalized object-oriented |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3552 (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
|
3553 (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
|
3554 (defun texinfo-format-defcv (parsed-args) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3555 ;; Generalized object oriented entity: |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3556 ;; @defcv category class name |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3557 ;; In Info, `Category of class: name' |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3558 ;; 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
|
3559 (let ((category (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3560 (class (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3561 (name (car (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3562 (args (cdr (cdr (cdr parsed-args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3563 (insert " -- " category " of " class ": " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3564 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3565 (insert " " (upcase (car args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3566 (setq args (cdr args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3567 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3568 ;; @defmethod: Specialized object-oriented |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3569 (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
|
3570 (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
|
3571 (defun texinfo-format-defmethod (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3572 ;; Specialized object oriented entity: |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3573 ;; @defmethod class name args... |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3574 ;; 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
|
3575 ;; 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
|
3576 ;; 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
|
3577 (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
|
3578 (class (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3579 (name (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3580 (args (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3581 (insert " -- " category " on " class ": " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3582 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3583 (insert " " (upcase (car args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3584 (setq args (cdr args))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3585 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3586 ;; @defivar: Specialized object-oriented |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3587 (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
|
3588 (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
|
3589 (defun texinfo-format-defivar (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3590 ;; Specialized object oriented entity: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3591 ;; @defivar class name |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3592 ;; 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
|
3593 ;; 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
|
3594 ;; 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
|
3595 (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
|
3596 (class (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3597 (name (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3598 (args (cdr (cdr parsed-args)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3599 (insert " -- " category " of " class ": " name) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3600 (while args |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3601 (insert " " (upcase (car args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3602 (setq args (cdr args))))) |
189 | 3603 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3604 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3605 ;;; Indexing for definitions |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3606 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3607 ;; 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
|
3608 ;; 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
|
3609 ;; formatted differently: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3610 ;; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3611 ;; @defun, |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3612 ;; @defmac, |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3613 ;; @defspec, |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3614 ;; @defvar, |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3615 ;; @defopt all use their 1st argument as the entry-proper |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3616 ;; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3617 ;; @deffn, |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3618 ;; @defvr, |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3619 ;; @deftp |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3620 ;; @deftypefun |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3621 ;; @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
|
3622 ;; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3623 ;; @deftypefn, |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3624 ;; @deftypevr both use their 3rd argument as the entry-proper |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3625 ;; |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3626 ;; @defmethod uses its 2nd and 1st arguments as an entry-proper |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3627 ;; formatted: NAME on CLASS |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3628 |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3629 ;; @defop uses its 3rd and 2nd arguments as an entry-proper |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3630 ;; formatted: NAME on CLASS |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3631 ;; |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3632 ;; @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
|
3633 ;; formatted: NAME of CLASS |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3634 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3635 ;; @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
|
3636 ;; formatted: NAME of CLASS |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3637 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3638 (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
|
3639 (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
|
3640 (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
|
3641 (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
|
3642 (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
|
3643 (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
|
3644 (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
|
3645 (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
|
3646 (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
|
3647 (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
|
3648 (defun texinfo-index-defun (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3649 ;; 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
|
3650 ;; `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
|
3651 (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
|
3652 (set index-list |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3653 (cons |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3654 ;; 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
|
3655 (list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3656 (car parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3657 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3658 ;; 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
|
3659 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3660 (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
|
3661 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3662 (symbol-value index-list))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3663 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3664 (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
|
3665 (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
|
3666 (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
|
3667 (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
|
3668 (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
|
3669 (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
|
3670 (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
|
3671 (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
|
3672 (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
|
3673 (put 'deftypevarx 'texinfo-defun-indexing-property 'texinfo-index-deffn) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3674 (defun texinfo-index-deffn (parsed-args) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3675 ;; 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
|
3676 ;; `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
|
3677 (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
|
3678 (set index-list |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3679 (cons |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3680 ;; 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
|
3681 (list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3682 (car (cdr parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3683 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3684 ;; 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
|
3685 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3686 (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
|
3687 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3688 (symbol-value index-list))))) |
189 | 3689 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3690 (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
|
3691 (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
|
3692 (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
|
3693 (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
|
3694 (defun texinfo-index-deftypefn (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3695 ;; 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
|
3696 ;; `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
|
3697 (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
|
3698 (set index-list |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3699 (cons |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3700 ;; 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
|
3701 (list |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3702 (car (cdr (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3703 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3704 ;; 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
|
3705 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3706 (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
|
3707 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3708 (symbol-value index-list))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3709 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3710 (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
|
3711 (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
|
3712 (defun texinfo-index-defmethod (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3713 ;; 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
|
3714 ;; `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
|
3715 (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
|
3716 (set index-list |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3717 (cons |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3718 ;; 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
|
3719 (list |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3720 (format "%s on %s" |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3721 (car (cdr parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3722 (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3723 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3724 ;; 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
|
3725 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3726 (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
|
3727 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3728 (symbol-value index-list))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3729 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3730 (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
|
3731 (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
|
3732 (defun texinfo-index-defop (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3733 ;; 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
|
3734 ;; `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
|
3735 (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
|
3736 (set index-list |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3737 (cons |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3738 ;; 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
|
3739 (list |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3740 (format "%s on %s" |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3741 (car (cdr (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3742 (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3743 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3744 ;; 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
|
3745 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3746 (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
|
3747 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3748 (symbol-value index-list))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3749 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3750 (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
|
3751 (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
|
3752 (defun texinfo-index-defivar (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3753 ;; 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
|
3754 ;; `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
|
3755 (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
|
3756 (set index-list |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3757 (cons |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3758 ;; 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
|
3759 (list |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3760 (format "%s of %s" |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3761 (car (cdr parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3762 (car parsed-args)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3763 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3764 ;; 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
|
3765 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3766 (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
|
3767 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3768 (symbol-value index-list))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3769 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3770 (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
|
3771 (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
|
3772 (defun texinfo-index-defcv (parsed-args) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3773 ;; 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
|
3774 ;; `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
|
3775 (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
|
3776 (set index-list |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3777 (cons |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3778 ;; 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
|
3779 (list |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3780 (format "%s of %s" |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3781 (car (cdr (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3782 (car (cdr parsed-args))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3783 texinfo-last-node |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3784 ;; 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
|
3785 (if texinfo-last-node-pos |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3786 (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
|
3787 1)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3788 (symbol-value index-list))))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3789 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3790 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3791 ;;; Properties for definitions |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3792 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3793 ;; Each definition command has six properties: |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3794 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3795 ;; 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
|
3796 ;; 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
|
3797 ;; 3. texinfo-format formatting command |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3798 ;; 4. texinfo-end end formatting command |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3799 ;; 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
|
3800 ;; 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
|
3801 ;; |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3802 ;; 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
|
3803 ;; and subsequent header lines. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3804 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3805 ;; 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
|
3806 ;; are listed just before the appropriate formatting and indexing commands. |
189 | 3807 |
3808 (put 'deffn 'texinfo-format 'texinfo-format-defun) | |
3809 (put 'deffnx 'texinfo-format 'texinfo-format-defunx) | |
3810 (put 'deffn 'texinfo-end 'texinfo-end-defun) | |
3811 (put 'deffn 'texinfo-defun-type '('deffn-type nil)) | |
3812 (put 'deffnx 'texinfo-defun-type '('deffn-type nil)) | |
3813 (put 'deffn 'texinfo-defun-index 'texinfo-findex) | |
3814 (put 'deffnx 'texinfo-defun-index 'texinfo-findex) | |
3815 | |
3816 (put 'defun 'texinfo-format 'texinfo-format-defun) | |
3817 (put 'defunx 'texinfo-format 'texinfo-format-defunx) | |
3818 (put 'defun 'texinfo-end 'texinfo-end-defun) | |
3819 (put 'defun 'texinfo-defun-type '('defun-type "Function")) | |
3820 (put 'defunx 'texinfo-defun-type '('defun-type "Function")) | |
3821 (put 'defun 'texinfo-defun-index 'texinfo-findex) | |
3822 (put 'defunx 'texinfo-defun-index 'texinfo-findex) | |
3823 | |
3824 (put 'defmac 'texinfo-format 'texinfo-format-defun) | |
3825 (put 'defmacx 'texinfo-format 'texinfo-format-defunx) | |
3826 (put 'defmac 'texinfo-end 'texinfo-end-defun) | |
3827 (put 'defmac 'texinfo-defun-type '('defun-type "Macro")) | |
3828 (put 'defmacx 'texinfo-defun-type '('defun-type "Macro")) | |
3829 (put 'defmac 'texinfo-defun-index 'texinfo-findex) | |
3830 (put 'defmacx 'texinfo-defun-index 'texinfo-findex) | |
3831 | |
3832 (put 'defspec 'texinfo-format 'texinfo-format-defun) | |
3833 (put 'defspecx 'texinfo-format 'texinfo-format-defunx) | |
3834 (put 'defspec 'texinfo-end 'texinfo-end-defun) | |
3835 (put 'defspec 'texinfo-defun-type '('defun-type "Special form")) | |
3836 (put 'defspecx 'texinfo-defun-type '('defun-type "Special form")) | |
3837 (put 'defspec 'texinfo-defun-index 'texinfo-findex) | |
3838 (put 'defspecx 'texinfo-defun-index 'texinfo-findex) | |
3839 | |
3840 (put 'defvr 'texinfo-format 'texinfo-format-defun) | |
3841 (put 'defvrx 'texinfo-format 'texinfo-format-defunx) | |
3842 (put 'defvr 'texinfo-end 'texinfo-end-defun) | |
3843 (put 'defvr 'texinfo-defun-type '('deffn-type nil)) | |
3844 (put 'defvrx 'texinfo-defun-type '('deffn-type nil)) | |
3845 (put 'defvr 'texinfo-defun-index 'texinfo-vindex) | |
3846 (put 'defvrx 'texinfo-defun-index 'texinfo-vindex) | |
3847 | |
3848 (put 'defvar 'texinfo-format 'texinfo-format-defun) | |
3849 (put 'defvarx 'texinfo-format 'texinfo-format-defunx) | |
3850 (put 'defvar 'texinfo-end 'texinfo-end-defun) | |
3851 (put 'defvar 'texinfo-defun-type '('defun-type "Variable")) | |
3852 (put 'defvarx 'texinfo-defun-type '('defun-type "Variable")) | |
3853 (put 'defvar 'texinfo-defun-index 'texinfo-vindex) | |
3854 (put 'defvarx 'texinfo-defun-index 'texinfo-vindex) | |
3855 | |
3856 (put 'defconst 'texinfo-format 'texinfo-format-defun) | |
3857 (put 'defconstx 'texinfo-format 'texinfo-format-defunx) | |
3858 (put 'defconst 'texinfo-end 'texinfo-end-defun) | |
3859 (put 'defconst 'texinfo-defun-type '('defun-type "Constant")) | |
3860 (put 'defconstx 'texinfo-defun-type '('defun-type "Constant")) | |
3861 (put 'defconst 'texinfo-defun-index 'texinfo-vindex) | |
3862 (put 'defconstx 'texinfo-defun-index 'texinfo-vindex) | |
3863 | |
3864 (put 'defcmd 'texinfo-format 'texinfo-format-defun) | |
3865 (put 'defcmdx 'texinfo-format 'texinfo-format-defunx) | |
3866 (put 'defcmd 'texinfo-end 'texinfo-end-defun) | |
3867 (put 'defcmd 'texinfo-defun-type '('defun-type "Command")) | |
3868 (put 'defcmdx 'texinfo-defun-type '('defun-type "Command")) | |
3869 (put 'defcmd 'texinfo-defun-index 'texinfo-findex) | |
3870 (put 'defcmdx 'texinfo-defun-index 'texinfo-findex) | |
3871 | |
3872 (put 'defopt 'texinfo-format 'texinfo-format-defun) | |
3873 (put 'defoptx 'texinfo-format 'texinfo-format-defunx) | |
3874 (put 'defopt 'texinfo-end 'texinfo-end-defun) | |
3875 (put 'defopt 'texinfo-defun-type '('defun-type "User Option")) | |
3876 (put 'defoptx 'texinfo-defun-type '('defun-type "User Option")) | |
3877 (put 'defopt 'texinfo-defun-index 'texinfo-vindex) | |
3878 (put 'defoptx 'texinfo-defun-index 'texinfo-vindex) | |
3879 | |
3880 (put 'deftp 'texinfo-format 'texinfo-format-defun) | |
3881 (put 'deftpx 'texinfo-format 'texinfo-format-defunx) | |
3882 (put 'deftp 'texinfo-end 'texinfo-end-defun) | |
3883 (put 'deftp 'texinfo-defun-type '('deftp-type nil)) | |
3884 (put 'deftpx 'texinfo-defun-type '('deftp-type nil)) | |
3885 (put 'deftp 'texinfo-defun-index 'texinfo-tindex) | |
3886 (put 'deftpx 'texinfo-defun-index 'texinfo-tindex) | |
3887 | |
3888 ;;; Object-oriented stuff is a little hairier. | |
3889 | |
3890 (put 'defop 'texinfo-format 'texinfo-format-defun) | |
3891 (put 'defopx 'texinfo-format 'texinfo-format-defunx) | |
3892 (put 'defop 'texinfo-end 'texinfo-end-defun) | |
3893 (put 'defop 'texinfo-defun-type '('defop-type nil)) | |
3894 (put 'defopx 'texinfo-defun-type '('defop-type nil)) | |
3895 (put 'defop 'texinfo-defun-index 'texinfo-findex) | |
3896 (put 'defopx 'texinfo-defun-index 'texinfo-findex) | |
3897 | |
3898 (put 'defmethod 'texinfo-format 'texinfo-format-defun) | |
3899 (put 'defmethodx 'texinfo-format 'texinfo-format-defunx) | |
3900 (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
|
3901 (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
|
3902 (put 'defmethodx 'texinfo-defun-type '('defmethod-type "Method")) |
189 | 3903 (put 'defmethod 'texinfo-defun-index 'texinfo-findex) |
3904 (put 'defmethodx 'texinfo-defun-index 'texinfo-findex) | |
3905 | |
3906 (put 'defcv 'texinfo-format 'texinfo-format-defun) | |
3907 (put 'defcvx 'texinfo-format 'texinfo-format-defunx) | |
3908 (put 'defcv 'texinfo-end 'texinfo-end-defun) | |
3909 (put 'defcv 'texinfo-defun-type '('defop-type nil)) | |
3910 (put 'defcvx 'texinfo-defun-type '('defop-type nil)) | |
3911 (put 'defcv 'texinfo-defun-index 'texinfo-vindex) | |
3912 (put 'defcvx 'texinfo-defun-index 'texinfo-vindex) | |
3913 | |
3914 (put 'defivar 'texinfo-format 'texinfo-format-defun) | |
3915 (put 'defivarx 'texinfo-format 'texinfo-format-defunx) | |
3916 (put 'defivar 'texinfo-end 'texinfo-end-defun) | |
3917 (put 'defivar 'texinfo-defun-type '('defmethod-type "Instance variable")) | |
3918 (put 'defivarx 'texinfo-defun-type '('defmethod-type "Instance variable")) | |
3919 (put 'defivar 'texinfo-defun-index 'texinfo-vindex) | |
3920 (put 'defivarx 'texinfo-defun-index 'texinfo-vindex) | |
3921 | |
3922 ;;; Typed functions and variables | |
3923 | |
3924 (put 'deftypefn 'texinfo-format 'texinfo-format-defun) | |
3925 (put 'deftypefnx 'texinfo-format 'texinfo-format-defunx) | |
3926 (put 'deftypefn 'texinfo-end 'texinfo-end-defun) | |
3927 (put 'deftypefn 'texinfo-defun-type '('deftypefn-type nil)) | |
3928 (put 'deftypefnx 'texinfo-defun-type '('deftypefn-type nil)) | |
3929 (put 'deftypefn 'texinfo-defun-index 'texinfo-findex) | |
3930 (put 'deftypefnx 'texinfo-defun-index 'texinfo-findex) | |
3931 | |
3932 (put 'deftypefun 'texinfo-format 'texinfo-format-defun) | |
3933 (put 'deftypefunx 'texinfo-format 'texinfo-format-defunx) | |
3934 (put 'deftypefun 'texinfo-end 'texinfo-end-defun) | |
3935 (put 'deftypefun 'texinfo-defun-type '('deftypefun-type "Function")) | |
3936 (put 'deftypefunx 'texinfo-defun-type '('deftypefun-type "Function")) | |
3937 (put 'deftypefun 'texinfo-defun-index 'texinfo-findex) | |
3938 (put 'deftypefunx 'texinfo-defun-index 'texinfo-findex) | |
3939 | |
3940 (put 'deftypevr 'texinfo-format 'texinfo-format-defun) | |
3941 (put 'deftypevrx 'texinfo-format 'texinfo-format-defunx) | |
3942 (put 'deftypevr 'texinfo-end 'texinfo-end-defun) | |
3943 (put 'deftypevr 'texinfo-defun-type '('deftypefn-type nil)) | |
3944 (put 'deftypevrx 'texinfo-defun-type '('deftypefn-type nil)) | |
3945 (put 'deftypevr 'texinfo-defun-index 'texinfo-vindex) | |
3946 (put 'deftypevrx 'texinfo-defun-index 'texinfo-vindex) | |
3947 | |
3948 (put 'deftypevar 'texinfo-format 'texinfo-format-defun) | |
3949 (put 'deftypevarx 'texinfo-format 'texinfo-format-defunx) | |
3950 (put 'deftypevar 'texinfo-end 'texinfo-end-defun) | |
3951 (put 'deftypevar 'texinfo-defun-type '('deftypevar-type "Variable")) | |
3952 (put 'deftypevarx 'texinfo-defun-type '('deftypevar-type "Variable")) | |
3953 (put 'deftypevar 'texinfo-defun-index 'texinfo-vindex) | |
3954 (put 'deftypevarx 'texinfo-defun-index 'texinfo-vindex) | |
3955 | |
3956 | |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3957 ;;; @set, @clear, @ifset, @ifclear |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3958 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3959 ;; 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
|
3960 ;; 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
|
3961 ;; @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
|
3962 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3963 ;; 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
|
3964 ;; 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
|
3965 ;; @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
|
3966 ;; is the opposite of @ifset. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3967 |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3968 ;; If a flag is set to a string with @set FLAG, |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3969 ;; replace @value{FLAG} with the string. |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3970 ;; If a flag with a value is cleared, |
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
3971 ;; @value{FLAG} is invalid, |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3972 ;; 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
|
3973 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3974 (put 'clear 'texinfo-format 'texinfo-clear) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3975 (defun texinfo-clear () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3976 "Clear the value of the flag." |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3977 (let* ((arg (texinfo-parse-arg-discard)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3978 (flag (car (read-from-string arg))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3979 (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
|
3980 (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
|
3981 (put flag 'texinfo-set-value ""))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3982 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3983 (put 'set 'texinfo-format 'texinfo-set) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3984 (defun texinfo-set () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3985 "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
|
3986 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
|
3987 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
|
3988 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
|
3989 (let* ((arg (texinfo-parse-arg-discard)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3990 (flag (car (read-from-string arg))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3991 (value (substring arg (cdr (read-from-string arg))))) |
37538
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
3992 (if (string-match "^[ \t]+" value) |
92c065fa43f6
(texinfo-format-parse-args): Don't
Gerd Moellmann <gerd@gnu.org>
parents:
36300
diff
changeset
|
3993 (setq value (substring value (match-end 0)))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3994 (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
|
3995 (put flag 'texinfo-set-value value))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3996 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3997 (put 'value 'texinfo-format 'texinfo-value) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3998 (defun texinfo-value () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
3999 "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
|
4000 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
|
4001 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
|
4002 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
|
4003 (let ((arg (texinfo-parse-arg-discard))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4004 (cond ((and |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4005 (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
|
4006 'flag-set) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4007 (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
|
4008 (insert (get (car (read-from-string arg)) 'texinfo-set-value))) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
4009 ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4010 'flag-cleared) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4011 (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
|
4012 ((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
|
4013 (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
|
4014 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4015 (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
|
4016 (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
|
4017 (defun texinfo-if-set () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4018 "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
|
4019 (let ((arg (texinfo-parse-arg-discard))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4020 (cond |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4021 ((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
|
4022 'flag-set) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4023 ;; 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
|
4024 ()) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4025 ((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
|
4026 'flag-cleared) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4027 ;; 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
|
4028 (delete-region texinfo-command-start |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
4029 (re-search-forward "@end ifset[ \t]*\n"))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4030 ((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
|
4031 nil) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
4032 ;; In this case flag is neither set nor cleared. |
5118
eec34ce70181
(texinfo-if-set, texinfo-if-clear): Act appropriately when flat neither
Robert J. Chassell <bob@rattlesnake.com>
parents:
4982
diff
changeset
|
4033 ;; 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
|
4034 ())))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4035 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4036 (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
|
4037 (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
|
4038 (defun texinfo-if-clear () |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4039 "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
|
4040 (let ((arg (texinfo-parse-arg-discard))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4041 (cond |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4042 ((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
|
4043 'flag-set) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4044 ;; 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
|
4045 (delete-region texinfo-command-start |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
4046 (re-search-forward "@end ifclear[ \t]*\n"))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4047 ((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
|
4048 'flag-cleared) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4049 ;; 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
|
4050 ()) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4051 ((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
|
4052 nil) |
49599
5ade352e8d1c
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
48932
diff
changeset
|
4053 ;; In this case flag is neither set nor cleared. |
5118
eec34ce70181
(texinfo-if-set, texinfo-if-clear): Act appropriately when flat neither
Robert J. Chassell <bob@rattlesnake.com>
parents:
4982
diff
changeset
|
4054 ;; 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
|
4055 ())))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4056 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4057 ;;; @ifeq |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4058 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4059 (put 'ifeq 'texinfo-format 'texinfo-format-ifeq) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4060 (defun texinfo-format-ifeq () |
17939
533508e3c425
(texinfo-extra-inter-column-width):
Richard M. Stallman <rms@gnu.org>
parents:
17938
diff
changeset
|
4061 "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
|
4062 Otherwise produces no output. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4063 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4064 Thus: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4065 @ifeq{ arg1 , arg1 , @code{foo}} bar |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4066 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4067 ==> `foo' bar. |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4068 but |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4069 @ifeq{ arg1 , arg2 , @code{foo}} bar |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4070 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4071 ==> bar |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4072 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4073 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
|
4074 the @ifeq command." |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4075 ;; 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
|
4076 (goto-char texinfo-command-end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4077 (let* ((case-fold-search t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4078 (stop (save-excursion (forward-sexp 1) (point))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4079 start end |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4080 ;; @ifeq{arg1, arg2, @command{optional-args}} |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4081 (arg1 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4082 (progn |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4083 (forward-char 1) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4084 (skip-chars-forward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4085 (setq start (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4086 (search-forward "," stop t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4087 (skip-chars-backward ", ") |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
4088 (buffer-substring-no-properties start (point)))) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4089 (arg2 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4090 (progn |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4091 (search-forward "," stop t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4092 (skip-chars-forward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4093 (setq start (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4094 (search-forward "," stop t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4095 (skip-chars-backward ", ") |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
4096 (buffer-substring-no-properties start (point)))) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4097 (texinfo-command |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4098 (progn |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4099 (search-forward "," stop t) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4100 (skip-chars-forward " ") |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4101 (setq start (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4102 (goto-char (1- stop)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4103 (skip-chars-backward " ") |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
4104 (buffer-substring-no-properties start (point))))) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4105 (delete-region texinfo-command-start stop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4106 (if (equal arg1 arg2) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4107 (insert texinfo-command)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4108 (goto-char texinfo-command-start))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4109 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4110 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4111 ;;; Process included files: `@include' command |
189 | 4112 |
4113 ;; Updated 19 October 1990 | |
4114 ;; In the original version, include files were ignored by Info but | |
4115 ;; incorporated in to the printed manual. To make references to the | |
4116 ;; included file, the Texinfo source file has to refer to the included | |
14040 | 4117 ;; files using the `(filename)nodename' format for referring to other |
189 | 4118 ;; Info files. Also, the included files had to be formatted on their |
4119 ;; own. It was just like they were another file. | |
4120 | |
4121 ;; Currently, include files are inserted into the buffer that is | |
4122 ;; formatted for Info. If large, the resulting info file is split and | |
4123 ;; tagified. For current include files to work, the master menu must | |
4124 ;; refer to all the nodes, and the highest level nodes in the include | |
4125 ;; files must have the correct next, prev, and up pointers. | |
4126 | |
4127 ;; 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
|
4128 ;; but not an `\input texinfo' line. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4129 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4130 ;; Updated 24 March 1993 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4131 ;; 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
|
4132 ;; 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
|
4133 ;; 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
|
4134 ;; is treated like other @-commands. |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4135 (put 'include 'texinfo-format 'texinfo-format-noop) |
189 | 4136 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4137 ;; Original definition: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4138 ;; (defun texinfo-format-include () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4139 ;; (let ((filename (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4140 ;; (default-directory input-directory) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4141 ;; subindex) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4142 ;; (setq subindex |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4143 ;; (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4144 ;; (progn (find-file |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4145 ;; (cond ((file-readable-p (concat filename ".texinfo")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4146 ;; (concat filename ".texinfo")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4147 ;; ((file-readable-p (concat filename ".texi")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4148 ;; (concat filename ".texi")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4149 ;; ((file-readable-p (concat filename ".tex")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4150 ;; (concat filename ".tex")) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4151 ;; ((file-readable-p filename) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4152 ;; filename) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4153 ;; (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
|
4154 ;; filename)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4155 ;; (texinfo-format-buffer-1)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4156 ;; (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
|
4157 ;; (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
|
4158 ;; (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
|
4159 ;; (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
|
4160 ;; (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
|
4161 ;; (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
|
4162 ;; |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4163 ;;(defun texinfo-subindex (indexvar file content) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4164 ;; (set indexvar (cons (list 'recurse file content) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4165 ;; (symbol-value indexvar)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4166 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4167 ;; Second definition: |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4168 ;; (put 'include 'texinfo-format 'texinfo-format-include) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4169 ;; (defun texinfo-format-include () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4170 ;; (let ((filename (concat input-directory |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4171 ;; (texinfo-parse-arg-discard))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4172 ;; (default-directory input-directory)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4173 ;; (message "Reading: %s" filename) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4174 ;; (save-excursion |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4175 ;; (save-restriction |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4176 ;; (narrow-to-region |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4177 ;; (point) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4178 ;; (+ (point) (car (cdr (insert-file-contents filename))))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4179 ;; (goto-char (point-min)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4180 ;; (texinfo-append-refill) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4181 ;; (texinfo-format-convert (point-min) (point-max)))) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4182 ;; (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
|
4183 ;; )) |
189 | 4184 |
4185 | |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4186 ;;; 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
|
4187 ;; 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
|
4188 |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4189 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4190 ;;; 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
|
4191 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4192 (put 'b 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4193 (put 'i 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4194 (put 'r 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4195 (put 't 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4196 (put 'w 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4197 (put 'asis 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4198 (put 'dmn 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4199 (put 'math 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4200 (put 'titlefont 'texinfo-format 'texinfo-format-noop) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4201 (defun texinfo-format-noop () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4202 (insert (texinfo-parse-arg-discard)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4203 (goto-char texinfo-command-start)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4204 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4205 ;; @hyphenation command discards an argument within braces |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4206 (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
|
4207 (defun texinfo-discard-command-and-arg () |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4208 "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
|
4209 (goto-char texinfo-command-end) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4210 (forward-list 1) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4211 (setq texinfo-command-end (point)) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4212 (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
|
4213 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4214 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4215 ;;; 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
|
4216 ;; 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
|
4217 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4218 (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
|
4219 (put 'smallbook 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4220 (put 'finalout 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4221 (put 'overfullrule 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4222 (put 'smallbreak 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4223 (put 'medbreak 'texinfo-format 'texinfo-discard-line) |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4224 (put 'bigbreak 'texinfo-format 'texinfo-discard-line) |
48063
4cef5030d270
(texinfo-format-ifplaintext): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
43808
diff
changeset
|
4225 (put 'afourpaper 'texinfo-format 'texinfo-discard-line) |
48755
a4aa559a2dec
Fix typos found by TAKAHASHI Kaoru <kaoru@kaisei.org>.
Robert J. Chassell <bob@rattlesnake.com>
parents:
48697
diff
changeset
|
4226 (put 'afivepaper 'texinfo-format 'texinfo-discard-line) |
a4aa559a2dec
Fix typos found by TAKAHASHI Kaoru <kaoru@kaisei.org>.
Robert J. Chassell <bob@rattlesnake.com>
parents:
48697
diff
changeset
|
4227 (put 'afourlatex 'texinfo-format 'texinfo-discard-line) |
a4aa559a2dec
Fix typos found by TAKAHASHI Kaoru <kaoru@kaisei.org>.
Robert J. Chassell <bob@rattlesnake.com>
parents:
48697
diff
changeset
|
4228 (put 'afourwide 'texinfo-format 'texinfo-discard-line) |
17937
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4229 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4230 |
4a8e23659626
(texinfmt-version): New function and variable.
Richard M. Stallman <rms@gnu.org>
parents:
15985
diff
changeset
|
4231 ;;; 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
|
4232 |
189 | 4233 (put 'c 'texinfo-format 'texinfo-discard-line-with-args) |
4234 (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
|
4235 (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
|
4236 (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
|
4237 (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
|
4238 (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
|
4239 (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
|
4240 (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
|
4241 (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
|
4242 (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
|
4243 (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
|
4244 (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
|
4245 |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4246 ;; @novalidate suppresses cross-reference checking and auxiliary file |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4247 ;; 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
|
4248 ;; 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
|
4249 ;; is not invoked automatically, the @novalidate command is irrelevant |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4250 ;; and not supported by texinfmt.el |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4251 (put 'novalidate 'texinfo-format 'texinfo-discard-line-with-args) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4252 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4253 (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
|
4254 (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
|
4255 (put 'parindent 'texinfo-format 'texinfo-discard-line-with-args) |
189 | 4256 (put 'setchapternewpage 'texinfo-format 'texinfo-discard-line-with-args) |
4257 (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
|
4258 |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4259 (put 'setcontentsaftertitlepage |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4260 'texinfo-format 'texinfo-discard-line-with-args) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4261 (put 'setshortcontentsaftertitlepage |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4262 'texinfo-format 'texinfo-discard-line-with-args) |
c47e86637371
(texinfmt-version): Update version.
Richard M. Stallman <rms@gnu.org>
parents:
22661
diff
changeset
|
4263 |
189 | 4264 (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
|
4265 (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
|
4266 (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
|
4267 (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
|
4268 (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
|
4269 (put 'input 'texinfo-format 'texinfo-discard-line-with-args) |
189 | 4270 |
48063
4cef5030d270
(texinfo-format-ifplaintext): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
43808
diff
changeset
|
4271 (put 'documentlanguage 'texinfo-format 'texinfo-discard-line-with-args) |
4cef5030d270
(texinfo-format-ifplaintext): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
43808
diff
changeset
|
4272 (put 'documentencoding 'texinfo-format 'texinfo-discard-line-with-args) |
4cef5030d270
(texinfo-format-ifplaintext): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
43808
diff
changeset
|
4273 |
4cef5030d270
(texinfo-format-ifplaintext): New function.
Juanma Barranquero <lekktu@gmail.com>
parents:
43808
diff
changeset
|
4274 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4275 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4276 ;;; Some commands cannot be handled |
189 | 4277 |
4278 (defun texinfo-unsupported () | |
4279 (error "%s is not handled by texinfo" | |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
4280 (buffer-substring-no-properties texinfo-command-start texinfo-command-end))) |
189 | 4281 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4282 ;;; Batch formatting |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4283 |
189 | 4284 (defun batch-texinfo-format () |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4285 "Runs texinfo-format-buffer on the files remaining on the command line. |
189 | 4286 Must be used only with -batch, and kills emacs on completion. |
4287 Each file will be processed even if an error occurred previously. | |
4288 For example, invoke | |
4289 \"emacs -batch -funcall batch-texinfo-format $docs/ ~/*.texinfo\"." | |
4290 (if (not noninteractive) | |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38044
diff
changeset
|
4291 (error "batch-texinfo-format may only be used -batch")) |
189 | 4292 (let ((version-control t) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4293 (auto-save-default nil) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4294 (find-file-run-dired nil) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4295 (kept-old-versions 259259) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4296 (kept-new-versions 259259)) |
189 | 4297 (let ((error 0) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4298 file |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4299 (files ())) |
189 | 4300 (while command-line-args-left |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4301 (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
|
4302 (cond ((not (file-exists-p file)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4303 (message ">> %s does not exist!" file) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4304 (setq error 1 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4305 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
|
4306 ((file-directory-p file) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4307 (setq command-line-args-left |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4308 (nconc (directory-files file) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4309 (cdr command-line-args-left)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4310 (t |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4311 (setq files (cons file files) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4312 command-line-args-left (cdr command-line-args-left))))) |
189 | 4313 (while files |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4314 (setq file (car files) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4315 files (cdr files)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4316 (condition-case err |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4317 (progn |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4318 (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
|
4319 (find-file file) |
4769
d1b5ca8f5493
(texinfo-format-region texinfo-format-buffer): Add ###autoload cookies.
Brian Fox <bfox@gnu.org>
parents:
4396
diff
changeset
|
4320 (buffer-disable-undo (current-buffer)) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4321 (set-buffer-modified-p nil) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4322 (texinfo-mode) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4323 (message "texinfo formatting %s..." file) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4324 (texinfo-format-buffer nil) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4325 (if (buffer-modified-p) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4326 (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
|
4327 (save-buffer)))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4328 (error |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4329 (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
|
4330 (message ">> point at") |
48518
0eb01081d9f5
(texinfo-format-separate-node): Handle node names with
Robert J. Chassell <bob@rattlesnake.com>
parents:
48063
diff
changeset
|
4331 (let ((s (buffer-substring-no-properties (point) |
49700
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
4332 (min (+ (point) 100) |
176bfa5ffebf
(texinfo-format-iftex, texinfo-format-ifhtml)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
49599
diff
changeset
|
4333 (point-max)))) |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4334 (tem 0)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4335 (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
|
4336 (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
|
4337 "\n>> " |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4338 (substring s (match-end 0))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4339 tem (1+ tem))) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4340 (message ">> %s" s)) |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4341 (setq error 1)))) |
189 | 4342 (kill-emacs error)))) |
657
fec3f9a1e3e5
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
4343 |
4396
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4344 |
0ab53cbfac0e
Installed the version from the Texinfo package.
Richard M. Stallman <rms@gnu.org>
parents:
3591
diff
changeset
|
4345 ;;; Place `provide' at end of file. |
3456 | 4346 (provide 'texinfmt) |
4347 | |
52401 | 4348 ;;; arch-tag: 1e8d9a2d-bca0-40a0-ac6c-dab01bc6f725 |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
38044
diff
changeset
|
4349 ;;; texinfmt.el ends here |