(let (beginning end node-name title)
(save-excursion
(beginning-of-line)
- (if (search-forward "* " (save-excursion (end-of-line) (point)) t)
+ (if (search-forward "* " (line-end-position) t)
(progn (skip-chars-forward " \t")
(setq beginning (point)))
(error "This is not a line in a menu"))
(cond
;; "Double colon" entry line; menu entry and node name are the same,
- ((search-forward "::" (save-excursion (end-of-line) (point)) t)
+ ((search-forward "::" (line-end-position) t)
(if (looking-at "[ \t]*[^ \t\n]+")
(error "Descriptive text already exists"))
(skip-chars-backward ": \t")
(setq node-name (buffer-substring beginning (point))))
;; "Single colon" entry line; menu entry and node name are different.
- ((search-forward ":" (save-excursion (end-of-line) (point)) t)
+ ((search-forward ":" (line-end-position) t)
(skip-chars-forward " \t")
(setq beginning (point))
;; Menu entry line ends in a period, comma, or tab.
(save-excursion
(goto-char (point-min))
(re-search-forward "^@node [ \t]*top[ \t]*\\(,\\|$\\)" nil t)
- (beginning-of-line)
- (point)))
+ (line-beginning-position)))
(t
(save-excursion
(re-search-backward
First argument is the position of the beginning of the section in
which the menu will be located; second argument is the position of the
end of that region; it limits the search."
-
(save-excursion
(goto-char beginning)
(forward-line 1)
(re-search-forward "^@node" end t)
- (beginning-of-line)
- (point)))
+ (line-beginning-position)))
\f
;;; Updating a node
Starts from the current position of the cursor, and searches forward
on the line for a comma and if one is found, deletes the rest of the
line, including the comma. Leaves point at beginning of line."
- (let ((eol-point (save-excursion (end-of-line) (point))))
+ (let ((eol-point (line-end-position)))
(if (search-forward "," eol-point t)
(delete-region (1- (point)) eol-point)))
(beginning-of-line))
"\\)")
(save-excursion
(goto-char beginning)
- (beginning-of-line)
- (point))
+ (line-beginning-position))
t)
'normal
'no-pointer))
"Remove extra commas, if any, at end of node line."
(end-of-line)
(skip-chars-backward ", ")
- (delete-region (point) (save-excursion (end-of-line) (point))))
+ (delete-region (point) (line-end-position)))
\f
;;; Updating nodes sequentially
(skip-chars-forward " \t")
(setq title (buffer-substring
(point)
- (save-excursion (end-of-line) (point))))))
+ (line-end-position)))))
;; Insert node line if necessary.
(if (re-search-backward
"^@node"
(point-min)
(save-excursion
(re-search-forward "^@include")
- (beginning-of-line)
- (point)))
-
+ (line-beginning-position)))
;; If found, leave point after word `menu' on the `@menu' line.
(progn
(texinfo-incorporate-descriptions main-menu-list)
;; Place `provide' at end of file.
(provide 'texnfo-upd)
-;; arch-tag: d21613a5-c32f-43f4-8af4-bfb1e7455842
;;; texnfo-upd.el ends here