GNU bug report logs - #39389
27.0.60; A couple of bugs messing with minibuffer completion of /sudo::

Previous Next

Package: emacs;

Reported by: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>

Date: Sun, 2 Feb 2020 14:52:02 UTC

Severity: normal

Tags: patch

Found in version 27.0.60

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39389 in the body.
You can then email your comments to 39389 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Sun, 02 Feb 2020 14:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 02 Feb 2020 14:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.60; A couple of bugs messing with minibuffer completion of
 /sudo::
Date: Sun, 02 Feb 2020 14:50:58 +0000
Bug 1:

If `ido-enable-tramp-completion` is set to `nil`, it's impossible to
open a file as root with `ido-find-file`. Here are the reproduction steps:

1. In Terminal, $ /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs -Q

2. M-x ido-mode

3. M-x set-variable ido-enable-tramp-completion RET nil RET

4. C-x C-f //sudo:

5. Minibuffer prompt will show `File file: /sudo:/ [No match]` and
there's no way to remove the auto completed / in the end.


Bug 2:

1. $ echo 'PATH=".:$PATH"' > .bash_profile

2. $ echo '(require
'exec-path-from-shell)(exec-path-from-shell-initialize)' > .emacs

3. Launch /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs in GUI

4. C-x C-f /sudo:: RET

5. Cursor now stops blinking but no password prompt is shown.

6. If you TAB complete after /sudo: but before the final :, prompt will
not be stuck


This bug can only be reproduced if steps 1-3 are followed exactly. The
following examples can't reproduce this problem:

* $ /Application/MacPorts/Emacs.app/Contents/MacOS/Emacs -Q -l tramp -l
/path/to/exec-path-from-shell --eval '(exec-path-from-shell-initialize)'
/sudo::

* $ echo '(set exec-path (cons "." exec-path))' > .emacs;
/Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs

There's some very weird interactions with how Emacs starts up, what
happens to Emacs after `call-process` on SHELL  and setting `exec-path`,
and tab completion of /sudo:: in the minibuffer. This appears to have
been the case since relatively early versions of Emacs 27.

Bug 2.1:

If `auth-sources` is set to `'("~/.authinfo.gpg")` and `~/.authinfo.gpg`
has saved the credentials of localhost or the machine's host name, bug 2
does not happened.


Bug 3:

1. Same as Bug 2

2. $ echo '(require
'exec-path-from-shell)(exec-path-from-shell-initialize)(require 'crux)'
> .emacs

3. Same as Bug 2

4. Same as Bug 2

5. M-x crux-sudo-edit

6. Minibuffer now stuck at "Tramp: Sending Password"

Possibly due to similar reasons as Bug 2.



In GNU Emacs 27.0.60 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G2022))
 of 2020-02-02 built on MobileCat.local
Repository revision: f27187f963e9e36435b508e29256e048799e0ff2
Repository branch: HEAD
Windowing system distributor 'Apple', version 10.3.1671
System Description:  Mac OS X 10.14.6

Recent messages:

Tramp: Checking ‘vc-registered’ for /sudo:root <at> localhost:/Users/wyuenho/.emacs...done
Tramp: Inserting ‘/sudo:root <at> localhost:/Users/wyuenho/.emacs’...done

Tramp: Checking ‘vc-registered’ for /sudo:root <at> localhost:/Users/wyuenho/Documents/workspace/dotfiles/.emacs...done
Tramp: Inserting ‘/sudo:root <at> localhost:/Users/wyuenho/.emacs’...done
Warning: symbolic link to Git-controlled source file
You can run the command ‘crux-sudo-edit’ with C-c C-u
Warning: symbolic link to Git-controlled source file
A-b is undefined [2 times]

Configured using:
 'configure --prefix=/opt/local --without-dbus --without-gconf
 --without-libotf --without-m17n-flt --without-gpm --with-gnutls
 --with-xml2 --with-modules --infodir /opt/local/share/info/emacs
 --with-json --without-harfbuzz --with-ns --with-lcms2
 --with-imagemagick --with-rsvg 'CFLAGS=-pipe -Os
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -arch
 x86_64' 'CPPFLAGS=-I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk'
 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-no_pie
 -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
 -arch x86_64''

