diff lisp/progmodes/idlwave.el @ 111433:05dc9dca8729

Replace end-of-line, save-excursion etc with point-at-eol, point-at-bol. * lisp/mh-e/mh-seq.el (mh-read-msg-list): Use point-at-eol. * lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-show-infos) (gnus-bookmark-kill-line): Use point-at-eol. * lisp/cedet/ede/proj-elisp.el (ede-proj-flush-autoconf): Use point-at-bol. * lisp/emacs-lisp/chart.el (chart-zap-chars): * lisp/play/decipher.el (decipher-set-map): * lisp/progmodes/ada-mode.el (ada-get-current-indent) (ada-search-ignore-string-comment, ada-tab-hard, ada-untab-hard): * lisp/progmodes/ada-prj.el (ada-prj-load-from-file, ada-prj-display-help): * lisp/progmodes/ada-xref.el (ada-initialize-runtime-library) (ada-get-all-references): * lisp/progmodes/cperl-mode.el (cperl-electric-paren) (cperl-electric-rparen, cperl-electric-keyword, cperl-electric-else) (cperl-linefeed, cperl-sniff-for-indent, cperl-to-comment-or-eol) (cperl-find-pods-heres, cperl-indent-exp, cperl-fix-line-spacing) (cperl-word-at-point-hard): * lisp/progmodes/idlw-shell.el (idlwave-shell-move-or-history) (idlwave-shell-filename-string, idlwave-shell-batch-command) (idlwave-shell-display-line): * lisp/progmodes/idlwave.el (idlwave-show-begin, idlwave-fill-paragraph) (idlwave-calc-hanging-indent, idlwave-auto-fill, idlwave-template): * lisp/progmodes/js.el (js--re-search-forward-inner) (js--re-search-backward-inner): * lisp/progmodes/vhdl-mode.el (vhdl-align-region-1, vhdl-align-region-2) (vhdl-fix-clause, vhdl-compose-configuration-architecture): * lisp/progmodes/ruby-mode.el (ruby-parse-partial, eval-when-compile): * lisp/textmodes/flyspell.el (flyspell-process-localwords): * lisp/textmodes/ispell.el (ispell-buffer-local-parsing) (ispell-buffer-local-dict, ispell-buffer-local-words): Use point-at-bol and point-at-eol.
author Glenn Morris <rgm@gnu.org>
date Sat, 06 Nov 2010 18:36:33 -0700
parents 043aac1cda3c
children 56b71cddc9c5
line wrap: on
line diff
--- a/lisp/progmodes/idlwave.el	Sun Nov 07 01:10:01 2010 +0000
+++ b/lisp/progmodes/idlwave.el	Sat Nov 06 18:36:33 2010 -0700
@@ -2152,7 +2152,7 @@
   ;;(backward-char 1)
   (let* ((pos (point-marker))
 	 (last-abbrev-marker (copy-marker last-abbrev-location))
-	 (eol-pos (save-excursion (end-of-line) (point)))
+	 (eol-pos (point-at-eol))
 	 begin-pos end-pos end end1 )
     (if idlwave-reindent-end  (idlwave-indent-line))
     (setq last-abbrev-location (marker-position last-abbrev-marker))
@@ -3301,10 +3301,8 @@
         (setq here (point))
         (beginning-of-line)
         (setq bcl (point))
-        (re-search-forward
-         (concat "^[ \t]*" comment-start "+")
-         (save-excursion (end-of-line) (point))
-         t)
+        (re-search-forward (concat "^[ \t]*" comment-start "+")
+			   (point-at-eol) t)
         ;; Get the comment leader on the line and its length
         (setq pre (current-column))
         ;; the comment leader is the indentation plus exactly the
@@ -3369,9 +3367,7 @@
               (setq indent hang)
               (beginning-of-line)
               (while (> (point) start)
-                (re-search-forward comment-start-skip
-                                   (save-excursion (end-of-line) (point))
-                                   t)
+                (re-search-forward comment-start-skip (point-at-eol) t)
                 (if (> (setq diff (- indent (current-column))) 0)
                     (progn
                       (if (>= here (point))
@@ -3393,13 +3389,9 @@
             (setq indent
                   (min indent
                        (progn
-                         (re-search-forward
-                          comment-start-skip
-                          (save-excursion (end-of-line) (point))
-                          t)
+                         (re-search-forward comment-start-skip (point-at-eol) t)
                          (current-column))))
-            (forward-line -1))
-          )
+            (forward-line -1)))
         (setq fill-prefix (concat fill-prefix
                                   (make-string (- indent pre)
                                                ?\ )))
@@ -3407,10 +3399,7 @@
         (setq first-indent
               (max
                (progn
-                 (re-search-forward
-                  comment-start-skip
-                  (save-excursion (end-of-line) (point))
-                  t)
+                 (re-search-forward comment-start-skip (point-at-eol) t)
                  (current-column))
                indent))
 
@@ -3448,17 +3437,11 @@
   (if idlwave-use-last-hang-indent
       (save-excursion
         (end-of-line)
-        (if (re-search-backward
-             idlwave-hang-indent-regexp
-             (save-excursion (beginning-of-line) (point))
-             t)
+        (if (re-search-backward idlwave-hang-indent-regexp (point-at-bol) t)
             (+ (current-column) (length idlwave-hang-indent-regexp))))
     (save-excursion
       (beginning-of-line)
-      (if (re-search-forward
-           idlwave-hang-indent-regexp
-           (save-excursion (end-of-line) (point))
-           t)
+      (if (re-search-forward idlwave-hang-indent-regexp (point-at-eol) t)
           (current-column)))))
 
 (defun idlwave-auto-fill ()
@@ -3502,18 +3485,14 @@
 			 (save-excursion
 			   (forward-line -1)
 			   (idlwave-calc-hanging-indent))))
-		    (if indent
-			(progn
-			  ;; Remove whitespace between comment delimiter and
-			  ;; text, insert spaces for appropriate indentation.
-			  (beginning-of-line)
-			  (re-search-forward
-			   comment-start-skip
-			   (save-excursion (end-of-line) (point)) t)
-			  (delete-horizontal-space)
-			  (idlwave-indent-to indent)
-			  (goto-char (- (point-max) here)))
-		      )))
+		    (when indent
+		      ;; Remove whitespace between comment delimiter and
+		      ;; text, insert spaces for appropriate indentation.
+		      (beginning-of-line)
+		      (re-search-forward comment-start-skip (point-at-eol) t)
+		      (delete-horizontal-space)
+		      (idlwave-indent-to indent)
+		      (goto-char (- (point-max) here)))))
 	    ;; Split code or comment?
 	    (if (save-excursion
 		  (end-of-line 0)
@@ -3767,7 +3746,7 @@
 	   (setq s1 (downcase s1) s2 (downcase s2)))
 	  (idlwave-abbrev-change-case
 	   (setq s1 (upcase s1) s2 (upcase s2))))
-    (let ((beg (save-excursion (beginning-of-line) (point)))
+    (let ((beg (point-at-bol))
 	  end)
       (if (not (looking-at "\\s-*\n"))
 	  (open-line 1))