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." Executes `autoscratch-rename-hook' afterwards."
(interactive) (interactive)
(unless (eq major-mode "autoscratch-mode") (rename-buffer
(rename-buffer (generate-new-buffer-name
(generate-new-buffer-name (format "*%s-scratch*"
(format "*%s-scratch*" (replace-regexp-in-string
(replace-regexp-in-string "-mode" ""
"-mode" "" (format "%s" major-mode))))
(format "%s" major-mode)))) (run-hooks 'autoscratch-rename-hook)))
(run-hooks 'autoscratch-rename-hook))))
(defun autoscratch-buffer () (defun autoscratch-buffer ()
"Create and switch to a new autoscratch buffer." "Create and switch to a new autoscratch buffer."