unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to speed up ido-use-filename-at-point 'guess on large directories
@ 2023-10-27 20:58 Tomas Volf
  0 siblings, 0 replies; only message in thread
From: Tomas Volf @ 2023-10-27 20:58 UTC (permalink / raw)
  To: help-gnu-emacs

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

Hello,

I ran into an issue of C-x C-f being very slow when guessing the filename at
point if the file at point is located in a large directory (119765 entries).

My ido configuration:

    (require 'ido)
    (setq ido-enable-flex-matching t
          ido-enable-dot-prefix t
          ido-max-prospects 8
          ido-everywhere t
          ido-auto-merge-work-directories-length -1
          ido-create-new-buffer 'always
          ido-use-filename-at-point 'guess)
    (ido-mode 1)

I did manage to find ido-big-directories variable, so I also added this:

    (add-to-list 'ido-big-directories (rx "/gnu/store"))

That does seem to work, because trying to navigate into /gnu/store does tell me
[Too big].

However when I have a point over a filename inside the /gnu/store, for example
/gnu/store/a1252v3fav1fabl1qmbzyjl936prabir-foo, the ido-find-file takes a long
time (many seconds) before showing the prompt (with the file at point filled
in).

#emacs did advice me to use toggle-debug-on-quit, so I do have a backtrace:

    Debugger entered--Lisp error: (quit)
      #f(compiled-function () #<bytecode 0x1e3ca1a0816daf>)()
      ido-ignore-item-p("gi4q3azbf5akkn2lwzqwk7w9zbb23xps-pyfuse3-3.2.1.tar..." ("\\`CVS/" "\\`#" "\\`.#" "\\`\\.\\./" "\\`\\./") t)
      #f(compiled-function (name) #<bytecode -0x1fcf4865f9f8d5f0>)("gi4q3azbf5akkn2lwzqwk7w9zbb23xps-pyfuse3-3.2.1.tar...")
      ido-make-file-list-1("/gnu/store/")
      ido-make-file-list(nil)
      ido-read-internal(file "Find file: " ido-file-history nil confirm-after-completion "a1252v3fav1fabl1qmbzyjl936prabir-foo")
      ido-file-internal(raise-frame)
      ido-find-file()
      funcall-interactively(ido-find-file)
      command-execute(ido-find-file)

It seems to be building a list of the files, I somewhat hoped the
ido-big-directories would prevent that.

Would someone have any idea how to make this faster?

Thank you and have a nice day,
Tomas Volf

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-27 20:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-27 20:58 How to speed up ido-use-filename-at-point 'guess on large directories Tomas Volf

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