GNU bug report logs - #78666
31.0.50; recentf-open-files reports opening the last file accessed

Previous Next

Package: emacs;

Reported by: Rick <rbielaws <at> gmail.com>

Date: Sun, 1 Jun 2025 23:35:02 UTC

Severity: normal

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Rick <rbielaws <at> gmail.com>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 78666 <at> debbugs.gnu.org
Subject: bug#78666: 31.0.50; recentf-open-files reports opening the last file accessed
Date: Tue, 3 Jun 2025 19:21:19 -0500
[Message part 1 (text/plain, inline)]
It seems you are confirming that the messages are in fact spurious
at this point in the execution process because they are generated
prior to the window being presented to the user.   You are
describing messages that are only useful once the user starts
being able to interact with the buffer so other than at this point
they are correct, necessary, appropriate.

Given I'm not mistaken, I'm now much more confident that the
fix I suggested an hour or so ago ago is only pretty close to
the correct way to deal with it.  I will now amend my suggestion
to the following.

Add the optional parameter (accepted by widget-move) to
recentf-dialog-goto-first so that 't' can be passed to widget-move
when recentf-edit-list and recentf-open-files call it.  All other
callers will default to nil and therefore be unaffected.  This should
cleanly remove them exactly and only where they are inappropriate.

(defun recentf-dialog-goto-first (widget-type *_&optional quietly_*)
  "Move the cursor to the first WIDGET-TYPE in current dialog.
Go to the beginning of buffer if not found."
  (goto-char (point-min))
  (condition-case nil
      (let (done)
        (widget-move 1 _*quietly*_)
        (while (not done)
          (if (eq widget-type (widget-type (widget-at (point))))
              (setq done t)
            (widget-move 1 _*quietly*_))))
    (error
     (goto-char (point-min)))))


(defun recentf-open-files (&optional files buffer-name)
...
    (recentf-dialog-goto-first 'link *_t_*)))


(defun recentf-edit-list ()
...
    (recentf-dialog-goto-first 'checkbox *_t_*)))


On 6/3/25 17:51, Stephen Berman wrote:
> On Sun, 1 Jun 2025 18:34:45 -0500 Rick<rbielaws <at> gmail.com> wrote:
>
>> --text follows this line--
>> You can recreate most of the problem starting with -Q however you must
>> have a previously populated recentf file before starting.
>>
>> M-x recentf-mode
>> M-x recentf-open-files
>>
>> Now switch to the *Messagers* buffer and notice something similar to:
>>
>>      Loading /home/rick/.emacs.d/recentf...done     Cleaning up the recentf
>> list...done (0 removed)     Mark set     Open
>> /snap/emacs/2827/usr/share/emacs/31.0.50/lisp/files.el.gz
>>
>> Observe that it claims to have opened the most recent item on recentf-list,
>> as loaded from the pre-populated recentf file.  In my case .../files.el.gz.
>>
>> There doesn't seem to be a buffer actually associated with the file but
>> it's unclear whether it was subsequently closed or a spurious message.
> I think you misunderstood those messages: each one is help text to
> inform you that by checking the box of that item you will open the file
> (in GUI Emacs you can see the same text in a tooltip if you move the
> mouse pointer over the item).  So they are not informing you that the
> file has been opened.
>
> Steve Berman
[Message part 2 (text/html, inline)]

This bug report was last modified 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.