xeft icon indicating copy to clipboard operation
xeft copied to clipboard

(setq xeft-directory-filter 'follow-symlinks) not working

Open AdelleBernal opened this issue 10 months ago • 7 comments

(setq xeft-directory-filter 'follow-symlinks) returns Symbol’s function definition is void: follow-symlinks

AdelleBernal avatar Feb 19 '25 23:02 AdelleBernal

What are you trying to do?

casouri avatar Feb 21 '25 17:02 casouri

I understand that only one folder can be set for Xeft. I would like it if it can search within my symlinks. Is this possible? Alternatively, is it possible to set up different Xeft with different folders and be able to call independently? Thank you.

AdelleBernal avatar Feb 24 '25 08:02 AdelleBernal

Yes, add symlinks of the directories that you want to search under xeft-directory, then configure xeft to search recursively and follow symlinks.

(setq xeft-recursive 'follow-symlinks)

You can also reference this issue: https://github.com/casouri/xeft/issues/6

casouri avatar Feb 25 '25 03:02 casouri

Out of curiosity, did you get the suggestion of (setq xeft-directory-filter 'follow-symlinks) from chatgpt or something similar?

casouri avatar Feb 25 '25 03:02 casouri

Thanks. It's referenced here: https://github.com/casouri/xeft But you're right that it's not correctly used. I don't remember if I used ChatGPT for this, perhaps!

AdelleBernal avatar Feb 27 '25 20:02 AdelleBernal

Once I add to my init (setq xeft-recursive 'follow-symlinks), do I have to rebuild the index of is it automatic?

AdelleBernal avatar Feb 27 '25 20:02 AdelleBernal

I added a symlink folder to my xeft directory. Then I added (setq xeft-recursive 'follow-symlinks) I did xeft-full-reindex I tried to search for a content inside the symlink folder. No success. :(

AdelleBernal avatar Feb 28 '25 21:02 AdelleBernal

For me (setq xeft-recursive 'follow-symlinks) also isn't working. I deleted previous index, restarted Emacs and even computer, did 'xeft-full-reindex' but that didn't work. I changed line '(string-equal "org" (file-name-extension file-path))))' from org to md (files in symlinked directory are md) but the only difference was that I see no initial list of files though search is working and results are show. Interestingly, I see no new index files after removing old ones in directory defined with xeft-database. But search is working and I see initial list of files after reverting back from md to org.

Relevant part of my init

(use-package xeft
  :commands xeft
  :bind ("C-c n x" . xeft)
  :config
  (setq xeft-directory org-directory
	        xeft-database "~/Documents/emacsdoku/xeft.db"
	xeft-default-extension '("org" "txt" "md")
	;; Don't follow symlinks.
	;; xeft-recursive nil
	;; Follow symlinks.
	xeft-recursive 'follow-symlinks
	xeft-file-filter
	(lambda (file-path)
          (string-equal "org" (file-name-extension file-path))))
  (set-face-attribute 'xeft-inline-highlight nil
                      :inherit 'highlight)
  (defun xeft-setup ()
    (auto-fill-mode))
  (add-hook 'xeft-find-file-hook #'xeft-setup)
  (add-hook 'bklink-minor-mode-hook #'xeft-setup))

maras avatar Apr 10 '25 19:04 maras

Hmm, what if you set xeft-file-filter to nil? What do you get if you evaluate (directory-files-recursively xeft-directory "" nil nil t)?

casouri avatar Apr 10 '25 20:04 casouri