From dc8ec3fa8e996b605e01dc54dd41534ce0558335 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 14 Apr 2024 00:22:26 -0500 Subject: tests and more bug fixing - make org todo starting priority the lowest ("D") - better default prompt for gptel - added function to browse arch-wiki-docs - added tests for join line or region - added tests for format region or buffer - added region arguments to cj/join-paragraph - updated tasks --- modules/help-utils.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'modules/help-utils.el') diff --git a/modules/help-utils.el b/modules/help-utils.el index d6301782..ab9f2855 100644 --- a/modules/help-utils.el +++ b/modules/help-utils.el @@ -84,5 +84,24 @@ :defer 1 :bind ("C-h W" . wiki-summary)) +;; --------------------------- Browse Local Arch Wiki -------------------------- +;; on Arch: yay (or whatever your AUR package manager is) -S arch-wiki-docs +;; browse the arch wiki topics offline + + +(defun cj/local-arch-wiki-search () + (interactive) + (let* ((dir "/usr/share/doc/arch-wiki/html/en") + (full-filenames (directory-files dir t "\\.html\\'")) + (basenames (mapcar 'file-name-base full-filenames)) + (chosen (completing-read "Choose an ArchWiki Topic: " basenames))) + (if (member chosen basenames) + (let* ((idx (cl-position chosen basenames :test 'equal)) + (fullname (nth idx full-filenames)) + (url (concat "file://" fullname))) + (eww-browse-url url)) + (message "File not found! Is arch-wiki-docs installed?")))) +(global-set-key (kbd "C-h A") 'cj/local-arch-wiki-search) + (provide 'help-utils) ;;; help-utils.el ends here -- cgit v1.2.3