Compare commits

..

2 Commits

Author SHA1 Message Date
ccb295f284 Tweaks to cider mode 2025-07-24 18:58:05 +02:00
6b76ac22be kill-this-buffer -> kill-current-buffer 2025-07-24 18:57:36 +02:00

View File

@ -1291,19 +1291,19 @@
I sometimes regret killing the =*scratch*=-buffer, and have realized I never I sometimes regret killing the =*scratch*=-buffer, and have realized I never
want to actually kill it. I just want to get it out of the way, and clean it want to actually kill it. I just want to get it out of the way, and clean it
up. The function below does just this for the =*scratch*=-buffer, and works up. The function below does just this for the =*scratch*=-buffer, and works
like =kill-this-buffer= for any other buffer. It removes all buffer content like =kill-current-buffer= for any other buffer. It removes all buffer content
and buries the buffer (this means making it the least likely candidate for and buries the buffer (this means making it the least likely candidate for
=other-buffer=). =other-buffer=).
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun kill-this-buffer-unless-scratch () (defun kill-current-buffer-unless-scratch ()
"Works like `kill-this-buffer' unless the current buffer is the "Works like `kill-this-buffer' unless the current buffer is the
,*scratch* buffer. In witch case the buffer content is deleted and ,*scratch* buffer. In witch case the buffer content is deleted and
the buffer is buried." the buffer is buried."
(interactive) (interactive)
(if (not (string= (buffer-name) "*scratch*")) (if (not (string= (buffer-name) "*scratch*"))
(kill-this-buffer) (kill-current-buffer)
(delete-region (point-min) (point-max)) (delete-region (point-min) (point-max))
(switch-to-buffer (other-buffer)) (switch-to-buffer (other-buffer))
(bury-buffer "*scratch*"))) (bury-buffer "*scratch*")))
@ -1597,6 +1597,8 @@
:bind (:map cider-repl-mode-map ("C-l" . cider-repl-clear-buffer)) :bind (:map cider-repl-mode-map ("C-l" . cider-repl-clear-buffer))
:config :config
(setq cider-save-file-on-load t (setq cider-save-file-on-load t
cider-font-lock-dynamically '(macro)
cider-repl-display-help-banner nil
cider-repl-pop-to-buffer-on-connect nil)) cider-repl-pop-to-buffer-on-connect nil))
#+end_src #+end_src
@ -2017,7 +2019,7 @@
:map custom-bindings-map :map custom-bindings-map
("M-," . jump-to-previous-like-this) ("M-," . jump-to-previous-like-this)
("M-." . jump-to-next-like-this) ("M-." . jump-to-next-like-this)
("C-x k" . kill-this-buffer-unless-scratch) ("C-x k" . kill-current-buffer-unless-scratch)
("C-c C-0" . global-scale-default) ("C-c C-0" . global-scale-default)
("C-c C-=" . global-scale-up) ("C-c C-=" . global-scale-up)
("C-c C-+" . global-scale-up) ("C-c C-+" . global-scale-up)