emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "N. Jackson" <nljlistbox2@gmail.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Off-by-one error in width of Agenda window?
Date: Tue, 19 Apr 2022 10:06:58 -0400	[thread overview]
Message-ID: <87czhdqi9p.fsf_-_@moondust.localdomain> (raw)
In-Reply-To: <874k2ppxth.fsf@localhost> (Ihor Radchenko's message of "Tue, 19 Apr 2022 11:16:26 +0800")

At 11:16 +0800 on Tuesday 2022-04-19, Ihor Radchenko wrote:
>
> Thanks! I was able to reproduce the problem.
>
> I believe that it is not Org's fault. Org is trusting (window-width)
> return value to calculate the width of the separator line. However, with
> you settings, (window-width) apparently returns a wrong value. You can
> see it yourself by running (insert (make-string (window-width) ?=)) in
> scratch buffer with and without your fringe settings.
>
> Probably, you should report this as Emacs bug.

It turns out there is already an Emacs bug for this (Bug 19395:
Setting left fringe to 0 messes up window-width
(https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19395)).

My understanding of the discussion is that the bug is caused by
window-width including in its return value the width of the column
reserved for the continuation glyph (which column exists when one or
both of the fringes is/are turned off), so window-width over-reports
the available width of the window in this case.

The bug hasn't been closed, but IIUC it has been "fixed" by changing
the documentation of window-width to indicate the limitation. The
latter part of the bug thread is a discussion and development of the
function window-max-chars-per-line.

It seems that Org maybe should be using window-max-chars-per-line
rather than window-width.

[Unfortunately w-m-c-p-l is not a drop in replacement for
window-width; it doesn't just fix the continuation glyph column
"bug", but it also adds additional functionality and has a different
signature.]

Regards,
N.

P.S. I learnt in my reading that turning off one of my fringes gains
me nothing because Emacs then turns around an puts an empty column
on the right side of my window to potentially display a continuation
glyph. So, to work around this Agenda bug temporarily I have turned
on both fringes.




  reply	other threads:[~2022-04-19 14:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18 13:10 [BUG] Off-by-one error in width of Agenda window? [9.5.2 (release_9.5.2-25-gaf6f12 @ /data/installs/snapshots/emacs-28.1/lisp/org/)] N. Jackson
2022-04-18 13:39 ` Ihor Radchenko
2022-04-18 19:06   ` N. Jackson
2022-04-19  3:16     ` Ihor Radchenko
2022-04-19 14:06       ` N. Jackson [this message]
2022-04-20  4:01         ` [BUG] Off-by-one error in width of Agenda window? Ihor Radchenko
2022-04-20 10:07           ` N. Jackson
2022-04-21  5:25             ` [PATCH] org-agenda: Use `window-max-chars-per-line' instead of `window-width' Ihor Radchenko
2022-04-21  7:16               ` N. Jackson
2022-04-21  7:56                 ` N. Jackson
2022-04-22  5:58                   ` [PATCH v2] org-agenda: Use `window-max-chars-per-line' to calculate max text width Ihor Radchenko
2022-04-22  8:42                     ` N. Jackson
2022-04-22  9:27                       ` Ihor Radchenko
2022-04-22 15:46                         ` N. Jackson
2022-04-24  7:04                           ` Ihor Radchenko
2022-04-24 11:55                             ` Thank you " N. Jackson
2022-04-18 14:30 ` [BUG] Off-by-one error in width of Agenda window? [9.5.2 (release_9.5.2-25-gaf6f12 @ /data/installs/snapshots/emacs-28.1/lisp/org/)] Tory S. Anderson

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.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87czhdqi9p.fsf_-_@moondust.localdomain \
    --to=nljlistbox2@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@gmail.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).