Configured features:
RSVG IMAGEMAGICK GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS XIM NS MODULES THREADS JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: 

Minor modes in effect:
  flycheck-pos-tip-mode: t
  projectile-rails-global-mode: t
  projectile-mode: t
  company-quickhelp-mode: t
  company-quickhelp-local-mode: t
  company-box-mode: t
  rainbow-mode: t
  elisp-def-mode: t
  display-line-numbers-mode: t
  subword-mode: t
  form-feed-mode: t
  purpose-mode: t
  imenu-list-minor-mode: t
  diff-hl-flydiff-mode: t
  company-flx-mode: t
  yas-minor-mode: t
  crm-custom-mode: t
  override-global-mode: t
  winner-mode: t
  which-key-mode: t
  smooth-scrolling-mode: t
  show-smartparens-global-mode: t
  show-smartparens-mode: t
  smartparens-global-mode: t
  smartparens-mode: t
  show-paren-mode: t
  savehist-mode: t
  save-place-mode: t
  rxt-global-mode: t
  rxt-mode: t
  recentf-mode: t
  ido-ubiquitous-mode: t
  global-whitespace-cleanup-mode: t
  whitespace-cleanup-mode: t
  global-origami-mode: t
  origami-mode: t
  global-move-dup-mode: t
  move-dup-mode: t
  global-magit-file-mode: t
  which-function-mode: t
  magit-auto-revert-mode: t
  global-auto-revert-mode: t
  global-git-commit-mode: t
  shell-dirtrack-mode: t
  server-mode: t
  global-hl-line-mode: t
  global-flycheck-mode: t
  global-diff-hl-mode: t
  diff-hl-mode: t
  flx-ido-mode: t
  ido-everywhere: t
  editorconfig-mode: t
  desktop-save-mode: t
  delete-selection-mode: t
  company-statistics-mode: t
  global-company-mode: t
  company-mode: t
  beginend-global-mode: t
  beginend-prog-mode: t
  auto-compile-on-save-mode: t
  auto-compile-mode: t
  async-bytecomp-package-mode: t
  amx-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  temp-buffer-resize-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Load-path shadows:
/opt/local/share/emacs/site-lisp/cmake-mode hides /Users/wyuenho/.emacs.d/elpa/cmake-mode-20190710.1319/cmake-mode

