Git Product home page Git Product logo

Comments (25)

astoff avatar astoff commented on July 17, 2024 1

I'm actually unable to reproduce the original issue now. Currently, I do get a little delay when first listing the files or after 10 seconds of inactivity, but not after each character I type, as used to happen. So all looks good from my perspective.

from vertico.

albinus avatar albinus commented on July 17, 2024 1

Yes, remote-file-name-inhibit-cache, is the way to configure Tramp's cache. It lived always in parallel to tramp-completion-reread-directory-timeout, this has been clarified now.

For the problem of prompts I cannot say anything offhand. I would need to see a scenario, including traces. This is discussed better on the Tramp ML.

from vertico.

astoff avatar astoff commented on July 17, 2024 1

For a quick test, you can try any ssh server for which you don't have a password or login key installed, perhaps /ssh:git.savannah.gnu.org:/ does the job.

In fact, the first time you do this, there will be also a different prompt about accepting a fingerprint. This could also be problematic with Vertico – I don't know, but it's worth checking.

from vertico.

minad avatar minad commented on July 17, 2024 1

@cid0rz I don't have issues with Tramp currently. There is no need for any additional caching. Can you try the newest version of all packages? Newest commit ideally, not only newest released version. Furthermore - do you have an example configuration I can try with emacs -Q? Are doing anything special or do you access plain "/ssh:host:/path/to/file"?

from vertico.

cid0rz avatar cid0rz commented on July 17, 2024 1

Ill keep an eye on it and come back if necessary, now i need to catch up with something else using the now usable TRAMP, thank you :)

from vertico.

minad avatar minad commented on July 17, 2024

Yes, this is a known problem. I think this issue should actually be fixed on a lower level. You may want to compare Vertico with Icomplete. Icomplete does better, but it still feels slow with Tramp. There are not many differences between Icomplete and Vertico in how the completion table is accessed. Icomplete sets the variable non-essential=t (such that it does not ask for passwords?) and then there is the icomplete-compute-delay and icomplete-max-delay-chars. I haven't investigated this closely. If you have some ideas for an easy fix please let me know - but I won't implement caching or workarounds on the ui level. My recommendation for heavy Tramp users is to use Selectrum, since Selectrum explicitly optimizes this use case, by replacing some of the file completion infrastructure with its own implementation.

from vertico.

minad avatar minad commented on July 17, 2024

I contacted the Tramp maintainer @albinus via mail. I hope he has some advice on this issue.

from vertico.

minad avatar minad commented on July 17, 2024

See the discussion on the mailing list:

from vertico.

minad avatar minad commented on July 17, 2024

To cache tramp directories for longer, set tramp-completion-reread-directory-timeout to a larger value. The default value is 10s which is way too small.

from vertico.

minad avatar minad commented on July 17, 2024

One can also try to use an additional cache:

(defvar-local my-file-name-cache nil)

