Nafai77 / metaproject

Project support and utilities for Emacs

metaproject / metaproject-ido.el
100644 52 lines (40 sloc) 1.708 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
;;; metaproject-ido.el --- ido wrappers for various metaproject functions
 
;; Copyright (C) 2009 Travis B. Hartwell (nafai AT travishartwell DOT net)
 
;; Version: 0.02-SNAPSHOT
 
;; This file is not part of GNU Emacs.
 
;; This 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 2, or (at your option) any later
;; version.
;;
;; This 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 GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
;; MA 02111-1307, USA.
 
;;; Commentary:
 
;;; TODO: Summary goes here
 
;;; History:
 
(require 'metaproject)
(require 'project-utils)
 
(defun metaproject-open-ido (arg)
  (interactive "P")
  (project-util-action-ido
   #'metaproject-find-metaprojects
   metaproject-project-dirs
   #'metaproject-get-top-dir
   #'metaproject-open-project
   "Metaproject Project to open? "
   arg))
 
(defun metaproject-switch-buffer-ido ()
  (interactive "P")
  (let ((project-config (metaproject-get-project-config-from-buffer (current-buffer))))
    (when (not (null project-config))
      (let* ((buffers (metaproject-config-get project-config 'project-buffers))
(buffer-names (mapcar 'buffer-name buffers)))
(switch-to-buffer (ido-completing-read "Project buffer? " buffer-names))))))
  
(provide 'metaproject-ido)