summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--notes.el
diff options
context:
space:
mode:
Diffstat (limited to '.config/emacs/modules/bd--notes.el')
-rw-r--r--.config/emacs/modules/bd--notes.el9
1 files changed, 8 insertions, 1 deletions
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\"