From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#34973: 27.0.50; gnus-summary-move-article fails due to remhash Date: Sun, 24 Mar 2019 14:52:28 +0000 Message-ID: <875zs82ukz.fsf@tcd.ie> References: <87a7hka0m4.fsf@aia00054aia.gr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="92963"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 34973@debbugs.gnu.org To: Deus Max Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 24 15:56:37 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h84Y5-000O2r-Nz for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Mar 2019 15:56:33 +0100 Original-Received: from localhost ([127.0.0.1]:57187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h84Y4-0005sC-Jg for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Mar 2019 10:56:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h84Xr-0005ol-HJ for bug-gnu-emacs@gnu.org; Sun, 24 Mar 2019 10:56:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h84Ug-0007gI-Py for bug-gnu-emacs@gnu.org; Sun, 24 Mar 2019 10:53:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43359) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h84Ug-0007fq-5s for bug-gnu-emacs@gnu.org; Sun, 24 Mar 2019 10:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h84Ug-0003Fb-2a for bug-gnu-emacs@gnu.org; Sun, 24 Mar 2019 10:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Mar 2019 14:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34973 X-GNU-PR-Package: emacs Original-Received: via spool by 34973-submit@debbugs.gnu.org id=B34973.155343915812459 (code B ref 34973); Sun, 24 Mar 2019 14:53:02 +0000 Original-Received: (at 34973) by debbugs.gnu.org; 24 Mar 2019 14:52:38 +0000 Original-Received: from localhost ([127.0.0.1]:56901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h84UI-0003Eq-4f for submit@debbugs.gnu.org; Sun, 24 Mar 2019 10:52:38 -0400 Original-Received: from mail-ed1-f54.google.com ([209.85.208.54]:34631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h84UG-0003EZ-6l for 34973@debbugs.gnu.org; Sun, 24 Mar 2019 10:52:37 -0400 Original-Received: by mail-ed1-f54.google.com with SMTP id x14so2742469eds.1 for <34973@debbugs.gnu.org>; Sun, 24 Mar 2019 07:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=8f3qg5dbIh+kRHn4T9e6b4/yNO+eu4PDsMw+U26Ro3g=; b=y6UIGUBDvE5MI9mkqNv2vVxhayeTTPMgMZk+5OV3fJL18/1Z0onStRH01o0xtrolTk TYS6EkhSy0te9lTpH7YxRt9TtI+2lnindvS7IOAk1Xw1iRIIesLnHCzQdixoUytqJ6kl l3f1sgd5PTYvRzs9YVqB2H68hgRFgnNtSXBeHvC9sWZoS8OszqY5wUfDlUrkbvgd589s 9L9zH6yFhEv2kdr3dFk6mUlaRaw8LzrwxNgPEuLsVV7SBUrs9xnaA4OdISjqQaMjIO+c bmkiWNZtKzufJxjqVPsR+VFuDfWFgJISFx3SgjrlnFAB2nb4Kdta5s76/9yb7vmAlB4H qGDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=8f3qg5dbIh+kRHn4T9e6b4/yNO+eu4PDsMw+U26Ro3g=; b=aqwkpiJgVTtWGCGrQ2SKWlXOksCT5luaGXucic++TUo6xKy69ZIyxcBdIxBSG7V7gF pHx7tElok/CU+vJ6tVRHvI47o/l9cbaWCunhvHhGNzW4JHLgfh5IFJC8LEhrytxikkNO sC9Hx2y5f/jiVc+ARja802T18vNU/iNysHGFj/CCVZKiXp67wkyLguT9WxIcwouP1eGz /Li03y7LrUyJ1ZJnCD1P4AyQrUQxebZdwI/Q3OdN/X8pwBkPEVd2NVlScI7vr3x838T1 pJwPpdlIpn5Xi0Jo8MJ4nUwyQf282+xQD0STEuEDWhkwLXaOXfQRHsiLnMkn1OipLDI/ sBqw== X-Gm-Message-State: APjAAAXI5JPARDg0xBl63UxXBYfYAZ+mTAYx3UQKWIItrSyYt1hizDuA Mwpbaivc50myokzuOrNsUvLG1Q== X-Google-Smtp-Source: APXvYqwgll3hKpySqRCVUt73vv0T9xJjlViVxCJ2CUdq0cA/kHMxnq6mVrYPaXv9XeIF1ddTGpIBcA== X-Received: by 2002:a50:b646:: with SMTP id c6mr13325342ede.149.1553439150462; Sun, 24 Mar 2019 07:52:30 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:f786:805d:f4ab:1006]) by smtp.gmail.com with ESMTPSA id i14sm2890704ejy.41.2019.03.24.07.52.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 24 Mar 2019 07:52:29 -0700 (PDT) In-Reply-To: <87a7hka0m4.fsf@aia00054aia.gr> (Deus Max's message of "Sun, 24 Mar 2019 15:00:19 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156698 Archived-At: --=-=-= Content-Type: text/plain tags 34973 patch quit --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-Gnus-duplicate-article-unsuppression.patch >From 9480af8c32389c0916cf83d3d2f12d62b0f0efc2 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sun, 24 Mar 2019 14:12:58 +0000 Subject: [PATCH] Fix Gnus duplicate article unsuppression * lisp/gnus/gnus-sum.el (gnus-summary-mode-group): Declare before first use to silence byte-compiler. (gnus-summary-select-article): Simplify boolean expression. (gnus-summary-move-article): Do not try to unsuppress article when duplicate suppression is disabled. (bug#34973, bug#34974) --- lisp/gnus/gnus-sum.el | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 85c902a5e4..f09c0fbb58 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -3053,6 +3053,11 @@ bookmark-make-record-function (defvar bidi-paragraph-direction) +(defvar gnus-summary-mode-group nil + "Variable for communication with `gnus-summary-mode'. +Allows the `gnus-newsgroup-name' local variable to be set before +the summary mode hooks are run.") + (define-derived-mode gnus-summary-mode gnus-mode "Summary" "Major mode for reading articles. \\ @@ -3468,11 +3473,6 @@ gnus-summary-set-article-display-arrow (point) (current-buffer)))))) -(defvar gnus-summary-mode-group nil - "Variable for communication with `gnus-summary-mode'. -Allows the `gnus-newsgroup-name' local variable to be set before -the summary mode hooks are run.") - (defun gnus-summary-setup-buffer (group) "Initialize summary buffer for GROUP. This function does all setup work that relies on the specific @@ -7744,7 +7744,7 @@ gnus-summary-select-article (unless (derived-mode-p 'gnus-summary-mode) (set-buffer gnus-summary-buffer)) (let ((article (or article (gnus-summary-article-number))) - (all-headers (not (not all-headers))) ;Must be t or nil. + (all-headers (and all-headers t)) ; Must be t or nil. gnus-summary-display-article-function) (and (not pseudo) (gnus-summary-article-pseudo-p article) @@ -9978,13 +9978,12 @@ gnus-summary-move-article (crosspost "Crosspost" "Crossposting"))) (copy-buf (save-excursion (nnheader-set-temp-buffer " *copy article*"))) - art-group to-method new-xref article to-groups + art-group to-method new-xref to-groups articles-to-update-marks encoded) (unless (assq action names) (error "Unknown action %s" action)) ;; Read the newsgroup name. - (when (and (not to-newsgroup) - (not select-method)) + (unless (or to-newsgroup select-method) (if (and gnus-move-split-methods (not (and (memq gnus-current-article articles) @@ -10029,8 +10028,7 @@ gnus-summary-move-article (or (car select-method) (gnus-group-decoded-name to-newsgroup)) articles) - (while articles - (setq article (pop articles)) + (dolist (article articles) ;; Set any marks that may have changed in the summary buffer. (when gnus-preserve-marks (gnus-summary-push-marks-to-backend article)) @@ -10039,8 +10037,9 @@ gnus-summary-move-article (cond ;; Move the article. ((eq action 'move) - ;; Remove this article from future suppression. - (gnus-dup-unsuppress-article article) + (when gnus-suppress-duplicates + ;; Remove this article from future suppression. + (gnus-dup-unsuppress-article article)) (let* ((from-method (gnus-find-method-for-group gnus-newsgroup-name)) (to-method (or select-method -- 2.20.1 --=-=-= Content-Type: text/plain Deus Max writes: > Reading the manual > (https://www.gnu.org/software/emacs/manual/html_node/elisp/Hash-Access.html#Hash-Access) > on remhash, it says: "In Emacs Lisp, remhash always returns nil.", so I > modified the calling function gnus-dup-unsuppress-article in gnus-dup.el, as follows: > > 157c157,159 > < (remhash id gnus-dup-hashtb)))) > --- >> (if (hash-table-p gnus-dup-hashtb) >> (remhash id gnus-dup-hashtb) >> nil)))) > > This patch seems to have fixed the problem and now > gnus-summary-move-article works fine. ! > the value of gnus-dup-hashtb was nil, for the problem runs. The return value of gnus-dup-unsuppress-article doesn't matter, only that remhash not be passed a nil gnus-dup-hashtb. In other words, gnus-dup-unsuppress-article should either not be called or should handle the case when it is called before gnus-dup-open has initialised gnus-dup-hashtb. I attach a patch which follows the apparent gnus-sum.el convention of guarding calls to gnus-dup.el functions based on the value of gnus-suppress-duplicates. This fixes the immediate issue at hand, but I think there may still be a problem when gnus-suppress-duplicates is enabled at a later time. I think that deserves a separate bug report, though. Thanks, -- Basil --=-=-=--