diff options
author | Yuchen Pei <id@ypei.org> | 2025-02-15 08:34:36 +1100 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2025-02-15 08:34:36 +1100 |
commit | 518449e07cb298fec6c98c4dea87e739b3abc9c3 (patch) | |
tree | cee611a43fdc8db9675bb4191bbc5f6acfb0e9ac /emacs/.emacs.d/lisp/my/my-web.el | |
parent | 42dec5e029d08cac20ddee0cc2320f4045e74b59 (diff) |
[emacs] firefox places completion in my-browse-url
Diffstat (limited to 'emacs/.emacs.d/lisp/my/my-web.el')
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-web.el | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-web.el b/emacs/.emacs.d/lisp/my/my-web.el index 6de8386..7d08936 100644 --- a/emacs/.emacs.d/lisp/my/my-web.el +++ b/emacs/.emacs.d/lisp/my/my-web.el @@ -223,10 +223,19 @@ https://emacs.stackexchange.com/questions/40887/in-org-mode-how-do-i-link-to-int (string-lines (buffer-string)) ))) -(defun my-firefox-places-collection (query _ action) +(defun my-firefox-places-collection (query pred action) (if (eq action 'metadata) - (message "action is metadata") - (my-firefox-places query))) + `(metadata (display-sort-function . ,#'identity) + ;; Needed for icomplete to respect list order + (cycle-sort-function . ,#'identity)) + (let ((candidates (my-firefox-places query))) + (message "Got %d candidates for query %s. Current action is %s" (length candidates) query action) + (cl-loop for str in-ref candidates do + (setf str (orderless--highlight regexps ignore-case (substring str)))) + candidates + ;; Does not show remotely as many results + ;; (complete-with-action action candidates query pred) + ))) (defun my-browse-url (url) (interactive (list (completing-read "URL to browse: " |