summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el8
-rw-r--r--lisp/+elfeed.el53
2 files changed, 45 insertions, 16 deletions
diff --git a/init.el b/init.el index 6940a12..53a8a81 100644 --- a/init.el +++ b/init.el
@@ -492,7 +492,7 @@
492 org-tags-column (- (- fill-column (length org-ellipsis))) 492 org-tags-column (- (- fill-column (length org-ellipsis)))
493 org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" 493 org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)"
494 "|" "DONE(d!)") 494 "|" "DONE(d!)")
495 (sequence "|" "CANCELED(k@/!)") 495 (sequence "|" "CANCELED(k@)")
496 (sequence "MEETING(m)"))) 496 (sequence "MEETING(m)")))
497 (:bind "RET" #'+org-return-dwim 497 (:bind "RET" #'+org-return-dwim
498 "<S-return>" #'+org-table-copy-down 498 "<S-return>" #'+org-table-copy-down
@@ -613,7 +613,11 @@
613 (:option tab-bar-tab-name-function '+tab-bar-basename 613 (:option tab-bar-tab-name-function '+tab-bar-basename
614 tab-bar-tab-name-truncated-max 20 614 tab-bar-tab-name-truncated-max 20
615 tab-bar-tab-name-ellipsis truncate-string-ellipsis 615 tab-bar-tab-name-ellipsis truncate-string-ellipsis
616 tab-bar-show t) 616 tab-bar-show t
617 tab-bar-close-button-show t
618 tab-bar-close-button (propertize " ✕ " 'display t
619 'close-tab t)
620 tab-bar-new-button (propertize "+ " 'display t))
617 (tab-bar-mode +1) 621 (tab-bar-mode +1)
618 (if (version< emacs-version "28.0") 622 (if (version< emacs-version "28.0")
619 (+tab-bar-misc-info-mode +1) 623 (+tab-bar-misc-info-mode +1)
diff --git a/lisp/+elfeed.el b/lisp/+elfeed.el index 47ada47..b2a578b 100644 --- a/lisp/+elfeed.el +++ b/lisp/+elfeed.el
@@ -52,21 +52,46 @@
52 (unless (file-exists-p script) 52 (unless (file-exists-p script)
53 (make-directory (file-name-directory script) :parents) 53 (make-directory (file-name-directory script) :parents)
54 (with-temp-buffer 54 (with-temp-buffer
55 (insert "(progn\n" 55 (insert
56 " (load (locate-user-emacs-file \"early-init\"))\n" 56 (nconcat nil
57 " (straight-use-package 'elfeed)\n" 57 "#!/usr/bin/env -S emacs --script"
58 " (require 'elfeed)\n" 58 ;; I have to load the necessary files
59 " (elfeed)\n" 59 "(load (locate-user-emacs-file \"early-init\"))"
60 " (elfeed-update)\n" 60 "(straight-use-package 'elfeed)"
61 " (while (> (elfeed-queue-count-total) 0)\n" 61 "(straight-use-package 'elfeed-org)"
62 " (sleep-for 5)\n" 62 "(require 'elfeed)"
63 " (message \"%s\" (elfeed-queue-count-total))\n" 63 "(require 'elfeed-org)"
64 " (accept-process-output))\n" 64 ;; And set needed variables
65 " (elfeed-db-save-safe)\n" 65 `("(setq rmh-elfeed-org-files '("
66 " (elfeed-db-gc-safe))") 66 ,(mapconcat (lambda (el)
67 (write-file script))) 67 (format "\"%s\"" el))
68 rmh-elfeed-org-files
69 " ")
70 "))")
71 ;; Overwrite log function to go to stdout
72 "(defun elfeed-log (level fmt &rest objects)"
73 " (princ (format \"[%s] [%s]: %s\\n\""
74 " (format-time-string \"%F %T\")"
75 " level"
76 " (apply #'format fmt objects))))"
77 ;; Load elfeed
78 "(elfeed-org)"
79 "(elfeed-db-load)"
80 "(elfeed)"
81 ;; Update elfeed
82 "(elfeed-update)"
83 ;; Wait to finish ... I think.
84 "(while (> (elfeed-queue-count-total) 0)"
85 " (sleep-for 5)"
86 " (message \"%s\" (elfeed-queue-count-total))"
87 " (accept-process-output))"
88 ;; Save and garbage-collect
89 "(elfeed-db-save)"
90 "(elfeed-db-gc)"))
91 (write-file script))
92 (chmod script #o777))
68 (set-process-sentinel (start-process-shell-command 93 (set-process-sentinel (start-process-shell-command
69 "Elfeed" nil (concat "emacs --script " script)) 94 "Elfeed" nil script)
70 (lambda (a b) 95 (lambda (a b)
71 (advice-remove 'elfeed #'+elfeed--update-message) 96 (advice-remove 'elfeed #'+elfeed--update-message)
72 (setq +elfeed--update-running nil) 97 (setq +elfeed--update-running nil)