(defun my-file-name-all-completions (orig file dir)
  (unless my-file-name-cache
    (setq my-file-name-cache (make-hash-table :test #'equal)))
  (all-completions file
                   (let ((completion-regexp-list))
                     (if-let (cached (gethash dir my-file-name-cache))
                         cached
                       (puthash dir (funcall orig "" dir)
                                my-file-name-cache)))))

(advice-add #'file-name-all-completions :around #'my-file-name-all-completions)

@astoff Does something like this help? But Tramp already does its own caching, so I would wonder if this improves anything.

from vertico.

minad avatar minad commented on July 17, 2024

I found the issue - the problem was that Vertico used a special file predicate.

from vertico.

minad avatar minad commented on July 17, 2024

Yes, some delay is there which is when the file names are retrieved initially. I wonder if this is better with Selectrum or Ivy? At least to me it feels like I can remove the disclaimer from the package, that it is not Tramp compatible. Now I think it is usable with Tramp.

from vertico.

astoff avatar astoff commented on July 17, 2024

No, I mean, at some point one has to call ls in the remote, no way around this. Even in emacs -Q pressing C-x C-f /ssh:host:/ TAB TAB often freezes for a couple of seconds, without any visual feedback.

As far as passwordless ssh remotes are concerned, all is good. I just tried the "sudo" remote and the password query didn't work. I believe there's an issue for that, already?

from vertico.

minad avatar minad commented on July 17, 2024

As far as passwordless ssh remotes are concerned, all is good. I just tried the "sudo" remote and the password query didn't work. I believe there's an issue for that, already?

There has been, but this is closed now as part of this one ;) I quickly tried the non-essential=t setting but this had other bad effects (not loading the file list at all?) so I didn't use it. It could be that there is no way to fix the prompt issue here. What do you want to see? Should this password prompt magically work? How does Icomplete handle this? I never had password prompts, since I always have some ssh agents running.

from vertico.

albinus avatar albinus commented on July 17, 2024

To cache tramp directories for longer, set tramp-completion-reread-directory-timeout to a larger value. The default value is 10s which is way too small.

tramp-completion-reread-directory-timeout has been obsoleted in Tramp 2.4.5, part of Emacs 27.2.

from vertico.

minad avatar minad commented on July 17, 2024

@albinus Thank you! Is it remote-file-name-inhibit-cache then? The performance issue with all-completions has been fixed here (f281aac). But there is still some issue with password prompts. Maybe @astoff can elaborate?

from vertico.

astoff avatar astoff commented on July 17, 2024

But there is still some issue with prompts. Maybe @astoff can elaborate?

You mean password prompts, right? Try C-x C-f /sudo::/ RET. If you get the dired buffer, then it's just me.

from vertico.

minad avatar minad commented on July 17, 2024

@astoff Yes, password prompts. I get a dired buffer, but sudo is configured to not ask me.

from vertico.

astoff avatar astoff commented on July 17, 2024

Try C-x C-f /sudo::/ RET. If you get the dired buffer, then it's just me.

I get a dired buffer, but sudo is configured to not ask me.

Then even if you get a dired buffer, I might not be just me. 😅

from vertico.

minad avatar minad commented on July 17, 2024

What should I get? Can you please be specific?

from vertico.

minad avatar minad commented on July 17, 2024

@albinus

I would need to see a scenario, including traces. This is discussed better on the Tramp ML.

Of course. Thank you for your help here! I will take it to the mailing list as soon as I get a better picture of what is going on, if it turns out that this is necessary.

@astoff I will try a modified sudoers file to check if there are password prompt issues.

from vertico.

minad avatar minad commented on July 17, 2024

I don't know. A password prompt does not work reliably with Icomplete, Selectrum etc. And with Vertico I am not seeing a prompt. I get an error "Opening connection...failed".

from vertico.

cid0rz avatar cid0rz commented on July 17, 2024

Hello,

Ive tried to move from my actual config with better-defaults (that use ido) to vertico with the following config:

  (use-package vertico
    :init
    (vertico-mode)

    ;; Grow and shrink the Vertico minibuffer
    ;; (setq vertico-resize t)

    ;; Optionally enable cycling for `vertico-next' and `vertico-previous'.
    ;; (setq vertico-cycle t)
    )


  (use-package corfu
    :config
    (corfu-global-mode))

  (use-package orderless
    :init
    (setq completion-styles '(orderless)
          completion-category-defaults nil
          completion-category-overrides '((file (styles . (partial-completion))))))

  (use-package marginalia
    :after vertico
    :custom
    (marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil))
    :init
    (marginalia-mode))

  (use-package consult)

When in my machine, everything worked fine and as expected. With TRAMP it was really slow, any path completion taked ages and even like froze so i had to C-g and start back. I have not tried to implement the cache shown in this issue, is it recommended to make a custom cache for vertico? Is it also necessary to increase the timeout as referred up? Thank you for the wonderful packages and for your help :)

from vertico.

cid0rz avatar cid0rz commented on July 17, 2024

Thank you, indeed using the main branches instead of the default straight recipes made the trick. It is a bit slow sometimes on tramp but is quite usable. I will try to publish my org configuraiton, meanwhile here it s
emacsvertico(org file).txt
By the way sometimes I sudo as sa different user or root, editing the partial path there is the more painful operation, moving along the path to get to the edit position to be more precise.

from vertico.

minad avatar minad commented on July 17, 2024

@cid0rz Okay, then the issue seems to be resolved as I had expected.

By the way sometimes I sudo as sa different user or root, editing the partial path there is the more painful operation, moving along the path to get to the edit position to be more precise.

Okay, what is the problem exactly? The minibuffer is just fundamental-mode basically. This is not a Vertico issue. If you want special editing/navigation commands, you can write them easily.

from vertico.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.