unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
@ 2020-02-02 14:50 Jimmy Yuen Ho Wong
  2020-02-02 15:47 ` Michael Albinus
  0 siblings, 1 reply; 19+ messages in thread
From: Jimmy Yuen Ho Wong @ 2020-02-02 14:50 UTC (permalink / raw)
  To: 39389


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.

\f

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@localhost:/Users/wyuenho/.emacs...done
Tramp: Inserting ‘/sudo:root@localhost:/Users/wyuenho/.emacs’...done

Tramp: Checking ‘vc-registered’ for /sudo:root@localhost:/Users/wyuenho/Documents/workspace/dotfiles/.emacs...done
Tramp: Inserting ‘/sudo:root@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))





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-02 14:50 bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo:: Jimmy Yuen Ho Wong
@ 2020-02-02 15:47 ` Michael Albinus
  2020-02-02 18:05   ` Jimmy Yuen Ho Wong
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Albinus @ 2020-02-02 15:47 UTC (permalink / raw)
  To: Jimmy Yuen Ho Wong; +Cc: 39389

Jimmy Yuen Ho Wong <wyuenho@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.





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-02 15:47 ` Michael Albinus
@ 2020-02-02 18:05   ` Jimmy Yuen Ho Wong
  2020-02-02 18:14     ` Michael Albinus
  0 siblings, 1 reply; 19+ messages in thread
From: Jimmy Yuen Ho Wong @ 2020-02-02 18:05 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 39389


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.





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-02 18:05   ` Jimmy Yuen Ho Wong
@ 2020-02-02 18:14     ` Michael Albinus
  2020-02-02 18:30       ` Jimmy Yuen Ho Wong
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Albinus @ 2020-02-02 18:14 UTC (permalink / raw)
  To: Jimmy Yuen Ho Wong; +Cc: 39389

Jimmy Yuen Ho Wong <wyuenho@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.





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-02 18:14     ` Michael Albinus
@ 2020-02-02 18:30       ` Jimmy Yuen Ho Wong
  2020-02-02 20:11         ` Michael Albinus
  0 siblings, 1 reply; 19+ messages in thread
From: Jimmy Yuen Ho Wong @ 2020-02-02 18:30 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 39389


On 02/02/2020 18:14, Michael Albinus wrote:
> Jimmy Yuen Ho Wong <wyuenho@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.





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-02 18:30       ` Jimmy Yuen Ho Wong
@ 2020-02-02 20:11         ` Michael Albinus
  2020-02-05 13:31           ` Jimmy Yuen Ho Wong
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Albinus @ 2020-02-02 20:11 UTC (permalink / raw)
  To: Jimmy Yuen Ho Wong; +Cc: 39389

Jimmy Yuen Ho Wong <wyuenho@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.





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-02 20:11         ` Michael Albinus
@ 2020-02-05 13:31           ` Jimmy Yuen Ho Wong
  2020-02-05 14:39             ` Michael Albinus
  0 siblings, 1 reply; 19+ messages in thread
From: Jimmy Yuen Ho Wong @ 2020-02-05 13:31 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 39389

On Sun, Feb 2, 2020 at 8:11 PM Michael Albinus <michael.albinus@gmx.de> wrote:
>
> Jimmy Yuen Ho Wong <wyuenho@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.





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-05 13:31           ` Jimmy Yuen Ho Wong
@ 2020-02-05 14:39             ` Michael Albinus
  2020-02-08 13:03               ` Jimmy Yuen Ho Wong
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Albinus @ 2020-02-05 14:39 UTC (permalink / raw)
  To: Jimmy Yuen Ho Wong; +Cc: 39389

Jimmy Yuen Ho Wong <wyuenho@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.





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-05 14:39             ` Michael Albinus
@ 2020-02-08 13:03               ` Jimmy Yuen Ho Wong
  2020-02-08 18:36                 ` Michael Albinus
  0 siblings, 1 reply; 19+ messages in thread
From: Jimmy Yuen Ho Wong @ 2020-02-08 13:03 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 39389

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@gmx.de> wrote:
>
> Jimmy Yuen Ho Wong <wyuenho@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.





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-08 13:03               ` Jimmy Yuen Ho Wong
@ 2020-02-08 18:36                 ` Michael Albinus
  2020-02-09  5:22                   ` Jimmy Yuen Ho Wong
  2020-02-09 23:44                   ` Jimmy Yuen Ho Wong
  0 siblings, 2 replies; 19+ messages in thread
From: Michael Albinus @ 2020-02-08 18:36 UTC (permalink / raw)
  To: Jimmy Yuen Ho Wong; +Cc: 39389

Jimmy Yuen Ho Wong <wyuenho@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.





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-08 18:36                 ` Michael Albinus
@ 2020-02-09  5:22                   ` Jimmy Yuen Ho Wong
  2020-02-09 23:44                   ` Jimmy Yuen Ho Wong
  1 sibling, 0 replies; 19+ messages in thread
From: Jimmy Yuen Ho Wong @ 2020-02-09  5:22 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 39389

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.






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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-08 18:36                 ` Michael Albinus
  2020-02-09  5:22                   ` Jimmy Yuen Ho Wong
@ 2020-02-09 23:44                   ` Jimmy Yuen Ho Wong
  2020-02-10  0:16                     ` Jimmy Yuen Ho Wong
  2020-02-10  9:18                     ` Michael Albinus
  1 sibling, 2 replies; 19+ messages in thread
