emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 777b383dd0: Fix Eshell electric slash when used from the root d


From: Jim Porter
Subject: emacs-29 777b383dd0: Fix Eshell electric slash when used from the root directory of a remote host
Date: Wed, 21 Dec 2022 17:26:54 -0500 (EST)

branch: emacs-29
commit 777b383dd0f61488ba4e43756cf43521f994f906
Author: montag451 <montag451@laposte.net>
Commit: Jim Porter <jporterbugs@gmail.com>

    Fix Eshell electric slash when used from the root directory of a remote host
    
    * lisp/eshell/em-elecslash.el (eshell-electric-forward-slash): Insert
    the remote prefix as determined by 'file-remote-p'.
    
    Copyright-paperwork-exempt: Yes
---
 lisp/eshell/em-elecslash.el | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/lisp/eshell/em-elecslash.el b/lisp/eshell/em-elecslash.el
index 091acb9a86..0ce3a4cc96 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]