Skip to content
Snippets Groups Projects
Commit d8ac1140 authored by llaffont's avatar llaffont
Browse files

opac3-mode: ajout menu opac dans menu bar

parent 25dcf62c
No related merge requests found
......@@ -179,6 +179,74 @@
)
(defun opac3-init-menu ()
(interactive)
(global-unset-key [menu-bar opac3])
(define-key-after global-map [menu-bar opac3]
(cons "OPAC3" (make-sparse-keymap "opac3"))
'tools )
(define-key global-map [menu-bar opac3 find-tests]
'("Find tests" . opac3-find-tests))
;; PHPUnit sub menus
(define-key global-map [menu-bar opac3 phpunit]
(cons "Run PHPUnit" (make-sparse-keymap "phpunit")))
(define-key global-map [menu-bar opac3 phpunit function]
'("function" . opac3-run-phpunit-filtered-function))
(define-key global-map [menu-bar opac3 phpunit class]
'("class" . opac3-run-phpunit-filtered-class))
(define-key global-map [menu-bar opac3 phpunit file]
'("file" . opac3-run-phpunit-filtered-file))
(define-key global-map [menu-bar opac3 phpunit all]
'("all" . opac3-run-phpunit))
(define-key global-map [menu-bar opac3 phpunit last]
'("last command" . opac3-run-last-phpunit-command))
(define-key global-map [menu-bar opac3 phpunit debug]
'("debug function" . opac3-debug-phpunit-function))
;;Jump to sub menus
;; (define-key global-map [menu-bar opac3 jump]
;; (cons "Jump to" (make-sparse-keymap "jump-to")))
;; (define-key global-map [menu-bar opac3 jump models]
;; (cons "Models" (make-sparse-keymap "models")))
;; (opac3-add-jump-menu (opac3-list-files "library/Class" "php$") '(menu-bar opac3 jump models) 1)
)
;; (defun opac3-add-jump-menu (files keymap index)
;; (if (null files)
;; nil
;; (let
;; ((file (car files)))
;; (define-key global-map (vector 'menu-bar 'opac3 'jump 'models index)
;; (cons file (lambda() (interactive) (switch-to-buffer file)))
;; )
;; (opac3-add-jump-menu (cdr files) keymap (+ 1 index))
;; )
;; )
;; )
;; (defmacro opac3-make-menu-callback (index file)
;; (list 'defun (intern (format "opac3-open-file-%d" index)) ()
;; (list 'interactive)
;; (list (intern switch-to-buffer file)))
;; )
(defun opac3-jump-to()
(interactive)
(funcall (popup-menu* (list
......@@ -195,6 +263,13 @@
)
(defun opac3-list-files (subdir nameregexp)
(let ((directory (concat (opac3-root-dir) subdir)))
(directory-files directory '() nameregexp)
)
)
(defun opac3-jump-to-model()
(interactive)
(opac3-select-file-and-switch "library/Class" ".php$")
......@@ -305,6 +380,7 @@
("\C-cj" . opac3-jump-to))
:after-hook 'opac3-mode-hook)
(provide 'opac3)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment