]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix windmove-reference-loc miscalculation.
authorJérémy Compostella <jeremy.compostella@gmail.com>
Sat, 21 Jan 2012 10:02:34 +0000 (11:02 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Sat, 21 Jan 2012 10:02:34 +0000 (11:02 +0100)
lisp/ChangeLog
lisp/windmove.el

index 40e4a8a844a6d1692b1fc1e8e9b334eca3749310..4790ec98cf620766cbf8d866f5e5d62f06dce573 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-21  Jérémy Compostella  <jeremy.compostella@gmail.com>
+
+       * windmove.el (windmove-reference-loc): Fix
+       windmove-reference-loc miscalculation.
+
 2012-01-21  Jay Belanger  <jay.p.belanger@gmail.com>
 
        * calc/calc-units.el (math-put-default-units): Don't use "1" as a
index 10a564419fbb4461fb741f86c6a4fa9ac1e8ec50..0523530869ba8d0d3f8162d4d2a226b25665d805 100644 (file)
@@ -417,17 +417,17 @@ supplied, if ARG is greater or smaller than zero, respectively."
                               (- (nth 3 edges) 1))))
       (cond
        ((> effective-arg 0)
-          top-left)
+       top-left)
        ((< effective-arg 0)
-          bottom-right)
+       bottom-right)
        ((= effective-arg 0)
-          (windmove-coord-add
-             top-left
-            (let ((col-row
-                   (posn-col-row
-                    (posn-at-point (window-point window) window))))
-              (cons (- (car col-row) (window-hscroll window))
-                    (cdr col-row)))))))))
+       (windmove-coord-add
+        top-left
+        ;; Don't care whether window is horizontally scrolled -
+        ;; `posn-at-point' handles that already.  See also:
+        ;; http://lists.gnu.org/archive/html/emacs-devel/2012-01/msg00638.html
+        (posn-col-row
+         (posn-at-point (window-point window) window))))))))
 
 ;; This uses the reference location in the current window (calculated
 ;; by `windmove-reference-loc' above) to find a reference location