From 701ff2928e47e6c29fe9f9500eb2b223b811ec13 Mon Sep 17 00:00:00 2001 From: Derek Taylor Date: Tue, 10 Jan 2023 19:56:23 -0600 Subject: [PATCH] Making new 'start-mode' read-only by default. --- .config/doom/config.el | 1 + .config/doom/config.org | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/doom/config.el b/.config/doom/config.el index 6740317..edfa23b 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -835,6 +835,7 @@ ;; (kbd "5") 'dt/open-eshell-profile) map)) +(add-hook 'start-mode-hook 'read-only-mode) ;; make start.org read-only; use 'SPC t r' to toggle off read-only. (provide 'start-mode) (map! :leader diff --git a/.config/doom/config.org b/.config/doom/config.org index c014383..1fe00ad 100644 --- a/.config/doom/config.org +++ b/.config/doom/config.org @@ -1288,7 +1288,7 @@ I set splits to default to opening on the right using 'prefer-horizontal-split'. #+END_SRC * START PAGE -Instead of using Doom's Dashboard or the Emacs Dashboard program, I have decided to just set an custom start file as my "dashboard" since it allows me more customization options. +Instead of using Doom's Dashboard or the Emacs Dashboard program, I have decided to just set an custom start file as my "dashboard" since it allows me more customization options. I have added to the 'start-mode-hook' the argument 'read-only-mode'. This is to prevent accidental editing of the start file, and to prevent clashes with the 'start-mode' specific keybindings. You can toggle on/off read-only-mode with 'SPC t r'. #+begin_src emacs-lisp (setq initial-buffer-choice "~/.config/doom/start.org") @@ -1331,6 +1331,7 @@ Instead of using Doom's Dashboard or the Emacs Dashboard program, I have decided ;; (kbd "5") 'dt/open-eshell-profile) map)) +(add-hook 'start-mode-hook 'read-only-mode) ;; make start.org read-only; use 'SPC t r' to toggle off read-only. (provide 'start-mode) #+end_src