Features:
(shadow sort mail-extr crux emacsbug sendmail two-column conf-mode
editorconfig-core editorconfig-core-handle editorconfig-fnmatch epa-file
blacken py-autopep8 python-docstring py-isort smartparens-python python
view flycheck-pos-tip add-node-modules-path dired-hide-dotfiles vc-mtn
vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs diff-hl-dired
dired-collapse dired-hacks-utils all-the-icons-dired lsp-ui
lsp-ui-flycheck lsp-ui-doc goto-addr lsp-ui-imenu lsp-ui-peek
lsp-ui-sideline company-shell sh-script executable projectile-rails rake
inflections inf-ruby smartparens-ruby ruby-mode smie projectile vc-git
company-quickhelp pos-tip company-box company-box-doc company-box-icons
company-keywords company-etags company-gtags company-dabbrev-code
company-dabbrev company-yasnippet company-capf company-emoji
company-emoji-list company-files company-cmake company-xcode
company-clang company-semantic company-eclim company-template
rainbow-mode xterm-color elisp-def ert pp debug backtrace
display-line-numbers cap-words superword subword smartparens-config
smartparens-org smartparens-markdown smartparens-text form-feed
solarized-dark-theme solarized-theme solarized solarized-faces
all-the-icons all-the-icons-faces data-material data-weathericons
data-octicons data-fileicons data-faicons data-alltheicons
spaceline-config spaceline-segments spaceline powerline
powerline-separators powerline-themes hideshow window-purpose-x shut-up
window-purpose window-purpose-fixes window-purpose-prefix-overload
window-purpose-switch window-purpose-layout window-purpose-core
window-purpose-configuration eieio-compat window-purpose-utils
imenu-list windmove magit-lfs magit-todos hl-todo org ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint
org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp
ob-core ob-eval org-table ol org-keys org-compat org-macs org-loaddefs
cal-menu calendar cal-loaddefs forge-list forge-commands forge-semi
forge-bitbucket buck forge-gogs gogs forge-gitea gtea forge-gitlab glab
forge-github ghub-graphql treepy gsexp ghub let-alist forge-notify
forge-revnote forge-pullreq forge-issue forge-topic bug-reference
forge-post forge-repo forge forge-core forge-db closql emacsql-sqlite
emacsql emacsql-compiler url-http url-auth url-gw diff-hl-flydiff
dumb-jump popup etags fileloop generator rg rg-info-hack rg-menu
rg-ibuffer rg-result wgrep-rg wgrep rg-history rg-header ibuf-ext
ibuffer ibuffer-loaddefs grep yard-mode poly-markdown polymode poly-lock
polymode-base polymode-weave polymode-export polymode-compat
polymode-methods polymode-core polymode-classes eieio-custom eieio-base
flycheck-objc-clang cl-lib-highlight company-lsp company-flx dap-mode
dap-overlays lsp-clients lsp-eslint lsp-verilog lsp-json url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
mailcap lsp-csharp gnutls lsp-pwsh lsp-terraform lsp-yaml lsp-vhdl
lsp-haxe lsp-erlang lsp-fsharp lsp-metals lsp-elm lsp-dart lsp-clojure
lsp-go lsp-xml lsp-css lsp-intelephense lsp-vetur lsp-html
lsp-solargraph lsp-rust lsp-pyls lsp lsp-mode xref url-util spinner
network-stream nsm markdown-mode color noutline outline lv inline ht f
em-glob esh-util dash-functional bindat flymake-proc flymake compile
warnings project yasnippet-snippets yasnippet crm-custom
pager-default-keybindings pager browse-kill-ring delight
use-package-bind-key use-package-delight osx-trash bind-key
exec-path-from-shell quelpa-use-package use-package-core quelpa lisp-mnt
help-fns radix-tree tramp-sh docker-tramp tramp-cache tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat
parse-time iso8601 ls-lisp winner which-key smooth-scrolling smartparens
thingatpt paren savehist saveplace pcre2el rxt re-builder recentf
tree-widget ido-completing-read+ memoize cus-edit wid-edit minibuf-eldef
help-at-pt whitespace-cleanup-mode whitespace origami origami-parsers cl
move-dup magit-submodule magit-obsolete magit-blame magit-stash
magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-tag magit-merge magit-branch magit-reset magit-files magit-refs
magit-status magit magit-repos magit-apply magit-wip magit-log
which-func imenu magit-diff smerge-mode diff magit-core magit-autorevert
autorevert filenotify magit-margin magit-transient magit-process
magit-mode git-commit transient magit-git magit-section magit-utils crm
log-edit message rmc puny dired dired-loaddefs format-spec rfc822 mml
mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs
text-property-search time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev
mail-utils gmm-utils mailheader pcvs-util add-log with-editor cl-extra
shell pcomplete comint ring server hl-line flycheck ansi-color find-func
help-mode dash diff-hl vc-dir ewoc vc vc-dispatcher diff-mode easy-mmode
flx-ido flx ido editorconfig desktop frameset delsel company-statistics
company pcase beginend auto-compile packed async-bytecomp advice async
amx s cus-start cus-load finder-inf edmacro kmacro rx info package
easymenu browse-url url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core term/tty-colors frame
minibuffer 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 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
threads kqueue cocoa ns lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 854521 343188)
 (symbols 48 45933 145)
 (strings 32 184516 65158)
 (string-bytes 1 5654575)
 (vectors 16 110270)
 (vector-slots 8 2263474 423548)
 (floats 8 1363 843)
 (intervals 56 5261 3325)
 (buffers 1000 54))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Sun, 02 Feb 2020 15:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Sun, 02 Feb 2020 16:47:47 +0100
Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> writes:

Hi,

> Bug 1:
>
> If `ido-enable-tramp-completion` is set to `nil`, it's impossible to
> open a file as root with `ido-find-file`. Here are the reproduction steps:
>
> 1. In Terminal, $ /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs -Q
>
> 2. M-x ido-mode
>
> 3. M-x set-variable ido-enable-tramp-completion RET nil RET
>
> 4. C-x C-f //sudo:
>
> 5. Minibuffer prompt will show `File file: /sudo:/ [No match]` and
> there's no way to remove the auto completed / in the end.

