(Info-summary): Clear buffer-read-only.
[bpt/emacs.git] / lisp / rect.el
index 71e1f8e..2904f94 100644 (file)
@@ -18,8 +18,9 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
@@ -59,6 +60,10 @@ Point is at the end of the segment of this line within the rectangle."
         (setq begextra (- (current-column) startcol))
         (setq startpos (point))
         (move-to-column endcol coerce-tabs)
+        ;; If we overshot, move back one character
+        ;; so that endextra will be positive.
+        (if (and (not coerce-tabs) (> (current-column) endcol))
+            (backward-char 1))
         (setq endextra (- endcol (current-column)))
         (if (< begextra 0)
             (setq endextra (+ endextra begextra)
@@ -204,8 +209,7 @@ This command does not delete or overwrite any existing text.
 
 Called from a program, takes three args; START, END and STRING."
   (interactive "r\nsString rectangle: ")
-  (operate-on-rectangle 'string-rectangle-line start end t)
-  (goto-char start))
+  (operate-on-rectangle 'string-rectangle-line start end t))
 
 (defun string-rectangle-line (startpos begextra endextra)
   (let (whitespace)