From 7aa4aa9ce6e8d3d65a608f9a07cdd5a4478067c6 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Tue, 11 Apr 2023 09:28:16 -0400 Subject: [PATCH] add error handling to code that deletes the scratch buffer as it may not always be present and its a non-error --- common/workspaces.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/workspaces.el b/common/workspaces.el index aabe34b..d5e07e5 100644 --- a/common/workspaces.el +++ b/common/workspaces.el @@ -33,7 +33,7 @@ ; start with fresh frame (delete-other-windows) (kmn/kill-other-buffers) - (kill-buffer (get-buffer "*scratch*")) + (ignore-errors (kill-buffer "*scratch*")) ; front load org-agenda so it doesnt reshuffle the frame layout on us (org-agenda nil "r") (split-window-below) @@ -57,6 +57,7 @@ ; start with fresh frame (delete-other-windows) (kmn/kill-other-buffers) + (ignore-errors (kill-buffer "*scratch*")) ; Open main files used as 'gateway' to everything else (find-file "~/org/health/health_houdini.org") (find-file "~/org/health/health_mike.org") @@ -76,7 +77,7 @@ (interactive) (delete-other-windows) (kmn/kill-other-buffers) - (kill-buffer "*scratch*") + (ignore-errors (kill-buffer "*scratch*")) (scratch 'text-mode) ; show dired at `~` in left side window (kmn/dired-directory-on-left dir_path)