bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#23006: 25.0.92; Loading Tramp breaks pcomplete in eshell-mode


From: Michael Albinus
Subject: bug#23006: 25.0.92; Loading Tramp breaks pcomplete in eshell-mode
Date: Tue, 22 Mar 2016 13:20:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Tramp needs an indication that file name completion is in progress.
>
> That's where we disagree.
>
>> Otherwise, it would regard remote file names like "/adb:" safe
>> to be handled, and it would report an error then.
>
> This bug report is not about "cd /adb: TAB signals an error" but about
> "cd / TAB signals an error".  The "/adb:" part comes from Tramp because
> of a problem in Tramp's implementation of file-name-directory, AFAICT.
> It has nothing to do with file name completion.

cd / TAB calls file-name-all-completions. This returns several
candidates, like "/adb:". That's OK.

Afterwards, (file-directory-p "adb:") is called from completion-file-name-table:

  ...
  expand-file-name("adb:" "/")
  apply(expand-file-name ("adb:" "/"))
  (let* ((inhibit-file-name-handlers (cons (quote 
tramp-completion-file-name-handler) (cons (quote 
cygwin-mount-name-hook-function) (cons (quote 
cygwin-mount-map-drive-hook-function) (and (eq inhibit-file-name-operation 
operation) inhibit-file-name-handlers))))) (inhibit-file-name-operation 
operation)) (apply operation args))
  tramp-completion-run-real-handler(expand-file-name ("adb:" "/"))
  (if (and fn tramp-mode (or (eq tramp-syntax (quote sep)) (featurep (quote 
tramp)) (and (boundp (quote partial-completion-mode)) (symbol-value (quote 
partial-completion-mode))) (featurep (quote ido)) (featurep (quote icicles)))) 
(let ((save-match-data-internal (match-data))) (unwind-protect (progn (apply 
(cdr fn) args)) (set-match-data save-match-data-internal (quote evaporate)))) 
(tramp-completion-run-real-handler operation args))
  (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) (if 
(and fn tramp-mode (or (eq tramp-syntax (quote sep)) (featurep (quote tramp)) 
(and (boundp (quote partial-completion-mode)) (symbol-value (quote 
partial-completion-mode))) (featurep (quote ido)) (featurep (quote icicles)))) 
(let ((save-match-data-internal (match-data))) (unwind-protect (progn (apply 
(cdr fn) args)) (set-match-data save-match-data-internal (quote evaporate)))) 
(tramp-completion-run-real-handler operation args)))
  tramp-completion-file-name-handler(expand-file-name "adb:" "/")
  file-directory-p("adb:")
  #[257 "\302\203\n\302!\205\301\203\301!\205\300?\206\300!\207" 
[file-directory-p #[257 
"\211GSH\302=\203\301\205\303\301\"\202\300\205\303\300\"?\207" ["~\\'" 
"\\`\\(\\.\\.?\\|CVS\\)/\\'" 47 string-match] 4 "\n\n(fn FILE)"] nil] 3 
"\n\n(fn F)"]("adb:")
  completion-file-name-table("/" #[257 
"\302\203\n\302!\205\301\203\301!\205\300?\206\300!\207" [file-directory-p 
#[257 "\211GSH\302=\203\301\205\303\301\"\202\300\205\303\300\"?\207" 
["~\\'" "\\`\\(\\.\\.?\\|CVS\\)/\\'" 47 string-match] 4 "\n\n(fn FILE)"] nil] 3 
"\n\n(fn F)"] t)
  comint-completion-file-name-table("/" #[257 
"\302\203\n\302!\205\301\203\301!\205\300?\206\300!\207" [file-directory-p 
#[257 "\211GSH\302=\203\301\205\303\301\"\202\300\205\303\300\"?\207" 
["~\\'" "\\`\\(\\.\\.?\\|CVS\\)/\\'" 47 string-match] 4 "\n\n(fn FILE)"] nil] 3 
"\n\n(fn F)"] t)
  complete-with-action(t comint-completion-file-name-table "/" #[257 
"\302\203\n\302!\205\301\203\301!\205\300?\206\300!\207" [file-directory-p 
#[257 "\211GSH\302=\203\301\205\303\301\"\202\300\205\303\300\"?\207" 
["~\\'" "\\`\\(\\.\\.?\\|CVS\\)/\\'" 47 string-match] 4 "\n\n(fn FILE)"] nil] 3 
"\n\n(fn F)"])
  completion-table-with-predicate(comint-completion-file-name-table #[257 
"\302\203\n\302!\205\301\203\301!\205\300?\206\300!\207" [file-directory-p 
#[257 "\211GSH\302=\203\301\205\303\301\"\202\300\205\303\300\"?\207" 
["~\\'" "\\`\\(\\.\\.?\\|CVS\\)/\\'" 47 string-match] 4 "\n\n(fn FILE)"] nil] 3 
"\n\n(fn F)"] strict "/" nil t)
  #[771 "\211\305=\203 
