unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56628: 28.1; dired + tramp/archive gives ibuffer fits
@ 2022-07-18  4:43 Peter Mao
  2022-07-23  8:11 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Mao @ 2022-07-18  4:43 UTC (permalink / raw)
  To: 56628

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

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)

### In *Messages*: ###
Opening directory
/archive:file[path-redacted]sampleproject-main.zip:/...done
Mark set
Updating buffer list...
, Method ‘archive’ is not known.
Method ‘archive’ is not known.
tramp-error: Method ‘archive’ is not known.
### end of *Messages* ###

temporary workaround: kill the inserted archive subdir, open/kill relevant
*tramp/archive buffer (either directly or via `buffer-list')

Thank you Emacs maintainers & bug hunters!  This is the best piece of
software in the local universe.

Peter

---

In GNU Emacs 28.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
cairo version 1.16.0)
 of 2022-04-07 built on chupa
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.4 LTS

Configured using:
 'configure --with-native-compilation'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LCMS2
LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3
ZLIB

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Messages

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow comp comp-cstr warnings rx cl-extra help-mode sort mail-extr
emacsbug message rmc puny rfc822 mml mml-sec epa derived epg rfc6068
epg-config gnus-util rmail rmail-loaddefs text-property-search mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
misearch multi-isearch ibuffer ibuffer-loaddefs conf-mode tramp-sh
mule-util tramp-archive tramp-gvfs tramp-cache zeroconf url-util
url-parse url-vars dbus xml tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat shell pcomplete comint ansi-color
ring parse-time iso8601 ls-lisp format-spec auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json map seq byte-opt
gv bytecomp byte-compile cconv time-date subr-x dired-aux cl-loaddefs
cl-lib dired dired-loaddefs iso-transl tooltip eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 128121 6660)
 (symbols 48 10578 1)
 (strings 32 33861 1448)
 (string-bytes 1 1124813)
 (vectors 16 22008)
 (vector-slots 8 420356 8984)
 (floats 8 41 262)
 (intervals 56 616 0)
 (buffers 992 15))

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

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

* bug#56628: 28.1; dired + tramp/archive gives ibuffer fits
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Lars Ingebrigtsen @ 2022-07-23  8:11 UTC (permalink / raw)
  To: Peter Mao; +Cc: 56628, Michael Albinus

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.






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

* bug#56628: 28.1; dired + tramp/archive gives ibuffer fits
  2022-07-23  8:11 ` Lars Ingebrigtsen
@ 2022-07-23 16:28   ` Michael Albinus
  2022-07-23 16:43     ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Albinus @ 2022-07-23 16:28 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56628, Peter Mao

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

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

* bug#56628: 28.1; dired + tramp/archive gives ibuffer fits
  2022-07-23 16:28   ` Michael Albinus
@ 2022-07-23 16:43     ` Eli Zaretskii
  2022-07-23 18:54       ` Michael Albinus
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2022-07-23 16:43 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 56628, peter.mao, larsi

> Cc: 56628@debbugs.gnu.org, Peter Mao <peter.mao@gmail.com>
> From: Michael Albinus <michael.albinus@gmx.de>
> Date: Sat, 23 Jul 2022 18:28:45 +0200
> 
> 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?

If you are sure this cannot possibly cause any harm, yes.





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

* bug#56628: 28.1; dired + tramp/archive gives ibuffer fits
  2022-07-23 16:43     ` Eli Zaretskii
@ 2022-07-23 18:54       ` Michael Albinus
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Albinus @ 2022-07-23 18:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 56628-done, peter.mao, larsi

Version: 28.2

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

>> 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?
>
> If you are sure this cannot possibly cause any harm, yes.

I don't see how it could harm (famous last words).

Pushed to the emacs-28 branch, and closing the bug report.

Best regards, Michael.





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

end of thread, other threads:[~2022-07-23 18:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2022-07-23 16:43     ` Eli Zaretskii
2022-07-23 18:54       ` Michael Albinus

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