unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31495: 26.1; filename completion -vs- "*"
@ 2018-05-18 15:33 Tom Tromey
  2018-05-19 13:32 ` Tino Calancha
  0 siblings, 1 reply; 12+ messages in thread
From: Tom Tromey @ 2018-05-18 15:33 UTC (permalink / raw)
  To: 31495


I found a situation where using "*" globbing in filename completion acts
strangely.

Here is how to set up to see the bug:

$ cd /tmp
$ mkdir -p a/b/c a/d/c
$ touch a/b/c/q

Now in Emacs, C-x C-f /tmp/a/*/c TAB

On the first TAB, a "/" is appended, and then point moves to the "/"
before "c".

Now type TAB again.
At this point, the "/tmp/a" is greyed out and the minibuffer shows:

Find file: /tmp/a//c/

... so now only completions for "/c" are available.

I think instead the "*" should be preserved.  Often I'm using this
feature to try to find a specific file where I don't know the exact
subdirectory it is in.





In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.26)
 of 2018-05-11 built on pokyo
Repository revision: c9c0e40d673a5fc0d24d30ff67ccb7c7f2fb482a
Windowing system distributor 'Fedora Project', version 11.0.11906000
System Description:	Fedora release 27 (Twenty Seven)

Recent messages:
Mark set
Saving file /home/tromey/rust-debug.org...
Wrote /home/tromey/rust-debug.org
Saving file /home/tromey/rust-debug.org...
Wrote /home/tromey/rust-debug.org
Mark saved where search started [2 times]
Quit
Making completion list... [2 times]
Quit [3 times]
Invalid module name "flycheck_TestRustNames" [invalid-name] [2 times]

Configured using:
 'configure --prefix=/home/tromey/Emacs/install --with-modules'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY
LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 MODULES THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Python

Minor modes in effect:
  ggtags-mode: t
  ggtags-navigation-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-netsplit-mode: t
  erc-spelling-mode: t
  erc-truncate-mode: t
  diff-auto-refine-mode: t
  flyspell-mode: t
  shell-dirtrack-mode: t
  which-function-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-notify-mode: t
  erc-notifications-mode: t
  erc-match-mode: t
  erc-services-mode: t
  erc-networks-mode: t
  erc-hl-nicks-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  flycheck-mode: t
  savehist-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t

Load-path shadows:
/home/tromey/.emacs.d/elpa/bubbles-0.5/bubbles hides /home/tromey/Emacs/install/share/emacs/26.1/lisp/play/bubbles

Features:
(shadow emacsbug python tramp-sh js sgml-mode gud mailalias bbdb-sc
supercite regi mail-hist iso-transl eieio-opt speedbar sb-image ezimage
dframe pulse compare-w org-rmail org-mhe org-irc org-info org-gnus nnir
org-docview doc-view image-mode org-bibtex bibtex org-bbdb org-w3m
org-element avl-tree generator org org-macro org-footnote org-pcomplete
org-list org-faces org-entities noutline outline org-version
ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp
ob-comint ob-core ob-eval org-compat org-macs org-loaddefs novice eww
webjump url-http url-auth url-gw log-view pcvs-util wgrep find-dired
grep tcl pcmpl-unix shr-color smerge-mode term/xterm xterm goto-addr
find-file dabbrev copyright idutils pcase add-log ggtags etags xref
project compile bug-reference whitespace cc-mode cc-fonts cc-guess
cc-menus cc-cmds shr svg dom jka-compr gnus-html url-queue help-fns
radix-tree browse-url url-cache mm-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf bbdb-gui
bbdb-hooks bbdb-rmail rmailsum sort smiley gnus-cite flow-fill
mm-archive gnus-bcklg erc-list erc-menu erc-join erc-ring erc-pcomplete
erc-netsplit erc-spelling erc-truncate qp gnus-async gnus-ml disp-table
misearch multi-isearch vc-mtn vc-hg vc-git diff-mode vc-bzr vc-src
vc-sccs vc-svn vc-cvs vc-rcs gnus-topic nndraft nnmh nnfolder utf-7
bbdb-gnus bbdb-snarf mail-extr bbdb-com network-stream nsm starttls
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp
gnus-cache gnus-registry registry eieio-base gnus-art mm-uu mml2015
mm-view mml-smime smime dig mailcap gnus-sum gnus-group gnus-undo
smtpmail sendmail gnus-start gnus-cloud nnimap nnmail mail-source tls
gnutls utf7 netrc nnoo gnus-spec gnus-int gnus-range message rmc puny
rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus
nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
mail-utils mm-util mail-prsvr elec-pair flyspell ispell diminish appt
diary-lib diary-loaddefs cal-menu calendar cal-loaddefs tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
parse-time which-func imenu autorevert filenotify desktop frameset
cus-start cus-load git-link url-util erc-track erc-notify
erc-desktop-notifications erc-match erc-services erc-networks
notifications dbus xml erc-hl-nicks easy-mmode color erc-button erc-fill
erc-stamp wid-edit erc-goodies erc erc-backend erc-compat format-spec
thingatpt pp dired-aux dired-x dired dired-loaddefs warnings advice
vc-dir ewoc vc vc-dispatcher flycheck cl-extra json map find-func
help-mode rx subr-x dash cc-styles cc-align cc-engine cc-vars cc-defs
bbdb cl timezone ange-ftp comint ansi-color ring server savehist
finder-inf bbdb-autoloads lisppaste-autoloads pydoc-info-autoloads
info-look info package easymenu epg-config url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv
cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type 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 elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic 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 charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 2783408 275648)
 (symbols 48 120787 15)
 (miscs 40 37433 11144)
 (strings 32 465564 61374)
 (string-bytes 1 12103968)
 (vectors 16 162401)
 (vector-slots 8 3066382 196672)
 (floats 8 608 703)
 (intervals 56 263860 7322)
 (buffers 992 263))





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

* bug#31495: 26.1; filename completion -vs- "*"
  2018-05-18 15:33 bug#31495: 26.1; filename completion -vs- "*" Tom Tromey
@ 2018-05-19 13:32 ` Tino Calancha
  2018-05-19 18:17   ` Michael Albinus
                     ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Tino Calancha @ 2018-05-19 13:32 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Michael Albinus, 31495

Tom Tromey <tom@tromey.com> writes:

> I found a situation where using "*" globbing in filename completion acts
> strangely.
>
> Here is how to set up to see the bug:
>
> $ cd /tmp
> $ mkdir -p a/b/c a/d/c
> $ touch a/b/c/q
>
> Now in Emacs, C-x C-f /tmp/a/*/c TAB
>
> On the first TAB, a "/" is appended, and then point moves to the "/"
> before "c".
Yeah, it's broken.
In this example adding a '/' makes the completion works
C-x C-f /tmp/a/*/c/ TAB

> Now type TAB again.
> At this point, the "/tmp/a" is greyed out and the minibuffer shows:
>
> Find file: /tmp/a//c/
>
> ... so now only completions for "/c" are available.
>
> I think instead the "*" should be preserved.  Often I'm using this
> feature to try to find a specific file where I don't know the exact
> subdirectory it is in.
Since Emacs 26.1 dired supports wildcards in the directory part.
You can use
C-x d /tmp/a/*/c/q RET

If you shell in '/bin/sh' supports globstar (and have it enabled by
default) then you can do just:
C-x d /tmp/**/q RET

We could even let the user enable globstar in those shells supporting
it but having it disable by default (e.g. bash).
For instance, following patch:
--8<-----------------------------cut here---------------start------------->8---
commit 1c1116e6a6ed369db63ddf00865f04f687579e71
Author: Tino Calancha <tino.calancha@gmail.com>
Date:   Sat May 19 21:57:42 2018 +0900

    Handle globstar in dired
    
    Allow user to enable globstar when the shell support
    it and disable it by default (e.g. bash).
    * lisp/dired.el (dired-maybe-use-globstar): New user option.
    (dired-enable-globstar-in-shell): New variable.
    (dired-insert-directory): if `dired-maybe-use-globstar' is
    non-nil and the shell supports globstar, then enable it.
    
    * doc/emacs/dired.texi: Document feature.
    ; * etc/NEWS: Add entry.

diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index fbb3030c2a..ad63c2f6a5 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -79,6 +79,24 @@ Dired Enter
 @samp{foo}.  The latter lists the files with extension @samp{.el}
 in all the subdirectories of @samp{foo}.
 
+When the system shell supports globstar and it's enabled, then you
+can use recursive globbing:
+
+@example
+C-x d  ~/foo/**/*.el  @key{RET}
+@end example
+
+This command lists all the files with extension @samp{.el} descending
+recursively in all the subdirectories of @samp{foo}.  Note that there
+are small differences in the implementation of globstar between shells.
+Check your shell manual to know the expected behavior.
+
+@vindex dired-maybe-use-globstar
+@vindex dired-enable-globstar-in-shell
+If the shell supports globstar and disables it by default, you
+can still enable this feature with @code{dired-maybe-use-globstar} if
+the shell is included in @code{dired-enable-globstar-in-shell}.
+
 The usual history and completion commands can be used in the minibuffer;
 in particular, @kbd{M-n} puts the name of the visited file (if any) in
 the minibuffer (@pxref{Minibuffer History}).
diff --git a/etc/NEWS b/etc/NEWS
index c7ffb17ad3..931289f0af 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -266,6 +266,12 @@ unescaping text.
 ** Dired
 
 +++
+*** The new user option 'dired-maybe-use-globstar' enables globstar
+in shells that support this feature.  The new variable
+'dired-enable-globstar-in-shell' lists which shells can have enabled
+globstar.
+
++++
 *** The new user option 'dired-create-destination-dirs' controls whether
 'dired-do-copy' and 'dired-rename-file' should create non-existent
 directories in the destination.
