From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Another "Rmail" problem I ran into Date: Sun, 09 Jun 2024 19:47:20 +0300 Message-ID: <86o78a9i7b.fsf@gnu.org> References: <6665d602.170a0220.5862e.c401@mx.google.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8200"; mail-complaints-to="usenet@ciao.gmane.io" To: Help-Gnu-Emacs@Gnu.Org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 09 18:48:11 2024 Return-path: Envelope-to: geh-help-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 1sGLiF-0001rz-4w for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 09 Jun 2024 18:48:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGLhV-000100-PG; Sun, 09 Jun 2024 12:47:25 -0400 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 1sGLhU-0000zf-0W for Help-Gnu-Emacs@Gnu.Org; Sun, 09 Jun 2024 12:47:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGLhT-0007m5-Ol for Help-Gnu-Emacs@Gnu.Org; Sun, 09 Jun 2024 12:47:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=SizlMn2JHa29j0vUVzEd4CXYm0l+g2Z9Wgs0Cepv3CE=; b=JQUrWaQKCsPv TdMVp8DFxKcn6IrSA75TO7My9w1uCSscOG1QUBO0V+HiIOQKzXQrD6jqVf2mYM8CPlTtwAsigbrQ4 qgNszKkBuclYghJBy9o37FAPOh4gv5W28xpGEnEnv4dq/s3LKSk6iKxSg/QXDohV3zHmjrkWT2jYp GHLnmNorrW8dG0B/U3SOfwPT0Tx04wf2z99lXmjWjpjKlrpyVoLeLKAeHALwAzVSuQdfdsVkbmHcC /S9nNNHQdbeDGPfcz1YKSD5CPae7mOxDfd4WFioV7+Mq05iJbIpJwkdjSWuByBmWIqIVq9QEVkDO1 kmOv9DWLTEYmI27OdyyESA==; In-Reply-To: <6665d602.170a0220.5862e.c401@mx.google.com> (message from Dr Rainer Woitok on Sun, 09 Jun 2024 18:19:13 +0200) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146868 Archived-At: > From: Dr Rainer Woitok > Date: Sun, 09 Jun 2024 18:19:13 +0200 > > Greetings, > > because sometimes Google sends some reply mail to my inbox before it > sends the corresponding original mail, I added the following lines to my > "Rmail" configuration file: > > (defun Sort-Date () > "Sort incoming mail by date." > (rmail-summary-sort-by-date nil)) > > (add-hook 'rmail-get-new-mail-hook 'Sort-Date) You cannot call rmail-summary functions from rmail-get-new-mail-hook, not without switching to the right buffer and doing other bookkeeping. rmail-get-new-mail-hook is a hook intended to act on the new messages in the Rmail buffer, it is not intended to make summaries. > But this leads to either the summary or the message buffer not being > displayed, and in buffer "*Messages*" I find > > Getting mail from /home/rainer/mail/.HAM... > Counting new messages...done (1) > Finding sort keys...30 > Reordering messages...30 > Counting messages...done > Computing summary lines...done > rmail-show-message: Wrong type argument: stringp, nil > > Just in case it matters: including the one new message there are 39 mes- > sages in the summary buffer, so why does "Rmail" only process 30 messa- > ges? Because when the hook is called, the Rmail buffer is narrowed to include only the newly arrived email messages.