unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: 17585@debbugs.gnu.org
Subject: bug#17585: 24.4.50; vertical-motion erroneously adds points
Date: Sat, 31 May 2014 22:11:13 +0300	[thread overview]
Message-ID: <83y4xhbw6m.fsf@gnu.org> (raw)
In-Reply-To: <m2y4xhhixg.wl%esq@lawlist.com>

> 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	other threads:[~2014-05-31 19:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-25  7:23 bug#17585: 24.4.50; vertical-motion erroneously adds points Keith David Bershatsky
2014-05-25 14:23 ` Eli Zaretskii
2014-05-30  6:21 ` Keith David Bershatsky
2014-05-30  6:47   ` Eli Zaretskii
2014-05-30 16:21   ` Stefan Monnier
2014-05-31 19:00 ` Keith David Bershatsky
2014-05-31 19:11   ` Eli Zaretskii [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83y4xhbw6m.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=17585@debbugs.gnu.org \
    --cc=esq@lawlist.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).