diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..11e228e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +autoscratch.elc diff --git a/autoscratch.el b/autoscratch.el index 6a6c1c2..ed3bb07 100644 --- a/autoscratch.el +++ b/autoscratch.el @@ -150,14 +150,13 @@ New name is '*autoscratch-* 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."