all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: emacs-devel@gnu.org
Subject: Re: Obtain X / HPOS with move_it_to at eol when buffer-display-table line-feed
Date: Tue, 29 Aug 2017 17:59:31 +0300	[thread overview]
Message-ID: <83ziai2ze4.fsf@gnu.org> (raw)
In-Reply-To: <m2tw0qzwlf.wl%esq@lawlist.com> (message from Keith David Bershatsky on Tue, 29 Aug 2017 00:01:16 -0700)

> Date: Tue, 29 Aug 2017 00:01:16 -0700
> From: Keith David Bershatsky <esq@lawlist.com>
> 
> I am working on my own feature requests 17684 (thin vertical line) and 22873 (multiple fake cursors).
> 
> I am having difficulty calculating the X and HPOS using move_it_to when a buffer-display-table contains an entry for a line feed (aka \n).  I am looking for a more eloquent way of of handling this instead of subtracting the frame-char-width from it.current.pos, and also subtracting 1 from it.current.hpos.  We can test the buffer-display-table with something like (aref buffer-display-table ?\n), which in my use-case yields [(182 . 127) 10] because I also use face to color the eol character.
> 
> We test for a line feed with:  FETCH_BYTE (IT_BYTEPOS (it)) == '\n'
> 
> We move to POS using:
> 
> move_it_to (&it, POS, it.last_visible_x, it.last_visible_y - 1, -1, MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
> 
> Is there a better way to handle this instead of subtracting frame-char-width from X and subtracting 1 from HPOS?

I'm sorry, I don't really understand what is it that you are trying to
accomplish.  Can you tell more about the goals of this code?  Also
what exactly isn't working as you expected?



  reply	other threads:[~2017-08-29 14:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-29  7:01 Obtain X / HPOS with move_it_to at eol when buffer-display-table line-feed Keith David Bershatsky
2017-08-29 14:59 ` Eli Zaretskii [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-08-29 18:51 Keith David Bershatsky
2017-08-30 16:51 ` Eli Zaretskii
2017-08-30 18:35 Keith David Bershatsky
2017-08-30 19:03 ` Eli Zaretskii
2017-08-31 16:07 Keith David Bershatsky
2017-08-31 16:17 ` Eli Zaretskii

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=83ziai2ze4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@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 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.