diff options
| author | Stefan Monnier | 2007-06-27 18:06:14 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-06-27 18:06:14 +0000 |
| commit | 36c6bc15c8318993963538825307eefb8a3eecc6 (patch) | |
| tree | 4635bbb7f9f6e6eac554bc496b07f5d320681ad7 | |
| parent | 231f3e6680c74c10152a3bf9cefd2eea2655b607 (diff) | |
| download | emacs-36c6bc15c8318993963538825307eefb8a3eecc6.tar.gz emacs-36c6bc15c8318993963538825307eefb8a3eecc6.zip | |
(texinfo-raisesections-alist, texinfo-lowersections-alist): Merge definition
and declaration.
(texinfo-start-of-header, texinfo-end-of-header): Remove.
(texinfo-format-syntax-table): Merge init into declaration.
(texinfo-format-parse-line-args, texinfo-format-parse-args)
(texinfo-format-parse-defun-args, texinfo-format-node)
(texinfo-push-stack, texinfo-multitable-widths)
(texinfo-define-info-enclosure, texinfo-alias)
(texinfo-format-defindex, batch-texinfo-format): Use push.
(texinfo-footnote-number): Remove duplicate declaration.
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/textmodes/texinfmt.el | 248 |
2 files changed, 125 insertions, 134 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bb1badfa481..807f51f3c89 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,16 @@ | |||
| 1 | 2007-06-27 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-06-27 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * textmodes/texinfmt.el (texinfo-raisesections-alist) | ||
| 4 | (texinfo-lowersections-alist): Merge definition and declaration. | ||
| 5 | (texinfo-start-of-header, texinfo-end-of-header): Remove. | ||
| 6 | (texinfo-format-syntax-table): Merge init into declaration. | ||
| 7 | (texinfo-format-parse-line-args, texinfo-format-parse-args) | ||
| 8 | (texinfo-format-parse-defun-args, texinfo-format-node) | ||
| 9 | (texinfo-push-stack, texinfo-multitable-widths) | ||
| 10 | (texinfo-define-info-enclosure, texinfo-alias) | ||
| 11 | (texinfo-format-defindex, batch-texinfo-format): Use push. | ||
| 12 | (texinfo-footnote-number): Remove duplicate declaration. | ||
| 13 | |||
| 3 | * ps-print.el: Update with auto-generated autoloads. | 14 | * ps-print.el: Update with auto-generated autoloads. |
| 4 | 15 | ||
| 5 | * ps-mule.el: Set generated-autoload-file to "ps-print.el". | 16 | * ps-mule.el: Set generated-autoload-file to "ps-print.el". |
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index 577eb2e1938..9f576b09db3 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el | |||
| @@ -57,8 +57,6 @@ If optional argument HERE is non-nil, insert info at point." | |||
| 57 | (require 'texinfo) ; So `texinfo-footnote-style' is defined. | 57 | (require 'texinfo) ; So `texinfo-footnote-style' is defined. |
| 58 | (require 'texnfo-upd) ; So `texinfo-section-types-regexp' is defined. | 58 | (require 'texnfo-upd) ; So `texinfo-section-types-regexp' is defined. |
| 59 | 59 | ||
| 60 | (defvar texinfo-format-syntax-table nil) | ||
| 61 | |||
| 62 | (defvar texinfo-vindex) | 60 | (defvar texinfo-vindex) |
| 63 | (defvar texinfo-findex) | 61 | (defvar texinfo-findex) |
| 64 | (defvar texinfo-cindex) | 62 | (defvar texinfo-cindex) |
| @@ -81,27 +79,80 @@ If optional argument HERE is non-nil, insert info at point." | |||
| 81 | (defvar texinfo-short-index-format-cmds-alist) | 79 | (defvar texinfo-short-index-format-cmds-alist) |
| 82 | (defvar texinfo-format-filename) | 80 | (defvar texinfo-format-filename) |
| 83 | (defvar texinfo-footnote-number) | 81 | (defvar texinfo-footnote-number) |
| 84 | (defvar texinfo-start-of-header) | 82 | |
| 85 | (defvar texinfo-end-of-header) | 83 | (defvar texinfo-raisesections-alist |
| 86 | (defvar texinfo-raisesections-alist) | 84 | '((@chapter . @chapter) ; Cannot go higher |
| 87 | (defvar texinfo-lowersections-alist) | 85 | (@unnumbered . @unnumbered) |
| 86 | (@centerchap . @unnumbered) | ||
| 87 | |||
| 88 | (@majorheading . @majorheading) | ||
| 89 | (@chapheading . @chapheading) | ||
| 90 | (@appendix . @appendix) | ||
| 91 | |||
| 92 | (@section . @chapter) | ||
| 93 | (@unnumberedsec . @unnumbered) | ||
| 94 | (@heading . @chapheading) | ||
| 95 | (@appendixsec . @appendix) | ||
| 96 | |||
| 97 | (@subsection . @section) | ||
| 98 | (@unnumberedsubsec . @unnumberedsec) | ||
| 99 | (@subheading . @heading) | ||
| 100 | (@appendixsubsec . @appendixsec) | ||
| 101 | |||
| 102 | (@subsubsection . @subsection) | ||
| 103 | (@unnumberedsubsubsec . @unnumberedsubsec) | ||
| 104 | (@subsubheading . @subheading) | ||
| 105 | (@appendixsubsubsec . @appendixsubsec)) | ||
| 106 | "*An alist of next higher levels for chapters, sections, etc... | ||
| 107 | For example, section to chapter, subsection to section. | ||
| 108 | Used by `texinfo-raise-lower-sections'. | ||
| 109 | The keys specify types of section; the values correspond to the next | ||
| 110 | higher types.") | ||
| 111 | |||
| 112 | (defvar texinfo-lowersections-alist | ||
| 113 | '((@chapter . @section) | ||
| 114 | (@unnumbered . @unnumberedsec) | ||
| 115 | (@centerchap . @unnumberedsec) | ||
| 116 | (@majorheading . @heading) | ||
| 117 | (@chapheading . @heading) | ||
| 118 | (@appendix . @appendixsec) | ||
| 119 | |||
| 120 | (@section . @subsection) | ||
| 121 | (@unnumberedsec . @unnumberedsubsec) | ||
| 122 | (@heading . @subheading) | ||
| 123 | (@appendixsec . @appendixsubsec) | ||
| 124 | |||
| 125 | (@subsection . @subsubsection) | ||
| 126 | (@unnumberedsubsec . @unnumberedsubsubsec) | ||
| 127 | (@subheading . @subsubheading) | ||
| 128 | (@appendixsubsec . @appendixsubsubsec) | ||
| 129 | |||
| 130 | (@subsubsection . @subsubsection) ; Cannot go lower. | ||
| 131 | (@unnumberedsubsubsec . @unnumberedsubsubsec) | ||
| 132 | (@subsubheading . @subsubheading) | ||
| 133 | (@appendixsubsubsec . @appendixsubsubsec)) | ||
| 134 | "*An alist of next lower levels for chapters, sections, etc... | ||
| 135 | For example, chapter to section, section to subsection. | ||
| 136 | Used by `texinfo-raise-lower-sections'. | ||
| 137 | The keys specify types of section; the values correspond to the next | ||
| 138 | lower types.") | ||
| 88 | 139 | ||
| 89 | ;;; Syntax table | 140 | ;;; Syntax table |
| 90 | 141 | ||
| 91 | (if texinfo-format-syntax-table | 142 | (defvar texinfo-format-syntax-table |
| 92 | nil | 143 | (let ((st (make-syntax-table))) |
| 93 | (setq texinfo-format-syntax-table (make-syntax-table)) | 144 | (modify-syntax-entry ?\" " " st) |
| 94 | (modify-syntax-entry ?\" " " texinfo-format-syntax-table) | 145 | (modify-syntax-entry ?\\ " " st) |
| 95 | (modify-syntax-entry ?\\ " " texinfo-format-syntax-table) | 146 | (modify-syntax-entry ?@ "\\" st) |
| 96 | (modify-syntax-entry ?@ "\\" texinfo-format-syntax-table) | 147 | (modify-syntax-entry ?\^q "\\" st) |
| 97 | (modify-syntax-entry ?\^q "\\" texinfo-format-syntax-table) | 148 | (modify-syntax-entry ?\[ "." st) |
| 98 | (modify-syntax-entry ?\[ "." texinfo-format-syntax-table) | 149 | (modify-syntax-entry ?\] "." st) |
| 99 | (modify-syntax-entry ?\] "." texinfo-format-syntax-table) | 150 | (modify-syntax-entry ?\( "." st) |
| 100 | (modify-syntax-entry ?\( "." texinfo-format-syntax-table) | 151 | (modify-syntax-entry ?\) "." st) |
| 101 | (modify-syntax-entry ?\) "." texinfo-format-syntax-table) | 152 | (modify-syntax-entry ?{ "(}" st) |
| 102 | (modify-syntax-entry ?{ "(}" texinfo-format-syntax-table) | 153 | (modify-syntax-entry ?} "){" st) |
| 103 | (modify-syntax-entry ?} "){" texinfo-format-syntax-table) | 154 | (modify-syntax-entry ?\' "." st) |
| 104 | (modify-syntax-entry ?\' "." texinfo-format-syntax-table)) | 155 | st)) |
| 105 | 156 | ||
| 106 | 157 | ||
| 107 | ;;; Top level buffer and region formatting functions | 158 | ;;; Top level buffer and region formatting functions |
| @@ -113,8 +164,8 @@ The Info file output is generated in a buffer visiting the Info file | |||
| 113 | name specified in the @setfilename command. | 164 | name specified in the @setfilename command. |
| 114 | 165 | ||
| 115 | Non-nil argument (prefix, if interactive) means don't make tag table | 166 | 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 | 167 | and don't split the file if large. You can use `Info-tagify' and |
| 117 | Info-split to do these manually." | 168 | `Info-split' to do these manually." |
| 118 | (interactive "P") | 169 | (interactive "P") |
| 119 | (let ((lastmessage "Formatting Info file...") | 170 | (let ((lastmessage "Formatting Info file...") |
| 120 | (coding-system-for-write buffer-file-coding-system)) | 171 | (coding-system-for-write buffer-file-coding-system)) |
| @@ -329,7 +380,7 @@ is automatically removed when the Info file is created. The original | |||
| 329 | Texinfo source buffer is not changed. | 380 | Texinfo source buffer is not changed. |
| 330 | 381 | ||
| 331 | Non-nil argument (prefix, if interactive) means don't split the file | 382 | Non-nil argument (prefix, if interactive) means don't split the file |
| 332 | if large. You can use Info-split to do this manually." | 383 | if large. You can use `Info-split' to do this manually." |
| 333 | (interactive "P") | 384 | (interactive "P") |
| 334 | (let ((temp-buffer (concat "*--" (buffer-name) "--temporary-buffer*" ))) | 385 | (let ((temp-buffer (concat "*--" (buffer-name) "--temporary-buffer*" ))) |
| 335 | (message "First updating nodes and menus, then creating Info file.") | 386 | (message "First updating nodes and menus, then creating Info file.") |
| @@ -764,64 +815,6 @@ commands." | |||
| 764 | (setq count (1+ count))) | 815 | (setq count (1+ count))) |
| 765 | (kill-word 1) | 816 | (kill-word 1) |
| 766 | (insert (symbol-name new-level)))))))))) | 817 | (insert (symbol-name new-level)))))))))) |
| 767 | |||
| 768 | (defvar texinfo-raisesections-alist | ||
| 769 | '((@chapter . @chapter) ; Cannot go higher | ||
| 770 | (@unnumbered . @unnumbered) | ||
| 771 | (@centerchap . @unnumbered) | ||
| 772 | |||
| 773 | (@majorheading . @majorheading) | ||
| 774 | (@chapheading . @chapheading) | ||
| 775 | (@appendix . @appendix) | ||
| 776 | |||
| 777 | (@section . @chapter) | ||
| 778 | (@unnumberedsec . @unnumbered) | ||
| 779 | (@heading . @chapheading) | ||
| 780 | (@appendixsec . @appendix) | ||
| 781 | |||
| 782 | (@subsection . @section) | ||
| 783 | (@unnumberedsubsec . @unnumberedsec) | ||
| 784 | (@subheading . @heading) | ||
| 785 | (@appendixsubsec . @appendixsec) | ||
| 786 | |||
| 787 | (@subsubsection . @subsection) | ||
| 788 | (@unnumberedsubsubsec . @unnumberedsubsec) | ||
| 789 | (@subsubheading . @subheading) | ||
| 790 | (@appendixsubsubsec . @appendixsubsec)) | ||
| 791 | "*An alist of next higher levels for chapters, sections. etc. | ||
| 792 | For example, section to chapter, subsection to section. | ||
| 793 | Used by `texinfo-raise-lower-sections'. | ||
| 794 | The keys specify types of section; the values correspond to the next | ||
| 795 | higher types.") | ||
| 796 | |||
| 797 | (defvar texinfo-lowersections-alist | ||
| 798 | '((@chapter . @section) | ||
| 799 | (@unnumbered . @unnumberedsec) | ||
| 800 | (@centerchap . @unnumberedsec) | ||
| 801 | (@majorheading . @heading) | ||
| 802 | (@chapheading . @heading) | ||
| 803 | (@appendix . @appendixsec) | ||
| 804 | |||
| 805 | (@section . @subsection) | ||
| 806 | (@unnumberedsec . @unnumberedsubsec) | ||
| 807 | (@heading . @subheading) | ||
| 808 | (@appendixsec . @appendixsubsec) | ||
| 809 | |||
| 810 | (@subsection . @subsubsection) | ||
| 811 | (@unnumberedsubsec . @unnumberedsubsubsec) | ||
| 812 | (@subheading . @subsubheading) | ||
| 813 | (@appendixsubsec . @appendixsubsubsec) | ||
| 814 | |||
| 815 | (@subsubsection . @subsubsection) ; Cannot go lower. | ||
| 816 | (@unnumberedsubsubsec . @unnumberedsubsubsec) | ||
| 817 | (@subsubheading . @subsubheading) | ||
| 818 | (@appendixsubsubsec . @appendixsubsubsec)) | ||
| 819 | "*An alist of next lower levels for chapters, sections. etc. | ||
| 820 | For example, chapter to section, section to subsection. | ||
| 821 | Used by `texinfo-raise-lower-sections'. | ||
| 822 | The keys specify types of section; the values correspond to the next | ||
| 823 | lower types.") | ||
| 824 | |||
| 825 | 818 | ||
| 826 | ;;; Perform those texinfo-to-info conversions that apply to the whole input | 819 | ;;; Perform those texinfo-to-info conversions that apply to the whole input |
| 827 | ;;; uniformly. | 820 | ;;; uniformly. |
| @@ -1077,8 +1070,8 @@ Leave point after argument." | |||
| 1077 | (forward-char -1) | 1070 | (forward-char -1) |
| 1078 | (skip-chars-backward " ") | 1071 | (skip-chars-backward " ") |
| 1079 | (setq end (point)) | 1072 | (setq end (point)) |
| 1080 | (setq args (cons (if (> end beg) (buffer-substring-no-properties beg end)) | 1073 | (push (if (> end beg) (buffer-substring-no-properties beg end)) |
| 1081 | args)) | 1074 | args) |
| 1082 | (goto-char next) | 1075 | (goto-char next) |
| 1083 | (skip-chars-forward " ")) | 1076 | (skip-chars-forward " ")) |
| 1084 | (if (eolp) (forward-char 1)) | 1077 | (if (eolp) (forward-char 1)) |
| @@ -1110,8 +1103,8 @@ Leave point after argument." | |||
| 1110 | (goto-char beg) | 1103 | (goto-char beg) |
| 1111 | (while (search-forward "\n" end t) | 1104 | (while (search-forward "\n" end t) |
| 1112 | (replace-match " ")))) | 1105 | (replace-match " ")))) |
| 1113 | (setq args (cons (if (> end beg) (buffer-substring-no-properties beg end)) | 1106 | (push (if (> end beg) (buffer-substring-no-properties beg end)) |
| 1114 | args)) | 1107 | args) |
| 1115 | (goto-char next)) | 1108 | (goto-char next)) |
| 1116 | ;;(if (eolp) (forward-char 1)) | 1109 | ;;(if (eolp) (forward-char 1)) |
| 1117 | (setq texinfo-command-end (point)) | 1110 | (setq texinfo-command-end (point)) |
| @@ -1140,7 +1133,7 @@ Leave point after argument." | |||
| 1140 | (re-search-forward "[\n ]") | 1133 | (re-search-forward "[\n ]") |
| 1141 | (forward-char -1) | 1134 | (forward-char -1) |
| 1142 | (setq end (point)))) | 1135 | (setq end (point)))) |
| 1143 | (setq args (cons (buffer-substring-no-properties beg end) args)) | 1136 | (push (buffer-substring-no-properties beg end) args) |
| 1144 | (skip-chars-forward " ")) | 1137 | (skip-chars-forward " ")) |
| 1145 | (forward-char 1) | 1138 | (forward-char 1) |
| 1146 | (nreverse args)))) | 1139 | (nreverse args)))) |
| @@ -1184,7 +1177,7 @@ Leave point after argument." | |||
| 1184 | (let ((tem (if texinfo-fold-nodename-case (downcase name) name))) | 1177 | (let ((tem (if texinfo-fold-nodename-case (downcase name) name))) |
| 1185 | (if (assoc tem texinfo-node-names) | 1178 | (if (assoc tem texinfo-node-names) |
| 1186 | (error "Duplicate node name: %s" name) | 1179 | (error "Duplicate node name: %s" name) |
| 1187 | (setq texinfo-node-names (cons (list tem) texinfo-node-names)))) | 1180 | (push (list tem) texinfo-node-names))) |
| 1188 | (setq texinfo-footnote-number 0) | 1181 | (setq texinfo-footnote-number 0) |
| 1189 | ;; insert "\n\^_" unconditionally since this is what info is looking for | 1182 | ;; insert "\n\^_" unconditionally since this is what info is looking for |
| 1190 | (insert "\n\^_\nFile: " texinfo-format-filename | 1183 | (insert "\n\^_\nFile: " texinfo-format-filename |
| @@ -1494,8 +1487,6 @@ If used within a line, follow `@br' with braces." | |||
| 1494 | Argument is either end or separate." | 1487 | Argument is either end or separate." |
| 1495 | (setq texinfo-footnote-style (texinfo-parse-arg-discard))) | 1488 | (setq texinfo-footnote-style (texinfo-parse-arg-discard))) |
| 1496 | 1489 | ||
| 1497 | (defvar texinfo-footnote-number) | ||
| 1498 | |||
| 1499 | (put 'footnote 'texinfo-format 'texinfo-format-footnote) | 1490 | (put 'footnote 'texinfo-format 'texinfo-format-footnote) |
| 1500 | (defun texinfo-format-footnote () | 1491 | (defun texinfo-format-footnote () |
| 1501 | "Format a footnote in either end of node or separate node style. | 1492 | "Format a footnote in either end of node or separate node style. |
| @@ -1601,9 +1592,8 @@ Used by @refill indenting command to avoid indenting within lists, etc.") | |||
| 1601 | 1592 | ||
| 1602 | (defun texinfo-push-stack (check arg) | 1593 | (defun texinfo-push-stack (check arg) |
| 1603 | (setq texinfo-stack-depth (1+ texinfo-stack-depth)) | 1594 | (setq texinfo-stack-depth (1+ texinfo-stack-depth)) |
| 1604 | (setq texinfo-stack | 1595 | (push (list check arg texinfo-command-start) |
| 1605 | (cons (list check arg texinfo-command-start) | 1596 | texinfo-stack)) |
| 1606 | texinfo-stack))) | ||
| 1607 | 1597 | ||
| 1608 | (defun texinfo-pop-stack (check) | 1598 | (defun texinfo-pop-stack (check) |
| 1609 | (setq texinfo-stack-depth (1- texinfo-stack-depth)) | 1599 | (setq texinfo-stack-depth (1- texinfo-stack-depth)) |
| @@ -1974,7 +1964,7 @@ Or else: | |||
| 1974 | @end multitable | 1964 | @end multitable |
| 1975 | 1965 | ||
| 1976 | where the fractions specify the width of each column as a percent | 1966 | where the fractions specify the width of each column as a percent |
| 1977 | of the current width of the text (i.e., of the fill-column). | 1967 | of the current width of the text (i.e., of the `fill-column'). |
| 1978 | 1968 | ||
| 1979 | Long lines of text are filled within columns. | 1969 | Long lines of text are filled within columns. |
| 1980 | 1970 | ||
| @@ -2028,12 +2018,10 @@ commands that are defined in texinfo.tex for printed output. | |||
| 2028 | ((looking-at "@columnfractions") | 2018 | ((looking-at "@columnfractions") |
| 2029 | (forward-word 1) | 2019 | (forward-word 1) |
| 2030 | (while (not (eolp)) | 2020 | (while (not (eolp)) |
| 2031 | (setq texinfo-multitable-width-list | 2021 | (push (truncate |
| 2032 | (cons | 2022 | (1- |
| 2033 | (truncate | 2023 | (* fill-column (read (get-buffer (current-buffer)))))) |
| 2034 | (1- | 2024 | texinfo-multitable-width-list))) |
| 2035 | (* fill-column (read (get-buffer (current-buffer)))))) | ||
| 2036 | texinfo-multitable-width-list)))) | ||
| 2037 | ;; | 2025 | ;; |
| 2038 | ;; Case 2: {Column 1 template} {Column 2} {Column 3 example} | 2026 | ;; Case 2: {Column 1 template} {Column 2} {Column 3 example} |
| 2039 | ((looking-at "{") | 2027 | ((looking-at "{") |
| @@ -2044,9 +2032,8 @@ commands that are defined in texinfo.tex for printed output. | |||
| 2044 | (end-of-template | 2032 | (end-of-template |
| 2045 | ;; forward-sexp works with braces in Texinfo mode | 2033 | ;; forward-sexp works with braces in Texinfo mode |
| 2046 | (progn (forward-sexp 1) (1- (point))))) | 2034 | (progn (forward-sexp 1) (1- (point))))) |
| 2047 | (setq texinfo-multitable-width-list | 2035 | (push (- end-of-template start-of-template) |
| 2048 | (cons (- end-of-template start-of-template) | 2036 | texinfo-multitable-width-list) |
| 2049 | texinfo-multitable-width-list)) | ||
| 2050 | ;; Remove carriage return from within a template, if any. | 2037 | ;; Remove carriage return from within a template, if any. |
| 2051 | ;; This helps those those who want to use more than | 2038 | ;; This helps those those who want to use more than |
| 2052 | ;; one line's worth of words in @multitable line. | 2039 | ;; one line's worth of words in @multitable line. |
| @@ -2417,13 +2404,11 @@ Use only the FILENAME arg; for Info, ignore the other arguments to @image." | |||
| 2417 | (beginning-delimiter (or (nth 1 args) "")) | 2404 | (beginning-delimiter (or (nth 1 args) "")) |
| 2418 | (end-delimiter (or (nth 2 args) ""))) | 2405 | (end-delimiter (or (nth 2 args) ""))) |
| 2419 | (texinfo-discard-command) | 2406 | (texinfo-discard-command) |
| 2420 | (setq texinfo-enclosure-list | 2407 | (push (list command-name |
| 2421 | (cons | 2408 | (list |
| 2422 | (list command-name | 2409 | beginning-delimiter |
| 2423 | (list | 2410 | end-delimiter)) |
| 2424 | beginning-delimiter | 2411 | texinfo-enclosure-list))) |
| 2425 | end-delimiter)) | ||
| 2426 | texinfo-enclosure-list)))) | ||
| 2427 | 2412 | ||
| 2428 | 2413 | ||
| 2429 | ;;; @alias | 2414 | ;;; @alias |
| @@ -2436,12 +2421,10 @@ Use only the FILENAME arg; for Info, ignore the other arguments to @image." | |||
| 2436 | (save-excursion (end-of-line) (setq texinfo-command-end (point))) | 2421 | (save-excursion (end-of-line) (setq texinfo-command-end (point))) |
| 2437 | (if (not (looking-at "\\([^=]+\\)=\\(.*\\)")) | 2422 | (if (not (looking-at "\\([^=]+\\)=\\(.*\\)")) |
| 2438 | (error "Invalid alias command") | 2423 | (error "Invalid alias command") |
| 2439 | (setq texinfo-alias-list | 2424 | (push (cons |
| 2440 | (cons | 2425 | (match-string-no-properties 1) |
| 2441 | (cons | 2426 | (match-string-no-properties 2)) |
| 2442 | (match-string-no-properties 1) | 2427 | texinfo-alias-list) |
| 2443 | (match-string-no-properties 2)) | ||
| 2444 | texinfo-alias-list)) | ||
| 2445 | (texinfo-discard-command)) | 2428 | (texinfo-discard-command)) |
| 2446 | ) | 2429 | ) |
| 2447 | ) | 2430 | ) |
| @@ -2570,8 +2553,7 @@ If used within a line, follow `@bullet' with braces." | |||
| 2570 | "lisp\\|" | 2553 | "lisp\\|" |
| 2571 | "smalllisp" | 2554 | "smalllisp" |
| 2572 | "\\)") | 2555 | "\\)") |
| 2573 | "Regexp specifying environments in which @kbd does not put `...' | 2556 | "Regexp matching environments in which @kbd does not put `...' around arg.") |
| 2574 | around argument.") | ||
| 2575 | 2557 | ||
| 2576 | (defvar texinfo-format-kbd-end-regexp | 2558 | (defvar texinfo-format-kbd-end-regexp |
| 2577 | (concat | 2559 | (concat |
| @@ -2584,7 +2566,7 @@ If used within a line, follow `@bullet' with braces." | |||
| 2584 | "smalllisp" | 2566 | "smalllisp" |
| 2585 | "\\)") | 2567 | "\\)") |
| 2586 | "Regexp specifying end of environments in which @kbd does not put `...' | 2568 | "Regexp specifying end of environments in which @kbd does not put `...' |
| 2587 | around argument. (See `texinfo-format-kbd-regexp')") | 2569 | around argument. (See `texinfo-format-kbd-regexp')") |
| 2588 | 2570 | ||
| 2589 | (put 'kbd 'texinfo-format 'texinfo-format-kbd) | 2571 | (put 'kbd 'texinfo-format 'texinfo-format-kbd) |
| 2590 | (defun texinfo-format-kbd () | 2572 | (defun texinfo-format-kbd () |
| @@ -2793,8 +2775,8 @@ If used within a line, follow `@minus' with braces." | |||
| 2793 | 2775 | ||
| 2794 | ;;; Refilling and indenting: @refill, @paragraphindent, @noindent | 2776 | ;;; Refilling and indenting: @refill, @paragraphindent, @noindent |
| 2795 | 2777 | ||
| 2796 | ;;; Indent only those paragraphs that are refilled as a result of an | 2778 | ;; Indent only those paragraphs that are refilled as a result of an |
| 2797 | ;;; @refill command. | 2779 | ;; @refill command. |
| 2798 | 2780 | ||
| 2799 | ;; * If the value is `asis', do not change the existing indentation at | 2781 | ;; * If the value is `asis', do not change the existing indentation at |
| 2800 | ;; the starts of paragraphs. | 2782 | ;; the starts of paragraphs. |
| @@ -2804,8 +2786,8 @@ If used within a line, follow `@minus' with braces." | |||
| 2804 | ;; * If the value is greater than zero, indent each paragraph by that | 2786 | ;; * If the value is greater than zero, indent each paragraph by that |
| 2805 | ;; number of spaces. | 2787 | ;; number of spaces. |
| 2806 | 2788 | ||
| 2807 | ;;; But do not refill paragraphs with an @refill command that are | 2789 | ;; But do not refill paragraphs with an @refill command that are |
| 2808 | ;;; preceded by @noindent or are part of a table, list, or deffn. | 2790 | ;; preceded by @noindent or are part of a table, list, or deffn. |
| 2809 | 2791 | ||
| 2810 | (defvar texinfo-paragraph-indent "asis" | 2792 | (defvar texinfo-paragraph-indent "asis" |
| 2811 | "Number of spaces for @refill to indent a paragraph; else to leave as is.") | 2793 | "Number of spaces for @refill to indent a paragraph; else to leave as is.") |
| @@ -2822,7 +2804,7 @@ Default is to leave the number of spaces as is." | |||
| 2822 | 2804 | ||
| 2823 | (put 'refill 'texinfo-format 'texinfo-format-refill) | 2805 | (put 'refill 'texinfo-format 'texinfo-format-refill) |
| 2824 | (defun texinfo-format-refill () | 2806 | (defun texinfo-format-refill () |
| 2825 | "Refill paragraph. Also, indent first line as set by @paragraphindent. | 2807 | "Refill paragraph. Also, indent first line as set by @paragraphindent. |
| 2826 | Default is to leave paragraph indentation as is." | 2808 | Default is to leave paragraph indentation as is." |
| 2827 | (texinfo-discard-command) | 2809 | (texinfo-discard-command) |
| 2828 | (let ((position (point-marker))) | 2810 | (let ((position (point-marker))) |
| @@ -2941,11 +2923,9 @@ Default is to leave paragraph indentation as is." | |||
| 2941 | 2923 | ||
| 2942 | ;; eg: "aa" . texinfo-aaindex | 2924 | ;; eg: "aa" . texinfo-aaindex |
| 2943 | (or (assoc index-name texinfo-indexvar-alist) | 2925 | (or (assoc index-name texinfo-indexvar-alist) |
| 2944 | (setq texinfo-indexvar-alist | 2926 | (push (cons index-name |
| 2945 | (cons | 2927 | index-alist-name) |
| 2946 | (cons index-name | 2928 | texinfo-indexvar-alist)) |
| 2947 | index-alist-name) | ||
| 2948 | texinfo-indexvar-alist))) | ||
| 2949 | 2929 | ||
| 2950 | (fset index-formatting-command | 2930 | (fset index-formatting-command |
| 2951 | (list 'lambda 'nil | 2931 | (list 'lambda 'nil |
| @@ -4024,7 +4004,7 @@ The command `@value{foo}' expands to the value." | |||
| 4024 | (put 'ifset 'texinfo-end 'texinfo-discard-command) | 4004 | (put 'ifset 'texinfo-end 'texinfo-discard-command) |
| 4025 | (put 'ifset 'texinfo-format 'texinfo-if-set) | 4005 | (put 'ifset 'texinfo-format 'texinfo-if-set) |
| 4026 | (defun texinfo-if-set () | 4006 | (defun texinfo-if-set () |
| 4027 | "If set, continue formatting; else do not format region up to @end ifset" | 4007 | "If set, continue formatting; else do not format region up to @end ifset." |
| 4028 | (let ((arg (texinfo-parse-arg-discard))) | 4008 | (let ((arg (texinfo-parse-arg-discard))) |
| 4029 | (cond | 4009 | (cond |
| 4030 | ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp) | 4010 | ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp) |
| @@ -4045,7 +4025,7 @@ The command `@value{foo}' expands to the value." | |||
| 4045 | (put 'ifclear 'texinfo-end 'texinfo-discard-command) | 4025 | (put 'ifclear 'texinfo-end 'texinfo-discard-command) |
| 4046 | (put 'ifclear 'texinfo-format 'texinfo-if-clear) | 4026 | (put 'ifclear 'texinfo-format 'texinfo-if-clear) |
| 4047 | (defun texinfo-if-clear () | 4027 | (defun texinfo-if-clear () |
| 4048 | "If clear, continue formatting; if set, do not format up to @end ifset" | 4028 | "If clear, continue formatting; if set, do not format up to @end ifset." |
| 4049 | (let ((arg (texinfo-parse-arg-discard))) | 4029 | (let ((arg (texinfo-parse-arg-discard))) |
| 4050 | (cond | 4030 | (cond |
| 4051 | ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp) | 4031 | ((eq (get (car (read-from-string arg)) 'texinfo-whether-setp) |
| @@ -4291,7 +4271,7 @@ the @ifeq command." | |||
| 4291 | ;;; Batch formatting | 4271 | ;;; Batch formatting |
| 4292 | 4272 | ||
| 4293 | (defun batch-texinfo-format () | 4273 | (defun batch-texinfo-format () |
| 4294 | "Runs texinfo-format-buffer on the files remaining on the command line. | 4274 | "Run `texinfo-format-buffer' on the files remaining on the command line. |
| 4295 | Must be used only with -batch, and kills Emacs on completion. | 4275 | Must be used only with -batch, and kills Emacs on completion. |
| 4296 | Each file will be processed even if an error occurred previously. | 4276 | Each file will be processed even if an error occurred previously. |
| 4297 | For example, invoke | 4277 | For example, invoke |
| @@ -4317,8 +4297,8 @@ For example, invoke | |||
| 4317 | (nconc (directory-files file) | 4297 | (nconc (directory-files file) |
| 4318 | (cdr command-line-args-left)))) | 4298 | (cdr command-line-args-left)))) |
| 4319 | (t | 4299 | (t |
| 4320 | (setq files (cons file files) | 4300 | (push file files) |
| 4321 | command-line-args-left (cdr command-line-args-left))))) | 4301 | (setq command-line-args-left (cdr command-line-args-left))))) |
| 4322 | (while files | 4302 | (while files |
| 4323 | (setq file (car files) | 4303 | (setq file (car files) |
| 4324 | files (cdr files)) | 4304 | files (cdr files)) |
| @@ -4354,5 +4334,5 @@ For example, invoke | |||
| 4354 | ;;; Place `provide' at end of file. | 4334 | ;;; Place `provide' at end of file. |
| 4355 | (provide 'texinfmt) | 4335 | (provide 'texinfmt) |
| 4356 | 4336 | ||
| 4357 | ;;; arch-tag: 1e8d9a2d-bca0-40a0-ac6c-dab01bc6f725 | 4337 | ;; arch-tag: 1e8d9a2d-bca0-40a0-ac6c-dab01bc6f725 |
| 4358 | ;;; texinfmt.el ends here | 4338 | ;;; texinfmt.el ends here |