aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorGlenn Morris <[email protected]>2010-11-06 13:23:42 -0700
committerGlenn Morris <[email protected]>2010-11-06 13:23:42 -0700
commit5ed619e0a309c8ce539f0fbc2d19a068139f099d (patch)
tree9fff5acd78b23128c671511932338347e0d06f3f /lisp/progmodes
parente2a9c0bca0dc06975181556767a3b6db8de4e486 (diff)
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.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/dcl-mode.el9
-rw-r--r--lisp/progmodes/ebnf2ps.el7
-rw-r--r--lisp/progmodes/ebrowse.el9
-rw-r--r--lisp/progmodes/etags.el9
-rw-r--r--lisp/progmodes/hideif.el5
-rw-r--r--lisp/progmodes/icon.el7
-rw-r--r--lisp/progmodes/perl-mode.el7
-rw-r--r--lisp/progmodes/prolog.el3
-rw-r--r--lisp/progmodes/python.el3
-rw-r--r--lisp/progmodes/simula.el7
-rw-r--r--lisp/progmodes/vera-mode.el3
11 files changed, 28 insertions, 41 deletions
diff --git a/lisp/progmodes/dcl-mode.el b/lisp/progmodes/dcl-mode.el
index bf12d772dd..dd7aa0eddf 100644
--- a/lisp/progmodes/dcl-mode.el
+++ b/lisp/progmodes/dcl-mode.el
@@ -1,7 +1,7 @@
;;; dcl-mode.el --- major mode for editing DCL command files
-;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;; 2009, 2010 Free Software Foundation, Inc.
;; Author: Odd Gripenstam <[email protected]>
;; Maintainer: Odd Gripenstam <[email protected]>
@@ -821,7 +821,7 @@ by the numbers in order 1-2-3-1-... :
;; text
;; 1
- (let* ((default-limit (save-excursion (end-of-line) (1+ (point))))
+ (let* ((default-limit (1+ (line-end-position)))
(limit (or limit default-limit))
(last-good-point (point))
(opoint (point)))
@@ -1783,7 +1783,7 @@ Set or update the value of VAR in the current buffers
(skip-chars-forward " \t")
(or (eolp)
(setq suffix-string (buffer-substring (point)
- (progn (end-of-line) (point)))))
+ (line-end-position))))
(goto-char (match-beginning 0))
(or (bolp)
(setq prefix-string
@@ -2214,5 +2214,4 @@ otherwise return nil."
(run-hooks 'dcl-mode-load-hook) ; for your customizations
-;; arch-tag: e00d421b-f26c-483e-a8bd-af412ea7764a
;;; dcl-mode.el ends here
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 201a091cc2..a4d1fe85c3 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -1,7 +1,7 @@
;;; ebnf2ps.el --- translate an EBNF to a syntactic chart on PostScript
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+;; 2008, 2009, 2010 Free Software Foundation, Inc.
;; Author: Vinicius Jose Latorre <[email protected]>
;; Maintainer: Vinicius Jose Latorre <[email protected]>
@@ -5279,7 +5279,7 @@ killed after process termination."
(goto-char (point-min))
(and (search-forward "%%Creator: " nil t)
(not (search-forward "& ebnf2ps v"
- (save-excursion (end-of-line) (point))
+ (line-end-position)
t))
(progn
;; adjust creator comment
@@ -6395,5 +6395,4 @@ killed after process termination."
(provide 'ebnf2ps)
-;; arch-tag: 148bc8af-5398-468b-b922-eeb7afef3e4f
;;; ebnf2ps.el ends here
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index e32c453b91..7101bf21ad 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -1,8 +1,8 @@
;;; ebrowse.el --- Emacs C++ class browser & tags facility
-;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation Inc.
+;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Free Software Foundation Inc.
;; Author: Gerd Moellmann <[email protected]>
;; Maintainer: FSF
@@ -1313,7 +1313,7 @@ With PREFIX, insert that many filenames."
(skip-chars-forward " \t*a-zA-Z0-9_")
(setq start (point)
file-name-existing (looking-at "("))
- (delete-region start (save-excursion (end-of-line) (point)))
+ (delete-region start (line-end-position))
(unless file-name-existing
(indent-to ebrowse-source-file-column)
(insert "(" (or (ebrowse-cs-file
@@ -4491,5 +4491,4 @@ EVENT is the mouse event."
;; eval:(put 'ebrowse-for-all-trees 'lisp-indent-hook 1)
;; End:
-;; arch-tag: 4fa3c8bf-1771-479b-bcd7-b029c7c9677b
;;; ebrowse.el ends here
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 042cc8c33f..96f36340fd 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1,8 +1,8 @@
;;; etags.el --- etags facility for Emacs
-;; Copyright (C) 1985, 1986, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1998,
-;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1988, 1989, 1992, 1993, 1994, 1995, 1996,
+;; 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+;; 2010 Free Software Foundation, Inc.
;; Author: Roland McGrath <[email protected]>
;; Maintainer: FSF
@@ -1681,7 +1681,7 @@ Point should be just after a string that matches TAG."
(save-excursion
(beginning-of-line)
(let ((bol (point)))
- (and (search-forward "\177" (save-excursion (end-of-line) (point)) t)
+ (and (search-forward "\177" (line-end-position) t)
(re-search-backward re bol t)))))
(defcustom tags-loop-revert-buffers nil
@@ -2086,5 +2086,4 @@ for \\[find-tag] (which see)."
(provide 'etags)
-;; arch-tag: b897c2b5-08f3-4837-b2d3-0e7d6db1b63e
;;; etags.el ends here
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el
index 04ec915f3d..b21cd9c89e 100644
--- a/lisp/progmodes/hideif.el
+++ b/lisp/progmodes/hideif.el
@@ -760,7 +760,7 @@ Point is left unchanged."
(cond ((hif-looking-at-else)
(setq else (point)))
(t
- (setq end (point)))) ; (save-excursion (end-of-line) (point))
+ (setq end (point)))) ; (line-end-position)
;; If found #else, look for #endif.
(when else
(while (progn
@@ -769,7 +769,7 @@ Point is left unchanged."
(hif-ifdef-to-endif))
(if (hif-looking-at-else)
(error "Found two elses in a row? Broken!"))
- (setq end (point))) ; (save-excursion (end-of-line) (point))
+ (setq end (point))) ; (line-end-position)
(hif-make-range start end else))))
@@ -1025,5 +1025,4 @@ Return as (TOP . BOTTOM) the extent of ifdef block."
(provide 'hideif)
-;; arch-tag: c6381d17-a59a-483a-b945-658f22277981
;;; hideif.el ends here
diff --git a/lisp/progmodes/icon.el b/lisp/progmodes/icon.el
index 9182b319b5..f0287c9018 100644
--- a/lisp/progmodes/icon.el
+++ b/lisp/progmodes/icon.el
@@ -1,7 +1,7 @@
;;; icon.el --- mode for editing Icon code
-;; Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1989, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;; 2009, 2010 Free Software Foundation, Inc.
;; Author: Chris Smith <[email protected]>
;; Created: 15 Feb 89
@@ -601,7 +601,7 @@ Returns nil if line starts inside a string, t if in a comment."
(indent-to this-indent)))
;; Indent any comment following the text.
(or (looking-at comment-start-skip)
- (if (re-search-forward comment-start-skip (save-excursion (end-of-line) (point)) t)
+ (if (re-search-forward comment-start-skip (line-end-position) t)
(progn (indent-for-comment) (beginning-of-line))))))))))
(defconst icon-font-lock-keywords-1
@@ -687,5 +687,4 @@ Returns nil if line starts inside a string, t if in a comment."
(provide 'icon)
-;; arch-tag: 8abf8c99-e7df-44af-a58f-ef5ed2ee52cb
;;; icon.el ends here
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 1bc9a397bc..97de1b3562 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -920,9 +920,7 @@ Optional argument PARSE-START should be the position of `beginning-of-defun'."
(cond ((looking-at ";?#")
(forward-line 1) t)
((looking-at "\\(\\w\\|\\s_\\)+:[^:]")
- (save-excursion
- (end-of-line)
- (setq colon-line-end (point)))
+ (setq colon-line-end (line-end-position))
(search-forward ":")))))
;; The first following code counts
;; if it is before the line we want to indent.
@@ -982,7 +980,7 @@ Optional argument PARSE-START should be the position of `beginning-of-defun'."
(if (= (char-after (marker-position bof-mark)) ?=)
(message "Can't indent a format statement")
(message "Indenting Perl expression...")
- (save-excursion (end-of-line) (setq eol (point)))
+ (setq eol (line-end-position))
(save-excursion ; locate matching close paren
(while (and (not (eobp)) (<= (point) eol))
(parse-partial-sexp (point) (point-max) 0))
@@ -1080,5 +1078,4 @@ With argument, repeat that many times; negative args move backward."
(provide 'perl-mode)
-;; arch-tag: 8c7ff68d-15f3-46a2-ade2-b7c41f176826
;;; perl-mode.el ends here
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 3e388dac56..dd17c4b608 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -242,7 +242,7 @@ if that value is non-nil."
(defun end-of-prolog-clause ()
"Go to end of clause in this line."
(beginning-of-line 1)
- (let* ((eolpos (save-excursion (end-of-line) (point))))
+ (let* ((eolpos (line-end-position)))
(if (re-search-forward comment-start-skip eolpos 'move)
(goto-char (match-beginning 0)))
(skip-chars-backward " \t")))
@@ -434,5 +434,4 @@ If COMPILE (prefix arg) is not nil, use compile mode rather than consult mode."
(provide 'prolog)
-;; arch-tag: f3ec6748-1272-4ab6-8826-c50cb1607636
;;; prolog.el ends here
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 10e852223c..e72b18afd6 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2605,7 +2605,7 @@ This function is appropriate for `comint-output-filter-functions'."
overlay-arrow-string "=>"
python-pdbtrack-is-tracking-p t)
(set-marker overlay-arrow-position
- (save-excursion (beginning-of-line) (point))
+ (line-beginning-position)
(current-buffer)))
(setq overlay-arrow-position nil
python-pdbtrack-is-tracking-p nil)))
@@ -2891,5 +2891,4 @@ filter."
(provide 'python)
(provide 'python-21)
-;; arch-tag: 6fce1d99-a704-4de9-ba19-c6e4912b0554
;;; python.el ends here
diff --git a/lisp/progmodes/simula.el b/lisp/progmodes/simula.el
index 34c50b6cfe..bfa921841e 100644
--- a/lisp/progmodes/simula.el
+++ b/lisp/progmodes/simula.el
@@ -964,7 +964,7 @@ If COUNT is negative, move backward instead."
(simula-previous-statement 1)
(simula-skip-comment-backward)))
(setq start-line
- (save-excursion (beginning-of-line) (point))
+ (line-beginning-position)
;; - perhaps this is a continued statement
continued
(save-excursion
@@ -1023,7 +1023,7 @@ If COUNT is negative, move backward instead."
(car simula-continued-statement-offset)
simula-continued-statement-offset))))
(setq start-line
- (save-excursion (beginning-of-line) (point))
+ (line-beginning-position)
continued nil))
;; search failed .. point is at beginning of line
;; determine if we should continue searching
@@ -1064,7 +1064,7 @@ If COUNT is negative, move backward instead."
simula-continued-statement-offset))))
;; while ends if point is at beginning of line at loop test
(if (not temp)
- (setq start-line (save-excursion (beginning-of-line) (point)))
+ (setq start-line (line-beginning-position))
(beginning-of-line))))
;;
;; return indentation
@@ -1659,5 +1659,4 @@ If not nil and not t, move to limit of search and return nil."
(provide 'simula)
-;; arch-tag: 488c1bb0-eebf-4f06-93df-1df603f06255
;;; simula.el ends here
diff --git a/lisp/progmodes/vera-mode.el b/lisp/progmodes/vera-mode.el
index 96877a000a..0d119503f3 100644
--- a/lisp/progmodes/vera-mode.el
+++ b/lisp/progmodes/vera-mode.el
@@ -770,7 +770,7 @@ the offset is simply returned."
relpos 0)
(setq offset (vera-evaluate-offset offset langelem symbol)))
(+ (if (and relpos
- (< relpos (save-excursion (beginning-of-line) (point))))
+ (< relpos (line-beginning-position)))
(save-excursion
(goto-char relpos)
(current-column))
@@ -1482,5 +1482,4 @@ If `vera-intelligent-tab' is nil, always indent line."
(provide 'vera-mode)
-;; arch-tag: 22eae722-7ac5-47ac-a713-c4db1cf623a9
;;; vera-mode.el ends here