all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host
@ 2022-12-14 23:46 montag451 via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-12-18 10:34 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: montag451 via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-12-14 23:46 UTC (permalink / raw)
  To: 60083

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

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

* bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host
  2022-12-14 23:46 bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host montag451 via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-12-18 10:34 ` Eli Zaretskii
  2022-12-18 20:04   ` Jim Porter
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-18 10:34 UTC (permalink / raw)
  To: montag451, Jim Porter; +Cc: 60083

> Date: Thu, 15 Dec 2022 00:46:50 +0100
> From:  montag451 via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> 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.

Jim, are you looking into this issue?

Thanks.





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

* bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host
  2022-12-18 10:34 ` 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
  0 siblings, 2 replies; 9+ messages in thread
From: Jim Porter @ 2022-12-18 20:04 UTC (permalink / raw)
  To: Eli Zaretskii, montag451; +Cc: 60083

On 12/18/2022 2:34 AM, Eli Zaretskii wrote:
>> Date: Thu, 15 Dec 2022 00:46:50 +0100
>> From:  montag451 via "Bug reports for GNU Emacs,
>>   the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> 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.
> 
> Jim, are you looking into this issue?

Thanks. I missed the original message. The patch looks good to me, 
although it compiles with the following warning:

   In eshell-electric-forward-slash:
   ../../lisp/eshell/em-elecslash.el:98:18: Warning: Unused lexical 
variable `localname'

Looking through the code, I think we can just remove that variable.

Since this is a small change, and fixes a corner case in a new feature, 
I think it would make sense to go on the release branch, though I'll 
defer to you on this, Eli. The fact that the new code (with the removal 
of 'localname') is a bit simpler helps too.





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

* bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host
  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
  1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-18 20:15 UTC (permalink / raw)
  To: Jim Porter; +Cc: montag451, 60083

> Date: Sun, 18 Dec 2022 12:04:47 -0800
> Cc: 60083@debbugs.gnu.org
> From: Jim Porter <jporterbugs@gmail.com>
> 
> On 12/18/2022 2:34 AM, Eli Zaretskii wrote:
> >> Date: Thu, 15 Dec 2022 00:46:50 +0100
> >> From:  montag451 via "Bug reports for GNU Emacs,
> >>   the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> >>
> >> 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.
> > 
> > Jim, are you looking into this issue?
> 
> Thanks. I missed the original message. The patch looks good to me, 
> although it compiles with the following warning:
> 
>    In eshell-electric-forward-slash:
>    ../../lisp/eshell/em-elecslash.el:98:18: Warning: Unused lexical 
> variable `localname'
> 
> Looking through the code, I think we can just remove that variable.
> 
> Since this is a small change, and fixes a corner case in a new feature, 
> I think it would make sense to go on the release branch, though I'll 
> defer to you on this, Eli. The fact that the new code (with the removal 
> of 'localname') is a bit simpler helps too.

Yes, the release branch is fine for this.  Especially since this
module is AFAIU new in Emacs 29.

Thanks.





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

* bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host
  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
  1 sibling, 1 reply; 9+ messages in thread
From: montag451 via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-12-19 11:29 UTC (permalink / raw)
  To: Jim Porter, Eli Zaretskii; +Cc: 60083

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

Le dimanche 18 décembre 2022 à 12:04 -0800, Jim Porter a écrit :
> On 12/18/2022 2:34 AM, Eli Zaretskii wrote:
> > > Date: Thu, 15 Dec 2022 00:46:50 +0100
> > > From:  montag451 via "Bug reports for GNU Emacs,
> > >   the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> > > 
> > > 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.
> > 
> > Jim, are you looking into this issue?
> 
> Thanks. I missed the original message. The patch looks good to me, 
> although it compiles with the following warning:
> 
>    In eshell-electric-forward-slash:
>    ../../lisp/eshell/em-elecslash.el:98:18: Warning: Unused lexical 
> variable `localname'
> 
> Looking through the code, I think we can just remove that variable.
> 
> Since this is a small change, and fixes a corner case in a new
> feature, 
> I think it would make sense to go on the release branch, though I'll 
> defer to you on this, Eli. The fact that the new code (with the
> removal 
> of 'localname') is a bit simpler helps too.

Thanks for looking into this. I've attached to this email a new patch
which fixes the compilation warning.

