all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 29002@debbugs.gnu.org
Subject: bug#29002: it.first_visible_x is erroneously 0 while horizontal scrolling.
Date: Sun, 29 Oct 2017 10:29:29 -0700	[thread overview]
Message-ID: <m2k1zd6ex2.wl%esq@lawlist.com> (raw)
In-Reply-To: <m2h8umbu0k.wl%esq@lawlist.com>

Here is a link to screen-shot #3:

https://www.lawlist.com/images/bug_hscl_03.png

In that screen-shot, we make the following observations:

* A total of 5 screen lines.

* Line 1 is the current line.

* All 5 lines visually appear to be horizontally scrolled.

* Using the revised function bug-hscroll (below), we iterate over each screen line and generate the values for it.first_visible_x and it.vpos.

* it.first_visible_x returns as being 0 for each of the 5 screen lines.

It is as though Emacs is unaware that the non-current lines still visually appear to be hscrolled, because Emacs "thinks" they are not.

DEFUN ("bug-hscroll", Fbug_hscroll, Sbug_hscroll, 0, 0, 0,
       doc: /* Demonstrate the Emacs hscroll bug. */)
  (void)
{
  struct window *w = decode_live_window (selected_window);
  struct it it;
  void *itdata = bidi_shelve_cache ();
  struct text_pos start_text_position;
  Lisp_Object temp = Qnil;
  Lisp_Object result = Qnil;
  Vmax_mini_window_height = make_number (1);
  SET_TEXT_POS_FROM_MARKER (start_text_position, w->start);
  start_display (&it, w, start_text_position);
  while (true)
    {
      temp = listn (CONSTYPE_HEAP, 3,
                    make_number (it.vpos),
                    build_string (" | "),
                    make_number (it.first_visible_x));
      result = Fcons (temp, result);
      if (IT_CHARPOS (it) == ZV)
        break;
      move_it_by_lines (&it, 1);
      if (it.current_y >= it.last_visible_y)
        break;
    }
  bidi_unshelve_cache (itdata, false);
  result = Fnreverse (result);
  AUTO_STRING (my_string_one, "%s");
  CALLN (Fmessage, my_string_one, result);
  return result;
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

DATE:  [10-29-2017 04:23:07] <29 Oct 2017 13:23:07 +0200>
FROM:  Eli Zaretskii <eliz@gnu.org>
> 
> > Date:  Thu, 26 Oct 2017 11:56:08 -0700
> > From:  Keith David Bershatsky <esq@lawlist.com>
> > Cc:  29002@debbugs.gnu.org
> > 
> > Unfortunately, w->min_hscroll returns a value of 0 in this example.
> 
> For the lines other than the current one, you should use
> it.first_visible_x, it is simpler.  For the current line, use
> w->hscroll.





  parent reply	other threads:[~2017-10-29 17:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-26  1:03 bug#29002: it.first_visible_x is erroneously 0 while horizontal scrolling Keith David Bershatsky
2017-10-26  3:45 ` Keith David Bershatsky
2017-10-26  4:51   ` Eli Zaretskii
2017-10-26  6:20 ` Keith David Bershatsky
2017-10-26 15:56   ` Eli Zaretskii
2017-10-26 18:56 ` Keith David Bershatsky
2017-10-29 11:23   ` Eli Zaretskii
2017-10-29 17:29 ` Keith David Bershatsky [this message]
2017-10-29 18:29   ` Eli Zaretskii
2017-10-29 18:56     ` Eli Zaretskii
2017-10-29 18:56 ` Keith David Bershatsky
2017-10-29 19:23   ` Eli Zaretskii
2017-10-29 19:08 ` Keith David Bershatsky
2017-10-29 20:12 ` Keith David Bershatsky
2017-10-30 18:02   ` Eli Zaretskii
2017-10-30 19:36 ` Keith David Bershatsky
2017-11-04  9:32   ` Eli Zaretskii
2017-11-05  0:16 ` Keith David Bershatsky
2017-11-05  9:15 ` Keith David Bershatsky
2017-11-05 10:44   ` Eli Zaretskii
2017-11-05 16:59 ` Keith David Bershatsky
2017-11-05 18:12   ` Eli Zaretskii
2017-11-06  1:05 ` Keith David Bershatsky

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=m2k1zd6ex2.wl%esq@lawlist.com \
    --to=esq@lawlist.com \
    --cc=29002@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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.