unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "J.P." <jp@neverwas.me>
To: Olivier Certner <olivier.certner@free.fr>
Cc: 44140@debbugs.gnu.org, emacs-erc@gnu.org
Subject: bug#44140: 26.3; ERC stamps: Really use latest buffer's window's width prior to `fill-column'
Date: Wed, 07 Jul 2021 05:28:11 -0700	[thread overview]
Message-ID: <87v95m71gk.fsf__14628.067873285$1625660955$gmane$org@neverwas.me> (raw)
In-Reply-To: <7448139.J7Vt23MMP5@ravel> (Olivier Certner's message of "Tue, 06 Jul 2021 17:15:34 +0200")

Olivier Certner <olivier.certner@free.fr> writes:

> After reading some code (in "window.c"), I think `get-buffer-window' works 
> like this:
> 1. It browses all windows in cyclic order (including windows of other frames 
> or not, depending on the ALL-FRAMES parameter).
> 2. If the currently selected window contains the wanted buffer, it is returned 
> immediately.
> 3. If 2 never occurs, and there is a window containing the current buffer in 
> the selected frame, then the first one (i.e., the most recently activated) is 
> returned.
> 4. If 2 and 3 never occur, than the first window containing the current buffer 
> is returned (so, a window from another frame).

I ended up stepping through some of the underlying functions that
determine this behavior. It seems I failed to grasp/remember what
"cyclic ordering" meant when reviewing your patch initially. Shocking,
I know (cough).

It's now my "belief" that the most recently selected ("other"/"old")
window (or frame) does *not* impact selecting/visiting by these core
functions. New windows/frames are just consed onto the front of global
variables designated for this purpose. So the visiting order is set in
stone and starts from the next oldest after the querying entity, moving
toward the oldest. It then wraps around and goes from the youngest
(newest) back toward itself.

You likely had the right idea originally but were thrown off by my
stupidity re "most recently activated" in #3. Anyway, the takeaway is
that this behavior is predictable as long as people grok and expect
(info "(elisp) Cyclic Window Ordering").

> Your changes seem interesting. I'm not very familiar with display properties, 
> and I'm wondering if this would work as expected on text displays. Since I 
> don't have much time to test that, and since these changes are independent of 
> the bugs fixed here, I'd suggest to put them in a separate report.

If only there were folks familiar enough with display properties to
offer some guidance to little old ERC. Assuming no, then no matter; it's
not worth fussing over what's basically only a cosmetic concern when we
have bigger fish to fry.

Anyway, good job. This one's ready, I guess.





      reply	other threads:[~2021-07-07 12:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 13:25 bug#44140: 26.3; ERC stamps: Really use latest buffer's window's width prior to `fill-column' Olivier Certner
2020-10-22 15:22 ` bug#44140: Patch Olivier Certner
2021-06-09  3:56 ` bug#44140: 26.3; ERC stamps: Really use latest buffer's window's width prior to `fill-column' J.P.
2021-06-09  5:29 ` J.P.
     [not found] ` <87v96n61xu.fsf@neverwas.me>
2021-06-09  9:31   ` J.P.
2021-07-06 12:09 ` bug#44140: Updated patch Olivier Certner
2021-08-06  5:28   ` bug#44140: 26.3; ERC stamps: Really use latest buffer's window's width prior to `fill-column' Amin Bandali
     [not found] ` <87bl8f7ktf.fsf@neverwas.me>
2021-07-06 15:15   ` Olivier Certner
2021-07-07 12:28     ` J.P. [this message]

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='87v95m71gk.fsf__14628.067873285$1625660955$gmane$org@neverwas.me' \
    --to=jp@neverwas.me \
    --cc=44140@debbugs.gnu.org \
    --cc=emacs-erc@gnu.org \
    --cc=olivier.certner@free.fr \
    /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).