[-- Attachment #2: eshell-elecslash.patch --]
[-- Type: text/x-patch, Size: 1571 bytes --]

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 @@ 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
@@ -93,14 +94,9 @@ eshell-electric-forward-slash
 			         (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.

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

* bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host
  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
  0 siblings, 1 reply; 9+ messages in thread
From: Jim Porter @ 2022-12-21  6:55 UTC (permalink / raw)
  To: montag451, Eli Zaretskii; +Cc: 60083

On 12/19/2022 3:29 AM, montag451 via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Thanks for looking into this. I've attached to this email a new patch
> which fixes the compilation warning.

Thanks. This looks good to me now.

Eli, should I merge this to the release branch then? (I'm not sure about 
copyright assignment paperwork and such here.)





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

* bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host
  2022-12-21  6:55       ` Jim Porter
@ 2022-12-21 12:42         ` Eli Zaretskii
  2022-12-21 22:27           ` Jim Porter
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-21 12:42 UTC (permalink / raw)
  To: Jim Porter; +Cc: montag451, 60083

> Date: Tue, 20 Dec 2022 22:55:24 -0800
> Cc: 60083@debbugs.gnu.org
> From: Jim Porter <jporterbugs@gmail.com>
> 
> On 12/19/2022 3:29 AM, montag451 via Bug reports for GNU Emacs, the 
> Swiss army knife of text editors wrote:
> > Thanks for looking into this. I've attached to this email a new patch
> > which fixes the compilation warning.
> 
> Thanks. This looks good to me now.
> 
> Eli, should I merge this to the release branch then?

Yes, please.  But don't forget the Copyright-paperwork-exempt thingy
in the log message.

Thanks.





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

* bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host
  2022-12-21 12:42         ` Eli Zaretskii
@ 2022-12-21 22:27           ` Jim Porter
  2022-12-23 19:46             ` Sean Whitton
  0 siblings, 1 reply; 9+ messages in thread
From: Jim Porter @ 2022-12-21 22:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: montag451, 60083-done

On 12/21/2022 4:42 AM, Eli Zaretskii wrote:
>> Date: Tue, 20 Dec 2022 22:55:24 -0800
>> Cc: 60083@debbugs.gnu.org
>> From: Jim Porter <jporterbugs@gmail.com>
>>
>> On 12/19/2022 3:29 AM, montag451 via Bug reports for GNU Emacs, the
>> Swiss army knife of text editors wrote:
>>> Thanks for looking into this. I've attached to this email a new patch
>>> which fixes the compilation warning.
>>
>> Thanks. This looks good to me now.
>>
>> Eli, should I merge this to the release branch then?
> 
> Yes, please.  But don't forget the Copyright-paperwork-exempt thingy
> in the log message.

Ok, merged to emacs-29 as 777b383dd0f61488ba4e43756cf43521f994f906.

Thanks again for the bug report/patch. Closing this bug now.






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

* bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host
  2022-12-21 22:27           ` Jim Porter
@ 2022-12-23 19:46             ` Sean Whitton
  0 siblings, 0 replies; 9+ messages in thread
From: Sean Whitton @ 2022-12-23 19:46 UTC (permalink / raw)
  To: 60083, jporterbugs, montag451

Hello,

On Wed 21 Dec 2022 at 02:27PM -08, Jim Porter wrote:

> On 12/21/2022 4:42 AM, Eli Zaretskii wrote:
>>> Date: Tue, 20 Dec 2022 22:55:24 -0800
>>> Cc: 60083@debbugs.gnu.org
>>> From: Jim Porter <jporterbugs@gmail.com>
>>>
>>> On 12/19/2022 3:29 AM, montag451 via Bug reports for GNU Emacs, the
>>> Swiss army knife of text editors wrote:
>>>> Thanks for looking into this. I've attached to this email a new patch
>>>> which fixes the compilation warning.
>>>
>>> Thanks. This looks good to me now.
>>>
>>> Eli, should I merge this to the release branch then?
>> Yes, please.  But don't forget the Copyright-paperwork-exempt thingy
>> in the log message.
>
> Ok, merged to emacs-29 as 777b383dd0f61488ba4e43756cf43521f994f906.
>
> Thanks again for the bug report/patch. Closing this bug now.

Thank you all for fixing my code!

-- 
Sean Whitton





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

end of thread, other threads:[~2022-12-23 19:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-14 23:46 bug#60083: 29.0.60; eshell-elecslash when in the root directory of a remote host montag451 via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-18 10:34 ` 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.