From: Richard M. Stallman Date: Thu, 2 Jul 1998 08:05:24 +0000 (+0000) Subject: (texinfo-anchor): New function. X-Git-Tag: emacs-20.3~418 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=007be42afdcddcde3006553a07d10cb06cec0b6d;p=emacs.git (texinfo-anchor): New function. --- 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." (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)