unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Help-Gnu-Emacs@Gnu.Org
Subject: Re: Another "Rmail" problem I ran into
Date: Sun, 09 Jun 2024 19:47:20 +0300	[thread overview]
Message-ID: <86o78a9i7b.fsf@gnu.org> (raw)
In-Reply-To: <6665d602.170a0220.5862e.c401@mx.google.com> (message from Dr Rainer Woitok on Sun, 09 Jun 2024 18:19:13 +0200)

> From: Dr Rainer Woitok <rainer.woitok@gmail.com>
> 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.



  reply	other threads:[~2024-06-09 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-09 16:19 Another "Rmail" problem I ran into Dr Rainer Woitok
2024-06-09 16:47 ` Eli Zaretskii [this message]
2024-06-10 15:32   ` Dr Rainer Woitok
2024-06-10 16:10     ` Eli Zaretskii

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=86o78a9i7b.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=Help-Gnu-Emacs@Gnu.Org \
    /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.
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).