Skip to content

Commit

Permalink
Update snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Jun 4, 2014
1 parent 836538d commit 7622141
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 21 deletions.
22 changes: 11 additions & 11 deletions cake2.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

;; Version: 2.0.5
;; Version: 2.0.6
;; Author: k1LoW (Kenichirou Oyama), <k1lowxb [at] gmail [dot] com> <k1low [at] 101000lab [dot] org>
;; URL: http://code.101000lab.org
;; Package-Requires: ((dash "2.6.0") (s "1.9.0") (f "0.16.2") (ht "2.0") (json "1.2") (cake-inflector "1.1.0") (historyf "0.0.8") (anything "1.3.9"))
Expand Down Expand Up @@ -171,7 +171,7 @@
:type 'boolean
:group 'cake2)

(defcustom cake2::core-version "2.0"
(defcustom cake2::core-version "2.x"
"CakePHP2 version"
:type 'string
:group 'cake2)
Expand Down Expand Up @@ -888,18 +888,18 @@
(cake2::create-open-dirs-anything-sources dirs recursive ignore) nil)
(message "Can't set app path.")))

(defun cake2::create-open-dirs-anything-sources (dir &optional recursive ignore)
"Create 'Open DIR' anything-sources. If RECURSIVE is true recursive."
(defun cake2::create-open-dirss-anything-sources (dirs &optional recursive ignore)
"Create 'Open DIRS' anything-sources. If RECURSIVE is true recursive."
(let (sources)
(unless (listp dir)
(setq dir (list dir)))
(unless (listp dirs)
(setq dirs (list dirs)))
(if (cake2::app-build)
(progn
(loop for d in dir do
(unless (not (f-dir? (f-join cake2::app-path d)))
(loop for d in dirs do
(unless (not (f-dirs? (f-join cake2::app-path d)))
(push
`((name . ,(concat "Open directory: " d))
(candidates . ,(remove-if (lambda (x) (and ignore (string-match ignore x))) (cake2::directory-files d recursive)))
`((name . ,(concat "Open dirsectory: " d))
(candidates . ,(remove-if (lambda (x) (and ignore (string-match ignore x))) (cake2::dirsectory-files d recursive)))
(display-to-real . (lambda (candidate)
(f-join ,cake2::app-path ,d candidate)))
(type . file))
Expand Down Expand Up @@ -1064,7 +1064,7 @@

(defvar cake2::source-version
'((name . "CakePHP2 core version")
(candidates . (lambda () (list "1.2" "1.3")))
(candidates . (lambda () (list "1.2" "1.3" "2.x")))
(action
("Set Version" . (lambda (candidate)
(setq cake2::core-version candidate))))))
Expand Down
3 changes: 2 additions & 1 deletion snippets/text-mode/cake2/Form/2.x/$fc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : $this->Form->create(...)
# name : $this->Form->create(...)
# condition: cake2
# --
\$this->Form->create('${1:Model}', array('action' => '${2:add}'));
3 changes: 2 additions & 1 deletion snippets/text-mode/cake2/Form/2.x/$fe
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : $this->Form->end();
# name : $this->Form->end();
# condition: cake2
# --
\$this->Form->end();
3 changes: 2 additions & 1 deletion snippets/text-mode/cake2/Form/2.x/$fi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : $this->Form->input(...)
# name : $this->Form->input(...)
# condition: cake2
# --
\$this->Form->input('${1:field_name}', array('type' => '${2:text}'${3:}));
3 changes: 2 additions & 1 deletion snippets/text-mode/cake2/Form/2.x/$fs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : $this->Form->submit(__('Submit'));
# name : $this->Form->submit(__('Submit'));
# condition: cake2
# --
\$this->Form->submit(__('${1:Submit}'));
3 changes: 2 additions & 1 deletion snippets/text-mode/cake2/Html/2.x/$hc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : $this->Html->css(...)
# name : $this->Html->css(...)
# condition: cake2
# --
\$this->Html->css('${1:css_path}');
3 changes: 2 additions & 1 deletion snippets/text-mode/cake2/Html/2.x/$hi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : $this->Html->image(...)
# name : $this->Html->image(...)
# condition: cake2
# --
\$this->Html->image('${1:image_path}', array(${2:param}));
3 changes: 2 additions & 1 deletion snippets/text-mode/cake2/Html/2.x/$hl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : $this->Html->link(...)
# name : $this->Html->link(...)
# condition: cake2
# --
\$this->Html->link(${1:'link_title'}, array('controller' => '${2:controller}', 'action' => '${3:action}'${4:}));
3 changes: 2 additions & 1 deletion snippets/text-mode/cake2/Html/2.x/$hu
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : $this->Html->url(...)
# name : $this->Html->url(...)
# condition: cake2
# --
\$this->Html->url(${1:'url_path'});
3 changes: 2 additions & 1 deletion snippets/text-mode/cake2/general/clog
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : $this->log(...,LOG_DEBUG);
# name : $this->log(...,LOG_DEBUG);
# condition: cake2
# --
\$this->log($0,LOG_DEBUG);
3 changes: 2 additions & 1 deletion snippets/text-mode/cake2/general/pr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#name : pr(...)
# name : pr(...)
# condition: cake2
# --
pr($0);

0 comments on commit 7622141

Please sign in to comment.