You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a current Emacs, with default settings, when counsel-find-file meets an archive file type (tar, rar, zip, OpenDocument, etc., any extension contained in tramp-archive-suffixes) it is automatically mounted and treated as a directory. As far as I can tell, this happens because ivy-expand-file-if-directory, which is indirectly used by the counsel-find-file machinery, wraps the file name in file-name-as-directory (thus appending a slash to it) and then testing if file-directory-p. But, with tramp-archive active, which it is by default, this predicate will not only mount the file, but also return t, meaning counsel-find-file will navigate inside the archive file, instead of selecting it.
It is a misuse to add a slash to an existing regular file and pray that
it works. There has been a similar error in ange-ftp, see bug#56078. It
has fixed. I recommend to contact the counsel author for a fix.
I'd say he's got a point and, either way, that's the upstream position. So, it'd probably be a good idea if file-name-as-directory was dropped from ivy-expand-file-if-directory.
The text was updated successfully, but these errors were encountered:
On a current Emacs, with default settings, when
counsel-find-file
meets an archive file type (tar, rar, zip, OpenDocument, etc., any extension contained intramp-archive-suffixes
) it is automatically mounted and treated as a directory. As far as I can tell, this happens becauseivy-expand-file-if-directory
, which is indirectly used by thecounsel-find-file
machinery, wraps the file name infile-name-as-directory
(thus appending a slash to it) and then testing iffile-directory-p
. But, withtramp-archive
active, which it is by default, this predicate will not only mount the file, but also returnt
, meaningcounsel-find-file
will navigate inside the archive file, instead of selecting it.I initially reported this to Emacs itself, in the following bug report: https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-10/msg00758.html
The stance of Tramp's maintainer, Michael Albinus, on the matter is the following:
I'd say he's got a point and, either way, that's the upstream position. So, it'd probably be a good idea if
file-name-as-directory
was dropped fromivy-expand-file-if-directory
.The text was updated successfully, but these errors were encountered: