From: montag451 via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 60083@debbugs.gnu.org
Subject: bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host
Date: Thu, 15 Dec 2022 00:46:50 +0100 [thread overview]
Message-ID: <3f509b4aaaa957d43a429b2ee843c88312486e86.camel@laposte.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 3510 bytes --]
Hi,
While testing the new eshell module 'eshell-elecslash' I found a bug
when the default-directory is the root of a remote host. To reproduce
the problem type the following in a eshell buffer (replacing "method"
and "host" by appropriate values):
$ cd /method:host:/
$ cd / <--- here the "/" should be replaced by "/method:host:/" but
instead nothing happen
I've attached a patch to this email which fixes this issue.
In GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.35, cairo version 1.16.0) of 2022-12-15 built on vincent-laptop
Repository revision: fbf0d3b796ac1b891be35b642878a1fd412ee5ea
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version
11.0.12201005
System Description: Debian GNU/Linux bookworm/sid
Configured using:
'configure --prefix /tmp/emacs-29'
Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG
LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG SECCOMP SOUND
SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM GTK3
ZLIB
Important settings:
value of $LANG: fr_FR.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: Fundamental
Minor modes in effect:
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
blink-cursor-mode: t
buffer-read-only: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils rmc iso-transl tooltip cconv 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 nadvice seq simple cl-generic
indonesian philippine 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 abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
emacs)
Memory information:
((conses 16 38765 9013)
(symbols 48 5124 0)
(strings 32 13223 1378)
(string-bytes 1 378252)
(vectors 16 9327)
(vector-slots 8 148424 13521)
(floats 8 22 18)
(intervals 56 369 2)
(buffers 976 12))
[-- Attachment #2: eshell-elecslash.patch --]
[-- Type: text/x-patch, Size: 1293 bytes --]
diff --git a/lisp/eshell/em-elecslash.el b/lisp/eshell/em-elecslash.el
index 091acb9a86..63de9da679 100644
--- a/lisp/eshell/em-elecslash.el
+++ b/lisp/eshell/em-elecslash.el
@@ -74,8 +74,9 @@ eshell-electric-forward-slash
(command (save-excursion
(eshell-bol)
(skip-syntax-forward " ")
- (thing-at-point 'sexp))))
- (if (and (file-remote-p default-directory)
+ (thing-at-point 'sexp)))
+ (prefix (file-remote-p default-directory)))
+ (if (and prefix
;; We can't formally parse the input. But if there is
;; one of these operators behind us, then looking at
;; the first command would not be sensible. So be
@@ -98,9 +99,7 @@ eshell-electric-forward-slash
(tramp-file-name-localname
(tramp-dissect-file-name default-directory))))
(when tilde-before (delete-char -1))
- (insert
- (substring default-directory 0
- (string-search localname default-directory)))
+ (insert prefix)
(unless tilde-before (insert "/"))
;; Typing a second slash undoes the insertion, for when
;; you really do want to type a local absolute file name.
next reply other threads:[~2022-12-14 23:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-14 23:46 montag451 via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-12-18 10:34 ` bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host Eli Zaretskii
2022-12-18 20:04 ` Jim Porter
2022-12-18 20:15 ` Eli Zaretskii
2022-12-19 11:29 ` montag451 via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-21 6:55 ` Jim Porter
2022-12-21 12:42 ` Eli Zaretskii
2022-12-21 22:27 ` Jim Porter
2022-12-23 19:46 ` Sean Whitton
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=3f509b4aaaa957d43a429b2ee843c88312486e86.camel@laposte.net \
--to=bug-gnu-emacs@gnu.org \
--cc=60083@debbugs.gnu.org \
--cc=montag451@laposte.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).