Add workspace support to rss/elfeed

I basically looked at the calendar app and copy/pasted the code into the rss app.

I tested it on my machine and it worked.
This commit is contained in:
Diego Alvarez 2020-12-15 15:42:30 -08:00 committed by GitHub
parent 0c9256411d
commit 50131ac995
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,8 +1,21 @@
;;; app/rss/autoload.el -*- lexical-binding: t; -*-
(defvar +rss--wconf nil)
;;;###autoload
(defalias '=rss #'elfeed
"Activate (or switch to) `elfeed' in its workspace.")
(defun =rss ()
"Activate (or switch to) `elfeed' in its workspace."
(interactive)
(if (featurep! :ui workspaces)
(progn
(+workspace-switch "rss" t)
(doom/switch-to-scratch-buffer)
(elfeed)
(+workspace/display))
(setq +rss--wconf (current-window-configuration))
(delete-other-windows)
(switch-to-buffer (doom-fallback-buffer))
(elfeed)))
;;;###autoload
(defun +rss/delete-pane ()
@ -77,7 +90,12 @@
(with-current-buffer b
(remove-hook 'kill-buffer-hook #'+rss-cleanup-h :local)
(kill-buffer b)))
(mapc #'kill-buffer show-buffers)))
(mapc #'kill-buffer show-buffers))
(if (featurep! :ui workspaces)
(+workspace/delete "rss")
(when (window-configuration-p +rss--wconf)
(set-window-configuration +rss--wconf))
(setq +rss--wconf nil)))
;;