I've tried this one. I've got exactly the same minibuffer contents. BUT
a simple backspace has removed everything, and it has shown just '/' .

This looks OK to me. I'm using

GNU Emacs 28.0.50 (build 32, x86_64-pc-linux-gnu, GTK+ Version 3.24.12, cairo version 1.16.0)
 of 2020-01-28

if this matters, but I don't believe this makes a difference.

For the other two problems I cannot say anything; I don't know the
packages.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Sun, 02 Feb 2020 18:06:02 GMT) Full text and rfc822 format available.

Message #11 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Sun, 2 Feb 2020 18:05:27 +0000
On 02/02/2020 15:47, Michael Albinus wrote:
> I've tried this one. I've got exactly the same minibuffer contents. BUT
> a simple backspace has removed everything, and it has shown just '/' .
>
This is exactly the problem. Backspace removes the whole "sudo:/", and
putting it back into the prompt, then RET just creates a directory
called `sudo:`. There's no way to enter the full Tramp syntax using ido
with ido-enable-tramp-completion off.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Sun, 02 Feb 2020 18:15:02 GMT) Full text and rfc822 format available.

Message #14 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Sun, 02 Feb 2020 19:14:28 +0100
Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> writes:

> On 02/02/2020 15:47, Michael Albinus wrote:
>> I've tried this one. I've got exactly the same minibuffer contents. BUT
>> a simple backspace has removed everything, and it has shown just '/' .
>>
> This is exactly the problem. Backspace removes the whole "sudo:/", and
> putting it back into the prompt, then RET just creates a directory
> called `sudo:`. There's no way to enter the full Tramp syntax using ido
> with ido-enable-tramp-completion off.

I see. Sorry, but I'm out of the game then. I don't know ido that I
could help you.

I'm just surprised, that you set ido-enable-tramp-completion to nil, and
that you still expect Tramp file name support. That doesn't sound right
to me.

Maybe somebody who knows ido could help you.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Sun, 02 Feb 2020 18:31:01 GMT) Full text and rfc822 format available.

Message #17 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Sun, 2 Feb 2020 18:30:40 +0000
On 02/02/2020 18:14, Michael Albinus wrote:
> Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> writes:
>
>> On 02/02/2020 15:47, Michael Albinus wrote:
>>> I've tried this one. I've got exactly the same minibuffer contents. BUT
>>> a simple backspace has removed everything, and it has shown just '/' .
>>>
>> This is exactly the problem. Backspace removes the whole "sudo:/", and
>> putting it back into the prompt, then RET just creates a directory
>> called `sudo:`. There's no way to enter the full Tramp syntax using ido
>> with ido-enable-tramp-completion off.
> I see. Sorry, but I'm out of the game then. I don't know ido that I
> could help you.
>
> I'm just surprised, that you set ido-enable-tramp-completion to nil, and
> that you still expect Tramp file name support. That doesn't sound right
> to me.
I expect either that variable didn't exist and Tramp file name
completion was always fast, or when it's off, ido just reverts back to
the behavior of the regular `find-file`, which should allow me to type
out the whole Tramp syntax.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Sun, 02 Feb 2020 20:12:01 GMT) Full text and rfc822 format available.

Message #20 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Sun, 02 Feb 2020 21:11:00 +0100
Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> writes:

>> I'm just surprised, that you set ido-enable-tramp-completion to nil, and
>> that you still expect Tramp file name support. That doesn't sound right
>> to me.
> I expect either that variable didn't exist and Tramp file name
> completion was always fast, or when it's off, ido just reverts back to
> the behavior of the regular `find-file`, which should allow me to type
> out the whole Tramp syntax.

Why do you expect this? At least the docstring of that variable doesn't
tell that ido behaves like this, when the variable is set to nil.

I agree with you, that the variable shall document its behaviour in this
case.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Wed, 05 Feb 2020 13:32:02 GMT) Full text and rfc822 format available.