From: Jimmy Yuen Ho Wong @ 2020-02-09 23:44 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 39389

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

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@localhost` into `~/.authinfo.gpg`
will work around this issue.

On Sat, Feb 8, 2020 at 6:36 PM Michael Albinus <michael.albinus@gmx.de> wrote:
>
> Jimmy Yuen Ho Wong <wyuenho@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.

[-- Attachment #2: without-epfs-backtrace.txt --]
[-- Type: text/plain, Size: 41118 bytes --]

  backtrace()
  tramp-signal-hook-function(quit (""))
  signal(quit (""))
  tramp-maybe-open-connection((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("MobileCat.local" 0 15 (tramp-default t)) nil "" nil))
  tramp-send-command((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("MobileCat.local" 0 15 (tramp-default t)) nil "" nil) #("cd ~root && pwd" 4 8 (tramp-default t)))
  tramp-sh-handle-expand-file-name("/sudo::" "~/")
  apply(tramp-sh-handle-expand-file-name ("/sudo::" "~/"))
  tramp-sh-file-name-handler(expand-file-name "/sudo::" "~/")
  apply(tramp-sh-file-name-handler expand-file-name ("/sudo::" "~/"))
  tramp-file-name-handler(expand-file-name "/sudo::" "~/")
  expand-file-name("/sudo::" "~/")
  #f(compiled-function (displayable-buffers dir line column name) #<bytecode 0x41e160c3>)((nil) "~/" (0) (0) "/sudo::")
  command-line-1(("-l" "tramp" "--eval" "(setq tramp-verbose 10 exec-path (cons \"/usr/local..." "/sudo::"))
  command-line()
  normal-top-level()
Debugger entered--Lisp error: (epg-error "no usable configuration OpenPGP")
  signal(epg-error ("no usable configuration OpenPGP"))
  (let (tramp-message-show-message signal-hook-function) (tramp-backtrace vec-or-proc) (if arguments nil (setq arguments (list fmt-string) fmt-string "%s")) (if vec-or-proc (progn (tramp-message vec-or-proc 1 "%s" (error-message-string (list signal (get signal 'error-message) (apply #'format-message fmt-string arguments)))))) (signal signal (list (substring-no-properties (apply #'format-message fmt-string arguments)))))
  tramp-error((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("MobileCat.local" 0 15 (tramp-default t)) nil "" nil) epg-error "%s" "no usable configuration OpenPGP")
  (if (eq error-symbol 'void-variable) nil (tramp-error (car tramp-current-connection) error-symbol "%s" (mapconcat #'(lambda (x) (format "%s" x)) data " ")))
  tramp-signal-hook-function(epg-error ("no usable configuration" OpenPGP))
  signal(epg-error ("no usable configuration" OpenPGP))
  epg-context--make(OpenPGP nil nil nil nil nil nil)
  epg-make-context()
  epa-file-insert-file-contents("/Users/wyuenho/.authinfo.gpg" nil nil nil nil)
  apply(epa-file-insert-file-contents ("/Users/wyuenho/.authinfo.gpg" nil nil nil nil))
  epa-file-handler(insert-file-contents "/Users/wyuenho/.authinfo.gpg" nil nil nil nil)
  insert-file-contents("~/.authinfo.gpg")
  auth-source-netrc-parse(:max 1 :require (:secret :user) :file "~/.authinfo.gpg" :host #("MobileCat.local" 0 15 (tramp-default t)) :user #("root" 0 4 (tramp-default t)) :port "sudo")
  auth-source-netrc-search(:backend #<auth-source-backend auth-source-backend-412d83b8> :type netrc :max 1 :require (:secret :user) :create nil :delete nil :max 1 :user #("root" 0 4 (tramp-default t)) :host #("MobileCat.local" 0 15 (tramp-default t)) :port "sudo" :require (:secret :user) :create t)
  apply(auth-source-netrc-search :backend #<auth-source-backend auth-source-backend-412d83b8> :type netrc :max 1 :require (:secret :user) :create nil :delete nil (:max 1 :user #("root" 0 4 (tramp-default t)) :host #("MobileCat.local" 0 15 (tramp-default t)) :port "sudo" :require (:secret :user) :create t))
  auth-source-search-backends((#<auth-source-backend auth-source-backend-41873e48> #<auth-source-backend auth-source-backend-412d83b8> #<auth-source-backend auth-source-backend-412d83fc>) (:max 1 :user #("root" 0 4 (tramp-default t)) :host #("MobileCat.local" 0 15 (tramp-default t)) :port "sudo" :require (:secret :user) :create t) 1 nil nil (:secret :user))
  auth-source-search(:max 1 :user #("root" 0 4 (tramp-default t)) :host #("MobileCat.local" 0 15 (tramp-default t)) :port "sudo" :require (:secret :user) :create t)
  (car (auth-source-search :max 1 (and user :user) (if domain (concat user tramp-prefix-domain-format domain) user) :host (if port (concat host tramp-prefix-port-format port) host) :port method :require (cons :secret (and user '(:user))) :create t))
  (setq auth-info (car (auth-source-search :max 1 (and user :user) (if domain (concat user tramp-prefix-domain-format domain) user) :host (if port (concat host tramp-prefix-port-format port) host) :port method :require (cons :secret (and user '(:user))) :create t)) tramp-password-save-function (plist-get auth-info :save-function) auth-passwd (plist-get auth-info :secret))
  (and (tramp-get-connection-property v "first-password-request" nil) (setq auth-info (car (auth-source-search :max 1 (and user :user) (if domain (concat user tramp-prefix-domain-format domain) user) :host (if port (concat host tramp-prefix-port-format port) host) :port method :require (cons :secret (and user '(:user))) :create t)) tramp-password-save-function (plist-get auth-info :save-function) auth-passwd (plist-get auth-info :secret)))
  (progn (and (tramp-get-connection-property v "first-password-request" nil) (setq auth-info (car (auth-source-search :max 1 (and user :user) (if domain (concat user tramp-prefix-domain-format domain) user) :host (if port (concat host tramp-prefix-port-format port) host) :port method :require (cons :secret (and user '...)) :create t)) tramp-password-save-function (plist-get auth-info :save-function) auth-passwd (plist-get auth-info :secret))) (while (functionp auth-passwd) (setq auth-passwd (funcall auth-passwd))) auth-passwd)
  (condition-case nil (progn (and (tramp-get-connection-property v "first-password-request" nil) (setq auth-info (car (auth-source-search :max 1 (and user :user) (if domain (concat user tramp-prefix-domain-format domain) user) :host (if port (concat host tramp-prefix-port-format port) host) :port method :require (cons :secret (and user ...)) :create t)) tramp-password-save-function (plist-get auth-info :save-function) auth-passwd (plist-get auth-info :secret))) (while (functionp auth-passwd) (setq auth-passwd (funcall auth-passwd))) auth-passwd) (error nil))
  (or (condition-case nil (progn (and (tramp-get-connection-property v "first-password-request" nil) (setq auth-info (car (auth-source-search :max 1 (and user :user) (if domain ... user) :host (if port ... host) :port method :require (cons :secret ...) :create t)) tramp-password-save-function (plist-get auth-info :save-function) auth-passwd (plist-get auth-info :secret))) (while (functionp auth-passwd) (setq auth-passwd (funcall auth-passwd))) auth-passwd) (error nil)) (progn (setq auth-passwd (password-read pw-prompt key) tramp-password-save-function #'(lambda nil (password-cache-add key auth-passwd))) auth-passwd) (read-passwd pw-prompt))
  (prog1 (or (condition-case nil (progn (and (tramp-get-connection-property v "first-password-request" nil) (setq auth-info (car (auth-source-search :max 1 ... ... :host ... :port method :require ... :create t)) tramp-password-save-function (plist-get auth-info :save-function) auth-passwd (plist-get auth-info :secret))) (while (functionp auth-passwd) (setq auth-passwd (funcall auth-passwd))) auth-passwd) (error nil)) (progn (setq auth-passwd (password-read pw-prompt key) tramp-password-save-function #'(lambda nil (password-cache-add key auth-passwd))) auth-passwd) (read-passwd pw-prompt)) (tramp-set-connection-property v "first-password-request" nil))
  (let* ((v (tramp-dissect-file-name key)) (method (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 1 v))) (user (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 2 v))) (domain (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 3 v))) (host (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 4 v))) (port (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 5 v))) (localname (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 6 v))) (hop (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 7 v)))) (ignore method user domain host port localname hop) (setq tramp-password-save-function nil user (or user (tramp-get-connection-property key "login-as" nil))) (prog1 (or (condition-case nil (progn (and (tramp-get-connection-property v "first-password-request" nil) (setq auth-info (car ...) tramp-password-save-function (plist-get auth-info :save-function) auth-passwd (plist-get auth-info :secret))) (while (functionp auth-passwd) (setq auth-passwd (funcall auth-passwd))) auth-passwd) (error nil)) (progn (setq auth-passwd (password-read pw-prompt key) tramp-password-save-function #'(lambda nil (password-cache-add key auth-passwd))) auth-passwd) (read-passwd pw-prompt)) (tramp-set-connection-property v "first-password-request" nil)))
  (let* ((case-fold-search t) (key (tramp-make-tramp-file-name (tramp-get-connection-property proc "password-vector" (process-get proc 'vector)) 'noloc 'nohop)) (pw-prompt (or prompt (save-current-buffer (set-buffer (process-buffer proc)) (tramp-check-for-regexp proc tramp-password-prompt-regexp) (format "%s for %s " (capitalize (match-string 1)) key)))) (auth-source-creation-prompts (list (cons 'secret pw-prompt))) (stimers (with-timeout-suspend)) auth-info auth-passwd) (let* ((v (tramp-dissect-file-name key)) (method (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 1 v))) (user (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 2 v))) (domain (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 3 v))) (host (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 4 v))) (port (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 5 v))) (localname (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 6 v))) (hop (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 7 v)))) (ignore method user domain host port localname hop) (setq tramp-password-save-function nil user (or user (tramp-get-connection-property key "login-as" nil))) (prog1 (or (condition-case nil (progn (and (tramp-get-connection-property v "first-password-request" nil) (setq auth-info ... tramp-password-save-function ... auth-passwd ...)) (while (functionp auth-passwd) (setq auth-passwd ...)) auth-passwd) (error nil)) (progn (setq auth-passwd (password-read pw-prompt key) tramp-password-save-function #'(lambda nil ...)) auth-passwd) (read-passwd pw-prompt)) (tramp-set-connection-property v "first-password-request" nil))) (with-timeout-unsuspend stimers))
  tramp-read-passwd(#<process *tramp/sudo root@MobileCat.local*>)
  (concat (tramp-read-passwd proc) tramp-local-end-of-line)
  (process-send-string proc (concat (tramp-read-passwd proc) tramp-local-end-of-line))
  (let ((enable-recursive-minibuffers t) (case-fold-search t)) (if (tramp-get-connection-property vec "first-password-request" nil) nil (tramp-clear-passwd vec)) (goto-char (point-min)) (tramp-check-for-regexp proc tramp-password-prompt-regexp) (tramp-message vec 3 "Sending %s" (match-string 1)) (process-send-string proc (concat (tramp-read-passwd proc) tramp-local-end-of-line)) (narrow-to-region (point-max) (point-max)))
  (save-current-buffer (set-buffer (process-buffer proc)) (let ((enable-recursive-minibuffers t) (case-fold-search t)) (if (tramp-get-connection-property vec "first-password-request" nil) nil (tramp-clear-passwd vec)) (goto-char (point-min)) (tramp-check-for-regexp proc tramp-password-prompt-regexp) (tramp-message vec 3 "Sending %s" (match-string 1)) (process-send-string proc (concat (tramp-read-passwd proc) tramp-local-end-of-line)) (narrow-to-region (point-max) (point-max))))
  tramp-action-password(#<process *tramp/sudo root@MobileCat.local*> (tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("MobileCat.local" 0 15 (tramp-default t)) nil "" nil))
  funcall(tramp-action-password #<process *tramp/sudo root@MobileCat.local*> (tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("MobileCat.local" 0 15 (tramp-default t)) nil "" nil))
  (setq found (funcall action proc vec))
  (progn (tramp-message vec 5 "Call `%s'" (symbol-name action)) (setq found (funcall action proc vec)))
  (if (tramp-check-for-regexp proc pattern) (progn (tramp-message vec 5 "Call `%s'" (symbol-name action)) (setq found (funcall action proc vec))))
  (while todo (setq item (car-safe (prog1 todo (setq todo (cdr todo))))) (setq pattern (format "\\(%s\\)\\'" (symbol-value (nth 0 item)))) (setq action (nth 1 item)) (tramp-message vec 5 "Looking for regexp \"%s\" from remote shell" pattern) (if (tramp-check-for-regexp proc pattern) (progn (tramp-message vec 5 "Call `%s'" (symbol-name action)) (setq found (funcall action proc vec)))))
  (while (not found) (while (tramp-accept-process-output proc 0)) (setq todo actions) (while todo (setq item (car-safe (prog1 todo (setq todo (cdr todo))))) (setq pattern (format "\\(%s\\)\\'" (symbol-value (nth 0 item)))) (setq action (nth 1 item)) (tramp-message vec 5 "Looking for regexp \"%s\" from remote shell" pattern) (if (tramp-check-for-regexp proc pattern) (progn (tramp-message vec 5 "Call `%s'" (symbol-name action)) (setq found (funcall action proc vec))))))
  (let ((case-fold-search t) found todo item pattern action) (while (not found) (while (tramp-accept-process-output proc 0)) (setq todo actions) (while todo (setq item (car-safe (prog1 todo (setq todo (cdr todo))))) (setq pattern (format "\\(%s\\)\\'" (symbol-value (nth 0 item)))) (setq action (nth 1 item)) (tramp-message vec 5 "Looking for regexp \"%s\" from remote shell" pattern) (if (tramp-check-for-regexp proc pattern) (progn (tramp-message vec 5 "Call `%s'" (symbol-name action)) (setq found (funcall action proc vec)))))) found)
  tramp-process-one-action(#<process *tramp/sudo root@MobileCat.local*> (tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("MobileCat.local" 0 15 (tramp-default t)) nil "" nil) ((tramp-login-prompt-regexp tramp-action-login) (tramp-password-prompt-regexp tramp-action-password) (tramp-wrong-passwd-regexp tramp-action-permission-denied) (shell-prompt-pattern tramp-action-succeed) (tramp-shell-prompt-pattern tramp-action-succeed) (tramp-yesno-prompt-regexp tramp-action-yesno) (tramp-yn-prompt-regexp tramp-action-yn) (tramp-terminal-prompt-regexp tramp-action-terminal) (tramp-antispoof-regexp tramp-action-confirm-message) (tramp-process-alive-regexp tramp-action-process-alive)))
  (catch 'tramp-action (tramp-process-one-action proc vec actions))
  (setq exit (catch 'tramp-action (tramp-process-one-action proc vec actions)))
  (while (not exit) (setq exit (catch 'tramp-action (tramp-process-one-action proc vec actions))))
  (progn (while (not exit) (setq exit (catch 'tramp-action (tramp-process-one-action proc vec actions)))))
  (unwind-protect (progn (while (not exit) (setq exit (catch 'tramp-action (tramp-process-one-action proc vec actions))))) (cancel-timer -with-timeout-timer-))
  (let* ((-with-timeout-timer- (run-with-timer timeout nil #'(lambda nil (throw 'timeout 'timeout)))) (with-timeout-timers (cons -with-timeout-timer- with-timeout-timers))) (unwind-protect (progn (while (not exit) (setq exit (catch 'tramp-action (tramp-process-one-action proc vec actions))))) (cancel-timer -with-timeout-timer-)))
  (catch 'timeout (let* ((-with-timeout-timer- (run-with-timer timeout nil #'(lambda nil (throw ... ...)))) (with-timeout-timers (cons -with-timeout-timer- with-timeout-timers))) (unwind-protect (progn (while (not exit) (setq exit (catch 'tramp-action (tramp-process-one-action proc vec actions))))) (cancel-timer -with-timeout-timer-))))
  (let ((-with-timeout-value- (catch 'timeout (let* ((-with-timeout-timer- (run-with-timer timeout nil ...)) (with-timeout-timers (cons -with-timeout-timer- with-timeout-timers))) (unwind-protect (progn (while ... ...)) (cancel-timer -with-timeout-timer-)))))) (if (eq -with-timeout-value- 'timeout) (progn (setq exit 'timeout)) -with-timeout-value-))
  (if timeout (let ((-with-timeout-value- (catch 'timeout (let* ((-with-timeout-timer- ...) (with-timeout-timers ...)) (unwind-protect (progn ...) (cancel-timer -with-timeout-timer-)))))) (if (eq -with-timeout-value- 'timeout) (progn (setq exit 'timeout)) -with-timeout-value-)) (while (not exit) (setq exit (catch 'tramp-action (tramp-process-one-action proc vec actions)))))
  (let (exit) (if timeout (let ((-with-timeout-value- (catch 'timeout (let* (... ...) (unwind-protect ... ...))))) (if (eq -with-timeout-value- 'timeout) (progn (setq exit 'timeout)) -with-timeout-value-)) (while (not exit) (setq exit (catch 'tramp-action (tramp-process-one-action proc vec actions))))) (save-current-buffer (set-buffer (tramp-get-connection-buffer vec)) (widen) (tramp-message vec 6 "\n%s" (buffer-string))) (if (eq exit 'ok) (condition-case nil (progn (and (functionp tramp-password-save-function) (funcall tramp-password-save-function))) (error nil)) (tramp-clear-passwd vec) (delete-process proc) (tramp-error-with-buffer (tramp-get-connection-buffer vec) vec 'file-error (cond ((eq exit 'permission-denied) "Permission denied") ((eq exit 'out-of-band-failed) (format-message "Copy failed, see buffer `%s' for details" (tramp-get-connection-buffer vec))) ((eq exit 'process-died) (substitute-command-keys '"Tramp failed to connect.  If this happens repeated...")) ((eq exit 'timeout) (format-message "Timeout reached, see buffer `%s' for details" (tramp-get-connection-buffer vec))) (t "Login failed")))))
  (progn (let (exit) (if timeout (let ((-with-timeout-value- (catch 'timeout (let* ... ...)))) (if (eq -with-timeout-value- 'timeout) (progn (setq exit 'timeout)) -with-timeout-value-)) (while (not exit) (setq exit (catch 'tramp-action (tramp-process-one-action proc vec actions))))) (save-current-buffer (set-buffer (tramp-get-connection-buffer vec)) (widen) (tramp-message vec 6 "\n%s" (buffer-string))) (if (eq exit 'ok) (condition-case nil (progn (and (functionp tramp-password-save-function) (funcall tramp-password-save-function))) (error nil)) (tramp-clear-passwd vec) (delete-process proc) (tramp-error-with-buffer (tramp-get-connection-buffer vec) vec 'file-error (cond ((eq exit 'permission-denied) "Permission denied") ((eq exit 'out-of-band-failed) (format-message "Copy failed, see buffer `%s' for details" (tramp-get-connection-buffer vec))) ((eq exit 'process-died) (substitute-command-keys '"Tramp failed to connect.  If this happens repeated...")) ((eq exit 'timeout) (format-message "Timeout reached, see buffer `%s' for details" (tramp-get-connection-buffer vec))) (t "Login failed"))))) (if (numberp pos) (progn (save-current-buffer (set-buffer (tramp-get-connection-buffer vec)) (let ((inhibit-read-only t)) (delete-region pos (point)))))))
  (prog1 (progn (let (exit) (if timeout (let ((-with-timeout-value- (catch ... ...))) (if (eq -with-timeout-value- 'timeout) (progn (setq exit ...)) -with-timeout-value-)) (while (not exit) (setq exit (catch 'tramp-action (tramp-process-one-action proc vec actions))))) (save-current-buffer (set-buffer (tramp-get-connection-buffer vec)) (widen) (tramp-message vec 6 "\n%s" (buffer-string))) (if (eq exit 'ok) (condition-case nil (progn (and (functionp tramp-password-save-function) (funcall tramp-password-save-function))) (error nil)) (tramp-clear-passwd vec) (delete-process proc) (tramp-error-with-buffer (tramp-get-connection-buffer vec) vec 'file-error (cond ((eq exit ...) "Permission denied") ((eq exit ...) (format-message "Copy failed, see buffer `%s' for details" ...)) ((eq exit ...) (substitute-command-keys ...)) ((eq exit ...) (format-message "Timeout reached, see buffer `%s' for details" ...)) (t "Login failed"))))) (if (numberp pos) (progn (save-current-buffer (set-buffer (tramp-get-connection-buffer vec)) (let ((inhibit-read-only t)) (delete-region pos (point))))))) (setq cookie "done"))
  (unwind-protect (prog1 (progn (let (exit) (if timeout (let ((-with-timeout-value- ...)) (if (eq -with-timeout-value- ...) (progn ...) -with-timeout-value-)) (while (not exit) (setq exit (catch ... ...)))) (save-current-buffer (set-buffer (tramp-get-connection-buffer vec)) (widen) (tramp-message vec 6 "\n%s" (buffer-string))) (if (eq exit 'ok) (condition-case nil (progn (and ... ...)) (error nil)) (tramp-clear-passwd vec) (delete-process proc) (tramp-error-with-buffer (tramp-get-connection-buffer vec) vec 'file-error (cond (... "Permission denied") (... ...) (... ...) (... ...) (t "Login failed"))))) (if (numberp pos) (progn (save-current-buffer (set-buffer (tramp-get-connection-buffer vec)) (let (...) (delete-region pos ...)))))) (setq cookie "done")) (if tm (cancel-timer tm)) (tramp-message proc 3 "%s...%s" "Waiting for prompts from remote shell" cookie))
  (let ((cookie "failed") (tm (if (and tramp-message-show-message (<= 3 (min tramp-verbose 3))) (progn (let ((pr ...)) (if pr (progn ...))))))) (unwind-protect (prog1 (progn (let (exit) (if timeout (let (...) (if ... ... -with-timeout-value-)) (while (not exit) (setq exit ...))) (save-current-buffer (set-buffer (tramp-get-connection-buffer vec)) (widen) (tramp-message vec 6 "\n%s" (buffer-string))) (if (eq exit 'ok) (condition-case nil (progn ...) (error nil)) (tramp-clear-passwd vec) (delete-process proc) (tramp-error-with-buffer (tramp-get-connection-buffer vec) vec 'file-error (cond ... ... ... ... ...)))) (if (numberp pos) (progn (save-current-buffer (set-buffer ...) (let ... ...))))) (setq cookie "done")) (if tm (cancel-timer tm)) (tramp-message proc 3 "%s...%s" "Waiting for prompts from remote shell" cookie)))
  (progn (tramp-message proc 3 "%s..." "Waiting for prompts from remote shell") (let ((cookie "failed") (tm (if (and tramp-message-show-message (<= 3 (min tramp-verbose 3))) (progn (let (...) (if pr ...)))))) (unwind-protect (prog1 (progn (let (exit) (if timeout (let ... ...) (while ... ...)) (save-current-buffer (set-buffer ...) (widen) (tramp-message vec 6 "\n%s" ...)) (if (eq exit ...) (condition-case nil ... ...) (tramp-clear-passwd vec) (delete-process proc) (tramp-error-with-buffer ... vec ... ...))) (if (numberp pos) (progn (save-current-buffer ... ...)))) (setq cookie "done")) (if tm (cancel-timer tm)) (tramp-message proc 3 "%s...%s" "Waiting for prompts from remote shell" cookie))))
  (save-restriction (progn (tramp-message proc 3 "%s..." "Waiting for prompts from remote shell") (let ((cookie "failed") (tm (if (and tramp-message-show-message (<= 3 ...)) (progn (let ... ...))))) (unwind-protect (prog1 (progn (let (exit) (if timeout ... ...) (save-current-buffer ... ... ...) (if ... ... ... ... ...)) (if (numberp pos) (progn ...))) (setq cookie "done")) (if tm (cancel-timer tm)) (tramp-message proc 3 "%s...%s" "Waiting for prompts from remote shell" cookie)))))
  tramp-process-actions(#<process *tramp/sudo root@MobileCat.local*> (tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("MobileCat.local" 0 15 (tramp-default t)) nil "" nil) 1 ((tramp-login-prompt-regexp tramp-action-login) (tramp-password-prompt-regexp tramp-action-password) (tramp-wrong-passwd-regexp tramp-action-permission-denied) (shell-prompt-pattern tramp-action-succeed) (tramp-shell-prompt-pattern tramp-action-succeed) (tramp-yesno-prompt-regexp tramp-action-yesno) (tramp-yn-prompt-regexp tramp-action-yn) (tramp-terminal-prompt-regexp tramp-action-terminal) (tramp-antispoof-regexp tramp-action-confirm-message) (tramp-process-alive-regexp tramp-action-process-alive)) 10)
  tramp-maybe-open-connection((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("MobileCat.local" 0 15 (tramp-default t)) nil "" nil))
  tramp-send-command((tramp-file-name "sudo" #("root" 0 4 (tramp-default t)) nil #("MobileCat.local" 0 15 (tramp-default t)) nil "" nil) #("cd ~root && pwd" 4 8 (tramp-default t)))
  tramp-sh-handle-expand-file-name(#("/sudo:root@MobileCat.local:" 6 10 (tramp-default t) 11 26 (tramp-default t)) nil)
  apply(tramp-sh-handle-expand-file-name (#("/sudo:root@MobileCat.local:" 6 10 (tramp-default t) 11 26 (tramp-default t)) nil))
  tramp-sh-file-name-handler(expand-file-name #("/sudo:root@MobileCat.local:" 6 10 (tramp-default t) 11 26 (tramp-default t)) nil)
  apply(tramp-sh-file-name-handler expand-file-name (#("/sudo:root@MobileCat.local:" 6 10 (tramp-default t) 11 26 (tramp-default t)) nil))
  (let ((tramp-locker t)) (apply foreign operation args))
  (unwind-protect (let ((tramp-locker t)) (apply foreign operation args)) (setq tramp-locked tl))
  (let ((tl tramp-locked)) (setq tramp-locked t) (unwind-protect (let ((tramp-locker t)) (apply foreign operation args)) (setq tramp-locked tl)))
  (catch 'suppress (if (and tramp-locked (not tramp-locker)) (progn (setq tramp-locked nil) (tramp-error v 'file-error "Forbidden reentrant call of Tramp"))) (let ((tl tramp-locked)) (setq tramp-locked t) (unwind-protect (let ((tramp-locker t)) (apply foreign operation args)) (setq tramp-locked tl))))
  (catch 'non-essential (catch 'suppress (if (and tramp-locked (not tramp-locker)) (progn (setq tramp-locked nil) (tramp-error v 'file-error "Forbidden reentrant call of Tramp"))) (let ((tl tramp-locked)) (setq tramp-locked t) (unwind-protect (let ((tramp-locker t)) (apply foreign operation args)) (setq tramp-locked tl)))))
  (setq result (catch 'non-essential (catch 'suppress (if (and tramp-locked (not tramp-locker)) (progn (setq tramp-locked nil) (tramp-error v 'file-error "Forbidden reentrant call of Tramp"))) (let ((tl tramp-locked)) (setq tramp-locked t) (unwind-protect (let ((tramp-locker t)) (apply foreign operation args)) (setq tramp-locked tl))))))
  (let ((sf (symbol-function foreign))) (if (autoloadp sf) (progn (let ((default-directory (tramp-compat-temporary-file-directory)) file-name-handler-alist) (autoload-do-load sf foreign)))) (setq result (catch 'non-essential (catch 'suppress (if (and tramp-locked (not tramp-locker)) (progn (setq tramp-locked nil) (tramp-error v 'file-error "Forbidden reentrant call of Tramp"))) (let ((tl tramp-locked)) (setq tramp-locked t) (unwind-protect (let (...) (apply foreign operation args)) (setq tramp-locked tl)))))) (cond ((eq result 'non-essential) (tramp-message v 5 "Non-essential received in operation %s" (cons operation args)) (tramp-run-real-handler operation args)) ((eq result 'suppress) (let (tramp-message-show-message) (tramp-message v 1 "Suppress received in operation %s" (cons operation args)) (tramp-cleanup-connection v t) (tramp-run-real-handler operation args))) (t result)))
  (if foreign (let ((sf (symbol-function foreign))) (if (autoloadp sf) (progn (let ((default-directory (tramp-compat-temporary-file-directory)) file-name-handler-alist) (autoload-do-load sf foreign)))) (setq result (catch 'non-essential (catch 'suppress (if (and tramp-locked (not tramp-locker)) (progn (setq tramp-locked nil) (tramp-error v ... "Forbidden reentrant call of Tramp"))) (let ((tl tramp-locked)) (setq tramp-locked t) (unwind-protect (let ... ...) (setq tramp-locked tl)))))) (cond ((eq result 'non-essential) (tramp-message v 5 "Non-essential received in operation %s" (cons operation args)) (tramp-run-real-handler operation args)) ((eq result 'suppress) (let (tramp-message-show-message) (tramp-message v 1 "Suppress received in operation %s" (cons operation args)) (tramp-cleanup-connection v t) (tramp-run-real-handler operation args))) (t result))) (setq result (tramp-run-real-handler operation args)) (if (stringp result) (tramp-drop-volume-letter result) result))
  (unwind-protect (if foreign (let ((sf (symbol-function foreign))) (if (autoloadp sf) (progn (let ((default-directory ...) file-name-handler-alist) (autoload-do-load sf foreign)))) (setq result (catch 'non-essential (catch 'suppress (if (and tramp-locked ...) (progn ... ...)) (let (...) (setq tramp-locked t) (unwind-protect ... ...))))) (cond ((eq result 'non-essential) (tramp-message v 5 "Non-essential received in operation %s" (cons operation args)) (tramp-run-real-handler operation args)) ((eq result 'suppress) (let (tramp-message-show-message) (tramp-message v 1 "Suppress received in operation %s" (cons operation args)) (tramp-cleanup-connection v t) (tramp-run-real-handler operation args))) (t result))) (setq result (tramp-run-real-handler operation args)) (if (stringp result) (tramp-drop-volume-letter result) result)) (if (tramp-file-name-equal-p (car current-connection) (car tramp-current-connection)) nil (setq tramp-current-connection current-connection)))
  (let ((current-connection tramp-current-connection) (foreign (tramp-find-foreign-file-name-handler filename operation)) (signal-hook-function #'tramp-signal-hook-function) result) (if (tramp-file-name-equal-p v (car tramp-current-connection)) nil (setq tramp-current-connection (list v))) (unwind-protect (if foreign (let ((sf (symbol-function foreign))) (if (autoloadp sf) (progn (let (... file-name-handler-alist) (autoload-do-load sf foreign)))) (setq result (catch 'non-essential (catch 'suppress (if ... ...) (let ... ... ...)))) (cond ((eq result 'non-essential) (tramp-message v 5 "Non-essential received in operation %s" (cons operation args)) (tramp-run-real-handler operation args)) ((eq result 'suppress) (let (tramp-message-show-message) (tramp-message v 1 "Suppress received in operation %s" ...) (tramp-cleanup-connection v t) (tramp-run-real-handler operation args))) (t result))) (setq result (tramp-run-real-handler operation args)) (if (stringp result) (tramp-drop-volume-letter result) result)) (if (tramp-file-name-equal-p (car current-connection) (car tramp-current-connection)) nil (setq tramp-current-connection current-connection))))
  (let* ((v (tramp-dissect-file-name filename)) (method (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 1 v))) (user (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 2 v))) (domain (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 3 v))) (host (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 4 v))) (port (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 5 v))) (localname (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 6 v))) (hop (progn (or (progn (and (memq ... cl-struct-tramp-file-name-tags) t)) (signal 'wrong-type-argument (list 'tramp-file-name v))) (nth 7 v)))) (ignore method user domain host port localname hop) (let ((current-connection tramp-current-connection) (foreign (tramp-find-foreign-file-name-handler filename operation)) (signal-hook-function #'tramp-signal-hook-function) result) (if (tramp-file-name-equal-p v (car tramp-current-connection)) nil (setq tramp-current-connection (list v))) (unwind-protect (if foreign (let ((sf (symbol-function foreign))) (if (autoloadp sf) (progn (let ... ...))) (setq result (catch 'non-essential (catch ... ... ...))) (cond ((eq result ...) (tramp-message v 5 "Non-essential received in operation %s" ...) (tramp-run-real-handler operation args)) ((eq result ...) (let ... ... ... ...)) (t result))) (setq result (tramp-run-real-handler operation args)) (if (stringp result) (tramp-drop-volume-letter result) result)) (if (tramp-file-name-equal-p (car current-connection) (car tramp-current-connection)) nil (setq tramp-current-connection current-connection)))))
  (progn (setq filename (tramp-replace-environment-variables filename)) (let* ((v (tramp-dissect-file-name filename)) (method (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 1 v))) (user (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 2 v))) (domain (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 3 v))) (host (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 4 v))) (port (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 5 v))) (localname (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 6 v))) (hop (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... v))) (nth 7 v)))) (ignore method user domain host port localname hop) (let ((current-connection tramp-current-connection) (foreign (tramp-find-foreign-file-name-handler filename operation)) (signal-hook-function #'tramp-signal-hook-function) result) (if (tramp-file-name-equal-p v (car tramp-current-connection)) nil (setq tramp-current-connection (list v))) (unwind-protect (if foreign (let ((sf ...)) (if (autoloadp sf) (progn ...)) (setq result (catch ... ...)) (cond (... ... ...) (... ...) (t result))) (setq result (tramp-run-real-handler operation args)) (if (stringp result) (tramp-drop-volume-letter result) result)) (if (tramp-file-name-equal-p (car current-connection) (car tramp-current-connection)) nil (setq tramp-current-connection current-connection))))))
  (unwind-protect (progn (setq filename (tramp-replace-environment-variables filename)) (let* ((v (tramp-dissect-file-name filename)) (method (progn (or (progn ...) (signal ... ...)) (nth 1 v))) (user (progn (or (progn ...) (signal ... ...)) (nth 2 v))) (domain (progn (or (progn ...) (signal ... ...)) (nth 3 v))) (host (progn (or (progn ...) (signal ... ...)) (nth 4 v))) (port (progn (or (progn ...) (signal ... ...)) (nth 5 v))) (localname (progn (or (progn ...) (signal ... ...)) (nth 6 v))) (hop (progn (or (progn ...) (signal ... ...)) (nth 7 v)))) (ignore method user domain host port localname hop) (let ((current-connection tramp-current-connection) (foreign (tramp-find-foreign-file-name-handler filename operation)) (signal-hook-function #'tramp-signal-hook-function) result) (if (tramp-file-name-equal-p v (car tramp-current-connection)) nil (setq tramp-current-connection (list v))) (unwind-protect (if foreign (let (...) (if ... ...) (setq result ...) (cond ... ... ...)) (setq result (tramp-run-real-handler operation args)) (if (stringp result) (tramp-drop-volume-letter result) result)) (if (tramp-file-name-equal-p (car current-connection) (car tramp-current-connection)) nil (setq tramp-current-connection current-connection)))))) (set-match-data save-match-data-internal 'evaporate))
  (let ((save-match-data-internal (match-data))) (unwind-protect (progn (setq filename (tramp-replace-environment-variables filename)) (let* ((v (tramp-dissect-file-name filename)) (method (progn (or ... ...) (nth 1 v))) (user (progn (or ... ...) (nth 2 v))) (domain (progn (or ... ...) (nth 3 v))) (host (progn (or ... ...) (nth 4 v))) (port (progn (or ... ...) (nth 5 v))) (localname (progn (or ... ...) (nth 6 v))) (hop (progn (or ... ...) (nth 7 v)))) (ignore method user domain host port localname hop) (let ((current-connection tramp-current-connection) (foreign (tramp-find-foreign-file-name-handler filename operation)) (signal-hook-function #'tramp-signal-hook-function) result) (if (tramp-file-name-equal-p v (car tramp-current-connection)) nil (setq tramp-current-connection (list v))) (unwind-protect (if foreign (let ... ... ... ...) (setq result ...) (if ... ... result)) (if (tramp-file-name-equal-p ... ...) nil (setq tramp-current-connection current-connection)))))) (set-match-data save-match-data-internal 'evaporate)))
  (if (tramp-tramp-file-p filename) (let ((save-match-data-internal (match-data))) (unwind-protect (progn (setq filename (tramp-replace-environment-variables filename)) (let* ((v (tramp-dissect-file-name filename)) (method (progn ... ...)) (user (progn ... ...)) (domain (progn ... ...)) (host (progn ... ...)) (port (progn ... ...)) (localname (progn ... ...)) (hop (progn ... ...))) (ignore method user domain host port localname hop) (let ((current-connection tramp-current-connection) (foreign ...) (signal-hook-function ...) result) (if (tramp-file-name-equal-p v ...) nil (setq tramp-current-connection ...)) (unwind-protect (if foreign ... ... ...) (if ... nil ...))))) (set-match-data save-match-data-internal 'evaporate))) (tramp-run-real-handler operation args))
  (let ((filename (apply #'tramp-file-name-for-operation operation args)) (non-essential (or non-essential (eq operation 'file-remote-p)))) (if (tramp-tramp-file-p filename) (let ((save-match-data-internal (match-data))) (unwind-protect (progn (setq filename (tramp-replace-environment-variables filename)) (let* ((v ...) (method ...) (user ...) (domain ...) (host ...) (port ...) (localname ...) (hop ...)) (ignore method user domain host port localname hop) (let (... ... ... result) (if ... nil ...) (unwind-protect ... ...)))) (set-match-data save-match-data-internal 'evaporate))) (tramp-run-real-handler operation args)))
  tramp-file-name-handler(expand-file-name #("/sudo:root@MobileCat.local:" 6 10 (tramp-default t) 11 26 (tramp-default t)) nil)
  file-exists-p(#("/sudo:root@MobileCat.local:" 6 10 (tramp-default t) 11 26 (tramp-default t)))
  completion-file-name-table(#("/sudo:root@MobileCat.local:" 6 10 (tramp-default t) 11 26 (tramp-default t)) file-exists-p lambda)
  test-completion(#("/sudo:root@MobileCat.local:" 6 10 (tramp-default t) 11 26 (tramp-default t)) completion-file-name-table file-exists-p)
  completion--file-name-table("/sudo::" file-exists-p lambda)
  complete-with-action(lambda completion--file-name-table "/sudo::" file-exists-p)
  #f(compiled-function (table) #<bytecode 0x412ef545>)(completion--file-name-table)
  completion--some(#f(compiled-function (table) #<bytecode 0x412ef545>) (completion--embedded-envvar-table completion--file-name-table))
  read-file-name-internal("/sudo::" file-exists-p lambda)
  test-completion("/sudo::" read-file-name-internal file-exists-p)
  completion--complete-and-exit(12 19 exit-minibuffer #f(compiled-function () #<bytecode 0x412ef605>))
  completion-complete-and-exit(12 19 exit-minibuffer)
  minibuffer-complete-and-exit()
  funcall-interactively(minibuffer-complete-and-exit)
  call-interactively(minibuffer-complete-and-exit nil nil)
  command-execute(minibuffer-complete-and-exit)
  read-from-minibuffer("Find file: " "/" (keymap (keymap (32)) keymap (10 . minibuffer-complete-and-exit) (13 . minibuffer-complete-and-exit) keymap (menu-bar keymap (minibuf "Minibuf" keymap (tab menu-item "Complete" minibuffer-complete :help "Complete as far as possible") (space menu-item "Complete Word" minibuffer-complete-word :help "Complete at most one word") (63 menu-item "List Completions" minibuffer-completion-help :help "Display all possible completions") "Minibuf")) (27 keymap (118 . switch-to-completions)) (prior . switch-to-completions) (63 . minibuffer-completion-help) (32 . minibuffer-complete-word) (9 . minibuffer-complete) keymap (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the min...") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuf...") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\15" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . abort-recursive-edit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (60 . minibuffer-beginning-of-buffer) (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil file-name-history "/" nil)
  completing-read-default("Find file: " read-file-name-internal file-exists-p confirm-after-completion "/" file-name-history "/" nil)
  completing-read("Find file: " read-file-name-internal file-exists-p confirm-after-completion "/" file-name-history "/")
  read-file-name-default("Find file: " nil "/" confirm-after-completion nil nil)
  read-file-name("Find file: " nil "/" confirm-after-completion)
  find-file-read-args("Find file: " confirm-after-completion)
  byte-code("\300\301\302 \"\207" [find-file-read-args "Find file: " confirm-nonexistent-file-or-buffer] 3)
  call-interactively(find-file nil nil)
  command-execute(find-file)

[-- Attachment #3: messages.txt --]
[-- Type: text/plain, Size: 751 bytes --]

Loading /opt/local/share/emacs/site-lisp/subdirs.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Waiting for git...
Error running git rev-parse --abbrev-ref: (file-missing "Searching for program" "No such file or directory" "git")
Waiting for git...
Error running git rev-parse: (file-missing "Searching for program" "No such file or directory" "git")
Tramp: Opening connection for root@MobileCat.local using sudo...
Tramp: Sending command ‘exec sudo -u root -s -H -p P""a""s""s""w""o""r""d"": /bin/sh ’
Tramp: Waiting for prompts from remote shell...
Tramp: Sending Password
Tramp: Waiting for prompts from remote shell...failed
Tramp: Opening connection for root@MobileCat.local using sudo...failed
Quit: ""

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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-09 23:44                   ` Jimmy Yuen Ho Wong
@ 2020-02-10  0:16                     ` Jimmy Yuen Ho Wong
  2020-02-10  9:23                       ` Michael Albinus
  2020-02-10  9:18                     ` Michael Albinus
  1 sibling, 1 reply; 19+ messages in thread
From: Jimmy Yuen Ho Wong @ 2020-02-10  0:16 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 39389

On Sun, Feb 9, 2020 at 11:44 PM Jimmy Yuen Ho Wong <wyuenho@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@localhost` into `~/.authinfo.gpg`
> will work around this issue.
>





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-09 23:44                   ` Jimmy Yuen Ho Wong
  2020-02-10  0:16                     ` Jimmy Yuen Ho Wong
@ 2020-02-10  9:18                     ` Michael Albinus
  2020-02-10 21:00                       ` Jimmy Yuen Ho Wong
  2020-02-10 21:06                       ` Jimmy Yuen Ho Wong
  1 sibling, 2 replies; 19+ messages in thread
From: Michael Albinus @ 2020-02-10  9:18 UTC (permalink / raw)
  To: Jimmy Yuen Ho Wong; +Cc: 39389

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

Jimmy Yuen Ho Wong <wyuenho@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@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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 547 bytes --]

diff --git a/lisp/tramp.el b/lisp/tramp.el
index 7e68b639..4c057703 100644
--- a/lisp/tramp.el
+++ b/lisp/tramp.el
@@ -4868,7 +4868,8 @@ verbosity of 6."
   "Read a password from user (compat function).
 Consults the auth-source package.
 Invokes `password-read' if available, `read-passwd' else."
-  (let* ((case-fold-search t)
+  (let* ((default-directory (tramp-compat-temporary-file-directory))
+	 (case-fold-search t)
 	 (key (tramp-make-tramp-file-name
 	       ;; In tramp-sh.el, we must use "password-vector" due to
 	       ;; multi-hop.

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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-10  0:16                     ` Jimmy Yuen Ho Wong
@ 2020-02-10  9:23                       ` Michael Albinus
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Albinus @ 2020-02-10  9:23 UTC (permalink / raw)
  To: Jimmy Yuen Ho Wong; +Cc: 39389

Jimmy Yuen Ho Wong <wyuenho@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.





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-10  9:18                     ` Michael Albinus
@ 2020-02-10 21:00                       ` Jimmy Yuen Ho Wong
  2020-02-10 21:06                       ` Jimmy Yuen Ho Wong
  1 sibling, 0 replies; 19+ messages in thread
From: Jimmy Yuen Ho Wong @ 2020-02-10 21:00 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 39389


> 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






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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-10  9:18                     ` Michael Albinus
  2020-02-10 21:00                       ` Jimmy Yuen Ho Wong
@ 2020-02-10 21:06                       ` Jimmy Yuen Ho Wong
  2020-02-11  8:56                         ` Michael Albinus
  1 sibling, 1 reply; 19+ messages in thread
From: Jimmy Yuen Ho Wong @ 2020-02-10 21:06 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 39389


> 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!






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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-10 21:06                       ` Jimmy Yuen Ho Wong
@ 2020-02-11  8:56                         ` Michael Albinus
  2020-02-16 19:30                           ` Michael Albinus
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Albinus @ 2020-02-11  8:56 UTC (permalink / raw)
  To: Jimmy Yuen Ho Wong; +Cc: 39389

Jimmy Yuen Ho Wong <wyuenho@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.





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

* bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo::
  2020-02-11  8:56                         ` Michael Albinus
@ 2020-02-16 19:30                           ` Michael Albinus
  0 siblings, 0 replies; 19+ messages in thread
From: Michael Albinus @ 2020-02-16 19:30 UTC (permalink / raw)
  To: Jimmy Yuen Ho Wong; +Cc: 39389-done

Michael Albinus <michael.albinus@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.





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

end of thread, other threads:[~2020-02-16 19:30 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-02 14:50 bug#39389: 27.0.60; A couple of bugs messing with minibuffer completion of /sudo:: Jimmy Yuen Ho Wong
2020-02-02 15:47 ` Michael Albinus
2020-02-02 18:05   ` Jimmy Yuen Ho Wong
2020-02-02 18:14     ` Michael Albinus
2020-02-02 18:30       ` Jimmy Yuen Ho Wong
2020-02-02 20:11         ` Michael Albinus
2020-02-05 13:31           ` Jimmy Yuen Ho Wong
2020-02-05 14:39             ` Michael Albinus
2020-02-08 13:03               ` Jimmy Yuen Ho Wong
2020-02-08 18:36                 ` Michael Albinus
2020-02-09  5:22                   ` Jimmy Yuen Ho Wong
2020-02-09 23:44                   ` Jimmy Yuen Ho Wong
2020-02-10  0:16                     ` Jimmy Yuen Ho Wong
2020-02-10  9:23                       ` Michael Albinus
2020-02-10  9:18                     ` Michael Albinus
2020-02-10 21:00                       ` Jimmy Yuen Ho Wong
2020-02-10 21:06                       ` Jimmy Yuen Ho Wong
2020-02-11  8:56                         ` Michael Albinus
2020-02-16 19:30                           ` Michael Albinus

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