unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Akib Azmain Turja via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rudalics@gmx.at, 59963@debbugs.gnu.org
Subject: bug#59963: 29.0.50; 'window-max-chars-per-line' doesn't always work on GUI without fringe
Date: Thu, 15 Dec 2022 21:53:23 +0600	[thread overview]
Message-ID: <878rj8r7d8.fsf@disroot.org> (raw)
In-Reply-To: <83o7s6m2o2.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Dec 2022 17:21:33 +0200")

[-- Attachment #1: Type: text/plain, Size: 1817 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

> Akib, please see if the patch below gives good results, including in
> the real-life use case which triggered this report:
>
> diff --git a/lisp/window.el b/lisp/window.el
> index 7d8ee48..a4a8421 100644
> --- a/lisp/window.el
> +++ b/lisp/window.el
> @@ -2162,17 +2162,14 @@ window-max-chars-per-line
>      (let* ((window-width (window-body-width window t))
>  	   (font-width (window-font-width window face))
>  	   (ncols (- (/ window-width font-width)
> -                     (ceiling (line-number-display-width 'columns)))))
> +                     (ceiling (line-number-display-width 'columns))))
> +           (fringes (window-fringes window))
> +           (lfringe (car fringes))
> +           (rfringe (nth 1 fringes)))
>        (if (and (display-graphic-p)
>  	       overflow-newline-into-fringe
> -               (not
> -                (or (eq left-fringe-width 0)
> -                    (and (null left-fringe-width)
> -                         (= (frame-parameter nil 'left-fringe) 0))))
> -               (not
> -                (or (eq right-fringe-width 0)
> -                    (and (null right-fringe-width)
> -                         (= (frame-parameter nil 'right-fringe) 0)))))
> +               (not (eq lfringe 0))
> +               (not (eq rfringe 0)))
>  	  ncols
>          ;; FIXME: This should remove 1 more column when there are no
>          ;; fringes, lines are truncated, and the window is hscrolled,

Looks good at the first glance!  Let me apply it on the function
definition...  Works good!  Approved.

-- 
Akib Azmain Turja, GPG key: 70018CE5819F17A3BBA666AFE74F0EFA922AE7F5
Fediverse: akib@hostux.social
Codeberg: akib
emailselfdefense.fsf.org | "Nothing can be secure without encryption."

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2022-12-15 15:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-11 11:13 bug#59963: 29.0.50; 'window-max-chars-per-line' doesn't always work on GUI without fringe Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-11 14:43 ` Eli Zaretskii
2022-12-11 14:50   ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]   ` <87o7sac78t.fsf@disroot.org>
2022-12-11 15:21     ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-11 16:14       ` Eli Zaretskii
2022-12-12  8:18         ` martin rudalics
2022-12-12 13:10           ` Eli Zaretskii
2022-12-12 16:50             ` martin rudalics
2022-12-14 15:21             ` Eli Zaretskii
2022-12-15 15:53               ` Akib Azmain Turja via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-12-17 12:05                 ` 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=878rj8r7d8.fsf@disroot.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=59963@debbugs.gnu.org \
    --cc=akib@disroot.org \
    --cc=eliz@gnu.org \
    --cc=rudalics@gmx.at \
    /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).