unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: 27108@debbugs.gnu.org
Subject: bug#27108: 26.0.50; tramp and recentf again
Date: Wed, 31 May 2017 11:51:47 +0200	[thread overview]
Message-ID: <87wp8xl5fw.fsf@detlef> (raw)
In-Reply-To: <87poeuf0t9.fsf@rosalinde>

[-- Attachment #1: Type: text/plain, Size: 2302 bytes --]

Stephen Berman <stephen.berman@gmx.net> writes:

Hi Stephen,

> Starting with this change:
>
>    commit dca22e86e02d16a31128c163925b13404f777c0f
>    Author: Michael Albinus <michael.albinus@gmx.de>
>    Date:   Wed May 24 16:16:53 2017 +0200
>
>      Introduce a defstruct `tramp-file-name' as central data structure.
>
> The problem also happens when I have the above recentf file and start
> emacs like this:
>
> emacs -Q --eval "(custom-set-variables '(recentf-mode t))"
>
> This recalls bug#26258 but now there is no error, just the login prompt.

Thanks for the report. I could reproduce it locally. However, I don't
know whether this counts as a bug.

The password request comes from the function
`file-name-case-insensitive-p', called when recentf scans the saved file
name list. Tramp has different approaches to implement this function;
for the sudo method (as in your case) it performs some tests on the
remote account. Usually, you don't see this, because Tramp keeps the
result of this function in its own persistency file "~/.emacs.d/tramp".

As you have observed, it didn't work this way after the switch to use
defstruct's in Tramp. Due to this change, the data in Tramp's
persistency file were invalid, and they were ignored at startup. Tramp's
`file-name-case-insensitive-p' implementation couldn't use the cached
value, and so it tried to recompute it, accessing the sudo account,
asking for the password.

As a skilled bug hunter, you have tried to find the problem by starting
further Emacs instances with "emacs -Q". But when Emacs is started with
the "-Q" argument, Tramp doesn't read its persistency file, it doesn't
know the cached value, and you have the same problem. So it looks like a
bug.

I'm pretty sure, if you continue to work the usual way, calling Emacs
w/o "-Q", the problem disappears latest after the second Emacs startup,
because the cached value is available then from the persistency
file. That's why I believe it isn't a bug.

OTOH, I understand that the problem is annoying when it appears, and
when it isn't obvious why this happens. The appended small patch in
`recentf-load-list' would avoid this, instructing Tramp not to open a
new connection while reading the previously saved recent list. Would it
be OK to apply this patch?

Best regards, Michael.


[-- Attachment #2: Type: text/plain, Size: 602 bytes --]

diff --git a/lisp/recentf.el b/lisp/recentf.el
index 4f0573911b..462ccb6db5 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -1304,7 +1304,9 @@ recentf-load-list
 When `recentf-initialize-file-name-history' is non-nil, initialize an
 empty `file-name-history' with the recent list."
   (interactive)
-  (let ((file (expand-file-name recentf-save-file)))
+  (let ((file (expand-file-name recentf-save-file))
+        ;; We do not want Tramp asking for passwords.
+        (non-essential t))
     (when (file-readable-p file)
       (load-file file)
       (and recentf-initialize-file-name-history

  reply	other threads:[~2017-05-31  9:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-27 21:26 bug#27108: 26.0.50; tramp and recentf again Stephen Berman
2017-05-31  9:51 ` Michael Albinus [this message]
2017-05-31 14:19   ` Stephen Berman
2017-05-31 18:35     ` Michael Albinus
2017-05-31 20:01       ` Stephen Berman
2017-06-01  7:18         ` Michael Albinus

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=87wp8xl5fw.fsf@detlef \
    --to=michael.albinus@gmx.de \
    --cc=27108@debbugs.gnu.org \
    --cc=stephen.berman@gmx.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).