From 13d96f5b959c3c2a6d64910a7b719999489661d1 Mon Sep 17 00:00:00 2001 From: bd Date: Sat, 2 Nov 2024 13:14:28 -0400 Subject: Scratch buffers categorized in switch-to-buffer --- .config/emacs/modules/bd--notes.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to '.config/emacs/modules/bd--notes.el') diff --git a/.config/emacs/modules/bd--notes.el b/.config/emacs/modules/bd--notes.el index b83b71e..678e4d9 100644 --- a/.config/emacs/modules/bd--notes.el +++ b/.config/emacs/modules/bd--notes.el @@ -3,6 +3,9 @@ ;;; Code: +(defvar scratch-buffer nil + "Non-nil if the current buffer is a scratch buffer.") +(make-variable-buffer-local 'scratch-buffer) (defun bd/send-to-scratch () "Creates/switches to the scratch for `major-mode', then pastes the active region." @@ -16,10 +19,15 @@ then pastes the active region." (pop-to-buffer (with-current-buffer (get-buffer-create name) (funcall mode) + (setq-local scratch-buffer t) (when contents (insert (format "\n\n%s" contents))) (current-buffer))))) (keymap-global-set "C-c s" #'bd/send-to-scratch) +(add-hook 'emacs-startup-hook + (lambda () + (with-current-buffer "*scratch*" + (setq-local scratch-buffer t)))) (use-package denote :hook @@ -31,7 +39,6 @@ then pastes the active region." :config (require 'denote-journal-extras) -;;;; skribe (defvar bd/denote-skribe-front-matter "(post :title \"%s\" -- cgit v1.2.3