From b6ae70a86b73ca9e0cce114232c02c317385dd67 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 12 Oct 2023 21:59:45 -0700 Subject: Add a random EmacsWiki page to my dashboard --- oni/home/services/emacs/oni-dashboard.el | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'oni/home/services/emacs') diff --git a/oni/home/services/emacs/oni-dashboard.el b/oni/home/services/emacs/oni-dashboard.el index a0a1767..b08be37 100644 --- a/oni/home/services/emacs/oni-dashboard.el +++ b/oni/home/services/emacs/oni-dashboard.el @@ -38,6 +38,29 @@ :button-suffix "" (string-trim-right (car element))))) +(defun oni-dashboard-insert-random-wiki-page (_) + "Insert a link to a random Emacs Wiki page." + (dashboard-insert-heading "Today's Wiki page:" "w") + (insert "\n ") + (dashboard-insert-shortcut 'random-wiki-page "w" "Today's Wiki page:") + (let ((info (with-current-buffer (url-retrieve-synchronously "https://www.emacswiki.org/emacs?action=random") + (prog1 (cons (url-recreate-url url-current-object) + (progn + (search-forward "