Skip to content

Commit

Permalink
rails-ui.el (rails-minor-mode-prefix-key): created
Browse files Browse the repository at this point in the history
	(rails-key): created


git-svn-id: svn+ssh://rubyforge.org/var/svn/emacs-rails/trunk@173 cc5033d0-740f-0410-afc7-949910e492f2
  • Loading branch information
dimaexe committed Apr 9, 2007
1 parent f363425 commit c9c3439
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 75 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2007-04-09 Dmitry Galinsky <[email protected]>

* rails-ui.el (rails-minor-mode-prefix-key): created
(rails-key): created

* predictive-prog-mode.el (predictive-prog-text-faces): fixed compilation warning

2007-04-08 Dmitry Galinsky <[email protected]>
Expand Down
4 changes: 3 additions & 1 deletion History
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
SVN
* Fixed bug [#9991]: allow setup key prefix for rails-minor-mode

0.5.99.3
* Added speedbar integration, type [F11] to toogle speedbar
* Fixed #9880: the hotkey "C-c ." conflicted with ECB, changed to "C-c C-c ,"

* New hotkeys, to easy switch without a popup menu between a
controller or a model related files
In model layout:
Expand Down
12 changes: 6 additions & 6 deletions rails-controller-layout.el
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ If the action is nil, return all views for the controller."
rails-controller-layout:switch-to-unit-test
:enable (rails-core:current-mailer))))
(define-keys map
((kbd "\C-c g") 'rails-controller-layout:switch-to-migration)
((kbd "\C-c m") 'rails-controller-layout:switch-to-model)
((kbd "\C-c h") 'rails-controller-layout:switch-to-helper)
((kbd "\C-c f") 'rails-controller-layout:switch-to-functional-test)
((kbd "\C-c c") 'rails-controller-layout:switch-to-controller)
((kbd "\C-c u") 'rails-controller-layout:switch-to-unit-test)
((rails-key "g") 'rails-controller-layout:switch-to-migration)
((rails-key "m") 'rails-controller-layout:switch-to-model)
((rails-key "h") 'rails-controller-layout:switch-to-helper)
((rails-key "f") 'rails-controller-layout:switch-to-functional-test)
((rails-key "c") 'rails-controller-layout:switch-to-controller)
((rails-key "u") 'rails-controller-layout:switch-to-unit-test)
([menu-bar rails-controller-layout] (cons name menu))))
map))

Expand Down
12 changes: 6 additions & 6 deletions rails-model-layout.el
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
rails-model-layout:switch-to-mailer
:enable (rails-core:mailer-exist-p (rails-core:current-mailer)))))
(define-keys map
((kbd "\C-c m") 'rails-model-layout:switch-to-model)
((kbd "\C-c u") 'rails-model-layout:switch-to-unit-test)
((kbd "\C-c g") 'rails-model-layout:switch-to-migration)
((kbd "\C-c c") 'rails-model-layout:switch-to-controller)
((kbd "\C-c x") 'rails-model-layout:switch-to-fixture)
((kbd "\C-c n") 'rails-model-layout:switch-to-mailer)
((rails-key "m") 'rails-model-layout:switch-to-model)
((rails-key "u") 'rails-model-layout:switch-to-unit-test)
((rails-key "g") 'rails-model-layout:switch-to-migration)
((rails-key "c") 'rails-model-layout:switch-to-controller)
((rails-key "x") 'rails-model-layout:switch-to-fixture)
((rails-key "n") 'rails-model-layout:switch-to-mailer)
([menu-bar rails-model-layout] (cons name menu))))
map))

Expand Down
2 changes: 1 addition & 1 deletion rails-ruby.el
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ See the variable `align-rules-list' for more details.")
(setq flymake-err-line-patterns
(cons flymake-ruby-error-line-pattern-regexp flymake-err-line-patterns))
(flymake-mode t)
(local-set-key (kbd "\C-c d") 'flymake-display-err-menu-for-current-line)))
(local-set-key (rails-key "d") 'flymake-display-err-menu-for-current-line)))

(add-hook 'ruby-mode-hook 'flymake-ruby-load)

Expand Down
117 changes: 63 additions & 54 deletions rails-ui.el
Original file line number Diff line number Diff line change
Expand Up @@ -194,92 +194,101 @@
([rails ws default] '(menu-item "Start/Stop Web Server (With Default Environment)" rails-ws:toggle-start-stop))
)

(defconst rails-minor-mode-test-current-method-key (kbd "\C-c \C-c ,"))
(defcustom rails-minor-mode-prefix-key "\C-c"
"Key prefix for rails minor mode."
:group 'rails)

(defvar rails-minor-mode-map (make-sparse-keymap))
(defmacro rails-key (key)
`(kbd ,(concat rails-minor-mode-prefix-key " " key)))

(defconst rails-minor-mode-test-current-method-key (rails-key "\C-c ,"))

(defvar rails-minor-mode-map
(let ((map (make-keymap)))
map))

(define-keys rails-minor-mode-map
([menu-bar] rails-minor-mode-menu-bar-map)
([menu-bar rails-tests] (cons "Tests" rails-minor-mode-tests-menu-bar-map))
([menu-bar rails-db] (cons "Database" rails-minor-mode-db-menu-bar-map))

;; Goto
((kbd "\C-c \C-c g m") 'rails-nav:goto-models)
((kbd "\C-c \C-c g c") 'rails-nav:goto-controllers)
((kbd "\C-c \C-c g o") 'rails-nav:goto-observers)
((kbd "\C-c \C-c g n") 'rails-nav:goto-mailers)
((kbd "\C-c \C-c g h") 'rails-nav:goto-helpers)
((kbd "\C-c \C-c g l") 'rails-nav:goto-layouts)
((kbd "\C-c \C-c g s") 'rails-nav:goto-stylesheets)
((kbd "\C-c \C-c g j") 'rails-nav:goto-javascripts)
((kbd "\C-c \C-c g g") 'rails-nav:goto-migrate)
((kbd "\C-c \C-c g p") 'rails-nav:goto-plugins)
((kbd "\C-c \C-c g x") 'rails-nav:goto-fixtures)
((kbd "\C-c \C-c g f") 'rails-nav:goto-functional-tests)
((kbd "\C-c \C-c g u") 'rails-nav:goto-unit-tests)
((rails-key "\C-c g m") 'rails-nav:goto-models)
((rails-key "\C-c g c") 'rails-nav:goto-controllers)
((rails-key "\C-c g o") 'rails-nav:goto-observers)
((rails-key "\C-c g n") 'rails-nav:goto-mailers)
((rails-key "\C-c g h") 'rails-nav:goto-helpers)
((rails-key "\C-c g l") 'rails-nav:goto-layouts)
((rails-key "\C-c g s") 'rails-nav:goto-stylesheets)
((rails-key "\C-c g j") 'rails-nav:goto-javascripts)
((rails-key "\C-c g g") 'rails-nav:goto-migrate)
((rails-key "\C-c g p") 'rails-nav:goto-plugins)
((rails-key "\C-c g x") 'rails-nav:goto-fixtures)
((rails-key "\C-c g f") 'rails-nav:goto-functional-tests)
((rails-key "\C-c g u") 'rails-nav:goto-unit-tests)

;; Switch
((kbd "<M-S-up>") 'rails-lib:run-primary-switch)
((kbd "<M-S-down>") 'rails-lib:run-secondary-switch)
((kbd "\C-c <up>") 'rails-lib:run-primary-switch)
((kbd "\C-c <down>") 'rails-lib:run-secondary-switch)
((rails-key "<up>") 'rails-lib:run-primary-switch)
((rails-key "<down>") 'rails-lib:run-secondary-switch)
((kbd "<C-return>") 'rails-goto-file-on-current-line)

;; Scripts & SQL
((kbd "\C-c \C-c e") 'rails-script:generate)
((kbd "\C-c \C-c x") 'rails-script:destroy)
((kbd "\C-c \C-c s c") 'rails-script:console)
((kbd "\C-c \C-c s b") 'rails-script:breakpointer)
((kbd "\C-c \C-c s s") 'rails-run-sql)
((kbd "\C-c \C-c w s") 'rails-ws:toggle-start-stop)
((kbd "\C-c \C-c w d") 'rails-ws:start-development)
((kbd "\C-c \C-c w p") 'rails-ws:start-production)
((kbd "\C-c \C-c w t") 'rails-ws:start-test)
((kbd "\C-c \C-c w i") 'rails-ws:print-status)
((kbd "\C-c \C-c w a") 'rails-ws:auto-open-browser)
((rails-key "\C-c e") 'rails-script:generate)
((rails-key "\C-c x") 'rails-script:destroy)
((rails-key "\C-c s c") 'rails-script:console)
((rails-key "\C-c s b") 'rails-script:breakpointer)
((rails-key "\C-c s s") 'rails-run-sql)
((rails-key "\C-c w s") 'rails-ws:toggle-start-stop)
((rails-key "\C-c w d") 'rails-ws:start-development)
((rails-key "\C-c w p") 'rails-ws:start-production)
((rails-key "\C-c w t") 'rails-ws:start-test)
((rails-key "\C-c w i") 'rails-ws:print-status)
((rails-key "\C-c w a") 'rails-ws:auto-open-browser)

;; Rails finds
((kbd "\C-c \C-c f m") 'rails-find:models)
((kbd "\C-c \C-c f c") 'rails-find:controller)
((kbd "\C-c \C-c f h") 'rails-find:helpers)
((kbd "\C-c \C-c f l") 'rails-find:layout)
((kbd "\C-c \C-c f s") 'rails-find:stylesheets)
((kbd "\C-c \C-c f j") 'rails-find:javascripts)
((kbd "\C-c \C-c f g") 'rails-find:migrate)
((kbd "\C-c \C-c f b") 'rails-find:lib)
((kbd "\C-c \C-c f t") 'rails-find:tasks)
((kbd "\C-c \C-c f v") 'rails-find:view)
((kbd "\C-c \C-c f d") 'rails-find:db)
((kbd "\C-c \C-c f p") 'rails-find:public)
((kbd "\C-c \C-c f f") 'rails-find:fixtures)
((kbd "\C-c \C-c f o") 'rails-find:config)

((kbd "\C-c \C-c d m") 'rails-rake:migrate)
((kbd "\C-c \C-c d v") 'rails-rake:migrate-to-version)
((kbd "\C-c \C-c d p") 'rails-rake:migrate-to-prev-version)
((rails-key "\C-c f m") 'rails-find:models)
((rails-key "\C-c f c") 'rails-find:controller)
((rails-key "\C-c f h") 'rails-find:helpers)
((rails-key "\C-c f l") 'rails-find:layout)
((rails-key "\C-c f s") 'rails-find:stylesheets)
((rails-key "\C-c f j") 'rails-find:javascripts)
((rails-key "\C-c f g") 'rails-find:migrate)
((rails-key "\C-c f b") 'rails-find:lib)
((rails-key "\C-c f t") 'rails-find:tasks)
((rails-key "\C-c f v") 'rails-find:view)
((rails-key "\C-c f d") 'rails-find:db)
((rails-key "\C-c f p") 'rails-find:public)
((rails-key "\C-c f f") 'rails-find:fixtures)
((rails-key "\C-c f o") 'rails-find:config)

((rails-key "\C-c d m") 'rails-rake:migrate)
((rails-key "\C-c d v") 'rails-rake:migrate-to-version)
((rails-key "\C-c d p") 'rails-rake:migrate-to-prev-version)

;; Tests
((kbd "\C-c \C-c r") 'rails-rake:task)
((kbd "\C-c \C-c t") 'rails-test:run)
((kbd "\C-c \C-c .") 'rails-test:run-current)
((rails-key "\C-c r") 'rails-rake:task)
((rails-key "\C-c t") 'rails-test:run)
((rails-key "\C-c .") 'rails-test:run-current)

;; Navigation

((kbd "\C-c \C-c l") 'rails-log:open)
((rails-key "\C-c l") 'rails-log:open)
;; Tags
((kbd "\C-c \C-c \C-t") 'rails-create-tags)
((rails-key "\C-c \C-t") 'rails-create-tags)

;; Documentation
([f1] 'rails-search-doc)
((kbd "<C-f1>") 'rails-browse-api-at-point)
((kbd "\C-c <f1>") 'rails-browse-api)
((kbd "\C-c /") 'rails-script:toggle-output-window)
((rails-key "<f1>") 'rails-browse-api)
((rails-key "/") 'rails-script:toggle-output-window)

([f9] 'rails-svn-status-into-root))

;; Global keys and menubar

(global-set-key (kbd "\C-c \C-c j") 'rails-script:create-project)
(global-set-key (rails-key "\C-c j") 'rails-script:create-project)

(when-bind (map (lookup-key global-map [menu-bar file]))
(define-key-after
Expand Down
8 changes: 4 additions & 4 deletions rails-view-minor-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@
(setq rails-secondary-switch-func 'rails-controller-layout:menu)
(if (boundp 'mmm-mode-map)
(progn
(define-key mmm-mode-map (kbd "\C-c p") 'rails-view-minor-mode:create-partial-from-selection)
(define-key mmm-mode-map (kbd "\C-c b") 'rails-view-minor-mode:create-helper-from-block))
(define-key mmm-mode-map (rails-key "p") 'rails-view-minor-mode:create-partial-from-selection)
(define-key mmm-mode-map (rails-key "b") 'rails-view-minor-mode:create-helper-from-block))
(progn
(local-set-key (kbd "\C-c p") 'rails-view-minor-mode:create-partial-from-selection)
(local-set-key (kbd "\C-c b") 'rails-view-minor-mode:create-helper-from-block))))
(local-set-key (rails-key "p") 'rails-view-minor-mode:create-partial-from-selection)
(local-set-key (rails-key "b") 'rails-view-minor-mode:create-helper-from-block))))

(provide 'rails-view-minor-mode)
6 changes: 3 additions & 3 deletions rails.el
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ necessary."
(local-set-key (if rails-use-another-define-key
(kbd "TAB") (kbd "<tab>"))
'indent-or-complete)
(local-set-key (kbd "C-c f") '(lambda()
(interactive)
(mouse-major-mode-menu (rails-core:menu-position))))
(local-set-key (rails-key "f") '(lambda()
(interactive)
(mouse-major-mode-menu (rails-core:menu-position))))
(local-set-key (kbd "C-:") 'ruby-toggle-string<>simbol)
(local-set-key (if rails-use-another-define-key
(kbd "RET") (kbd "<return>"))
Expand Down

0 comments on commit c9c3439

Please sign in to comment.