emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105204: Leave point at the end of th


From: Lars Magne Ingebrigtsen
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105204: Leave point at the end of the rectangle after replacing text
Date: Thu, 14 Jul 2011 17:23:08 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105204
fixes bug(s): http://debbugs.gnu.org/7522
committer: Lars Magne Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Thu 2011-07-14 17:23:08 +0200
message:
  Leave point at the end of the rectangle after replacing text
  
  * rect.el (apply-on-rectangle): Return the point after the last
  operation.
  (string-rectangle): Go to the point after the last operation
  (bug#7522).
modified:
  lisp/ChangeLog
  lisp/rect.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-07-14 15:05:08 +0000
+++ b/lisp/ChangeLog    2011-07-14 15:23:08 +0000
@@ -1,5 +1,10 @@
 2011-07-14  Lars Magne Ingebrigtsen  <address@hidden>
 
+       * rect.el (apply-on-rectangle): Return the point after the last
+       operation.
+       (string-rectangle): Go to the point after the last operation
+       (bug#7522).
+
        * simple.el (current-kill): Clarify what
        `interprogram-paste-function' does (bug#7500).
 

=== modified file 'lisp/rect.el'
--- a/lisp/rect.el      2011-04-19 13:44:55 +0000
+++ b/lisp/rect.el      2011-07-14 15:23:08 +0000
@@ -93,8 +93,9 @@
   "Call FUNCTION for each line of rectangle with corners at START, END.
 FUNCTION is called with two arguments: the start and end columns of the
 rectangle, plus ARGS extra arguments.  Point is at the beginning of line when
-the function is called."
-  (let (startcol startpt endcol endpt)
+the function is called.
+The final point after the last operation will be returned."
+  (let (startcol startpt endcol endpt final-point)
     (save-excursion
       (goto-char start)
       (setq startcol (current-column))
@@ -112,8 +113,9 @@
       (goto-char startpt)
       (while (< (point) endpt)
        (apply function startcol endcol args)
+       (setq final-point (point))
        (forward-line 1)))
-    ))
+    final-point))
 
 (defun delete-rectangle-line (startcol endcol fill)
   (when (= (move-to-column startcol (if fill t 'coerce)) startcol)
@@ -323,7 +325,8 @@
                                (or (car string-rectangle-history) ""))
                        nil 'string-rectangle-history
                        (car string-rectangle-history)))))
-  (apply-on-rectangle 'string-rectangle-line start end string t))
+  (goto-char
+   (apply-on-rectangle 'string-rectangle-line start end string t)))
 
 ;;;###autoload
 (defalias 'replace-rectangle 'string-rectangle)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]