From ac0bc578a386c5278dd12beb5ebf46b629c49c77 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Sat, 16 Mar 2024 12:40:33 +0100 Subject: Create a simple hook for dired-mode --- create-license.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/create-license.el b/create-license.el index ba108ba..2f828c3 100644 --- a/create-license.el +++ b/create-license.el @@ -48,7 +48,12 @@ dot." :group 'create-license :type 'string) -(defcustom create-license-hook nil +(defun create-license--dired-update () + "Revert the current buffer if it is a `dired' buffer." + (when (eq major-mode 'dired-mode) + (revert-buffer))) + +(defcustom create-license-hook '(create-license--dired-update) "Hook run after `create-license'. Functions in this hook are called with no arguments." -- cgit v1.2.3