From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?J=C3=A9r=C3=A9my_Compostella?= Newsgroups: gmane.emacs.devel Subject: [PATCH] windmove.el: Fix windmove-reference-loc miscalculation Date: Thu, 19 Jan 2012 22:57:36 +0100 Message-ID: <87wr8ntkxb.fsf@Apollo.jerryland.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1327010251 1833 80.91.229.12 (19 Jan 2012 21:57:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 19 Jan 2012 21:57:31 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 19 22:57:26 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rnzz4-0008Se-MH for ged-emacs-devel@m.gmane.org; Thu, 19 Jan 2012 22:57:26 +0100 Original-Received: from localhost ([::1]:38356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rnzz3-0002OI-Fs for ged-emacs-devel@m.gmane.org; Thu, 19 Jan 2012 16:57:25 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:58927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rnzz0-0002OA-S3 for emacs-devel@gnu.org; Thu, 19 Jan 2012 16:57:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rnzyz-0004j8-IE for emacs-devel@gnu.org; Thu, 19 Jan 2012 16:57:22 -0500 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:39073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rnzyz-0004iq-8J for emacs-devel@gnu.org; Thu, 19 Jan 2012 16:57:21 -0500 Original-Received: by werl4 with SMTP id l4so445780wer.0 for ; Thu, 19 Jan 2012 13:57:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type; bh=y4cO7/LC6duUDhlJSG9RLezkMmrQVoSRyJWRW/Qxmac=; b=VCbBD6JglSxSMvIYhJLtS5m88Zt89M0VQ0ykehL5KMPjgJTEOqvx4SWXdJ0sP6YEcE 1N9CC8UV+voMN/dgme7DbapMaL6s4Gv6yfQNUqxKlfBnek3aZW2xj0VKc81A0Q+iwRCj WJgPB1BqQVeScgBIwJnoQ+LGxbfrEFwPYOdvI= Original-Received: by 10.216.131.234 with SMTP id m84mr8126651wei.24.1327010240343; Thu, 19 Jan 2012 13:57:20 -0800 (PST) Original-Received: from Apollo.jerryland.fr ([85.69.251.50]) by mx.google.com with ESMTPS id bj10sm30319947wib.9.2012.01.19.13.57.19 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jan 2012 13:57:19 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:147750 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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=C3=A9r=C3=A9my -- Sent from my Emacs --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-windmove.el-Fix-windmove-reference-loc-miscalculatio.patch Content-Description: [PATCH] windmove.el: Fix windmove-reference-loc miscalculation >From 65341a5b715062679a228c23f74273194334f417 Mon Sep 17 00:00:00 2001 From: Jeremy Compostella 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 --- 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 --=-=-=--