diff --git a/src/lib/modes.el b/src/lib/modes.el index fab7c15..61e8f3c 100644 --- a/src/lib/modes.el +++ b/src/lib/modes.el @@ -16,6 +16,25 @@ fff;; Shit - My personal emacs IDE configuration ;; This file will define the most popular modes for ShitIDE +;; --------------------------------------------------------------------- +;; Hooks +;; --------------------------------------------------------------------- +(defvar shit-preinit-mode-hook '() + "This hook runs before initializing the 'shit-mode' minor mode." + ) + +(defvar shit-postinit-mode-hook '() + "This hook runs after 'shit-mode' minor mode initialized." + ) + +(defvar shit-prerm-mode-hook '() + "This hook runs before deactivating 'shit-mode' minor mode." + ) + +(defvar shit-postrm-mode-hook '() + "This hook runs after 'shit-mode' minor mode deactivated." + ) + ;; --------------------------------------------------------------------- ;; Keymaps ;; --------------------------------------------------------------------- @@ -57,6 +76,21 @@ This mode provide a basic configuration for an IDE." :group 'shit-group (if (not shit-mode) - (menu/init-menu) - ) -) \ No newline at end of file + ;; shit-mode is not loaded + (let () + ;; before initiazing mode + (run-hooks shit-preinit-mode-hook) + + ;; after mode was initialized + (run-hooks shit-postinit-mode-hook) + ) + ;; shit-mode already loaded + (let () + ;; before deactivating mode + (run-hooks shit-prerm-mode-hook) + + ;; after deactivating mode + (run-hooks shit-postrm-mode-hook) + ) + ) + ) \ No newline at end of file diff --git a/src/shit-ide.el b/src/shit-ide.el index 29d73de..8ecf505 100644 --- a/src/shit-ide.el +++ b/src/shit-ide.el @@ -14,12 +14,39 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . -(setq DEBUG 1) -(setq ROOTPATH nil) -(setq LIBPATH nil) -(setq PLUGINPATH nil) -(setq TEMPLATESPATH nil) +;; -------------------------------------------------------------------- +;; Global variables +;; -------------------------------------------------------------------- + +;; Turning on debuggin for development +(defvar DEBUG 1 + "Shit IDE will produce more output in the debug mode (DEBUG = 1). log +function outputs will appear in *Messages* buffer." + ) + +(defvar ROOTPATH nil + "This variable refer to absolute path to Shit IDE source tree." +) + +(defvar LIBPATH nil + "This variable refer to 'lib' directory of Shit IDE that contains the +internal libraries for ShitIDE." +) + +(defvar PLUGINPATH nil + "This variable refer to 'plugin' directory of ShitIDE that contains +Shit plugins." +) + +(defvar TEMPLATESPATH nil + "This variable refer to 'template' directory of ShitIDE where plugins +store their code templates." +) + +;; ------------------------------------------------------------------- +;; Functions +;; ------------------------------------------------------------------- (defun strip-el-ext (STR) "strinp the lastest elist extension suffix" (let (ext) (setq ext (replace-regexp-in-string "\.el$" "" STR)) @@ -94,3 +121,4 @@ function." ) (start-shit) +