From: morioka Date: Wed, 17 Jun 1998 21:34:18 +0000 (+0000) Subject: (call-after-loaded): Moved from semi-def.el. X-Git-Tag: remi-199811302358~4 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=b1fbc8af47f36f2f992e01d713793453a2bbbacb;p=elisp%2Fsemi.git (call-after-loaded): Moved from semi-def.el. --- 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