]> code.delx.au - gnu-emacs/commitdiff
(transpose-subr, transpose-subr-1): Rename variables
authorRichard M. Stallman <rms@gnu.org>
Sat, 28 Nov 1998 02:42:51 +0000 (02:42 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 28 Nov 1998 02:42:51 +0000 (02:42 +0000)
bound in one function and used in the other.
(transpose-subr-start1, transpose-subr-start2): Add defvars.
(transpose-subr-end1, transpose-subr-end2): Add defvars.

lisp/simple.el

index 9e51d95d9bc8f7f4499f42148deb0beac1fc220d..6a4734a80043b9a5f2b2ab3bfc1673ac4ed856e0 100644 (file)
@@ -2524,56 +2524,66 @@ With argument 0, interchanges line point is in with line mark is in."
                       (forward-line arg))))
                  arg))
 
+(defvar transpose-subr-start1)
+(defvar transpose-subr-start2)
+(defvar transpose-subr-end1)
+(defvar transpose-subr-end2)
+
 (defun transpose-subr (mover arg)
-  (let (start1 end1 start2 end2)
+  (let (transpose-subr-start1
+       transpose-subr-end1
+       transpose-subr-start2
+       transpose-subr-end2)
     (if (= arg 0)
        (progn
          (save-excursion
            (funcall mover 1)
-           (setq end2 (point))
+           (setq transpose-subr-end2 (point))
            (funcall mover -1)
-           (setq start2 (point))
+           (setq transpose-subr-start2 (point))
            (goto-char (mark))
            (funcall mover 1)
-           (setq end1 (point))
+           (setq transpose-subr-end1 (point))
            (funcall mover -1)
-           (setq start1 (point))
+           (setq transpose-subr-start1 (point))
            (transpose-subr-1))
          (exchange-point-and-mark))
       (if (> arg 0)
          (progn
            (funcall mover -1)
-           (setq start1 (point))
+           (setq transpose-subr-start1 (point))
            (funcall mover 1)
-           (setq end1 (point))
+           (setq transpose-subr-end1 (point))
            (funcall mover arg)
-           (setq end2 (point))
+           (setq transpose-subr-end2 (point))
            (funcall mover (- arg))
-           (setq start2 (point))
+           (setq transpose-subr-start2 (point))
            (transpose-subr-1)
-           (goto-char end2))
+           (goto-char transpose-subr-end2))
        (funcall mover -1)
-       (setq start2 (point))
+       (setq transpose-subr-start2 (point))
        (funcall mover 1)
-       (setq end2 (point))
+       (setq transpose-subr-end2 (point))
        (funcall mover (1- arg))
-       (setq start1 (point))
+       (setq transpose-subr-start1 (point))
        (funcall mover (- arg))
-       (setq end1 (point))
+       (setq transpose-subr-end1 (point))
        (transpose-subr-1)))))
 
 (defun transpose-subr-1 ()
-  (if (> (min end1 end2) (max start1 start2))
+  (if (> (min transpose-subr-end1 transpose-subr-end2)
+        (max transpose-subr-start1 transpose-subr-start2))
       (error "Don't have two things to transpose"))
-  (let* ((word1 (buffer-substring start1 end1))
+  (let* ((word1 (buffer-substring transpose-subr-start1 transpose-subr-end1))
         (len1 (length word1))
-        (word2 (buffer-substring start2 end2))
+        (word2 (buffer-substring transpose-subr-start2 transpose-subr-end2))
         (len2 (length word2)))
-    (delete-region start2 end2)
-    (goto-char start2)
+    (delete-region transpose-subr-start2 transpose-subr-end2)
+    (goto-char transpose-subr-start2)
     (insert word1)
-    (goto-char (if (< start1 start2) start1
-                (+ start1 (- len1 len2))))
+    (goto-char (if (< transpose-subr-start1 transpose-subr-start2)
+                  transpose-subr-start1
+                (+ transpose-subr-start1 (- len1 len2))))
     (delete-region (point) (+ (point) len1))
     (insert word2)))
 \f