From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#17585: 24.4.50; vertical-motion erroneously adds points Date: Sat, 31 May 2014 22:11:13 +0300 Message-ID: <83y4xhbw6m.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1401563544 17579 80.91.229.3 (31 May 2014 19:12:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 31 May 2014 19:12:24 +0000 (UTC) Cc: 17585@debbugs.gnu.org To: Keith David Bershatsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 31 21:12:16 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WqohT-0005cH-HV for geb-bug-gnu-emacs@m.gmane.org; Sat, 31 May 2014 21:12:15 +0200 Original-Received: from localhost ([::1]:60910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WqohS-0003jH-Sb for geb-bug-gnu-emacs@m.gmane.org; Sat, 31 May 2014 15:12:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WqohL-0003h9-IA for bug-gnu-emacs@gnu.org; Sat, 31 May 2014 15:12:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WqohG-0004PM-6X for bug-gnu-emacs@gnu.org; Sat, 31 May 2014 15:12:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40280) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WqohG-0004PI-3D for bug-gnu-emacs@gnu.org; Sat, 31 May 2014 15:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WqohF-0000IT-Oj for bug-gnu-emacs@gnu.org; Sat, 31 May 2014 15:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 31 May 2014 19:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17585 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17585-submit@debbugs.gnu.org id=B17585.14015634881093 (code B ref 17585); Sat, 31 May 2014 19:12:01 +0000 Original-Received: (at 17585) by debbugs.gnu.org; 31 May 2014 19:11:28 +0000 Original-Received: from localhost ([127.0.0.1]:39157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wqogi-0000HY-01 for submit@debbugs.gnu.org; Sat, 31 May 2014 15:11:28 -0400 Original-Received: from mtaout27.012.net.il ([80.179.55.183]:45843) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wqoge-0000HJ-Mg for 17585@debbugs.gnu.org; Sat, 31 May 2014 15:11:26 -0400 Original-Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0N6G00G00CQOV100@mtaout27.012.net.il> for 17585@debbugs.gnu.org; Sat, 31 May 2014 22:08:09 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N6G00E9ZD5L7Q50@mtaout27.012.net.il>; Sat, 31 May 2014 22:08:09 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:89822 Archived-At: > Date: Sat, 31 May 2014 12:00:59 -0700 > From: Keith David Bershatsky > Cc: 17585@debbugs.gnu.org > > I am working on writing a custom library that draws a thin vertical line (i.e., "|") and a thin horizontal line (i.e., `underline`), which is compatible with `visual-line-mode` and `linum-mode`. The visual effect is similar to the `crosshairs.el` library, except that mine is done with thin lines only -- i.e., no background highlighting. One of my key functions uses (vertical-motion 1) for every line in the visible window. To deal with the situation best described by Eli (below), I use the following immediately after each execution of (vertical-motion 1): > > (when (= (current-column) 2 ) > (move-to-column (+ (current-column) (- window-width 2)))) This shouldn't be necessary. Try invoking linum-update (or whatever function is put by linum-mode on the post-command hook) before/when you display the buffer for the first time, and I think the problem should go away. It is caused by the fact that the line numbers are not displayed until the first command that displays the buffer finishes, and therefore any functions in that first command will not be aware that the window has non-zero left margin.