added a simple open-project function to emacs

This commit is contained in:
Sami Samhuri 2010-08-29 18:39:34 -07:00
parent 558ed92aa4
commit d78d5b6a82

24
emacs
View file

@ -387,6 +387,9 @@
;; run the ssa server ;; run the ssa server
(global-set-key [(super s)] 'ssa-run-server) (global-set-key [(super s)] 'ssa-run-server)
;; quickly jump to a project
(global-set-key [(super o)] 'open-project)
(defun ssa-start-server (buffer) (defun ssa-start-server (buffer)
(process-send-string buffer "cd ~/Projects/ssa/SelfServeApps/Backend") (process-send-string buffer "cd ~/Projects/ssa/SelfServeApps/Backend")
(comint-send-input) (comint-send-input)
@ -409,6 +412,27 @@
(comint-interrupt-subjob) (comint-interrupt-subjob)
(ssa-start-server "*server*"))))) (ssa-start-server "*server*")))))
(defvar *open-project-registry* (list))
(defun register-project (name root-file)
(interactive "sProject name: \nfRoot filename: ")
(when (null (assoc name *open-project-registry*))
(set '*open-project-registry* (cons (list name root-file) *open-project-registry*))))
;; FIXME use completing read
(defun open-project (name)
(interactive "sProject name: ")
(let* ((project (assoc name *open-project-registry*))
(root-file (cadr project)))
(when (null root-file)
(error "No such project"))
(find-file root-file)))
;; register projects
(register-project "ssa" "/Users/sjs/Projects/ssa/SelfServeApps/Frontend/AppController.j")
(register-project "cappuccino" "/Users/sjs/Projects/cappuccino/Foundation/CPObject.j")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; utilities & customizations ;; utilities & customizations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;