From b1fbc8af47f36f2f992e01d713793453a2bbbacb Mon Sep 17 00:00:00 2001 From: morioka Date: Wed, 17 Jun 1998 21:34:18 +0000 Subject: [PATCH] (call-after-loaded): Moved from semi-def.el. --- semi-setup.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/semi-setup.el b/semi-setup.el index 113606e..e7decc8 100644 --- a/semi-setup.el +++ b/semi-setup.el @@ -27,6 +27,19 @@ (require 'semi-def) (require 'path-util) +(defun call-after-loaded (module func &optional hook-name) + "If MODULE is provided, then FUNC is called. +Otherwise func is set to MODULE-load-hook. +If optional argument HOOK-NAME is specified, +it is used as hook to set." + (if (featurep module) + (funcall func) + (or hook-name + (setq hook-name (intern (concat (symbol-name module) "-load-hook"))) + ) + (add-hook hook-name func) + )) + ;; for image/* and X-Face (defvar mime-setup-enable-inline-image -- 1.7.10.4