"Configure Gnus specific customizations."
(require 'gnus)
(require 'gnus-icalendar)
- (require 'shr)
(require 'ace-link)
(setq
gnus-article-treat-types '("text/plain"
(address ,esy/user-mail-address-gmail)))
gnus-icalendar-org-capture-file esy/inbox-path
gnus-icalendar-org-capture-headline '("Calendar")
- shr-use-colors nil
calendar-date-style 'iso)
(gnus-icalendar-setup)
(gnus-icalendar-org-setup)
(keymap-set ctl-x-map "s" rg-global-map)
(keymap-set ctl-x-map "c" #'org-capture)
(keymap-set ctl-x-map "o" #'ace-window)
- (keymap-set ctl-x-map "w" #'browse-web)
+ (keymap-set ctl-x-map "w" #'esy/eww)
(keymap-set ctl-x-map "j" #'org-agenda))
(add-hook 'after-init-hook #'esy/customize-ctl-x-map)
"https://planet.emacslife.com/atom.xml")))
#+end_src
-** eww
+** eww :www:
:PROPERTIES:
:CUSTOM_ID: eww
:END:
(with-eval-after-load 'eww
(setq eww-auto-rename-buffer 'title
browse-url-browser-function #'eww-browse-url))
+
+ (with-eval-after-load 'shr
+ (setq shr-use-colors nil))
+#+end_src
+
+*** Prompt for URL with history-based completion
+:PROPERTIES:
+:CUSTOM_ID: eww-completing-read-url
+:CreatedAt: <2022-05-08 Sun>
+:CapturedAt: [[file:~/checkouts/protfiles/emacs/.emacs.d/prot-lisp/prot-eww.el::defun prot-eww-browse-dwim]]
+:CapturedAs: Emacs configuration fragment
+:END:
+
+The =eww= command in the heart of =eww.el= prompts the user for a URL,
+and browses it (see [[info:eww#Basics][eww#Basics]] for more details). One shortcoming of
+the built-in =eww= command is that it uses the =read-string= function
+to read the requested URL, which does not facilitate completions.
+
+The following fragment, inspired by [[https://protesilaos.com/emacs/dotemacs#h:524bc702-ff55-4ed9-9a38-26d30d64591d][Protesilaos Stavrou's prot-eww.el]],
+provides a simple wrapper for =eww= that uses =completing-read=
+instead of =read-string=, allowing for quick input completion based on
+the prior submitted URLs and web search keywords.
+
+#+begin_src emacs-lisp
+ (defun esy/eww ()
+ "URL ARG."
+ (interactive)
+ (require 'eww)
+ (eww (completing-read "Browse or search: "
+ eww-prompt-history
+ nil nil nil
+ 'eww-prompt-history
+ (car (eww-suggested-uris)))))
#+end_src
** Proced