From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.bugs Subject: bug#67791: 30.0.50; `t' command on Gnus summary buffer sometimes causes an error Date: Tue, 12 Dec 2023 11:15:54 +0900 Organization: Emacsen advocacy group Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32368"; mail-complaints-to="usenet@ciao.gmane.io" To: 67791@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 12 03:17:13 2023 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 1rCsKe-0008I8-Q0 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Dec 2023 03:17:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCsKI-0001mt-OU; Mon, 11 Dec 2023 21:16:50 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rCsKG-0001mW-G0 for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 21:16:48 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rCsKF-0002eQ-0X for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 21:16:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rCsKT-0005eU-Rg for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 21:17:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Katsumi Yamaoka Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Dec 2023 02:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67791 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.170234738621675 (code B ref -1); Tue, 12 Dec 2023 02:17:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Dec 2023 02:16:26 +0000 Original-Received: from localhost ([127.0.0.1]:55053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCsJt-0005dX-HD for submit@debbugs.gnu.org; Mon, 11 Dec 2023 21:16:25 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:56878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCsJq-0005d4-GL for submit@debbugs.gnu.org; Mon, 11 Dec 2023 21:16:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rCsJW-0001is-45 for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 21:16:02 -0500 Original-Received: from mail-pl1-f182.google.com ([209.85.214.182]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rCsJU-0002Zc-6M for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 21:16:01 -0500 Original-Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1d053c45897so45303375ad.2 for ; Mon, 11 Dec 2023 18:15:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702347358; x=1702952158; h=mime-version:organization:subject:to:from:message-id:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mLUfUufMG5aBAVj0Gv8WFV+frZEGf/fWpvHRoujWuZM=; b=Kxa1BFcuZJ/FWrJct+rFMrPJ7kE+Ul23oOvzAiutVP4EBg4vc6Bn0CL6w0fm8D5Lck e6FnOQToD2M0XYDEvy4qMJoCW0XINJgLO/PmWKV/DbMCqzET9iP4egAQe96lH83SFdKO ruJFDQnE7wBDNbAWm/S/+ZwBA8k88iIo20euWdUTwh+fdMmiOt9AcerbgkJef2Ddd2VK 3EporpYnb1qV4SxKOhNRbZ7Q23oyOKuga1gEWHMJzXIChH4UeW/GxyizQnw7TP9EslQA CrMuMv8D3WvMrcDY7JXXLXhJ0C9zT2/OSXjef/SdCmIoRJfaRk0mYdJo3OaWCOt9z4Vg cwrQ== X-Gm-Message-State: AOJu0YzL4YsTdWwtkVrclIhgsQdUWftqKDPcwtFVvHnGxN7xJir5LfOH 35l1oAhV1Xq/0AGcRomVB50bZiXY+A== X-Google-Smtp-Source: AGHT+IGGr3Oj+gBkedw6gwGYNvBPfb3hoPRlN5tKMKYdZQfeg6Reo0Co2aj6h+wDDGU6VkSXDnXaiA== X-Received: by 2002:a17:902:fe82:b0:1cf:b12a:a9eb with SMTP id x2-20020a170902fe8200b001cfb12aa9ebmr4874803plm.19.1702347358167; Mon, 11 Dec 2023 18:15:58 -0800 (PST) Original-Received: from localhost (157-205-200-190.cns.tayoreru.com. [157.205.200.190]) by smtp.gmail.com with ESMTPSA id o1-20020a170902d4c100b001cfcd4eca11sm7311574plg.114.2023.12.11.18.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 18:15:57 -0800 (PST) X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( Received-SPF: pass client-ip=209.85.214.182; envelope-from=katsumi.yamaoka@gmail.com; helo=mail-pl1-f182.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276012 Archived-At: Because the `gnus-article-treat-fold-headers' function does not work as expected. `t' command, i.e. `gnus-summary-toggle-header' is invoked on the Gnus summary buffer, that runs by default `gnus-article-treat-fold-headers' by way of `gnus-treat-article'. It works on the article buffer and folds headers with the help of the pixel-fill functions. One of them, `pixel-fill-region' uses the built-in `window-text-pixel-size' function, that is required to run on the selected window in which there is the text to measure the pixel size (since `pixel-fill-region' passes nil to `window-text-pixel-size' as the 1st argument `WINDOW'). ,---- | (window-text-pixel-size &optional WINDOW FROM TO ...) | | Return the size of the text of WINDOW's buffer in pixels. | WINDOW must be a live window and defaults to the selected one. `---- Therefore, the window should be that of the article. However, in that situation the selected one is that of the summary, as mentioned above. Because of this, the `window-text-pixel-size' sometimes returns a funny value and it causes the error like this: Debugger entered--Lisp error: (error "The indentation (640) is wider than th... signal(error ("The indentation (640) is wider than the fill width (623)"))... error("The indentation (%s) is wider than the fill width (%s)" 640 623)... (progn (error "The indentation (%s) is wider than the fill width (%s)" ind... (if (> indentation pixel-width) (progn (error "The indentation (%s) is wid... (let ((indentation (car (window-text-pixel-size nil (line-beginning-positi... (save-excursion (goto-char start) (let ((indentation (car (window-text-pix... pixel-fill-region(101 181 623) [...] command-execute(gnus-summary-toggle-header) Another possible cause might be the recent change (33b6de7a) made in `window-text-pixel-size', because such an error doesn't look to cause in Emacs 29.1.90 (the function before the change might possibly have worked on the current buffer, not the selected window). Here is a quick hack: * lisp/gnus/gnus-art.el (gnus-article-treat-fold-headers): Make sure the article window is selected while running pixel-fill-region. --8<---------------cut here---------------start------------->8--- --- gnus-art.el~ 2023-12-10 23:22:23.410103300 +0000 +++ gnus-art.el 2023-12-12 02:11:11.364620000 +0000 @@ -2240,7 +2240,9 @@ (if (not (gnus--variable-pitch-p (get-text-property (point) 'face))) (mail-header-fold-field) (forward-char 1) - (pixel-fill-region (point) (point-max) (pixel-fill-width))) + (save-window-excursion + (set-window-buffer nil (current-buffer)) + (pixel-fill-region (point) (point-max) (pixel-fill-width)))) (goto-char (point-max)))))) (defun gnus-article-treat-suspicious-headers () --8<---------------cut here---------------end--------------->8--- In GNU Emacs 30.0.50 (build 1, x86_64-pc-cygwin, GTK+ Version 3.22.28, cairo version 1.17.4) of 2023-12-12 built on localhost Windowing system distributor 'The Cygwin/X Project', version 11.0.12101008 Configured using: 'configure 'CFLAGS=-O0 -g3' --verbose --infodir=/usr/local/info/emacs --with-x-toolkit=gtk3 --with-cairo-xcb --with-imagemagick --with-native-compilation=no'