all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Keith David Bershatsky <esq@lawlist.com>, 16475@debbugs.gnu.org
Subject: bug#16475: enhancement request: remove vertical scroll bar automatically when not needed
Date: Wed, 25 Oct 2017 09:47:00 +0200	[thread overview]
Message-ID: <59F04174.6090601@gmx.at> (raw)
In-Reply-To: <m2she7vluc.wl%esq@lawlist.com>

 > Here is a first draft with a simple test (modifying xdisp.c), which
 > probably nukes more than just the selected window's scroll bars when
 > removing them, but it may be sufficient to revive this enhancement
 > request in the event anyone is interested.

Thanks for looking into this.  The test for the vertical scroll bar case
is whether the buffer beginning and its end are both visible in the
window, taking into account visibility, overlays and the like.  I'm not
sure whether

         && ZV - BEGV > BUF_Z (XBUFFER (w->contents)) - w->window_end_pos - marker_position (w->start))

can handle that.

Auto-removal of horizontal scroll bars is more complicated.  Basically,
we could remove the horizontal scroll bar when no line in the window had
to be truncated.  But then we have space to display the next buffer line
and that line could be awfully long.  So some lookahead is needed which
will consume processing time.  Obviously, we could just use the check
whether the entire buffer is visible as for the vertical case but that's
not what other applications usually do.

Also, the state of a window is usually reflected in its variables and
parameters.  The question with auto-removal of scroll bars is how we
reflect a new state in functions like ‘window-scroll-bars’ and
‘set-window-scroll-bars’.

Personally I never cared much about this auto-removal because when space
to display things is scarce, usually a buffer cannot be displayed in its
entirety and scroll bars are needed.  When space abandons I don't mind a
scroll bar being present anyway.  But since most applications usually
remove scroll bars when they are not needed we should probably conform.

Thanks again, martin







  reply	other threads:[~2017-10-25  7:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17  4:42 bug#16475: 24.3.50; enhancement request: remove vertical scroll bar automatically when not needed Drew Adams
2014-01-17 14:35 ` Stefan Monnier
2016-02-12  2:46 ` Keith David Bershatsky
2017-10-25  5:27 ` bug#16475: " Keith David Bershatsky
2017-10-25  7:47   ` martin rudalics [this message]
2017-10-25 14:40     ` Eli Zaretskii
2017-10-26  7:56       ` martin rudalics
2017-10-26 15:59         ` Eli Zaretskii
2017-10-27  8:25           ` martin rudalics
2017-10-27  2:44         ` Richard Stallman
2017-10-25 22:25 ` Keith David Bershatsky
2017-10-26 16:30   ` Eli Zaretskii
2017-10-26 16:03 ` Keith David Bershatsky
2017-10-26 17:07   ` Eli Zaretskii
2017-10-27  8:26     ` martin rudalics

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=59F04174.6090601@gmx.at \
    --to=rudalics@gmx.at \
    --cc=16475@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 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.