diff --git a/lisp/dired.el b/lisp/dired.el
index 1348df6934..0adffdbd3f 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -77,6 +77,26 @@ dired-subdir-switches
    :type '(choice (const :tag "Use dired-listing-switches" nil)
                   (string :tag "Switches")))
 
+(defcustom dired-maybe-use-globstar nil
+  "If non-nil, enable globstar if the shell support it.
+Some shells enable this feature by default (e.g. zsh or fish).
+
+See `dired-enable-globstar-in-shell' for a list of shells
+that support globstar and disable it by default.
+
+Note that the implementation of globstar have small differences
+between shells.  You must check your shell documentation to see
+what to expect."
+  :type 'boolean
+  :group 'dired)
+
+(defconst dired-enable-globstar-in-shell
+  '(("ksh" . "set -G")
+    ("bash" . "shopt -s globstar"))
+  "Alist of (SHELL . COMMAND), where COMMAND enables globstar in SHELL.
+If `dired-maybe-use-globstar' is non-nil, then `dired-insert-directory'
+checks this alist to enable globstar in the shell subprocess.")
+
 (defcustom dired-chown-program
   (purecopy (cond ((executable-find "chown") "chown")
                   ((file-executable-p "/usr/sbin/chown") "/usr/sbin/chown")
@@ -1297,6 +1317,13 @@ dired-insert-directory
                                  (executable-find explicit-shell-file-name))
                             (executable-find "sh")))
                     (switch (if remotep "-c" shell-command-switch)))
