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.