From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrey Listopadov Newsgroups: gmane.emacs.bugs Subject: bug#68786: 30.0.50; Horizontal overscroll Date: Mon, 29 Jan 2024 20:53:34 +0300 Message-ID: <87wmrs9fyt.fsf@gmail.com> References: <871qa1b08i.fsf@gmail.com> <86msso4abj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6152"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.11; emacs 30.0.50 Cc: 68786@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 29 19:02:17 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rUVxY-0001P4-RH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 Jan 2024 19:02:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUVxI-0000GE-D1; Mon, 29 Jan 2024 13:02:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUVxD-0000Fz-Cl for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2024 13:01:56 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUVxB-0004I2-Rq for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2024 13:01:54 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rUVxK-0006Ez-6U for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2024 13:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrey Listopadov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Jan 2024 18:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68786 X-GNU-PR-Package: emacs Original-Received: via spool by 68786-submit@debbugs.gnu.org id=B68786.170655129323947 (code B ref 68786); Mon, 29 Jan 2024 18:02:02 +0000 Original-Received: (at 68786) by debbugs.gnu.org; 29 Jan 2024 18:01:33 +0000 Original-Received: from localhost ([127.0.0.1]:33409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUVwr-0006EB-2s for submit@debbugs.gnu.org; Mon, 29 Jan 2024 13:01:33 -0500 Original-Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:53258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rUVwp-0006Ds-BL for 68786@debbugs.gnu.org; Mon, 29 Jan 2024 13:01:31 -0500 Original-Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-51025cafb51so4197959e87.2 for <68786@debbugs.gnu.org>; Mon, 29 Jan 2024 10:01:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706551276; x=1707156076; darn=debbugs.gnu.org; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=8eQZQpOT8Gc4FN4PV/jxJd3h2AeslaGJo7ZT2/IoKZY=; b=H3pRWGj3N9ZpUL5E3F6w+1a7LS0zr4mRsL9dHhXQjYURKxF3h557+SXFpG+NgaWVK+ 8wDcbQkdfUr56hblwwE1rDS8Kw6HYsephwi7w58/xs6RNRvnObWWU6j8Ah5bEF11Vur5 EEfLOlGnH4xFtfyasaO4XV9GRtzE0ZuEyvopsA9VMqNhsprFsx05Y+Rn56VN8TISkM+H bEka7HdPqV3Ajpnpkf5s8nw9/3hpJK4h044fCnNZIA94xR2AoBbDdsx0zCnrg6Vei4FW 7yftP6oGY85FcXyTv6RhTHYrjyTqyXqhbGh4OeTGKEC/NAPzXk+c4I+8UtPblbpHecd/ q9SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706551276; x=1707156076; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8eQZQpOT8Gc4FN4PV/jxJd3h2AeslaGJo7ZT2/IoKZY=; b=ZkfFyy2k8CmRqhRVrO6MXufhpUOIxb2i9bMLWwsMxfxkLDMH1MxIZx7e5fBAV/b2Aj 08GImRsSxeqGg7baobmpBUaXD8/CmmsfqnmJhiEIvTT7NpnO3n0HtJldmWCgg43Pu/Zf JU/5HGZb2LWI4JsVmM0SyhR0UeR2AJ4lSp6WHmROA3ex8QnLxedhXjq08AtRUGtq1/tc pUHPibqtIKzBCIKAQRmOmhjoG4Ng+lmP2Siu4Ku/ioZ88c00J1dbILsIjIXnDasWrMv7 PlAqBhC4sS78AlebTqRO/GkwgY9ejNNHH3uydR5Tebn1pL8v5jF1AaFs6ifQEJV1/qqa nqgA== X-Gm-Message-State: AOJu0YzjjNmd0/3Xy4iEDeTp6ZgB4TTztJOj8VwRHZhITQg5CjpobWoK MRVno/dkd5H2WJdy7o5LNYEd3oY8a4iuXhkabeyq3i/rw1acaPrt3FtocOvcs4Y= X-Google-Smtp-Source: AGHT+IFMUL5F3uhlQVJdUhd8OLluZvQrv4d4/ewvFbyWD6gfnyZRsUNicLfRskn9BsPJ2zOnUCUH6w== X-Received: by 2002:a05:6512:2209:b0:50e:dfb7:607d with SMTP id h9-20020a056512220900b0050edfb7607dmr5055268lfu.55.1706551276146; Mon, 29 Jan 2024 10:01:16 -0800 (PST) Original-Received: from toolbox.smtp.gmail.com ([185.9.75.213]) by smtp.gmail.com with ESMTPSA id t1-20020ac24c01000000b0050e94329e7csm1180384lfq.269.2024.01.29.10.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 10:01:15 -0800 (PST) In-reply-to: <86msso4abj.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:279138 Archived-At: Eli Zaretskii writes: > The above can also be done with horizontal scroll bar, if instead of > dragging the scroll-bar's "thumb" you click on the arrow at the right > side of the scroll bar. At least it works here (perhaps this depends > on the toolkit, I don't know). I'm using GNOME, and in its toolkit the scrollbars are "modern", i.e. flat and without any buttons. > So I think the inconsistency is much smaller than you think, and we > should stop right here and talk about why this makes you uncomfortable > or requires any changes in your opinion. I personally find nothing > bad or unexpected with the ability to scroll past the last visible > character: after all, if the user doesn't want that, he/she can avoid > scrolling farther than he/she wants. The reason I made the piece of code that prevents this is because usually when I'm scrolling to the right (I'm using line truncation all the time), I don't want to overshoot the code I want to see. With the touchpad it's quite easy to do, because the acceleration of the scrolling motion is pretty high, but I usually want it to be that high, otherwise it feels like a /drag/. > It is true that most other applications don't vary the thumb size, but > Emacs has always behaved like it does, so changing it to follow the > other apps is not an option at this point, at least not by default. > > Having said that, ... > >> I would like to ask for a feature to limit the horizontal scroll by the >> longest line, much like the horizontal scrollbar works by default. It >> may not be the longest line in the buffer, as calculating this for huge >> buffers is probably too impactful unless we can cache the longest line >> length until the buffer is changed. Or maybe Emacs already knows the >> buffer's "dimensions", I don't know. > > ... I won't object to such a feature, provided that it's optional and > OFF by default, and also that it is supported on as many toolkits as > is practical. Patches welcome. Fair enough. Right now I can't send a patch, because I don't have the solution for this problem. The piece of code I sent works for me, but it's not general by any means, and has a lot of subtle flaws. Maybe if you could point me out to parts of Emacs that do the calculation of the longest visible line for the scroll bar so I could adopt it instead of doing hacky unscallable-face-font-width-based calculation? Or maybe help me think of a better way to calculate this. Thanks!