From f66eb7cb914b0b1a1e8e8074de01ef98a789fac5 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Thu, 23 Dec 2010 16:50:09 +0330 Subject: [PATCH] basic menu loading done --- .hgignore | 2 ++ src/lib/menu.el | 21 +++++++++++++++++++++ src/shitty.el | 29 +++++++++++++++++++++++------ 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 src/lib/menu.el diff --git a/.hgignore b/.hgignore index 1350747..237bfd7 100755 --- a/.hgignore +++ b/.hgignore @@ -10,6 +10,8 @@ syntax: glob .cache/ *.pyc *~ +\#* +\.\#* .settings/* *Thumbs.db *.swp diff --git a/src/lib/menu.el b/src/lib/menu.el new file mode 100644 index 0000000..724214b --- /dev/null +++ b/src/lib/menu.el @@ -0,0 +1,21 @@ +;; Shitty - My personal emacs IDE configuration +;; Copyright (C) 2010 Sameer Rahmani +;; +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +(defun init-menu () "Initializing Shit IDE menu" + + (define-key global-map [menu-bar file new-project] '("New project" . new-project)) +) +(init-menu) \ No newline at end of file diff --git a/src/shitty.el b/src/shitty.el index c489040..70aadcb 100644 --- a/src/shitty.el +++ b/src/shitty.el @@ -16,6 +16,27 @@ (setq shit-mode 0) (setq DEBUG 1) +(setq ROOTPATH nil) +(setq LIBPATH nil) + +(defun init-shit () "Inittialize Shit IDE environment" + (log "initializing SHIT . . .") + (setq cur-path-list (split-string load-file-name "/")) + (nbutlast cur-path-list) + (setq ROOTPATH (concat (mapconcat 'identity cur-path-list "/") "/")) + (setq LIBPATH (concat ROOTPATH "lib/")) + (log (format "Running on %s" ROOTPATH)) + (log (format "lib : %s" LIBPATH)) +) + +(defun load-lib (ADDR) "load the shit library on the ADDR path" + (interactive) + (let (tmp) + (setq tmp (concat LIBPATH ADDR)) + (load tmp) + ) + ) + (defun log (ARG) "print a log on message buffer." (if (= DEBUG 1) (message "[SHIT] DEBUG >>> %s" ARG)) @@ -29,12 +50,8 @@ (progn (setq shit-mode 1) (log "Starting shit mode . . .") - (setq cur-path-list (split-string load-file-name "/")) - (nbutlast cur-path-list) - (setq curpath (mapconcat 'identity cur-path-list "/")) - (log curpath) - (add-to-list 'load-path curpath) - + (init-shit) + (load-lib "menu.el") ) ) )