Message #23 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Wed, 5 Feb 2020 13:31:31 +0000
On Sun, Feb 2, 2020 at 8:11 PM Michael Albinus <michael.albinus <at> gmx.de> wrote:
>
> Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> writes:
>
> >> I'm just surprised, that you set ido-enable-tramp-completion to nil, and
> >> that you still expect Tramp file name support. That doesn't sound right
> >> to me.
> > I expect either that variable didn't exist and Tramp file name
> > completion was always fast, or when it's off, ido just reverts back to
> > the behavior of the regular `find-file`, which should allow me to type
> > out the whole Tramp syntax.
>
> Why do you expect this? At least the docstring of that variable doesn't
> tell that ido behaves like this, when the variable is set to nil.
>

Because no reasonable person will knowing turn on something that will
break tramp during find-file completely.

> I agree with you, that the variable shall document its behaviour in this
> case.
>

It's not a documentation problem. It's called the principle of least
astonishment, and the culprit for bug 1 is hidden somewhere in
`ido-read-internal` in one of the 2 cases that deals with tramp
syntax.

For bug 2 and 3, there's definitely something wrong with the
`auth-source-search` call in `tramp-read-passwd` that's blocking the
display of the password prompt, as the same workaround works for both
issues.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Wed, 05 Feb 2020 14:41:02 GMT) Full text and rfc822 format available.

Message #26 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Wed, 05 Feb 2020 15:39:57 +0100
Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> writes:

Hi,

>> > I expect either that variable didn't exist and Tramp file name
>> > completion was always fast, or when it's off, ido just reverts back to
>> > the behavior of the regular `find-file`, which should allow me to type
>> > out the whole Tramp syntax.
>>
>> Why do you expect this? At least the docstring of that variable doesn't
>> tell that ido behaves like this, when the variable is set to nil.
>
> Because no reasonable person will knowing turn on something that will
> break tramp during find-file completely.

It is not about turning *on*, it is about turning *off* (setting
ido-enable-tramp-completion to nil). I, for example, would not expect
remote file names to work, after setting a variable with this name to nil.

>> I agree with you, that the variable shall document its behaviour in this
>> case.
>>
>
> It's not a documentation problem. It's called the principle of least
> astonishment, and the culprit for bug 1 is hidden somewhere in
> `ido-read-internal` in one of the 2 cases that deals with tramp
> syntax.

admin/MAINTAINERS does not mention anybody who feels responsible for
ido.el. I hope somebody can chime in. I'm not such familiar with ido.

> For bug 2 and 3, there's definitely something wrong with the
> `auth-source-search` call in `tramp-read-passwd` that's blocking the
> display of the password prompt, as the same workaround works for both
> issues.

Both bugs require exec-path-from-shell.el MELPA, which I don't use. Have
you contacted the author of that package, for debugging?

Before seeing evidences, I wouldn't say that "there's definitely
something wrong with the `auth-source-search` call in
`tramp-read-passwd`". It is used by many users as it is.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Sat, 08 Feb 2020 13:05:02 GMT) Full text and rfc822 format available.

Message #29 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Sat, 8 Feb 2020 13:03:47 +0000
For bug 2 and 3, the author said `file-remote-p` might have triggered
some weird code paths that triggered this bug. I don't know how to
edebug further as `redisplay_internal` keeps calling it. Do you know
how to debug it?

https://github.com/purcell/exec-path-from-shell/issues/95#issuecomment-582629738

