diff options
| -rw-r--r-- | lisp/textmodes/texinfmt.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index 90e682f4705..ddb12882bd9 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el | |||
| @@ -1132,6 +1132,22 @@ Leave point after argument." | |||
| 1132 | (insert ?\n) | 1132 | (insert ?\n) |
| 1133 | (setq texinfo-last-node-pos (point)))) | 1133 | (setq texinfo-last-node-pos (point)))) |
| 1134 | 1134 | ||
| 1135 | (put 'anchor 'texinfo-format 'texinfo-anchor) | ||
| 1136 | (defun texinfo-anchor () | ||
| 1137 | (let (anchor-string | ||
| 1138 | (here (- (point) 7)) ; save location of beginning of `@anchor' | ||
| 1139 | (arg (texinfo-parse-arg-discard))) | ||
| 1140 | (delete-char 1) ; since a space is left after -discard | ||
| 1141 | (forward-paragraph) | ||
| 1142 | (let ((end (point))) | ||
| 1143 | (if (save-excursion | ||
| 1144 | (backward-word 1) | ||
| 1145 | (search-forward "@refill" end t)) | ||
| 1146 | (setq anchor-string "@anchor-yes-refill") | ||
| 1147 | (setq anchor-string "@anchor-no-refill"))) | ||
| 1148 | (goto-char here) | ||
| 1149 | (insert anchor-string "{" arg "}"))) | ||
| 1150 | |||
| 1135 | (put 'menu 'texinfo-format 'texinfo-format-menu) | 1151 | (put 'menu 'texinfo-format 'texinfo-format-menu) |
| 1136 | (defun texinfo-format-menu () | 1152 | (defun texinfo-format-menu () |
| 1137 | (texinfo-discard-line) | 1153 | (texinfo-discard-line) |