remove if-mode condition, doesn't run in other modes anyway

This commit is contained in:
2023-06-05 08:17:13 +02:00
parent 8c6488183a
commit 350a27e5d2
2 changed files with 8 additions and 8 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
autoscratch.elc

View File

@@ -150,14 +150,13 @@ New name is '*autoscratch-<new-major-mode><N>*
Executes `autoscratch-rename-hook' afterwards."
(interactive)
(unless (eq major-mode "autoscratch-mode")
(rename-buffer
(generate-new-buffer-name
(format "*%s-scratch*"
(replace-regexp-in-string
"-mode" ""
(format "%s" major-mode))))
(run-hooks 'autoscratch-rename-hook))))
(rename-buffer
(generate-new-buffer-name
(format "*%s-scratch*"
(replace-regexp-in-string
"-mode" ""
(format "%s" major-mode))))
(run-hooks 'autoscratch-rename-hook)))
(defun autoscratch-buffer ()
"Create and switch to a new autoscratch buffer."