aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2010-11-06 18:06:37 -0700
committerGlenn Morris2010-11-06 18:06:37 -0700
commit26f097bff6dc221b89300a251d36b3cb9fe7ef5b (patch)
tree19a6c79ca453ec199cb42c6a04ee2c5659deda7a
parent4ddab346e6595eefaaf575a1aee508950a33fee0 (diff)
downloademacs-26f097bff6dc221b89300a251d36b3cb9fe7ef5b.tar.gz
emacs-26f097bff6dc221b89300a251d36b3cb9fe7ef5b.zip
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.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/speedbar.el44
2 files changed, 21 insertions, 32 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0c32061f41a..3c2593382b5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12010-11-07 Glenn Morris <rgm@gnu.org>
2
3 * speedbar.el (speedbar-generic-item-info)
4 (speedbar-item-info-tag-helper, speedbar-change-expand-button-char)
5 (speedbar-add-indicator, speedbar-check-vc-this-line)
6 (speedbar-check-obj-this-line, speedbar-extract-one-symbol)
7 (speedbar-buffers-line-directory, speedbar-buffer-revert-buffer):
8 Replace more uses of end-of-line etc with line-end-position.
9
12010-11-06 Glenn Morris <rgm@gnu.org> 102010-11-06 Glenn Morris <rgm@gnu.org>
2 11
3 * textmodes/texnfo-upd.el (texinfo-start-menu-description) 12 * textmodes/texnfo-upd.el (texinfo-start-menu-description)
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 3c05734489c..cb5a8d5c0d3 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -1472,7 +1472,7 @@ File style information is displayed with `speedbar-item-info'."
1472 (if (looking-at "\\s-*[[<({].[]>)}] ") (goto-char (match-end 0))) 1472 (if (looking-at "\\s-*[[<({].[]>)}] ") (goto-char (match-end 0)))
1473 ;; Get the text 1473 ;; Get the text
1474 (speedbar-message "Text: %s" (buffer-substring-no-properties 1474 (speedbar-message "Text: %s" (buffer-substring-no-properties
1475 (point) (progn (end-of-line) (point)))))) 1475 (point) (line-end-position)))))
1476 1476
1477(defun speedbar-item-info () 1477(defun speedbar-item-info ()
1478 "Display info in the minibuffer about the button the mouse is over. 1478 "Display info in the minibuffer about the button the mouse is over.
@@ -1498,8 +1498,7 @@ instead of reading it from the speedbar buffer."
1498Return nil if not applicable." 1498Return nil if not applicable."
1499 (save-excursion 1499 (save-excursion
1500 (beginning-of-line) 1500 (beginning-of-line)
1501 (if (re-search-forward " [-+=]?> \\([^\n]+\\)" 1501 (if (re-search-forward " [-+=]?> \\([^\n]+\\)" (line-end-position) t)
1502 (save-excursion(end-of-line)(point)) t)
1503 (let* ((tag (match-string 1)) 1502 (let* ((tag (match-string 1))
1504 (attr (speedbar-line-token)) 1503 (attr (speedbar-line-token))
1505 (item nil) 1504 (item nil)
@@ -1517,8 +1516,7 @@ Return nil if not applicable."
1517 (looking-at "\\([0-9]+\\):") 1516 (looking-at "\\([0-9]+\\):")
1518 (setq item (file-name-nondirectory (speedbar-line-directory))) 1517 (setq item (file-name-nondirectory (speedbar-line-directory)))
1519 (speedbar-message "Tag: %s in %s" tag item))) 1518 (speedbar-message "Tag: %s in %s" tag item)))
1520 (if (re-search-forward "{[+-]} \\([^\n]+\\)$" 1519 (if (re-search-forward "{[+-]} \\([^\n]+\\)$" (line-end-position) t)
1521 (save-excursion(end-of-line)(point)) t)
1522 (speedbar-message "Group of tags \"%s\"" (match-string 1)) 1520 (speedbar-message "Group of tags \"%s\"" (match-string 1))
1523 (if (re-search-forward " [+-]?[()|@] \\([^\n]+\\)$" nil t) 1521 (if (re-search-forward " [+-]?[()|@] \\([^\n]+\\)$" nil t)
1524 (let* ((detailtext (match-string 1)) 1522 (let* ((detailtext (match-string 1))
@@ -2062,8 +2060,7 @@ position to insert a new item, and that the new item will end with a CR."
2062 "Change the expansion button character to CHAR for the current line." 2060 "Change the expansion button character to CHAR for the current line."
2063 (save-excursion 2061 (save-excursion
2064 (beginning-of-line) 2062 (beginning-of-line)
2065 (if (re-search-forward ":\\s-*.\\([-+?]\\)" (save-excursion (end-of-line) 2063 (if (re-search-forward ":\\s-*.\\([-+?]\\)" (line-end-position) t)
2066 (point)) t)
2067 (speedbar-with-writable 2064 (speedbar-with-writable
2068 (goto-char (match-end 1)) 2065 (goto-char (match-end 1))
2069 (insert-char char 1 t) 2066 (insert-char char 1 t)
@@ -2852,9 +2849,7 @@ indicator, then do not add a space."
2852 (speedbar-with-writable 2849 (speedbar-with-writable
2853 (save-excursion 2850 (save-excursion
2854 (if (and replace-this 2851 (if (and replace-this
2855 (re-search-forward replace-this (save-excursion (end-of-line) 2852 (re-search-forward replace-this (line-end-position) t))
2856 (point))
2857 t))
2858 (delete-region (match-beginning 0) (match-end 0)))) 2853 (delete-region (match-beginning 0) (match-end 0))))
2859 (end-of-line) 2854 (end-of-line)
2860 (if (not (string= " " indicator-string)) 2855 (if (not (string= " " indicator-string))
@@ -2952,9 +2947,7 @@ the file being checked."
2952 (fn (buffer-substring-no-properties 2947 (fn (buffer-substring-no-properties
2953 ;; Skip-chars: thanks ptype@dra.hmg.gb 2948 ;; Skip-chars: thanks ptype@dra.hmg.gb
2954 (point) (progn 2949 (point) (progn
2955 (skip-chars-forward "^ " 2950 (skip-chars-forward "^ " (line-end-position))
2956 (save-excursion (end-of-line)
2957 (point)))
2958 (point)))) 2951 (point))))
2959 (fulln (concat f fn))) 2952 (fulln (concat f fn)))
2960 (if (<= 2 speedbar-verbosity-level) 2953 (if (<= 2 speedbar-verbosity-level)
@@ -3026,9 +3019,7 @@ the file being checked."
3026 (fn (buffer-substring-no-properties 3019 (fn (buffer-substring-no-properties
3027 ;; Skip-chars: thanks ptype@dra.hmg.gb 3020 ;; Skip-chars: thanks ptype@dra.hmg.gb
3028 (point) (progn 3021 (point) (progn
3029 (skip-chars-forward "^ " 3022 (skip-chars-forward "^ " (line-end-position))
3030 (save-excursion (end-of-line)
3031 (point)))
3032 (point)))) 3023 (point))))
3033 (fulln (concat f fn))) 3024 (fulln (concat f fn)))
3034 (if (<= 2 speedbar-verbosity-level) 3025 (if (<= 2 speedbar-verbosity-level)
@@ -3764,17 +3755,12 @@ The line should contain output from etags. Parse the output using the
3764regular expression EXPR." 3755regular expression EXPR."
3765 (let* ((sym (if (stringp expr) 3756 (let* ((sym (if (stringp expr)
3766 (if (save-excursion 3757 (if (save-excursion
3767 (re-search-forward expr (save-excursion 3758 (re-search-forward expr (line-end-position) t))
3768 (end-of-line)
3769 (point)) t))
3770 (buffer-substring-no-properties (match-beginning 1) 3759 (buffer-substring-no-properties (match-beginning 1)
3771 (match-end 1))) 3760 (match-end 1)))
3772 (funcall expr))) 3761 (funcall expr)))
3773 (pos (let ((j (re-search-forward "[\C-?\C-a]\\([0-9]+\\),\\([0-9]+\\)" 3762 (pos (let ((j (re-search-forward "[\C-?\C-a]\\([0-9]+\\),\\([0-9]+\\)"
3774 (save-excursion 3763 (line-end-position) t)))
3775 (end-of-line)
3776 (point))
3777 t)))
3778 (if (and j sym) 3764 (if (and j sym)
3779 (1+ (string-to-number (buffer-substring-no-properties 3765 (1+ (string-to-number (buffer-substring-no-properties
3780 (match-beginning 2) 3766 (match-beginning 2)
@@ -3948,9 +3934,7 @@ Optional argument DEPTH specifies the current depth of the back search."
3948 (let* ((bn (speedbar-line-text)) 3934 (let* ((bn (speedbar-line-text))
3949 (buffer (if bn (get-buffer bn)))) 3935 (buffer (if bn (get-buffer bn))))
3950 (if buffer 3936 (if buffer
3951 (if (save-excursion 3937 (if (eq start (line-end-position))
3952 (end-of-line)
3953 (eq start (point)))
3954 (or (with-current-buffer buffer default-directory) 3938 (or (with-current-buffer buffer default-directory)
3955 "") 3939 "")
3956 (buffer-file-name buffer)))))))) 3940 (buffer-file-name buffer))))))))
@@ -3982,14 +3966,10 @@ TEXT is the buffer's name, TOKEN and INDENT are unused."
3982 (beginning-of-line) 3966 (beginning-of-line)
3983 ;; If this fails, then it is a non-standard click, and as such, 3967 ;; If this fails, then it is a non-standard click, and as such,
3984 ;; perfectly allowed 3968 ;; perfectly allowed
3985 (if (re-search-forward "[]>?}] [^ ]" 3969 (if (re-search-forward "[]>?}] [^ ]" (line-end-position) t)
3986 (line-end-position)
3987 t)
3988 (let ((text (progn 3970 (let ((text (progn
3989 (forward-char -1) 3971 (forward-char -1)
3990 (buffer-substring (point) (save-excursion 3972 (buffer-substring (point) (line-end-position)))))
3991 (end-of-line)
3992 (point))))))
3993 (if (get-buffer text) 3973 (if (get-buffer text)
3994 (progn 3974 (progn
3995 (set-buffer text) 3975 (set-buffer text)