From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Olivier Certner Newsgroups: gmane.emacs.bugs Subject: bug#44140: 26.3; ERC stamps: Really use latest buffer's window's width prior to `fill-column' Date: Thu, 22 Oct 2020 15:25:40 +0200 Message-ID: <1821306.tpkKSVv8f3@ravel> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7Bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5475"; mail-complaints-to="usenet@ciao.gmane.io" To: 44140@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 22 17:15:18 2020 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 1kVcJB-0001KM-Qy for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Oct 2020 17:15:17 +0200 Original-Received: from localhost ([::1]:34618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVcJA-0007OK-SQ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Oct 2020 11:15:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVcIx-0007ET-1d for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2020 11:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kVcIw-000269-LJ for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2020 11:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kVcIw-0002hW-Gl for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2020 11:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Olivier Certner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Oct 2020 15:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44140 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160337966110297 (code B ref -1); Thu, 22 Oct 2020 15:15:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Oct 2020 15:14:21 +0000 Original-Received: from localhost ([127.0.0.1]:53513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVcIG-0002g0-E2 for submit@debbugs.gnu.org; Thu, 22 Oct 2020 11:14:21 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:57120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kVabD-0001UI-W1 for submit@debbugs.gnu.org; Thu, 22 Oct 2020 09:25:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVabD-0000n8-Ka for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2020 09:25:47 -0400 Original-Received: from smtp2-g21.free.fr ([2a01:e0c:1:1599::11]:40639) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVabB-0003fY-Pg for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2020 09:25:47 -0400 Original-Received: from ravel.localnet (unknown [2.15.200.177]) (Authenticated sender: olivier.certner) by smtp2-g21.free.fr (Postfix) with ESMTPSA id 4ECBA2003CF for ; Thu, 22 Oct 2020 15:25:41 +0200 (CEST) Received-SPF: none client-ip=2a01:e0c:1:1599::11; envelope-from=olivier.certner@free.fr; helo=smtp2-g21.free.fr X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 1 X-Spam_score: 0.1 X-Spam_bar: / X-Spam_report: (0.1 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, SPOOFED_FREEMAIL=1.999 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 22 Oct 2020 11:14:19 -0400 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" Xref: news.gmane.io gmane.emacs.bugs:191285 Archived-At: Applies to 26.3, but also all more recent versions as well. Bug trigger: 1. Load ERC (e.g., open some IRC connection). 2. In some ERC buffer, deactivate ERC fill mode (if not deactivated globally in your configuration), e.g., M-x erc-fill-mode. 3. Notice that `fill-column' (if non-nil; if nil, set it temporarily to some small value, e.g., 40, to see the effect) will be used in this case, contrary to what the documentation of `erc-insert-timestamp-right' says (window's width is supposed to be used in priority when erc-fill-mode is not activated). 4. Set `fill-column' to nil. Then, move to another window selecting another buffer, whose size is visibly smaller. Wait for messages to arrive in the ERC buffer and observe the timestamp position: It is relative to the currently selected window's width! Root causes: 1. Precedence of window's width over `fill-column' not implemented, contrary to what the documentation states, which makes much more sense. 2. `window-width' is called to obtain window's width, but this gets the width of the selected window, which is not necessarily where the buffer is actually displayed. Moreover, the buffer may not be displayed at the moment, so some other fallback is necessary. Patch: To be attached shortly after bug creation. -- Olivier Certner