~vonfry/zoxide.el

1ec22ca486aaa838828ec516e91f8880b478bd19 — Vonfry 8 months ago 68e0e64 1.2.0
doc: add more description for zoxide-open-with
2 files changed, 12 insertions(+), 2 deletions(-)

M readme.org
M zoxide.el
M readme.org => readme.org +3 -0
@@ 26,5 26,8 @@ Find file and open directory in special directory with zoxide.
* Customize
** ~zoxide-find-file-function~
   This can change the default callback function for ~zoxide-find-file~.
** ~zoxide-get-path-function~
   This can change the default action to get path for `zoxide-remove` and
   `zoxide-add` when `path` is nil.
** Evil
   You can bind ~zoxide-find-file~ to ~gz~ or ~gZ~ for quick jump.

M zoxide.el => zoxide.el +9 -2
@@ 66,9 66,12 @@ as its first argument noninteractively."

(defcustom zoxide-get-path-function (lambda (&rest _) default-directory)
  "A function how to get current path.

The function should take a argument to get the context and return a string for
path.

The context may be one of add or remove.

The default defination is get from `default-directory' for add and remove and."
  :type 'function
  :group 'zoxide)


@@ 132,8 135,12 @@ a list of paths is returned."
(defun zoxide-open-with (query callback &optional noninteractive)
  "Search query and run callback function with a selected path.

If noninteractive is non-nil, the callback is always called directly with the
selected path as its first argument."
If noninteractive is non-nil, the callback is always called
directly with the selected path as its first argument.

This is a help function to define interactive commands like
`zoxide-find-file'. If you want to do things noninteractive, please use
`zoxide-query', filter results and pass it to your function manually instead."
  (let* ((results (if query
                      (zoxide-query-with query)
                    (zoxide-query)))