From 50131ac995029a5b3f58923359f9578a899242e1 Mon Sep 17 00:00:00 2001 From: Diego Alvarez Date: Tue, 15 Dec 2020 15:42:30 -0800 Subject: [PATCH] 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. --- modules/app/rss/autoload.el | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/modules/app/rss/autoload.el b/modules/app/rss/autoload.el index 98f121c83..2f742348a 100644 --- a/modules/app/rss/autoload.el +++ b/modules/app/rss/autoload.el @@ -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))) ;;