-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfzfa-locate.el
More file actions
50 lines (39 loc) · 1.48 KB
/
Copy pathfzfa-locate.el
File metadata and controls
50 lines (39 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
;;; fzfa-locate.el --- Locate integration for `fzfa' -*- lexical-binding: t; -*-
;; Copyright (C) 2026 James Nguyen
;; Author: James Nguyen <james@jojojames.com>
;; Version: 1.0
;; Package-Requires: ((emacs "29.1"))
;; Homepage: https://github.com/jojojames/fzfa
;; Assisted-by: Claude:claude-opus-4-7
;; SPDX-License-Identifier: GPL-3.0-or-later
;;; Commentary:
;; `locate' integration for fzfa.
;;
;; Loaded automatically when `locate' is in `fzfa-extensions' and
;; `fzfa-setup' has been called. No setup function is registered —
;; the command is usable immediately.
;;
;; Commands:
;; `fzfa-locate' Find a file system-wide using locate
;;; Code:
(require 'fzfa)
(defcustom fzfa-locate-command "locate ''"
"Shell command used by `fzfa-locate'.
Stdout lines become file candidates."
:type 'string
:group 'fzfa)
;;;###autoload
(defun fzfa-locate ()
"Find a file system-wide using locate.
The command is configurable via `fzfa-locate-command'. Selection
is routed through `fzfa-visit-file', so files whose extension is
in `fzfa-external-extensions' are dispatched to the OS handler
\(`open' on macOS, `xdg-open' on Linux, `start' on Windows) and
everything else goes through the `fzfa-file' category action in
`fzfa-action-config' — same strategy every other fzfa file-picker uses."
(interactive)
(when-let* ((result (fzfa-completing-read
:command fzfa-locate-command)))
(fzfa-visit-file result)))
(provide 'fzfa-locate)
;;; fzfa-locate.el ends here