\203\305\306\307B\310#ABB\207\311\n\312\313\300\314&*\207" [#[257 
"\302\203\n\302!\205\301\203\301!\205\300?\206\300!\207" [file-directory-p 
#[257 "\211GSH\302=\203\301\205\303\301\"\202\300\205\303\300\"?\207" 
["~\\'" "\\`\\(\\.\\.?\\|CVS\\)/\\'" 47 string-match] 4 "\n\n(fn FILE)"] nil] 3 
"\n\n(fn F)"] pcomplete-compare-entry-function pcomplete-ignore-case 
completion-ignore-case completion-ignored-extensions metadata 
cycle-sort-function #[257 "\301\"\207" [pcomplete-compare-entry-function sort] 
4 "\n\n(fn COMPS)"] completion-file-name-table nil 
completion-table-with-predicate comint-completion-file-name-table strict] 10 
"\n\n(fn S P A)"]("/" nil t)
  complete-with-action(t #[771 "\211\305=\203  
\203\305\306\307B\310#ABB\207\311\n\312\313\300\314&*\207" [#[257 
"\302\203\n\302!\205\301\203\301!\205\300?\206\300!\207" [file-directory-p 
#[257 "\211GSH\302=\203\301\205\303\301\"\202\300\205\303\300\"?\207" 
["~\\'" "\\`\\(\\.\\.?\\|CVS\\)/\\'" 47 string-match] 4 "\n\n(fn FILE)"] nil] 3 
"\n\n(fn F)"] pcomplete-compare-entry-function pcomplete-ignore-case 
completion-ignore-case completion-ignored-extensions metadata 
cycle-sort-function #[257 "\301\"\207" [pcomplete-compare-entry-function sort] 
4 "\n\n(fn COMPS)"] completion-file-name-table nil 
completion-table-with-predicate comint-completion-file-name-table strict] 10 
"\n\n(fn S P A)"] "/" nil)
  #[771 "\302G\303      
