From aab5bfd074e57d06a79e39d7c7c4760e1f385a06 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 17 Oct 2022 21:41:28 -0500 Subject: Bankruptcy 9 --- lisp/+burly.el | 63 ---------------------------------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 lisp/+burly.el (limited to 'lisp/+burly.el') diff --git a/lisp/+burly.el b/lisp/+burly.el deleted file mode 100644 index a32bc97..0000000 --- a/lisp/+burly.el +++ /dev/null @@ -1,63 +0,0 @@ -;;; +burly.el --- Bespoke burly add-ons -*- lexical-binding: t; -*- - -;;; Commentary: - -;;; Code: - -(require 'burly) - -(defgroup +burly nil - "Extra `burly' customizations." - :group 'burly - :prefix "+burly-") - -(defcustom +burly-windows-bookmark-name "pre-close-window-config" - "The name of the window config bookmark pre-frame deletion.") - -(defun +burly--get-name (arg) - "Get the name of a Burly bookmark to restore. -If ARG is passed, ask for the bookmark's name; otherwise, just -use `+burly-windows-bookmark-name'." - (if arg - (completing-read "Save Burly bookmark: " (burly-bookmark-names) - nil nil burly-bookmark-prefix) - +burly-windows-bookmark-name)) - -(defun +burly-recover-windows-bookmark (&optional arg frame) - "Recover the window configuration from a previous bookmark. -ARG is passed to `+burly--get-name', which see." - (interactive (list current-prefix-arg - (selected-frame))) - (with-selected-frame frame - (burly-open-bookmark (+burly--get-name arg)))) - -(defun +burly--recover-windows-on-new-frame (frame) - "Recover the current window configuration in a new frame. -This function removes itself from `after-make-frame-functions'." - ;; XXX: For some reason, *scratch* pops up. So I need to run this after a - ;; short delay, which sadly causes a flash of *scratch*. - (run-with-idle-timer 0.1 nil - (lambda (f) (+burly-recover-windows-bookmark nil f)) - frame) - (remove-hook 'after-make-frame-functions #'+burly--recover-windows-on-new-frame)) - -(defun +burly-save-then-close-frame (&optional arg) - "Save window configuration and close the frame. -ARG is passed to `+burly--get-name', which see." - (interactive "P") - (if (not (frame-parameter nil 'client)) - (when (yes-or-no-p "Sure you want to quit? ") - (save-buffers-kill-emacs)) - (save-some-buffers t) - (burly-bookmark-windows (+burly--get-name arg)) - (delete-frame nil :force))) - -(defun +burly-save-then-close-frame-remembering () - "Save window configurations and close the frame. -The next frame created will restore the window configuration." - (interactive) - (add-hook 'after-make-frame-functions #'+burly--recover-windows-on-new-frame 90) - (+burly-save-then-close-frame)) - -(provide '+burly) -;;; +burly.el ends here -- cgit 1.4.1-21-gabe81