Adding ednc (notifications) to Doom Emacs.

This commit is contained in:
Derek Taylor
2023-01-01 09:46:37 -06:00
parent a2897010b8
commit e6c9be411b
3 changed files with 43 additions and 0 deletions

View File

@@ -184,6 +184,24 @@ List of keybindings (SPC h b b)")
(map! :leader
:desc "Load new theme" "h t" #'counsel-load-theme)
(ednc-mode 1)
(defun show-notification-in-buffer (old new)
(let ((name (format "Notification %d" (ednc-notification-id (or old new)))))
(with-current-buffer (get-buffer-create name)
(if new (let ((inhibit-read-only t))
(if old (erase-buffer) (ednc-view-mode))
(insert (ednc-format-notification new t))
(pop-to-buffer (current-buffer)))
(kill-buffer)))))
(add-hook 'ednc-notification-presentation-functions
#'show-notification-in-buffer)
(evil-define-key 'normal ednc-view-mode-map "d" 'ednc-dismiss-notification)
(evil-define-key 'normal ednc-view-mode-map (kbd "RET") 'ednc-invoke-action)
(evil-define-key 'normal ednc-view-mode-map (kbd "TAB") 'ednc-toggle-expanded-view)
(use-package! elfeed-goodies)
(elfeed-goodies/setup)
(setq elfeed-goodies/entry-pane-size 0.5)

View File

@@ -23,6 +23,7 @@
- [[#keybindings-within-dired-with-peep-dired-mode-enabled][Keybindings Within Dired With Peep-Dired-Mode Enabled]]
- [[#making-deleted-files-go-to-trash-can][Making deleted files go to trash can]]
- [[#doom-theme][DOOM THEME]]
- [[#ednc-notifications][EDNC (Notifications)]]
- [[#elfeed][ELFEED]]
- [[#emms][EMMS]]
- [[#emojis][EMOJIS]]
@@ -414,6 +415,29 @@ Setting the theme to doom-one. To try out new themes, I set a keybinding for co
:desc "Load new theme" "h t" #'counsel-load-theme)
#+END_SRC
* EDNC (Notifications)
#+begin_src emacs-lisp
(ednc-mode 1)
(defun show-notification-in-buffer (old new)
(let ((name (format "Notification %d" (ednc-notification-id (or old new)))))
(with-current-buffer (get-buffer-create name)
(if new (let ((inhibit-read-only t))
(if old (erase-buffer) (ednc-view-mode))
(insert (ednc-format-notification new t))
(pop-to-buffer (current-buffer)))
(kill-buffer)))))
(add-hook 'ednc-notification-presentation-functions
#'show-notification-in-buffer)
(evil-define-key 'normal ednc-view-mode-map "d" 'ednc-dismiss-notification)
(evil-define-key 'normal ednc-view-mode-map (kbd "RET") 'ednc-invoke-action)
(evil-define-key 'normal ednc-view-mode-map (kbd "TAB") 'ednc-toggle-expanded-view)
#+end_src
* ELFEED
An RSS newsfeed reader for Emacs.

View File

@@ -63,6 +63,7 @@
(package! dired-subtree)
(package! dirvish)
(package! dmenu)
(package! ednc)
(package! elfeed-goodies)
(package! emojify)
(package! evil-tutor)