diff lisp/progmodes/cperl-mode.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 d90a3bc6b730
children 56b71cddc9c5
line wrap: on
line diff
--- a/lisp/progmodes/cperl-mode.el	Sun Nov 07 01:10:01 2010 +0000
+++ b/lisp/progmodes/cperl-mode.el	Sat Nov 06 18:36:33 2010 -0700
@@ -1,8 +1,8 @@
 ;;; cperl-mode.el --- Perl code editing commands for Emacs
 
-;; Copyright (C) 1985, 1986, 1987, 1991, 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) 1985, 1986, 1987, 1991, 1992, 1993, 1994, 1995, 1996,
+;;   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+;;   2008, 2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: Ilya Zakharevich
 ;;	Bob Olson
@@ -2145,7 +2145,7 @@
   "Insert an opening parenthesis or a matching pair of parentheses.
 See `cperl-electric-parens'."
   (interactive "P")
-  (let ((beg (save-excursion (beginning-of-line) (point)))
+  (let ((beg (point-at-bol))
 	(other-end (if (and cperl-electric-parens-mark
 			    (cperl-mark-active)
 			    (> (mark) (point)))
@@ -2182,7 +2182,7 @@
 If not, or if we are not at the end of marking range, would self-insert.
 Affected by `cperl-electric-parens'."
   (interactive "P")
-  (let ((beg (save-excursion (beginning-of-line) (point)))
+  (let ((beg (point-at-bol))
 	(other-end (if (and cperl-electric-parens-mark
 			    (cperl-val 'cperl-electric-parens)
 			    (memq last-command-event
@@ -2215,7 +2215,7 @@
   "Insert a construction appropriate after a keyword.
 Help message may be switched off by setting `cperl-message-electric-keyword'
 to nil."
-  (let ((beg (save-excursion (beginning-of-line) (point)))
+  (let ((beg (point-at-bol))
 	(dollar (and (eq last-command-event ?$)
 		     (eq this-command 'self-insert-command)))
 	(delete (and (memq last-command-event '(?\s ?\n ?\t ?\f))
@@ -2358,7 +2358,7 @@
   "Insert a construction appropriate after a keyword.
 Help message may be switched off by setting `cperl-message-electric-keyword'
 to nil."
-  (let ((beg (save-excursion (beginning-of-line) (point))))
+  (let ((beg (point-at-bol)))
     (and (save-excursion
 	   (backward-sexp 1)
 	   (cperl-after-expr-p nil "{;:"))
@@ -2397,8 +2397,8 @@
   "Go to end of line, open a new line and indent appropriately.
 If in POD, insert appropriate lines."
   (interactive)
-  (let ((beg (save-excursion (beginning-of-line) (point)))
-	(end (save-excursion (end-of-line) (point)))
+  (let ((beg (point-at-bol))
+	(end (point-at-eol))
 	(pos (point)) start over cut res)
     (if (and				; Check if we need to split:
 					; i.e., on a boundary and inside "{...}"
@@ -2476,12 +2476,8 @@
 		   (forward-paragraph -1)
 		   (forward-word 1)
 		   (setq pos (point))
-		   (setq cut (buffer-substring (point)
-					       (save-excursion
-						 (end-of-line)
-						 (point))))
-		   (delete-char (- (save-excursion (end-of-line) (point))
-				   (point)))
+		   (setq cut (buffer-substring (point) (point-at-eol)))
+		   (delete-char (- (point-at-eol) (point)))
 		   (setq res (expand-abbrev))
 		   (save-excursion
 		     (goto-char pos)
@@ -2946,8 +2942,7 @@
 					(point-max)))) ; do not loop if no syntaxification
 				  ;; label:
 				  (t
-				   (save-excursion (end-of-line)
-						   (setq colon-line-end (point)))
+				   (setq colon-line-end (point-at-eol))
 				   (search-forward ":"))))
 			  ;; We are at beginning of code (NOT label or comment)
 			  ;; First, the following code counts
@@ -3220,7 +3215,7 @@
 Returns true if comment is found.  In POD will not move the point."
   ;; If the line is inside other syntax groups (qq-style strings, HERE-docs)
   ;; then looks for literal # or end-of-line.
-  (let (state stop-in cpoint (lim (progn (end-of-line) (point))) pr e)
+  (let (state stop-in cpoint (lim (point-at-eol)) pr e)
     (or cperl-font-locking
 	(cperl-update-syntaxification lim lim))
     (beginning-of-line)
@@ -3814,7 +3809,7 @@
 		 (let ((case-fold-search t))
 		   (looking-at "extproc[ \t]")) ; Analogue of #!
 		 (cperl-commentify min
-				   (save-excursion (end-of-line) (point))
+				   (point-at-eol)
 				   nil))
 	    (while (and
 		    (< (point) max)
@@ -5002,7 +4997,7 @@
 conditional/loop constructs."
   (interactive)
   (save-excursion
-    (let ((tmp-end (progn (end-of-line) (point))) top done)
+    (let ((tmp-end (point-at-eol)) top done)
       (save-excursion
 	(beginning-of-line)
 	(while (null done)
@@ -5045,13 +5040,9 @@
 			   "\\<\\(else\\|elsif\|continue\\)\\>"))
 		  (progn
 		    (goto-char (match-end 0))
-		    (save-excursion
-		      (end-of-line)
-		      (setq tmp-end (point))))
+		    (setq tmp-end (point-at-eol)))
 		(setq done t))))
-	  (save-excursion
-	    (end-of-line)
-	    (setq tmp-end (point))))
+	  (setq tmp-end (point-at-eol)))
 	(goto-char tmp-end)
 	(setq tmp-end (point-marker)))
       (if cperl-indent-region-fix-constructs
@@ -5064,7 +5055,7 @@
   (interactive)
   (or end
       (setq end (point-max)))
-  (let ((ee (save-excursion (end-of-line) (point)))
+  (let ((ee (point-at-eol))
 	(cperl-indent-region-fix-constructs
 	 (or cperl-indent-region-fix-constructs 1))
 	p pp ml have-brace ret)
@@ -5217,7 +5208,7 @@
 				(if (cperl-indent-line parse-data)
 				    (setq ret (cperl-fix-line-spacing end parse-data)))))))))))
 	(beginning-of-line)
-	(setq p (point) pp (save-excursion (end-of-line) (point))) ; May be different from ee.
+	(setq p (point) pp (point-at-eol)) ; May be different from ee.
 	;; Now check whether there is a hanging `}'
 	;; Looking at:
 	;; } blah
@@ -7479,7 +7470,7 @@
   ;; Get to the something meaningful
   (or (eobp) (eolp) (forward-char 1))
   (re-search-backward "[-a-zA-Z0-9_:!&*+,-./<=>?\\\\^|~$%@]"
-		      (save-excursion (beginning-of-line) (point))
+		      (point-at-bol)
 		      'to-beg)
   ;;  (cond
   ;;   ((or (eobp) (looking-at "[][ \t\n{}();,]")) ; Not at a symbol
@@ -8999,5 +8990,4 @@
 
 (provide 'cperl-mode)
 
-;; arch-tag: 42e5b19b-e187-4537-929f-1a7408980ce6
 ;;; cperl-mode.el ends here