On Wed, Feb 5, 2020 at 2:39 PM Michael Albinus <michael.albinus <at> gmx.de> wrote:
>
> Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> writes:
>
> Hi,
>
> >> > I expect either that variable didn't exist and Tramp file name
> >> > completion was always fast, or when it's off, ido just reverts back to
> >> > the behavior of the regular `find-file`, which should allow me to type
> >> > out the whole Tramp syntax.
> >>
> >> Why do you expect this? At least the docstring of that variable doesn't
> >> tell that ido behaves like this, when the variable is set to nil.
> >
> > Because no reasonable person will knowing turn on something that will
> > break tramp during find-file completely.
>
> It is not about turning *on*, it is about turning *off* (setting
> ido-enable-tramp-completion to nil). I, for example, would not expect
> remote file names to work, after setting a variable with this name to nil.
>
> >> I agree with you, that the variable shall document its behaviour in this
> >> case.
> >>
> >
> > It's not a documentation problem. It's called the principle of least
> > astonishment, and the culprit for bug 1 is hidden somewhere in
> > `ido-read-internal` in one of the 2 cases that deals with tramp
> > syntax.
>
> admin/MAINTAINERS does not mention anybody who feels responsible for
> ido.el. I hope somebody can chime in. I'm not such familiar with ido.
>
> > For bug 2 and 3, there's definitely something wrong with the
> > `auth-source-search` call in `tramp-read-passwd` that's blocking the
> > display of the password prompt, as the same workaround works for both
> > issues.
>
> Both bugs require exec-path-from-shell.el MELPA, which I don't use. Have
> you contacted the author of that package, for debugging?
>
> Before seeing evidences, I wouldn't say that "there's definitely
> something wrong with the `auth-source-search` call in
> `tramp-read-passwd`". It is used by many users as it is.
>
> Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Sat, 08 Feb 2020 18:37:01 GMT) Full text and rfc822 format available.

Message #32 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Sat, 08 Feb 2020 19:36:47 +0100
Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> writes:

Hi,

> For bug 2 and 3, the author said `file-remote-p` might have triggered
> some weird code paths that triggered this bug. I don't know how to
> edebug further as `redisplay_internal` keeps calling it. Do you know
> how to debug it?
>
> https://github.com/purcell/exec-path-from-shell/issues/95#issuecomment-582629738

I doubt that file-remote-p is guilty. This function is designed to *not*
work on the remote side, but check the syntax of a file name only.

However, I've downloaded the package exec-path-from-shell from
MELPA. Reading the code, I have serious doubst it will cooperate with
Tramp. It's idea is to analyze the *local* shell, and apply actions over
the shell. But the *local* shell doesn't matter for remote files, so it
is completely useless. I'd recommend NOT to use exec-path-from-shell for
remote files.

If you want to know mor details what happens with Tramp, you might
analyze the function calls. Evaluate

