all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 56628@debbugs.gnu.org, Peter Mao <peter.mao@gmail.com>
Subject: bug#56628: 28.1; dired + tramp/archive gives ibuffer fits
Date: Sat, 23 Jul 2022 18:28:45 +0200	[thread overview]
Message-ID: <87ilnniyiq.fsf@gmx.de> (raw)
In-Reply-To: <87pmhw1c60.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 23 Jul 2022 10:11:19 +0200")

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

Lars Ingebrigtsen <larsi@gnus.org> writes:

Hi,

> Peter Mao <peter.mao@gmail.com> writes:
>
>> Ibuffer throws an error when an archive file (I've tried zip and tar.gz)
>> is inserted into a Dired buffer (with `dired-maybe-insert-subdir').
>> Recipe for bug and relevant *Messages* below.
>>
>> Actions starting from `emacs -Q`:
>> 1. open directory in Dired with an archive file (C-x d)
>> 2. insert zip contents into Dired buffer with 'i'
>> 3. open Ibuffer (M-x ibuffer)
>
> This leads to the following error:
>
> Debugger entered--Lisp error: (user-error "Method ‘archive’ is not known.")
>   signal(user-error ("Method ‘archive’ is not known."))
>   tramp-error((tramp-file-name "archive" nil nil "file%3A%2F%2F%2Fhome%2Flarsi%2FDownloads%2F4672362..." nil "" nil) user-error "Method `%s' is not known." "archive")
>   apply(tramp-error (tramp-file-name "archive" nil nil "file%3A%2F%2F%2Fhome%2Flarsi%2FDownloads%2F4672362..." nil "" nil) user-error "Method `%s' is not known." "archive")
>   tramp-user-error((tramp-file-name "archive" nil nil "file%3A%2F%2F%2Fhome%2Flarsi%2FDownloads%2F4672362..." nil "" nil) "Method `%s' is not known." "archive")
>   tramp-dissect-file-name("/archive:file%3A%2F%2F%2Fhome%2Flarsi%2FDownloads%...")
>   tramp-file-name-handler(expand-file-name "" "/archive:file%3A%2F%2F%2Fhome%2Flarsi%2FDownloads%...")
>   file-name-case-insensitive-p("")
>   abbreviate-file-name("")
>   ibuffer--abbreviate-file-name("")
>
> The problem seems to stem from tramp throwing an error when calling
> `abbreviate-file-name' in the *tramp/archive...* buffer.  Perhaps
> Michael knows why; added to the CCs.

The default directory of the *tramp/archive...* buffer cannot be
accessed outside the Tramp machinery. The fix is simple, patch appended.

Would it be OK to push this to the emacs-28 branch?

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 939 bytes --]

diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index 4b649edaab..33348ca21e 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -339,6 +339,13 @@ tramp-archive-file-name-handler
 	        (tramp-archive-run-real-handler
                  #'file-directory-p (list archive)))
             (tramp-archive-run-real-handler operation args)
+	  ;; The default directory of the Tramp connection buffer
+	  ;; cannot be accessed.  (Bug#56628)
+	  ;; FIXME: It is superfluous to set it every single loop.
+	  ;; But there is no place to set it when creating the buffer.
+	  (with-current-buffer
+	      (tramp-get-buffer (tramp-archive-dissect-file-name filename))
+	    (setq default-directory (file-name-as-directory archive)))
           ;; Now run the handler.
           (let ((tramp-methods (cons `(,tramp-archive-method) tramp-methods))
 	        (tramp-gvfs-methods tramp-archive-all-gvfs-methods)

  reply	other threads:[~2022-07-23 16:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18  4:43 bug#56628: 28.1; dired + tramp/archive gives ibuffer fits Peter Mao
2022-07-23  8:11 ` Lars Ingebrigtsen
2022-07-23 16:28   ` Michael Albinus [this message]
2022-07-23 16:43     ` Eli Zaretskii
2022-07-23 18:54       ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ilnniyiq.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=56628@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=peter.mao@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.