]> git.eshelyaron.com Git - emacs.git/commitdiff
Use line-beginning-position in some texinfo.el files.
authorGlenn Morris <rgm@gnu.org>
Wed, 10 Nov 2010 04:35:18 +0000 (20:35 -0800)
committerGlenn Morris <rgm@gnu.org>
Wed, 10 Nov 2010 04:35:18 +0000 (20:35 -0800)
* lisp/textmodes/texnfo-upd.el (texinfo-all-menus-update)
(texinfo-menu-copy-old-description, texinfo-start-menu-description)
(texinfo-master-menu, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* lisp/textmodes/texinfmt.el (texinfo-append-refill, texinfo-copying):
Use line-beginning-position.

lisp/ChangeLog
lisp/textmodes/texinfmt.el
lisp/textmodes/texnfo-upd.el

index fea67a367190d50970fd3c3e2023731664c71677..67ab836359e32560ced8e82aac313969a01a387c 100644 (file)
@@ -1,5 +1,12 @@
 2010-11-10  Glenn Morris  <rgm@gnu.org>
 
+       * textmodes/texnfo-upd.el (texinfo-all-menus-update)
+       (texinfo-menu-copy-old-description, texinfo-start-menu-description)
+       (texinfo-master-menu, texinfo-insert-node-lines)
+       (texinfo-multiple-files-update):
+       * textmodes/texinfmt.el (texinfo-append-refill, texinfo-copying):
+       Use line-beginning-position.
+
        * progmodes/cperl-mode.el (cperl-find-pods-heres, cperl-write-tags):
        No recent Emacs supports system-type `emx'.
 
index 577287c60bcf5511df03312c4917b1ccd3d085d2..7c331c7809d4bd758f544d00ea192db641b02948 100644 (file)
@@ -663,11 +663,12 @@ Do not append @refill to paragraphs containing @w{TEXT} or @*."
         ;; Else
         ;; 3. Do not refill a paragraph containing @w or @*, or ending
         ;;    with @<newline> followed by a newline.
-        (if  (or (>= (point) (point-max))
-                (re-search-forward
-                 "@w{\\|@\\*\\|@\n\n"
-                 (save-excursion (forward-paragraph) (forward-line 1) (point))
-                 t))
+        (if (or (>= (point) (point-max))
+                (re-search-forward
+                 "@w{\\|@\\*\\|@\n\n"
+                 (save-excursion (forward-paragraph)
+                                 (line-beginning-position 2))
+                 t))
             ;; Go to end of paragraph and do nothing.
             (forward-paragraph)
           ;; 4. Else go to end of paragraph and insert @refill
@@ -944,8 +945,8 @@ insert the text with the @insertcopying command."
         (end  (progn (re-search-forward "^@end copying[ \t]*\n") (point))))
     (setq texinfo-copying-text
           (buffer-substring-no-properties
-           (save-excursion (goto-char beg) (forward-line 1) (point))
-           (save-excursion (goto-char end) (forward-line -1) (point))))
+           (save-excursion (goto-char beg) (line-beginning-position 2))
+           (save-excursion (goto-char end) (line-beginning-position 0))))
     (delete-region beg end)))
 
 (defun texinfo-insertcopying ()
@@ -4297,5 +4298,4 @@ For example, invoke
 ;;; Place `provide' at end of file.
 (provide 'texinfmt)
 
-;; arch-tag: 1e8d9a2d-bca0-40a0-ac6c-dab01bc6f725
 ;;; texinfmt.el ends here
index a5b4937f24013b387ecd478dca1cfefec2521490..4c3dbda80b0d9e1ef11a42f1bf8a31112933a8ce 100644 (file)
@@ -1,7 +1,7 @@
 ;;; texnfo-upd.el --- utilities for updating nodes and menus in Texinfo files
 
-;; Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 1990, 1991, 1992, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: Robert J. Chassell
 ;; Maintainer: bug-texinfo@gnu.org
@@ -349,9 +349,7 @@ section titles are often too short to explain a node well."
        (when (search-forward texinfo-master-menu-header nil t)
          ;; Check if @detailmenu kludge is used;
          ;; if so, leave point before @detailmenu.
-         (search-backward "\n@detailmenu"
-                          (save-excursion (forward-line -3) (point))
-                          t)
+         (search-backward "\n@detailmenu" (line-beginning-position -2) t)
          ;; Remove detailed master menu listing
          (setq master-menu-p t)
          (goto-char (match-beginning 0))
@@ -627,9 +625,7 @@ Single argument, END-OF-MENU, is position limiting search."
        (point)
        (save-excursion
         (re-search-forward "\\(^\\* \\|^@ignore\\|^@end menu\\)" end-of-menu t)
-        (forward-line -1)
-        (end-of-line)                  ; go to end of last description line
-        (point)))
+        (line-end-position 0)))        ; end of last description line
     ""))
 
 (defun texinfo-menu-end ()
@@ -737,16 +733,14 @@ complements the node name rather than repeats it as a title does."
        (skip-chars-forward " \t")
        (setq beginning (point))
        ;; Menu entry line ends in a period, comma, or tab.
-       (if (re-search-forward "[.,\t]"
-                              (save-excursion (forward-line 1) (point)) t)
+       (if (re-search-forward "[.,\t]" (line-beginning-position 2) t)
            (progn
              (if (looking-at "[ \t]*[^ \t\n]+")
                  (error "Descriptive text already exists"))
              (skip-chars-backward "., \t")
              (setq node-name (buffer-substring beginning (point))))
          ;; Menu entry line ends in a return.
-         (re-search-forward ".*\n"
-                            (save-excursion (forward-line 1) (point)) t)
+         (re-search-forward ".*\n" (line-beginning-position 2) t)
          (skip-chars-backward " \t\n")
          (setq node-name (buffer-substring beginning (point)))
          (if (= 0 (length node-name))
@@ -904,9 +898,7 @@ section titles are often too short to explain a node well."
          (progn
            ;; Check if @detailmenu kludge is used;
            ;; if so, leave point before @detailmenu.
-           (search-backward "\n@detailmenu"
-                            (save-excursion (forward-line -3) (point))
-                            t)
+           (search-backward "\n@detailmenu" (line-beginning-position -2) t)
            ;; Remove detailed master menu listing
            (goto-char (match-beginning 0))
            (let ((end-of-detailed-menu-descriptions
@@ -941,9 +933,7 @@ section titles are often too short to explain a node well."
            (goto-char (match-beginning 0))
            ;; Check if @detailmenu kludge is used;
            ;; if so, leave point before @detailmenu.
-           (search-backward "\n@detailmenu"
-                            (save-excursion (forward-line -3) (point))
-                            t)
+           (search-backward "\n@detailmenu" (line-beginning-position -2) t)
            (insert "\n")
            (delete-blank-lines)
            (goto-char (point-min))))
@@ -1449,6 +1439,7 @@ The argument is the kind of section, either `normal' or `no-pointer'."
           (end-of-line)                ; this handles prev node top case
           (re-search-backward          ; when point is already
            "^@node"                    ; at the beginning of @node line
+           ;; FIXME this can't be right.  Missing the point?
            (save-excursion (forward-line -3))
            t)
           (setq name (texinfo-copy-node-name)))
@@ -1649,7 +1640,8 @@ node names in pre-existing `@node' lines that lack names."
           "^@node"
           ;; Avoid finding previous node line if node lines are close.
           (or last-section-position
-              (save-excursion (forward-line -2) (point))) t)
+              (line-beginning-position -1))
+          t)
          ;;  @node is present, and point at beginning of that line
          (forward-word 1)          ; Leave point just after @node.
        ;; Else @node missing; insert one.
@@ -1671,7 +1663,7 @@ node names in pre-existing `@node' lines that lack names."
                  (message "Inserted title %s ... " title)))))
       ;; Go forward beyond current section title.
       (re-search-forward texinfo-section-types-regexp
-                        (save-excursion (forward-line 3) (point)) t)
+                        (line-beginning-position 4) t)
       (setq last-section-position (point))
       (forward-line 1))
 
@@ -2015,9 +2007,7 @@ chapter."
                (goto-char (match-beginning 0))
                ;; Check if @detailmenu kludge is used;
                ;; if so, leave point before @detailmenu.
-               (search-backward "\n@detailmenu"
-                                (save-excursion (forward-line -3) (point))
-                                t)
+               (search-backward "\n@detailmenu" (line-beginning-position -2) t)
                ;; Remove detailed master menu listing
                (let ((end-of-detailed-menu-descriptions
                       (save-excursion  ; beginning of end menu line