+               ;; Enable globstar
+               (when-let ((globstar dired-maybe-use-globstar)
+                          (enable-it
+                           (assoc-default
+                            (file-truename sh) dired-enable-globstar-in-shell
+                            (lambda (reg shell) (string-match reg shell)))))
+                 (setq script (format "%s; %s" enable-it script)))
                (unless
                    (zerop
                     (process-file sh nil (current-buffer) nil switch script))
--8<-----------------------------cut here---------------end--------------->8---
In GNU Emacs 27.0.50 (build 12, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2018-05-17 built on calancha-pc
Repository revision: 593c367b0727affc739832ab4f4bdb9d7dd1ddd7





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

* bug#31495: 26.1; filename completion -vs- "*"
  2018-05-19 13:32 ` Tino Calancha
@ 2018-05-19 18:17   ` Michael Albinus
  2018-05-20  2:19     ` Tino Calancha
  2018-06-20 12:36   ` Noam Postavsky
  2020-08-22 15:40   ` Lars Ingebrigtsen
  2 siblings, 1 reply; 12+ messages in thread
From: Michael Albinus @ 2018-05-19 18:17 UTC (permalink / raw)
  To: Tino Calancha; +Cc: Tom Tromey, 31495

Tino Calancha <tino.calancha@gmail.com> writes:

Hi Tino,

> We could even let the user enable globstar in those shells supporting
> it but having it disable by default (e.g. bash).

What about ls-lisp?

> +(defconst dired-enable-globstar-in-shell
> +  '(("ksh" . "set -G")
> +    ("bash" . "shopt -s globstar"))
> +  "Alist of (SHELL . COMMAND), where COMMAND enables globstar in SHELL.
> +If `dired-maybe-use-globstar' is non-nil, then `dired-insert-directory'
> +checks this alist to enable globstar in the shell subprocess.")

This works only if the shell name like bash or ksh is used. Often, just
/bin/sh is used, and you don't know which real shell this file is linked to.

Best regards, Michael.





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

* bug#31495: 26.1; filename completion -vs- "*"
  2018-05-19 18:17   ` Michael Albinus
@ 2018-05-20  2:19     ` Tino Calancha
  0 siblings, 0 replies; 12+ messages in thread
From: Tino Calancha @ 2018-05-20  2:19 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Tom Tromey, 31495

Michael Albinus <michael.albinus@gmx.de> writes:

> Tino Calancha <tino.calancha@gmail.com> writes:
>
> Hi Tino,
>
>> We could even let the user enable globstar in those shells supporting
>> it but having it disable by default (e.g. bash).
>
> What about ls-lisp?
It would be great to have there but it's out of the
scope of the patch yet.   This is not about add a new dired
feature.  Instead, the target is to turn on a
feature from your shell that is disabled by default.

If you use em-ls you have this feature.  Same as if you use
external program `ls' from zsh or fish shells.
The idea is to let users if they want to enable globstar
in their shell when its disabled by default.

>> +(defconst dired-enable-globstar-in-shell
>> +  '(("ksh" . "set -G")
>> +    ("bash" . "shopt -s globstar"))
>> +  "Alist of (SHELL . COMMAND), where COMMAND enables globstar in SHELL.
>> +If `dired-maybe-use-globstar' is non-nil, then `dired-insert-directory'
>> +checks this alist to enable globstar in the shell subprocess.")
>
> This works only if the shell name like bash or ksh is used. Often, just
> /bin/sh is used, and you don't know which real shell this file is linked to.
My patch use `file-truename' to get the actual shell
used by `dired-insert-directory'.





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

* bug#31495: 26.1; filename completion -vs- "*"
  2018-05-19 13:32 ` Tino Calancha
  2018-05-19 18:17   ` Michael Albinus
@ 2018-06-20 12:36   ` Noam Postavsky
  2018-06-20 12:48     ` Tino Calancha
  2020-08-22 15:40   ` Lars Ingebrigtsen
  2 siblings, 1 reply; 12+ messages in thread
From: Noam Postavsky @ 2018-06-20 12:36 UTC (permalink / raw)
  To: Tino Calancha; +Cc: Tom Tromey, Michael Albinus, 31495

severity 31495 minor
quit

Tino Calancha <tino.calancha@gmail.com> writes:

> Tom Tromey <tom@tromey.com> writes:
>
>> Now in Emacs, C-x C-f /tmp/a/*/c TAB
>>
>> On the first TAB, a "/" is appended, and then point moves to the "/"
>> before "c".
> Yeah, it's broken.
> In this example adding a '/' makes the completion works
> C-x C-f /tmp/a/*/c/ TAB

Hmm, that makes it seem like the different behaviour without the
trailing slash is on purpose (though I can't see what that would be).

> +(defconst dired-enable-globstar-in-shell
> +  '(("ksh" . "set -G")
> +    ("bash" . "shopt -s globstar"))
> +  "Alist of (SHELL . COMMAND), where COMMAND enables globstar in SHELL.
> +If `dired-maybe-use-globstar' is non-nil, then `dired-insert-directory'
> +checks this alist to enable globstar in the shell subprocess.")

Shouldn't this be a defvar or a defcustom?  Using defconst makes it seem
like the code wouldn't handle it being changed.





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

* bug#31495: 26.1; filename completion -vs- "*"
  2018-06-20 12:36   ` Noam Postavsky
@ 2018-06-20 12:48     ` Tino Calancha
  2018-06-20 13:08       ` Tino Calancha
  0 siblings, 1 reply; 12+ messages in thread
From: Tino Calancha @ 2018-06-20 12:48 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Tom Tromey, Michael Albinus, 31495, Tino Calancha



>> +(defconst dired-enable-globstar-in-shell
>> +  '(("ksh" . "set -G")
>> +    ("bash" . "shopt -s globstar"))
>> +  "Alist of (SHELL . COMMAND), where COMMAND enables globstar in SHELL.
>> +If `dired-maybe-use-globstar' is non-nil, then `dired-insert-directory'
>> +checks this alist to enable globstar in the shell subprocess.")
>
> Shouldn't this be a defvar or a defcustom?  Using defconst makes it seem
> like the code wouldn't handle it being changed.
To indicate what shells Emacs is supporting for 
this feature.  Of course it might be a defvar, and users might change that adding other 
shells; but then, those shells might not been heavily tested by Emacs 
developers, and other features can break.
I just wanted to be conservative.

I think that is a cheap and useful addition.  I like it.
I set '/bin/sh' to '/bin/zsh' mainly to have globstar in dired; often,
I find that I reset it to 'bash' and globstar stop working with Dired :-(





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

* bug#31495: 26.1; filename completion -vs- "*"
  2018-06-20 12:48     ` Tino Calancha
@ 2018-06-20 13:08       ` Tino Calancha
  2018-06-20 14:05         ` Michael Albinus
  0 siblings, 1 reply; 12+ messages in thread
From: Tino Calancha @ 2018-06-20 13:08 UTC (permalink / raw)
  To: Tino Calancha; +Cc: Tom Tromey, Michael Albinus, Noam Postavsky, 31495



> I set '/bin/sh' to '/bin/zsh' mainly to have globstar in dired; often,
> I find that I reset it to 'bash' and globstar stop working with Dired :-(
You might be wondering why I reset back '/bin/sh' to '/bin/bash'.
The reason is that `shell-prompt-pattern' doesn't recognize my 
zsh prompt;
that means, if I want to visit dired as root:
emacs -Q 
C-x d /sudo::/bin
;; this command won't end if I am using zsh.
;; It works OK with other shells (dash, bash, etc).

I can modify `shell-prompt-pattern' myself but if I use
emacs -Q
still I cannot use dired as root in that case, which it's handy.





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

* bug#31495: 26.1; filename completion -vs- "*"
  2018-06-20 13:08       ` Tino Calancha
@ 2018-06-20 14:05         ` Michael Albinus
  2018-06-21  1:50           ` Tino Calancha
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Albinus @ 2018-06-20 14:05 UTC (permalink / raw)
  To: Tino Calancha; +Cc: Tom Tromey, Noam Postavsky, 31495

Tino Calancha <tino.calancha@gmail.com> writes:

> C-x d /sudo::/bin
> ;; this command won't end if I am using zsh.
> ;; It works OK with other shells (dash, bash, etc).

Problems of cooperation between Tramp and zsh are discussed in the Tramp
manual.

Best regards, Michael.





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

* bug#31495: 26.1; filename completion -vs- "*"
  2018-06-20 14:05         ` Michael Albinus
@ 2018-06-21  1:50           ` Tino Calancha
  2018-06-21  7:19             ` Michael Albinus
  0 siblings, 1 reply; 12+ messages in thread
From: Tino Calancha @ 2018-06-21  1:50 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Tom Tromey, Noam Postavsky, 31495

Michael Albinus <michael.albinus@gmx.de> writes:

> Tino Calancha <tino.calancha@gmail.com> writes:
>
>> C-x d /sudo::/bin
>> ;; this command won't end if I am using zsh.
>> ;; It works OK with other shells (dash, bash, etc).
>
> Problems of cooperation between Tramp and zsh are discussed in the Tramp
> manual.
Thank you,

I find-grep 'zsh' in doc, and I found from tramp manual just this:
When using zsh on remote hosts, disable zsh line editor because zsh
uses left-hand side and right-hand side prompts in parallel.  Add the
following line to @file{~/.zshrc}:

@example
[[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
@end example

Then, I add such line in
~/.zsh
and
/root/.zsh
sudo ln -sf /bin/zsh /bin/sh
emacs -Q
C-x d /sudo::/bin
;; I don't get prompt for root password

ln -sf /bin/bash /bin/sh
C-x d /sudo::/bin
;; OK, but I lost globstar sniff, sniff :-(





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

* bug#31495: 26.1; filename completion -vs- "*"
  2018-06-21  1:50           ` Tino Calancha
@ 2018-06-21  7:19             ` Michael Albinus
  2018-06-21  7:44               ` Tino Calancha
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Albinus @ 2018-06-21  7:19 UTC (permalink / raw)
  To: Tino Calancha; +Cc: Tom Tromey, Noam Postavsky, 31495

Tino Calancha <tino.calancha@gmail.com> writes:

Hi Tino,

this discussion is going offtopic. Maybe you write a bug report?

> I find-grep 'zsh' in doc, and I found from tramp manual just this:
> When using zsh on remote hosts, disable zsh line editor because zsh
> uses left-hand side and right-hand side prompts in parallel.  Add the
> following line to @file{~/.zshrc}:
>
> @example
> [[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
> @end example
>
> Then, I add such line in
> ~/.zsh
> and
> /root/.zsh
> sudo ln -sf /bin/zsh /bin/sh
> emacs -Q
> C-x d /sudo::/bin
> ;; I don't get prompt for root password

Please eval (setq tramp-verbose 10) prior opening your remote
directory. There will be a Tramp debug buffer; pls show it.

Out of curiosity, why do you edit ~/.zsh and /root/.zsh? The manual
speaks about ~/.zshrc (I'm not an zsh user, so I don't know what I'm
speaking about).

Best regards, Michael.





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

* bug#31495: 26.1; filename completion -vs- "*"
  2018-06-21  7:19             ` Michael Albinus
@ 2018-06-21  7:44               ` Tino Calancha
  0 siblings, 0 replies; 12+ messages in thread
From: Tino Calancha @ 2018-06-21  7:44 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Tom Tromey, Tino Calancha, 31495, Noam Postavsky



On Thu, 21 Jun 2018, Michael Albinus wrote:

> this discussion is going offtopic. Maybe you write a bug report?
You are right.  Sorry for that.

>> I find-grep 'zsh' in doc, and I found from tramp manual just this:
>> When using zsh on remote hosts, disable zsh line editor because zsh
>> uses left-hand side and right-hand side prompts in parallel.  Add the
>> following line to @file{~/.zshrc}:
>>
>> @example
>> [[ $TERM == "dumb" ]] && unsetopt zle && PS1='$ ' && return
>> @end example
>>
>> Then, I add such line in
>> ~/.zsh
>> and
>> /root/.zsh
>> sudo ln -sf /bin/zsh /bin/sh
>> emacs -Q
>> C-x d /sudo::/bin
>> ;; I don't get prompt for root password
>
> Please eval (setq tramp-verbose 10) prior opening your remote
> directory. There will be a Tramp debug buffer; pls show it.
This must go in the new bug report whenever it exists.

> Out of curiosity, why do you edit ~/.zsh and /root/.zsh? The manual
> speaks about ~/.zshrc (I'm not an zsh user, so I don't know what I'm
> speaking about).
Good catch!
My typo in the email.  I actually created:
~/.zshrc
/root/.zshrc


> Best regards, Michael
My best regards too,
Tino





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

* bug#31495: 26.1; filename completion -vs- "*"
  2018-05-19 13:32 ` Tino Calancha
  2018-05-19 18:17   ` Michael Albinus
  2018-06-20 12:36   ` Noam Postavsky
@ 2020-08-22 15:40   ` Lars Ingebrigtsen
  2 siblings, 0 replies; 12+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-22 15:40 UTC (permalink / raw)
  To: Tino Calancha; +Cc: Tom Tromey, Michael Albinus, 31495

Tino Calancha <tino.calancha@gmail.com> writes:

> We could even let the user enable globstar in those shells supporting
> it but having it disable by default (e.g. bash).
> For instance, following patch:
>
> commit 1c1116e6a6ed369db63ddf00865f04f687579e71
> Author: Tino Calancha <tino.calancha@gmail.com>
> Date:   Sat May 19 21:57:42 2018 +0900
>
>     Handle globstar in dired
>
>     Allow user to enable globstar when the shell support
>     it and disable it by default (e.g. bash).
>     * lisp/dired.el (dired-maybe-use-globstar): New user option.
>     (dired-enable-globstar-in-shell): New variable.
>     (dired-insert-directory): if `dired-maybe-use-globstar' is
>     non-nil and the shell supports globstar, then enable it.
>
>     * doc/emacs/dired.texi: Document feature.
>     ; * etc/NEWS: Add entry.

Makes sense to me, so I've applied it to Emacs 28.  Only very lightly
tested, though.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2020-08-22 15:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-18 15:33 bug#31495: 26.1; filename completion -vs- "*" Tom Tromey
2018-05-19 13:32 ` Tino Calancha
2018-05-19 18:17   ` Michael Albinus
2018-05-20  2:19     ` Tino Calancha
2018-06-20 12:36   ` Noam Postavsky
2018-06-20 12:48     ` Tino Calancha
2018-06-20 13:08       ` Tino Calancha
2018-06-20 14:05         ` Michael Albinus
2018-06-21  1:50           ` Tino Calancha
2018-06-21  7:19             ` Michael Albinus
2018-06-21  7:44               ` Tino Calancha
2020-08-22 15:40   ` Lars Ingebrigtsen

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