\"\203)\304\305\224OB\262\306\307\310\"!B\262\305\225\302O\262\202\203:\311=\204O\242\312=\204O\313\314B\237\315#\316\300$\262\202\307\317\320\321\322\"\"\313\314B\237\315#\323\300\243\206k\315$\211@Y\203\223\311=\203\204\316\300\n$\202\305\312@GZ\\ABB\202\305\311=\203\272\316\300\n$@Z\321\324\325\326\327\330!\331\"\332\333%\"\266\202\202\305\312GZ\\ABB\266\203\207"
 [#[771 "\211\305=\203  
\203\305\306\307B\310#ABB\207\311\n\312\313\300\314&*\207" [#[257 
"\302\203\n\302!\205\301\203\301!\205\300?\206\300!\207" [file-directory-p 
#[257 "\211GSH\302=\203\301\205\303\301\"\202\300\205\303\300\"?\207" 
["~\\'" "\\`\\(\\.\\.?\\|CVS\\)/\\'" 47 string-match] 4 "\n\n(fn FILE)"] nil] 3 
"\n\n(fn F)"] pcomplete-compare-entry-function pcomplete-ignore-case 
completion-ignore-case completion-ignored-extensions metadata 
cycle-sort-function #[257 "\301\"\207" [pcomplete-compare-entry-function sort] 
4 "\n\n(fn COMPS)"] completion-file-name-table nil 
completion-table-with-predicate comint-completion-file-name-table strict] 10 
"\n\n(fn S P A)"] pcomplete--env-regexp nil string-match 0 1 getenv 
match-string 2 t boundaries mapconcat identity "" complete-with-action apply + 
mapcar length completion-boundaries make-byte-code 257 "\211\300\301O\207" 
vconcat vector [nil] 4 "\n\n(fn S)"] 17 "\n\n(fn STRING PRED ACTION)"]("/" nil 
t)
  all-completions("/" #[771 "\302G\303  
\"\203)\304\305\224OB\262\306\307\310\"!B\262\305\225\302O\262\202\203:\311=\204O\242\312=\204O\313\314B\237\315#\316\300$\262\202\307\317\320\321\322\"\"\313\314B\237\315#\323\300\243\206k\315$\211@Y\203\223\311=\203\204\316\300\n$\202\305\312@GZ\\ABB\202\305\311=\203\272\316\300\n$@Z\321\324\325\326\327\330!\331\"\332\333%\"\266\202\202\305\312GZ\\ABB\266\203\207"
 [#[771 "\211\305=\203  
\203\305\306\307B\310#ABB\207\311\n\312\313\300\314&*\207" [#[257 
"\302\203\n\302!\205\301\203\301!\205\300?\206\300!\207" [file-directory-p 
#[257 "\211GSH\302=\203\301\205\303\301\"\202\300\205\303\300\"?\207" 
["~\\'" "\\`\\(\\.\\.?\\|CVS\\)/\\'" 47 string-match] 4 "\n\n(fn FILE)"] nil] 3 
"\n\n(fn F)"] pcomplete-compare-entry-function pcomplete-ignore-case 
completion-ignore-case completion-ignored-extensions metadata 
cycle-sort-function #[257 "\301\"\207" [pcomplete-compare-entry-function sort] 
4 "\n\n(fn COMPS)"] completion-file-name-table nil 
completion-table-with-predicate comint-completion-file-name-table strict] 10 
"\n\n(fn S P A)"] pcomplete--env-regexp nil string-match 0 1 getenv 
match-string 2 t boundaries mapconcat identity "" complete-with-action apply + 
mapcar length completion-boundaries make-byte-code 257 "\211\300\301O\207" 
vconcat vector [nil] 4 "\n\n(fn S)"] 17 "\n\n(fn STRING PRED ACTION)"])
  pcomplete-stub("/" #[771 "\302G\303   
\"\203)\304\305\224OB\262\306\307\310\"!B\262\305\225\302O\262\202\203:\311=\204O\242\312=\204O\313\314B\237\315#\316\300$\262\202\307\317\320\321\322\"\"\313\314B\237\315#\323\300\243\206k\315$\211@Y\203\223\311=\203\204\316\300\n$\202\305\312@GZ\\ABB\202\305\311=\203\272\316\300\n$@Z\321\324\325\326\327\330!\331\"\332\333%\"\266\202\202\305\312GZ\\ABB\266\203\207"
 [#[771 "\211\305=\203  
\203\305\306\307B\310#ABB\207\311\n\312\313\300\314&*\207" [#[257 
"\302\203\n\302!\205\301\203\301!\205\300?\206\300!\207" [file-directory-p 
#[257 "\211GSH\302=\203\301\205\303\301\"\202\300\205\303\300\"?\207" 
["~\\'" "\\`\\(\\.\\.?\\|CVS\\)/\\'" 47 string-match] 4 "\n\n(fn FILE)"] nil] 3 
"\n\n(fn F)"] pcomplete-compare-entry-function pcomplete-ignore-case 
completion-ignore-case completion-ignored-extensions metadata 
cycle-sort-function #[257 "\301\"\207" [pcomplete-compare-entry-function sort] 
4 "\n\n(fn COMPS)"] completion-file-name-table nil 
completion-table-with-predicate comint-completion-file-name-table strict] 10 
"\n\n(fn S P A)"] pcomplete--env-regexp nil string-match 0 1 getenv 
match-string 2 t boundaries mapconcat identity "" complete-with-action apply + 
mapcar length completion-boundaries make-byte-code 257 "\211\300\301O\207" 
vconcat vector [nil] 4 "\n\n(fn S)"] 17 "\n\n(fn STRING PRED ACTION)"])
  pcomplete-do-complete("/" #[771 "\302G\303    
\"\203)\304\305\224OB\262\306\307\310\"!B\262\305\225\302O\262\202\203:\311=\204O\242\312=\204O\313\314B\237\315#\316\300$\262\202\307\317\320\321\322\"\"\313\314B\237\315#\323\300\243\206k\315$\211@Y\203\223\311=\203\204\316\300\n$\202\305\312@GZ\\ABB\202\305\311=\203\272\316\300\n$@Z\321\324\325\326\327\330!\331\"\332\333%\"\266\202\202\305\312GZ\\ABB\266\203\207"
 [#[771 "\211\305=\203  
\203\305\306\307B\310#ABB\207\311\n\312\313\300\314&*\207" [#[257 
"\302\203\n\302!\205\301\203\301!\205\300?\206\300!\207" [file-directory-p 
#[257 "\211GSH\302=\203\301\205\303\301\"\202\300\205\303\300\"?\207" 
["~\\'" "\\`\\(\\.\\.?\\|CVS\\)/\\'" 47 string-match] 4 "\n\n(fn FILE)"] nil] 3 
"\n\n(fn F)"] pcomplete-compare-entry-function pcomplete-ignore-case 
completion-ignore-case completion-ignored-extensions metadata 
cycle-sort-function #[257 "\301\"\207" [pcomplete-compare-entry-function sort] 
4 "\n\n(fn COMPS)"] completion-file-name-table nil 
completion-table-with-predicate comint-completion-file-name-table strict] 10 
"\n\n(fn S P A)"] pcomplete--env-regexp nil string-match 0 1 getenv 
match-string 2 t boundaries mapconcat identity "" complete-with-action apply + 
mapcar length completion-boundaries make-byte-code 257 "\211\300\301O\207" 
vconcat vector [nil] 4 "\n\n(fn S)"] 17 "\n\n(fn STRING PRED ACTION)"])
  pcomplete(1)
  funcall-interactively(pcomplete 1)
  call-interactively(pcomplete record nil)
  command-execute(pcomplete record)
  execute-extended-command(nil "pcomplete" "pcomplete")
  funcall-interactively(execute-extended-command nil "pcomplete" "pcomplete")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Tramp has no information, that file-name-completion is still in
progress, and does its job. It tries to connect to the remote host
"/adb:" in order to check.

If Tramp would have been said, that file name completion is still in
progress, it would behave correctly.

And it isn't only about file-directory-p, that's just an example. *Any*
file name operation could be called while file name completion is in
progress. That's why Tramp needs this information.

And yes, this is our basic disagreement. I'm not able to implement
proper Tramp operation without this information. Why do you refuse to
tell this to Tramp?

>         Stefan

Best regards, Michael.





reply via email to

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