Use line-end-position rather than end-of-line, etc.
[bpt/emacs.git] / lisp / textmodes / texnfo-upd.el
index f4fcc95..a5b4937 100644 (file)
@@ -719,21 +719,21 @@ complements the node name rather than repeats it as a title does."
   (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.
@@ -1154,8 +1154,7 @@ Only argument is a string of the general type of section."
       (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
@@ -1206,13 +1205,11 @@ The menu will be located just before this position.
 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
@@ -1331,7 +1328,7 @@ Point must be at beginning of node line.  Does not move point."
 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))
@@ -1437,8 +1434,7 @@ will be at some level higher in the Texinfo file.  The fourth argument
                 "\\)")
                (save-excursion
                  (goto-char beginning)
-                 (beginning-of-line)
-                 (point))
+                 (line-beginning-position))
                t)
               'normal
             'no-pointer))
@@ -1483,7 +1479,7 @@ towards which the pointer is directed, one of `next', `previous', or `up'."
   "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
@@ -1647,7 +1643,7 @@ node names in pre-existing `@node' lines that lack names."
            (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"
@@ -1993,9 +1989,7 @@ chapter."
         (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)
@@ -2057,5 +2051,4 @@ chapter."
 ;; Place `provide' at end of file.
 (provide 'texnfo-upd)
 
-;; arch-tag: d21613a5-c32f-43f4-8af4-bfb1e7455842
 ;;; texnfo-upd.el ends here