summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2023-02-15 14:28:39 -0700
committerSean Whitton <spwhitton@spwhitton.name>2023-02-15 14:30:39 -0700
commit74ada4e51f975224b3dd30567abb2e00f61b77af (patch)
treef08f1223aae018793e3b4974e487c3bb7fb06bdd
parentd945c74512ae2e6344bb8c9444d71a96d7770c83 (diff)
downloaddotfiles-74ada4e51f975224b3dd30567abb2e00f61b77af.tar.gz
avoid trying to enable paredit-mode in *scratch*
It'll often fail due to unbalanced parentheses. Additionally, use paredit-mode, not spw/scratch-paredit-mode, in any other lisp-interaction-mode buffers.
-rw-r--r--.emacs.d/init.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 6b68302b..9a698e9b 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -4445,7 +4445,11 @@ likely to keep parentheses balanced."
;;; Paredit
-(spw/feature-add-hook enable-paredit-mode
+(defun spw/enable-paredit-mode ()
+ (if (eq (current-buffer) (get-buffer "*scratch*"))
+ (spw/scratch-paredit-mode 1)
+ (paredit-mode 1)))
+(spw/feature-add-hook spw/enable-paredit-mode
(nil lisp-data-mode-hook) (nil emacs-lisp-mode-hook)
(nil eval-expression-minibuffer-setup-hook)
scheme (xscheme xscheme-start-hook) slime-repl)
@@ -4619,7 +4623,6 @@ likely to keep parentheses balanced."
(define-minor-mode spw/scratch-paredit-mode
"Less strict Paredit for the *scratch* buffer.
Paredit commands are invoked only when point's paragraph is within a defun.")
-(add-hook 'lisp-interaction-mode-hook #'spw/scratch-paredit-mode)
;;;; Text mode