changeset 22661:90460d1e2c3f

(texinfo-anchor): New function.
author Richard M. Stallman <rms@gnu.org>
date Thu, 02 Jul 1998 08:05:24 +0000
parents 1614e05bf2b5
children f0078b7750b7
files lisp/textmodes/texinfmt.el
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/texinfmt.el	Thu Jul 02 07:46:15 1998 +0000
+++ b/lisp/textmodes/texinfmt.el	Thu Jul 02 08:05:24 1998 +0000
@@ -1132,6 +1132,22 @@
     (insert ?\n)
     (setq texinfo-last-node-pos (point))))
 
+(put 'anchor 'texinfo-format 'texinfo-anchor)
+(defun texinfo-anchor ()
+  (let (anchor-string 
+        (here (- (point) 7))  ; save location of beginning of `@anchor'
+        (arg (texinfo-parse-arg-discard)))
+    (delete-char 1)           ; since a space is left after -discard
+    (forward-paragraph) 
+    (let ((end (point)))
+      (if (save-excursion 
+            (backward-word 1)
+            (search-forward "@refill" end t))
+          (setq anchor-string "@anchor-yes-refill")
+        (setq anchor-string "@anchor-no-refill")))
+      (goto-char here)
+      (insert anchor-string "{" arg "}")))
+
 (put 'menu 'texinfo-format 'texinfo-format-menu)
 (defun texinfo-format-menu ()
   (texinfo-discard-line)