unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 22637@debbugs.gnu.org
Subject: bug#22637: 25.1.50; `mode-line` face `:height` incompatible with `scroll-conservatively 101`.
Date: Sat, 13 Feb 2016 19:40:34 -0800	[thread overview]
Message-ID: <m2fuww558t.wl%esq@lawlist.com> (raw)
In-Reply-To: <m21t8ioevq.wl%esq@lawlist.com>

In addition to the fix that you implemented yesterday near the section of "optimization 3", another similar fix would be needed near the following "recenter" section that affects cursor visibility when using isearch where sometimes point is below the bottom of the screen and remains there subsequent to redisplay.  I have not yet been able to figure out how to use `cursor_row_fully_visible_p`, so I used something a little easier for me to understand that basically tests the same thing (I think).

If I can come up with a small test that demonstrates the problem when searching, I'll send over an example.  The following code, however, does seem to fix the problem in all of my tests.


      /* Users who set scroll-conservatively to a large number want
	 point just above/below the scroll margin.  If we ended up
	 with point's row partially visible, move the window start to
	 make that row fully visible and out of the margin.  */
      if (scroll_conservatively > SCROLL_LIMIT)
	{
	  int window_total_lines
	    = WINDOW_TOTAL_LINES (w) * FRAME_LINE_HEIGHT (f) * frame_line_height;
	  int margin =
	    scroll_margin > 0
	    ? min (scroll_margin, window_total_lines / 4)
	    : 0;
	  bool move_down = w->cursor.vpos >= window_total_lines / 2;

	  move_it_by_lines (&it, move_down ? margin + 1 : -(margin + 1));
	  clear_glyph_matrix (w->desired_matrix);

  /* Added a check/fix for a problem similar/same as bug #22637.  */
  if (1 == try_window (window, it.current.pos, TRY_WINDOW_CHECK_MARGINS))
    {
      bool fully_p = false;
      EMACS_INT posint = PT;
      struct buffer *buf;
      int x, y, rtop, rbot, rowh, vpos;
      buf = XBUFFER (w->contents);
      if ((posint >= CHARPOS (startp) && posint <= BUF_ZV (buf))
          && CHARPOS (startp) >= BUF_BEGV (buf)
          && CHARPOS (startp) <= BUF_ZV (buf)
          && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos))
        fully_p = !rtop && !rbot;
      if (!fully_p)
        {
#ifdef GLYPH_DEBUG
          debug_method_add (w, "!fully_p -- goto try_to_scroll");
#endif
          goto try_to_scroll;
        }
        else
          {
#ifdef GLYPH_DEBUG
            debug_method_add (w, "fully_p -- goto done");
#endif
            goto done;
          }
    }

	}





  parent reply	other threads:[~2016-02-14  3:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12  2:12 bug#22637: 25.1.50; `mode-line` face `:height` incompatible with `scroll-conservatively 101` Keith David Bershatsky
2016-02-12  8:17 ` Eli Zaretskii
2016-02-12 16:17 ` Keith David Bershatsky
2016-02-12 19:40   ` Eli Zaretskii
2016-02-14  3:40 ` Keith David Bershatsky [this message]
2016-02-14  6:05   ` Eli Zaretskii
2016-02-14  7:55 ` Keith David Bershatsky
2016-02-14 19:26   ` Eli Zaretskii
2016-02-16  2:00 ` Keith David Bershatsky
2016-02-16  2:51 ` Keith David Bershatsky
2016-02-16 15:51   ` Eli Zaretskii
2022-02-10  8:09     ` Lars Ingebrigtsen
2022-02-10 12:33       ` 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

  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=m2fuww558t.wl%esq@lawlist.com \
    --to=esq@lawlist.com \
    --cc=22637@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 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).