unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34529: C-x b became unusable (ido, recentf, tramp)
@ 2019-02-18 16:58 Felicián Németh
  2019-02-19  7:42 ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Felicián Németh @ 2019-02-18 16:58 UTC (permalink / raw)
  To: 34529

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

I had a problem, which can be reproduced to some extent with the
following snippet.  (emacs -Q -l /tmp/bug.el)

   (require 'recentf)
   (setq recentf-save-file "/tmp/bug-recentf")
   (setq recentf-list '("/ssh:localhost#2222:~/a.txt"))
   (setq ido-use-virtual-buffers t)
   (setq ido-save-directory-list-file "/tmp/bug-ido.last")
   (recentf-save-list)
   (ido-mode t)
   (ido-switch-buffer) ; Simulating C-x b

However, that doesn't explain how that entry ended up in my
recentf-save-file.  I'm guessing I opened many tramp files in a
virtual machine, and after I had halted the virtual machine,
emacs wanted to convert the file names to absolute paths.
Strangely,
(get-file-buffer "/ssh:localhost#2222:~/a.txt") and
(expand-file-name "/ssh:localhost#2222:~/a.txt") fail, but
evaluating them the second time, they succeed,  but
expand-file-name returns a wrong value, i.e,

(expand-file-name "/ssh:localhost#2222:~/a.txt")
   =>  error
(expand-file-name "/ssh:localhost#2222:~/a.txt")
   =>  "/ssh:localhost#2222:~/a.txt"

"emacs -Q -l /tmp/bug.el" reproduces the problem with version
25.1.1 and a recent 27.0.50 as well, but I think it was former
who originally wrote the problematic entry into the
recent-save-file.

Thank you.

[-- Attachment #2: Type: text/html, Size: 1510 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#34529: C-x b became unusable (ido, recentf, tramp)
  2019-02-18 16:58 bug#34529: C-x b became unusable (ido, recentf, tramp) Felicián Németh
@ 2019-02-19  7:42 ` Michael Albinus
  2019-02-20  7:34   ` Felicián Németh
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2019-02-19  7:42 UTC (permalink / raw)
  To: Felicián Németh; +Cc: 34529

Felicián Németh <felician.nemeth@gmail.com> writes:

Hi Felicián,

> However, that doesn't explain how that entry ended up in my
> recentf-save-file.  I'm guessing I opened many tramp files in a
> virtual machine, and after I had halted the virtual machine,
> emacs wanted to convert the file names to absolute paths.

Do you use ad-hoc multi-hop file names?

> Thank you.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#34529: C-x b became unusable (ido, recentf, tramp)
  2019-02-19  7:42 ` Michael Albinus
@ 2019-02-20  7:34   ` Felicián Németh
  2019-02-20  9:40     ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Felicián Németh @ 2019-02-20  7:34 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 34529

Hi Michael,

>> However, that doesn't explain how that entry ended up in my
>> recentf-save-file.  I'm guessing I opened many tramp files in a
>> virtual machine, and after I had halted the virtual machine,
>> emacs wanted to convert the file names to absolute paths.
>
> Do you use ad-hoc multi-hop file names?

With this virtual machine, definitely not.  However, the problem occurred
in a long lasting emacs session and I do remember trying to ssh|su
into a remote system.  It wasn't successful because (I think) tramp
failed to find the password prompt because of an unfortunate locale
setting.

However, I found a probable cause of evenets that inserts a wrong entry
into recentf-list:
  bug.el:
     (require 'recentf)
     (setq recentf-save-file "/tmp/bug2-recentf")
     (setq ido-use-virtual-buffers t)
     (setq ido-save-directory-list-file "/tmp/bug-ido.last")
     (ido-mode t)
     (ffap-bindings)
  0. emacs -Q -l bug.el
  1. Open a relative file in a VM (/ssh:localhost#2222:~/a.txt)
  2. Close the file, halt the VM.
  3. (Accidentally) open the same file from the file-name-history.
     (C-x C-f M-p)
  4. Close emacs.
    => /tmp/bug2-recentf has the relative path.

Thanks again,
Felicián





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#34529: C-x b became unusable (ido, recentf, tramp)
  2019-02-20  7:34   ` Felicián Németh
@ 2019-02-20  9:40     ` Michael Albinus
  2019-02-21  8:12       ` Felicián Németh
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2019-02-20  9:40 UTC (permalink / raw)
  To: Felicián Németh; +Cc: 34529

Felicián Németh <felician.nemeth@gmail.com> writes:

> Hi Michael,

Hi Felicián,

> However, the problem occurred in a long lasting emacs session and I do
> remember trying to ssh|su into a remote system.  It wasn't successful
> because (I think) tramp failed to find the password prompt because of
> an unfortunate locale setting.
>
> However, I found a probable cause of evenets that inserts a wrong entry
> into recentf-list:
>   bug.el:
>      (require 'recentf)
>      (setq recentf-save-file "/tmp/bug2-recentf")
>      (setq ido-use-virtual-buffers t)
>      (setq ido-save-directory-list-file "/tmp/bug-ido.last")
>      (ido-mode t)
>      (ffap-bindings)
>   0. emacs -Q -l bug.el
>   1. Open a relative file in a VM (/ssh:localhost#2222:~/a.txt)
>   2. Close the file, halt the VM.
>   3. (Accidentally) open the same file from the file-name-history.
>      (C-x C-f M-p)
>   4. Close emacs.
>     => /tmp/bug2-recentf has the relative path.

This doesn't sound like an error. recentf does what you tell it to
do. After step 3, there is a buffer with the remote file name
"/ssh:localhost#2222:~/a.txt". recentf stores also remote file names,
according to `recentf-keep-default-predicate':

--8<---------------cut here---------------start------------->8---
 (cond
   ((file-remote-p file nil t) (file-readable-p file))
   ((file-remote-p file))
   ((file-readable-p file))))
--8<---------------cut here---------------end--------------->8---

The problem seems to be rather ido. Could you pls check bug#24980? It
sounds similar to your problem, and it was solved in Emacs 26.1. Btw,
which Emacs version are you running?

> Thanks again,
> Felicián

Best regards, Michael.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#34529: C-x b became unusable (ido, recentf, tramp)
  2019-02-20  9:40     ` Michael Albinus
@ 2019-02-21  8:12       ` Felicián Németh
  0 siblings, 0 replies; 5+ messages in thread
From: Felicián Németh @ 2019-02-21  8:12 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 34529-done

Hi Michael,

> The problem seems to be rather ido. Could you pls check bug#24980? It
> sounds similar to your problem, and it was solved in Emacs 26.1. Btw,
> which Emacs version are you running?

I bumped into the problem with Emacs 25.1, but I verified git head
misbehaves with the part of the problem that I understood in my original
report.  However, I forgot to check my recipe to insert a relative path
into recentf-save-file is still valid for the latest Emacs.  It is not,
so I close this report.

Sorry for wasting your time,
Felicián





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-21  8:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-18 16:58 bug#34529: C-x b became unusable (ido, recentf, tramp) Felicián Németh
2019-02-19  7:42 ` Michael Albinus
2019-02-20  7:34   ` Felicián Németh
2019-02-20  9:40     ` Michael Albinus
2019-02-21  8:12       ` Felicián Németh

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