From aa57cbf238130d30dafccc0665be89c8b5674815 Mon Sep 17 00:00:00 2001 From: lxsameer Date: Sun, 29 May 2011 13:28:09 +0430 Subject: [PATCH] some functionality moved to kuso mode --- src/lib/modes.el | 31 +++++++++++++++++++++++++++++++ src/plugins/django.el | 17 ----------------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/lib/modes.el b/src/lib/modes.el index 3079408..c2ccdfe 100644 --- a/src/lib/modes.el +++ b/src/lib/modes.el @@ -16,6 +16,12 @@ ;; This file will define the most popular modes for KusoIDE +;; ------------------------------------------------------------------- +;; Variables +;; ------------------------------------------------------------------- +(defvar project-path "" + "Project source tree path.") + ;; --------------------------------------------------------------------- ;; Hooks ;; --------------------------------------------------------------------- @@ -79,6 +85,31 @@ can define their key bindings easily." ;; ---------------------------------------------------------------------- ;; Functions ;; ---------------------------------------------------------------------- +(defun get-project-path () + "Get the project path." + (setq project-path (read-directory-name "Project source tree: ")) +) + +(defun kuso/get-todo () + "Get a list of TODO entries from the project source tree" + (interactive) +) + +(defun kuso/cleanup () + "Remove all the unneecessary files form project." + (interactive) + (let (buffer commands) + (if (string= project-path "") + (get-project-path) + ) + (setq commands "rm -fv `find @@pp@@ -iname \"*.pyc\"` && rm -fv `find @@pp@@ -iname \"*~\"` && rm -fv `find @@pp@@ -iname \"\.#*\"` && rm -vf `find @@pp@@ -iname \"#*\"`") + (setq commands (replace-regexp-in-string "@@pp@@" project-path commands)) + (setq buffer (get-buffer-create "*Cleanup*")) + (switch-to-buffer buffer) + (start-process-shell-command "Cleanup" buffer commands) + ) + + ) ;; ---------------------------------------------------------------------- ;; Minor Modes diff --git a/src/plugins/django.el b/src/plugins/django.el index 1aeccb7..e1dd965 100644 --- a/src/plugins/django.el +++ b/src/plugins/django.el @@ -176,23 +176,6 @@ binding for Kuso IDE django plugin" (manage-command "*Custom*" "custom" command) ) - -(defun django/cleanup () - "Remove all the unneecessary files form project." - (interactive) - (let (buffer commands) - (if (string= project-path "") - (get-project-path) - ) - (setq commands "rm -fv `find @@pp@@ -iname \"*.pyc\"` && rm -fv `find @@pp@@ -iname \"*~\"` && rm -fv `find @@pp@@ -iname \"\.#*\"` && rm -vf `find @@pp@@ -iname \"#*\"`") - (setq commands (replace-regexp-in-string "@@pp@@" project-path commands)) - (setq buffer (get-buffer-create "*Cleanup*")) - (switch-to-buffer buffer) - (start-process-shell-command "Cleanup" buffer commands) - ) - - ) - ;; ---------------------------------------------------------------------- ;; Minor Modes ;; ----------------------------------------------------------------------