summaryrefslogtreecommitdiff
path: root/lisp/eshell/em-elecslash.el
diff options
context:
space:
mode:
authorGerd Möllmann <gerd@gnu.org>2022-12-31 09:04:56 +0100
committerGerd Möllmann <gerd@gnu.org>2022-12-31 09:04:56 +0100
commit716d676747119f9950861f9a64a8e7871b0082d4 (patch)
treeb71f94b50896736a007d6977c97679e1abd895a6 /lisp/eshell/em-elecslash.el
parent54ec3973e298c3d2b3d81484f80053d881694f88 (diff)
parent7493b4026fc74a51c76c5b614bc83b864af9bc31 (diff)
downloademacs-716d676747119f9950861f9a64a8e7871b0082d4.tar.gz
Merge remote-tracking branch 'origin/master' into scratch/pkgscratch/pkg
Diffstat (limited to 'lisp/eshell/em-elecslash.el')
-rw-r--r--lisp/eshell/em-elecslash.el14
1 files changed, 5 insertions, 9 deletions
diff --git a/lisp/eshell/em-elecslash.el b/lisp/eshell/em-elecslash.el
index 091acb9a861..0ce3a4cc963 100644
--- a/lisp/eshell/em-elecslash.el
+++ b/lisp/eshell/em-elecslash.el
@@ -74,8 +74,9 @@ insertion."
(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
@@ -93,14 +94,9 @@ insertion."
(or eshell-prefer-lisp-functions
(not (eshell-search-path command))))))))
(let ((map (make-sparse-keymap))
- (start (if tilde-before (1- (point)) (point)))
- (localname
- (tramp-file-name-localname
- (tramp-dissect-file-name default-directory))))
+ (start (if tilde-before (1- (point)) (point))))
(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.