--8<---------------cut here---------------start------------->8---
(require 'trace)
(dolist (elt (all-completions "tramp-" obarray 'functionp))
  (trace-function-background (intern elt)))
(untrace-function 'tramp-read-passwd)
--8<---------------cut here---------------end--------------->8---

Then run your test. The buffer *trace-output* contains the output from
the function call traces. You might show it here, maybe I can find
something more about the problem.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Sun, 09 Feb 2020 05:23:02 GMT) Full text and rfc822 format available.

Message #35 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Sun, 9 Feb 2020 05:22:28 +0000
The problem, as I suspected in the very beginning, it's something within
`auth-source`. Specifically, it's the `insert-file-contents` call inside
`auth-source-netrc-parse` that locks up after having a dot prepended to
PATH, exec'ing shell, setting Emacs's env and exec-path. I'm at a lost
at how to debug this 1100-line function.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Sun, 09 Feb 2020 23:45:01 GMT) Full text and rfc822 format available.

Message #38 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Sun, 9 Feb 2020 23:44:01 +0000
[Message part 1 (text/plain, inline)]
Ok I've found a way to reproduce bug 2 and 3 *without* `exec-path-from-shell`.

0. Get on macOS 10.14
1. Install [GPGTools](https://gpgtools.org/), this will put the `gpg`
binary into `/usr/local/bin`
2. env -i /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs -l
tramp --eval '(setq tramp-verbose 10 exec-path (cons "/usr/local/bin/"
exec-path))' /sudo::
3. Now the minibuffer prompt will be stuck at Tramp: Sending Password.
4. C-g to quit. I've attached a backtrace and the logs in *Messages* for this.
5. The `exec-path` is now `("/usr/local/bin/" "."
"/Applications/MacPorts/Emacs.app/Contents/MacOS/libexec"
"/Applications/MacPorts/Emacs.app/Contents/MacOS/bin")`. It appears as
long as `.` is part of the search paths and `gpg` can be found in any
of the search paths, the prompt will get stuck.
6. Saving the credentials for `root <at> localhost` into `~/.authinfo.gpg`
will work around this issue.

On Sat, Feb 8, 2020 at 6:36 PM Michael Albinus <michael.albinus <at> gmx.de> wrote:
>
> Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> writes:
>
> Hi,
>
> > For bug 2 and 3, the author said `file-remote-p` might have triggered
> > some weird code paths that triggered this bug. I don't know how to
> > edebug further as `redisplay_internal` keeps calling it. Do you know
> > how to debug it?
> >
> > https://github.com/purcell/exec-path-from-shell/issues/95#issuecomment-582629738
>
> I doubt that file-remote-p is guilty. This function is designed to *not*
> work on the remote side, but check the syntax of a file name only.
>
> However, I've downloaded the package exec-path-from-shell from
> MELPA. Reading the code, I have serious doubst it will cooperate with
> Tramp. It's idea is to analyze the *local* shell, and apply actions over
> the shell. But the *local* shell doesn't matter for remote files, so it
> is completely useless. I'd recommend NOT to use exec-path-from-shell for
> remote files.
>
> If you want to know mor details what happens with Tramp, you might
> analyze the function calls. Evaluate
>
> --8<---------------cut here---------------start------------->8---
> (require 'trace)
> (dolist (elt (all-completions "tramp-" obarray 'functionp))
>   (trace-function-background (intern elt)))
> (untrace-function 'tramp-read-passwd)
> --8<---------------cut here---------------end--------------->8---
>
> Then run your test. The buffer *trace-output* contains the output from
> the function call traces. You might show it here, maybe I can find
> something more about the problem.
>
> Best regards, Michael.
[without-epfs-backtrace.txt (text/plain, attachment)]
[messages.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Mon, 10 Feb 2020 00:17:02 GMT) Full text and rfc822 format available.

Message #41 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Mon, 10 Feb 2020 00:16:06 +0000
On Sun, Feb 9, 2020 at 11:44 PM Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> wrote:
>
> Ok I've found a way to reproduce bug 2 and 3 *without* `exec-path-from-shell`.
>
> 0. Get on macOS 10.14
> 1. Install [GPGTools](https://gpgtools.org/), this will put the `gpg`
> binary into `/usr/local/bin`
> 2. env -i /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs -l
> tramp --eval '(setq tramp-verbose 10 exec-path (cons "/usr/local/bin/"
> exec-path))' /sudo::

I should point out that replacing /App.../Emacs with Emacs -q will
also reproduce this issue. But Emacs -Q doesn't. This can be
reproduced in with the nox variant of emacs in the term as well.

> 3. Now the minibuffer prompt will be stuck at Tramp: Sending Password.
> 4. C-g to quit. I've attached a backtrace and the logs in *Messages* for this.
> 5. The `exec-path` is now `("/usr/local/bin/" "."
> "/Applications/MacPorts/Emacs.app/Contents/MacOS/libexec"
> "/Applications/MacPorts/Emacs.app/Contents/MacOS/bin")`. It appears as
> long as `.` is part of the search paths and `gpg` can be found in any
> of the search paths, the prompt will get stuck.
> 6. Saving the credentials for `root <at> localhost` into `~/.authinfo.gpg`
> will work around this issue.
>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Mon, 10 Feb 2020 09:19:02 GMT) Full text and rfc822 format available.

Message #44 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Mon, 10 Feb 2020 10:18:25 +0100
[Message part 1 (text/plain, inline)]
Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> writes:

Hi,

> Ok I've found a way to reproduce bug 2 and 3 *without* `exec-path-from-shell`.
>
> 0. Get on macOS 10.14
> 1. Install [GPGTools](https://gpgtools.org/), this will put the `gpg`
> binary into `/usr/local/bin`
> 2. env -i /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs -l
> tramp --eval '(setq tramp-verbose 10 exec-path (cons "/usr/local/bin/"
> exec-path))' /sudo::
> 3. Now the minibuffer prompt will be stuck at Tramp: Sending Password.
> 4. C-g to quit. I've attached a backtrace and the logs in *Messages* for this.
> 5. The `exec-path` is now `("/usr/local/bin/" "."
> "/Applications/MacPorts/Emacs.app/Contents/MacOS/libexec"
> "/Applications/MacPorts/Emacs.app/Contents/MacOS/bin")`. It appears as
> long as `.` is part of the search paths and `gpg` can be found in any
> of the search paths, the prompt will get stuck.
> 6. Saving the credentials for `root <at> localhost` into `~/.authinfo.gpg`
> will work around this issue.

A relative entry like "." in `exec-path' could be a problem, if
`call-process' searches for the gpg command, and `default-directory' is
remote. Could you pls check whether the appended patch solves it for you?

Best regards, Michael.

[Message part 2 (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Mon, 10 Feb 2020 09:24:01 GMT) Full text and rfc822 format available.

Message #47 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Mon, 10 Feb 2020 10:23:29 +0100
Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> writes:

Hi,

> I should point out that replacing /App.../Emacs with Emacs -q will
> also reproduce this issue. But Emacs -Q doesn't. This can be
> reproduced in with the nox variant of emacs in the term as well.

This is OK. "emacs -Q" prevents using of auth-source.el in Tramp.
"emacs -q" does not restrict Tramp. See (info "(tramp) Bug Reports")
which explains this difference.

Best regards, Michael.




Added tag(s) patch. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Mon, 10 Feb 2020 09:29:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Mon, 10 Feb 2020 21:01:01 GMT) Full text and rfc822 format available.

Message #52 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Mon, 10 Feb 2020 21:00:00 +0000
> A relative entry like "." in `exec-path' could be a problem, if
> `call-process' searches for the gpg command, and `default-directory' is
> remote. Could you pls check whether the appended patch solves it for you?
>
> Best regards, Michael.
>
Nope. Still stuck at Tramp: Sending Password





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Mon, 10 Feb 2020 21:07:02 GMT) Full text and rfc822 format available.

Message #55 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Mon, 10 Feb 2020 21:06:42 +0000
> A relative entry like "." in `exec-path' could be a problem, if
> `call-process' searches for the gpg command, and `default-directory' is
> remote. Could you pls check whether the appended patch solves it for you?
>
> Best regards, Michael.

Acutally sorry, ignore my last reply. This patch works! Thanks!





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39389; Package emacs. (Tue, 11 Feb 2020 08:57:02 GMT) Full text and rfc822 format available.

Message #58 received at 39389 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
Cc: 39389 <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Tue, 11 Feb 2020 09:56:27 +0100
Jimmy Yuen Ho Wong <wyuenho <at> gmail.com> writes:

Hi,

>> A relative entry like "." in `exec-path' could be a problem, if
>> `call-process' searches for the gpg command, and `default-directory' is
>> remote. Could you pls check whether the appended patch solves it for you?
>
> Acutally sorry, ignore my last reply. This patch works! Thanks!

Thanks for the feedback. I've pushed the patch to the master branch of
Emacs. It will be merged with the emacs-27 branch after the release of
Emacs 27.1. And it will also be part of Tramp 2.4.3.2, to be released
via GNU ELPA in a couple of weeks.

What's left is your first problem: when setting
`ido-enable-tramp-completion' to nil, ido does not handle remote file
names as you expect. I've explained already, that I don't believe that
this is a bug. So I'd like to close this bug report.

Why do you need to set `ido-enable-tramp-completion' to nil?

Best regards, Michael.




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Sun, 16 Feb 2020 19:31:02 GMT) Full text and rfc822 format available.

Notification sent to Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>:
bug acknowledged by developer. (Sun, 16 Feb 2020 19:31:02 GMT) Full text and rfc822 format available.

Message #63 received at 39389-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jimmy Yuen Ho Wong <wyuenho <at> gmail.com>
Cc: 39389-done <at> debbugs.gnu.org
Subject: Re: bug#39389: 27.0.60; A couple of bugs messing with minibuffer
 completion of /sudo::
Date: Sun, 16 Feb 2020 20:30:32 +0100
Michael Albinus <michael.albinus <at> gmx.de> writes:

Hi,

> What's left is your first problem: when setting
> `ido-enable-tramp-completion' to nil, ido does not handle remote file
> names as you expect. I've explained already, that I don't believe that
> this is a bug. So I'd like to close this bug report.
>
> Why do you need to set `ido-enable-tramp-completion' to nil?

Well, no response. I'm closing the bug.

If you think this needs further attention, I'm happy to hear.

Best regards, Michael.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 16 Mar 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 122 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.