bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17585: 24.4.50; vertical-motion erroneously adds points


From: Eli Zaretskii
Subject: bug#17585: 24.4.50; vertical-motion erroneously adds points
Date: Sat, 31 May 2014 22:11:13 +0300

> Date:  Sat, 31 May 2014 12:00:59 -0700
> From:  Keith David Bershatsky <esq@lawlist.com>
> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]