all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] windmove.el: Fix windmove-reference-loc miscalculation
@ 2012-01-19 21:57 Jérémy Compostella
  2012-01-20 10:01 ` martin rudalics
  0 siblings, 1 reply; 9+ messages in thread
From: Jérémy Compostella @ 2012-01-19 21:57 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

All,

When using window hscroll (toggle-truncate-lines on a long lines
buffer), windmove misbehaves. I mean : with the following window
configuration :

+------+-----+
|      |     |
|      |  2  |
|  1   +-----+
|      |     |
|      |  3  |
+------+-----+

and with the very long lines buffer as current buffer of window 3 and point
to the end of a line, `windmove-up' selects the window 1 instead of the
window 2.

Please merge the attached patch or review it.

Best regards,

Jérémy

--
Sent from my Emacs


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] windmove.el: Fix windmove-reference-loc miscalculation --]
[-- Type: text/x-diff, Size: 1229 bytes --]

From 65341a5b715062679a228c23f74273194334f417 Mon Sep 17 00:00:00 2001
From: Jeremy Compostella <jeremy.compostella@gmail.com>
Date: Thu, 19 Jan 2012 22:46:17 +0100
Subject: [PATCH] windmove.el: Fix windmove-reference-loc miscalculation

The `windmove-reference-loc' function should not take into account the
`window-hscoll'.

Signed-off-by: Jeremy Compostella <jeremy.compostella@gmail.com>
---
 lisp/windmove.el |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/lisp/windmove.el b/lisp/windmove.el
index 10a5644..424b3e1 100644
--- a/lisp/windmove.el
+++ b/lisp/windmove.el
@@ -422,12 +422,8 @@ supplied, if ARG is greater or smaller than zero, respectively."
           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)))))))))
+ 	     top-left
+	    (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
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-01-21 10:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-19 21:57 [PATCH] windmove.el: Fix windmove-reference-loc miscalculation Jérémy Compostella
2012-01-20 10:01 ` martin rudalics
2012-01-20 16:16   ` Sylvain Rousseau
2012-01-20 16:55     ` Jérémy Compostella
2012-01-20 18:07       ` martin rudalics
2012-01-20 18:14         ` Jérémy Compostella
2012-01-21 10:05           ` Jérémy Compostella
2012-01-21 10:13             ` martin rudalics
2012-01-20 18:07     ` martin rudalics

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.