From a571e4ce77c441eeb1ee095f70e680d35301003c Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 6 Jun 2021 22:12:44 +0100 Subject: jao-rss-subscribe inserting a maildir mailbox --- init.org | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'init.org') diff --git a/init.org b/init.org index 52f9401..ad732e3 100644 --- a/init.org +++ b/init.org @@ -408,7 +408,7 @@ (setq custom-theme-directory (expand-file-name "lib/themes" jao-emacs-dir)) - (setq jao-frames-default-font "Hack-9") + (defvar jao-default-font "Fira Code-9") ;; "Hack-9" (require 'jao-themes) @@ -1175,7 +1175,6 @@ * Frames *** Frame geometry #+begin_src emacs-lisp - (defvar jao-frames-default-font "Hack-9") (setq frame-resize-pixelwise nil) ;;; modeline, toolbars and co. @@ -1185,7 +1184,7 @@ (scroll-bar-width . 11) (menu-bar . nil) (alpha . (,jao-frames-default-alpha ,jao-frames-default-alpha)) - (font . ,jao-frames-default-font))) + (font . ,jao-default-font))) #+end_src *** Frame layout, title, etc. #+BEGIN_SRC emacs-lisp @@ -1574,6 +1573,14 @@ (if (fboundp 'w3m-view-mode) (w3m-view-source) (View-quit)) (when url (cons url (or title "")))))))) + (defun jao-rss2e-append (name url mbox) + (with-current-buffer (find-file-noselect "~/.config/rss2email.cfg") + (goto-char (point-max)) + (insert "[feed." name "]\nurl = " url) + (insert "\nto = jao+feeds_" mbox "@localhost") + (insert "\nmaildir-mailbox = " mbox "\n\n") + (save-buffer))) + (defun jao-rss-subscribe () (interactive) (let* ((url (or (jao-url-around-point) @@ -1583,16 +1590,14 @@ (url (car url+title)) (title (cdr url+title))) (if url - (let ((url (if (string-match "^feed:" url) - (substring url 5) url))) + (let ((url (if (string-match "^feed:" url) (substring url 5) url))) (when (y-or-n-p (format "Subscribe to <%s>? " url)) (let* ((name (read-string "Name: " title)) (cat (completing-read "Category: " (jao-list-mailboxes "feeds") nil t))) - (shell-command - (format "r2e add %s %s jao+feeds_%s@localhost && r2e run %s" - name url cat name))))) + (jao-rss2e-append name url cat) + (shell-command (format "r2e run %s" name))))) (message "No feeds found")))) #+end_src * Email -- cgit v1.2.3