changeset 111431:e4200648c86f

Replace more speedbar uses of end-of-line etc with line-end-position. * lisp/speedbar.el (speedbar-generic-item-info) (speedbar-item-info-tag-helper, speedbar-change-expand-button-char) (speedbar-add-indicator, speedbar-check-vc-this-line) (speedbar-check-obj-this-line, speedbar-extract-one-symbol) (speedbar-buffers-line-directory, speedbar-buffer-revert-buffer): Replace more uses of end-of-line etc with line-end-position.
author Glenn Morris <rgm@gnu.org>
date Sat, 06 Nov 2010 18:06:37 -0700
parents b75e6634a171
children 8de1e4554e5e
files lisp/ChangeLog lisp/speedbar.el
diffstat 2 files changed, 21 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Nov 07 00:22:06 2010 +0000
+++ b/lisp/ChangeLog	Sat Nov 06 18:06:37 2010 -0700
@@ -1,3 +1,12 @@
+2010-11-07  Glenn Morris  <rgm@gnu.org>
+
+	* speedbar.el (speedbar-generic-item-info)
+	(speedbar-item-info-tag-helper, speedbar-change-expand-button-char)
+	(speedbar-add-indicator, speedbar-check-vc-this-line)
+	(speedbar-check-obj-this-line, speedbar-extract-one-symbol)
+	(speedbar-buffers-line-directory, speedbar-buffer-revert-buffer):
+	Replace more uses of end-of-line etc with line-end-position.
+
 2010-11-06  Glenn Morris  <rgm@gnu.org>
 
 	* textmodes/texnfo-upd.el (texinfo-start-menu-description)
--- a/lisp/speedbar.el	Sun Nov 07 00:22:06 2010 +0000
+++ b/lisp/speedbar.el	Sat Nov 06 18:06:37 2010 -0700
@@ -1472,7 +1472,7 @@
     (if (looking-at "\\s-*[[<({].[]>)}] ") (goto-char (match-end 0)))
     ;; Get the text
     (speedbar-message "Text: %s" (buffer-substring-no-properties
-				  (point) (progn (end-of-line) (point))))))
+				  (point) (line-end-position)))))
 
 (defun speedbar-item-info ()
   "Display info in the minibuffer about the button the mouse is over.
@@ -1498,8 +1498,7 @@
 Return nil if not applicable."
   (save-excursion
     (beginning-of-line)
-    (if (re-search-forward " [-+=]?> \\([^\n]+\\)"
-			   (save-excursion(end-of-line)(point)) t)
+    (if (re-search-forward " [-+=]?> \\([^\n]+\\)" (line-end-position) t)
        (let* ((tag (match-string 1))
 	      (attr (speedbar-line-token))
 	      (item nil)
@@ -1517,8 +1516,7 @@
 	    (looking-at "\\([0-9]+\\):")
 	    (setq item (file-name-nondirectory (speedbar-line-directory)))
 	    (speedbar-message "Tag: %s  in %s" tag item)))
-      (if (re-search-forward "{[+-]} \\([^\n]+\\)$"
-			     (save-excursion(end-of-line)(point)) t)
+      (if (re-search-forward "{[+-]} \\([^\n]+\\)$" (line-end-position) t)
 	  (speedbar-message "Group of tags \"%s\"" (match-string 1))
 	(if (re-search-forward " [+-]?[()|@] \\([^\n]+\\)$" nil t)
 	    (let* ((detailtext (match-string 1))
@@ -2062,8 +2060,7 @@
   "Change the expansion button character to CHAR for the current line."
   (save-excursion
     (beginning-of-line)
-    (if (re-search-forward ":\\s-*.\\([-+?]\\)" (save-excursion (end-of-line)
-								(point)) t)
+    (if (re-search-forward ":\\s-*.\\([-+?]\\)" (line-end-position) t)
 	(speedbar-with-writable
 	  (goto-char (match-end 1))
 	  (insert-char char 1 t)
@@ -2852,9 +2849,7 @@
   (speedbar-with-writable
     (save-excursion
       (if (and replace-this
-	       (re-search-forward replace-this (save-excursion (end-of-line)
-							       (point))
-				  t))
+	       (re-search-forward replace-this (line-end-position) t))
 	  (delete-region (match-beginning 0) (match-end 0))))
     (end-of-line)
     (if (not (string= " " indicator-string))
@@ -2952,9 +2947,7 @@
 	 (fn (buffer-substring-no-properties
 	      ;; Skip-chars: thanks ptype@dra.hmg.gb
 	      (point) (progn
-			(skip-chars-forward "^ "
-					    (save-excursion (end-of-line)
-							    (point)))
+			(skip-chars-forward "^ " (line-end-position))
 			(point))))
 	 (fulln (concat f fn)))
     (if (<= 2 speedbar-verbosity-level)
@@ -3026,9 +3019,7 @@
 	 (fn (buffer-substring-no-properties
 	      ;; Skip-chars: thanks ptype@dra.hmg.gb
 	      (point) (progn
-			(skip-chars-forward "^ "
-					    (save-excursion (end-of-line)
-							    (point)))
+			(skip-chars-forward "^ " (line-end-position))
 			(point))))
 	 (fulln (concat f fn)))
     (if (<= 2 speedbar-verbosity-level)
@@ -3764,17 +3755,12 @@
 regular expression EXPR."
   (let* ((sym (if (stringp expr)
 		  (if (save-excursion
-			(re-search-forward expr (save-excursion
-						  (end-of-line)
-						  (point)) t))
+			(re-search-forward expr (line-end-position) t))
 		      (buffer-substring-no-properties (match-beginning 1)
 						      (match-end 1)))
 		(funcall expr)))
 	 (pos (let ((j (re-search-forward "[\C-?\C-a]\\([0-9]+\\),\\([0-9]+\\)"
-					  (save-excursion
-					    (end-of-line)
-					    (point))
-					  t)))
+					  (line-end-position) t)))
 		(if (and j sym)
 		    (1+ (string-to-number (buffer-substring-no-properties
 					(match-beginning 2)
@@ -3948,9 +3934,7 @@
 	(let* ((bn (speedbar-line-text))
 	       (buffer (if bn (get-buffer bn))))
 	  (if buffer
-	      (if (save-excursion
-		    (end-of-line)
-		    (eq start (point)))
+	      (if (eq start (line-end-position))
 		  (or (with-current-buffer buffer default-directory)
 		      "")
 		(buffer-file-name buffer))))))))
@@ -3982,14 +3966,10 @@
     (beginning-of-line)
     ;; If this fails, then it is a non-standard click, and as such,
     ;; perfectly allowed
-    (if (re-search-forward "[]>?}] [^ ]"
-			   (line-end-position)
-			   t)
+    (if (re-search-forward "[]>?}] [^ ]" (line-end-position) t)
 	(let ((text (progn
 		      (forward-char -1)
-		      (buffer-substring (point) (save-excursion
-						  (end-of-line)
-						  (point))))))
+		      (buffer-substring (point) (line-end-position)))))
 	  (if (get-buffer text)
 	      (progn
 		(set-buffer text)