flexibeast / ebuku

Emacs interface to the buku Web bookmark manager.
92 stars 7 forks source link

Make list of Buku URLs available for completion UIs #5

Closed flexibeast closed 4 years ago

flexibeast commented 4 years ago

Suggested by /u/ftrx on /r/emacs.

noctuid commented 4 years ago

Fwiw, here's a really basic/dumb implementation I've been using for ivy:

(defun counsel-buku-action (cand)
  "Run \"buku --open\" on CAND."
  (let ((db-index (car (split-string cand "\t"))))
    (counsel--run "buku" "--open" db-index)))

(defun counsel-buku ()
  "Open a buku bookmark."
  (interactive)
  (counsel-require-program "buku")
  (let ((cands
         (split-string
          (shell-command-to-string "buku --print --format 5")
          "\n" t)))
    (ivy-read "open bookmark: " cands
              :action #'counsel-buku-action
              :caller 'counsel-buku)))
flexibeast commented 4 years ago

Addressed in https://github.com/flexibeast/ebuku/commit/3847cf6944184efb77130807b32b6c9077503476; closing.