Use line-end-position rather than end-of-line, etc.

* textmodes/texnfo-upd.el (texinfo-start-menu-description)
(texinfo-update-menu-region-beginning, texinfo-menu-first-node)
(texinfo-delete-existing-pointers, texinfo-find-pointer)
(texinfo-clean-up-node-line, texinfo-insert-node-lines)
(texinfo-multiple-files-update):
* textmodes/table.el (table--probe-cell-left-up)
(table--probe-cell-right-bottom):
* textmodes/picture.el (picture-tab-search):
* textmodes/page-ext.el (pages-copy-header-and-position)
(pages-directory-for-addresses):
* progmodes/vera-mode.el (vera-get-offset):
* progmodes/simula.el (simula-calculate-indent):
* progmodes/python.el (python-pdbtrack-overlay-arrow):
* progmodes/prolog.el (end-of-prolog-clause):
* progmodes/perl-mode.el (perl-calculate-indent, perl-indent-exp):
* progmodes/icon.el (indent-icon-exp):
* progmodes/etags.el (tag-re-match-p):
* progmodes/ebrowse.el (ebrowse-show-file-name-at-point):
* progmodes/ebnf2ps.el (ebnf-begin-file):
* progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-save-local-variable):
* play/life.el (life-setup):
* play/gametree.el (gametree-looking-at-ply):
* nxml/nxml-maint.el (nxml-insert-target-repertoire-glyph-set):
* mail/sendmail.el (mail-mode-auto-fill):
* emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* emacs-lisp/edebug.el (edebug-overlay-arrow):
* emacs-lisp/checkdoc.el (checkdoc-this-string-valid):
* woman.el (woman-parse-numeric-value, woman2-TH, woman2-SH)
(woman-tab-to-tab-stop, WoMan-warn-ignored):
* type-break.el (type-break-file-keystroke-count):
* term.el (term-replace-by-expanded-history-before-point)
(term-skip-prompt, term-extract-string):
* speedbar.el (speedbar-edit-line, speedbar-expand-line)
(speedbar-contract-line, speedbar-toggle-line-expansion)
(speedbar-parse-c-or-c++tag, speedbar-parse-tex-string)
(speedbar-buffer-revert-buffer, speedbar-highlight-one-tag-line):
* sort.el (sort-skip-fields):
* skeleton.el (skeleton-internal-list):
* simple.el (line-move-finish, line-move-to-column):
* shell.el (shell-forward-command):
* misc.el (copy-from-above-command):
* makesum.el (double-column):
* ebuff-menu.el (electric-buffer-update-highlight):
* dired.el (dired-move-to-end-of-filename):
* dframe.el (dframe-popup-kludge):
* bookmark.el (bookmark-kill-line, bookmark-bmenu-show-filenames):
* arc-mode.el (archive-get-lineno):
Use line-end-position and line-beginning-position.

* net/ange-ftp.el, progmodes/hideif.el, reposition.el:
Same, but only in comments.
This commit is contained in:
Glenn Morris 2010-11-06 13:23:42 -07:00
parent e2a9c0bca0
commit 5ed619e0a3
40 changed files with 180 additions and 175 deletions

View 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)))
;;; 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)))
;;; 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