emacs-helm / helm

Emacs incremental completion and selection narrowing framework
https://emacs-helm.github.io/helm/
GNU General Public License v3.0
3.37k stars 390 forks source link

Find files does not show updated list of files #2372

Closed matthuszagh closed 4 years ago

matthuszagh commented 4 years ago

Expected behavior

M-x helm-find-files should display the current files on disk.

Actual behavior (from emacs-helm.sh if possible, see note at the bottom)

Find-files shows slightly outdated file list. I haven't been able to figure out when the file update occurs, but calling directory-files in the directory where a file update occurs seems to update the list for helm too.

EDIT actually, directory-files mostly doesn't seem to help, even though directory-files does return the correct file list.

Steps to reproduce (recipe)

$ emacs -Q -l ~/.emacs.d/straight/repos/straight.el/bootstrap.el

In *scratch*:

(straight-use-package 'helm)

(this should be basically equivalent to emacs-helm.sh which I had trouble running (I believe that's related to the fact I use nix, but not completely sure).

M-x helm-find-files

create mwe.org

~/mwe.org

save to filesystem:

C-x C-s

Running helm-find-files again shows mwe.org. But, now if I delete it with helm-find-files again, use the persistent action delete option, then run helm-find-files once again i still see mwe.org.

Now if I run

M-: (directory-files default-directory)

mwe.org does not display. Further invocations of helm-find-files do not show mwe.org.

Backtraces if any (M-x toggle-debug-on-error)

Describe versions of Helm, Emacs, operating system, etc.

In addition to below, I was getting the same issue on 27.1.

Output of relevant info in report-emacs-bug:

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.21, cairo version 1.16.0)
Repository revision: f3e29733bbe63950b3ef1259744723193ff5f388
Repository branch: master
System Description: NixOS 20.09 (Nightingale)

Configured using:
 'configure
 --prefix=/nix/store/f4c334xhr1fkccm6zfd49awp5lfcxf83-emacs-git-20200825.0
 --disable-build-details --with-modules --with-x-toolkit=gtk3 --with-xft
 --with-cairo --with-xwidgets 'CFLAGS=-O3 -march=native
 -momit-leaf-frame-pointer''

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD JSON PDUMPER

Important settings:
  value of $EMACSLOADPATH: /nix/store/pkj11gd9lwzbyxh39p0n875vfmjfphsp-emacs-packages-deps/share/emacs/site-lisp:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  helm-ff-cache-mode: t
  shell-dirtrack-mode: t
  async-bytecomp-package-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  gpm-mouse-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/nix/store/pkj11gd9lwzbyxh39p0n875vfmjfphsp-emacs-packages-deps/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist hides /nix/store/f4c334xhr1fkccm6zfd49awp5lfcxf83-emacs-git-20200825.0/share/emacs/28.0.50/lisp/emacs-lisp/let-alist

Features:
(helm-autoloads helm-for-files helm-comint helm-imenu
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet imenu helm-bookmark helm-external package
url-handlers helm-mode helm-elisp helm-files image-dired image-mode exif
dired-x dired-aux ffap thingatpt tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat shell pcomplete parse-time
iso8601 ls-lisp helm-buffers helm-tags helm-locate helm-eval edebug
backtrace find-func helm-occur helm-grep helm-regexp format-spec
helm-net browse-url xml url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util url-parse auth-source json
map url-vars mailcap helm-adaptive helm-info helm-utils helm-types
helm-help bookmark helm async-bytecomp advice helm-core-autoloads
helm-global-bindings helm-easymenu helm-source helm-multi-match async
edmacro kmacro eieio-compat eieio eieio-core eieio-loaddefs easy-mmode
helm-lib pcase compile comint ansi-color ring autoload radix-tree
lisp-mnt popup-autoloads finder-inf async-autoloads cl-seq pp shadow
sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml
mml-sec password-cache epa derived epg epg-config gnus-util rmail
rmail-loaddefs text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
straight-autoloads info cl-extra help-mode easymenu seq byte-opt
straight subr-x cl-macs gv cl-loaddefs cl-lib bytecomp byte-compile
cconv t-mouse term/linux disp-table tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd 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 xwidget-internal dbusbind inotify dynamic-setting
system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit
x multi-tty make-network-process emacs)

Memory information:
((conses 16 230157 16578)
 (symbols 48 20902 36)
 (strings 32 59943 3483)
 (string-bytes 1 2889197)
 (vectors 16 24312)
 (vector-slots 8 278742 28638)
 (floats 8 83 238)
 (intervals 56 403 0)
 (buffers 992 15))

Are you using emacs-helm.sh to reproduce this bug? (yes/no):

No, but see above. It should be basically equivalent except straight is also loaded.

Are you using Spacemacs? (yes/no):

No.

IMPORTANT NOTE

Helm provides a script named emacs-helm.sh which runs Helm in a neutral environment: no other packages and only minimal settings.

When possible, use it to reproduce your Helm issue to ensure no other package is interfering.

To run it, simply switch to the directory where Helm is installed and call ./emacs-helm.sh. If necessary you can specify emacs executable path on command line with "-P" option.

Thanks.

thierryvolpiatto commented 4 years ago

matthuszagh notifications@github.com writes:

Expected behavior

M-x helm-find-files should display the current files on disk.

It does, you have to wait a a few ms between each sessions when helm-ff-cache-mode is enabled, otherwise hit C-c C-u.

Actual behavior (from emacs-helm.sh if possible, see note at the bottom)

Find-files shows slightly outdated file list. I haven't been able to figure out when the file update occurs,

Yes, helm-find-files is now caching its candidates, see the section "Helm-find-files is using a cache" in helm-find-files documentation (C-h m) you will find directions on how to see when the cache is refreshed.

-- Thierry

thierryvolpiatto commented 4 years ago

You can also set helm-ff-cache-mode-post-delay and helm-ff-refresh-cache-delay to 0.3 (I do this in my config).

matthuszagh commented 4 years ago

Yep, this does indeed work as expected. Sorry for the false alarm and thanks for pointing me to the documentation!

thierryvolpiatto commented 4 years ago

Maybe also you want to customize helm-ff-keep-cached-candidates to not keep cache between helm sessions, if you do so use customize and not setq to do this.

-- Thierry