all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jérémy Compostella" <jeremy.compostella@gmail.com>
To: emacs-devel@gnu.org
Subject: [PATCH] windmove.el: Fix windmove-reference-loc miscalculation
Date: Thu, 19 Jan 2012 22:57:36 +0100	[thread overview]
Message-ID: <87wr8ntkxb.fsf@Apollo.jerryland.fr> (raw)

[-- 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


             reply	other threads:[~2012-01-19 21:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19 21:57 Jérémy Compostella [this message]
2012-01-20 10:01 ` [PATCH] windmove.el: Fix windmove-reference-loc miscalculation 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wr8ntkxb.fsf@Apollo.jerryland.fr \
    --to=jeremy.compostella@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.