From 42dec5e029d08cac20ddee0cc2320f4045e74b59 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Wed, 12 Feb 2025 09:50:00 +1100 Subject: [emacs] my-browse-url completion list from firefox places --- emacs/.emacs.d/lisp/my/my-web.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'emacs') diff --git a/emacs/.emacs.d/lisp/my/my-web.el b/emacs/.emacs.d/lisp/my/my-web.el index 21b227d..6de8386 100644 --- a/emacs/.emacs.d/lisp/my/my-web.el +++ b/emacs/.emacs.d/lisp/my/my-web.el @@ -215,14 +215,24 @@ https://emacs.stackexchange.com/questions/40887/in-org-mode-how-do-i-link-to-int (with-temp-buffer (call-process "sqlite3" nil t nil (format "file://%s/places.sqlite?immutable=1" - my-firefox-profile-dir) + (expand-file-name my-firefox-profile-dir)) (format "SELECT url,title FROM moz_places %s ORDER BY visit_count desc limit %d" where my-firefox-place-limit)) - (buffer-string) + (string-lines (buffer-string)) ))) +(defun my-firefox-places-collection (query _ action) + (if (eq action 'metadata) + (message "action is metadata") + (my-firefox-places query))) + +(defun my-browse-url (url) + (interactive (list (completing-read "URL to browse: " + #'my-firefox-places-collection))) + (message url)) + (defun my-forge-infobox-format-url (url) (concat url " -- " (buttonize "clone" -- cgit v1.2.3