summaryrefslogtreecommitdiff
path: root/lisp/cedet/srecode/mode.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2010-09-23 15:00:31 -0400
committerChong Yidong <cyd@stupidchicken.com>2010-09-23 15:00:31 -0400
commit266a86bd7fedf743225c2497956b73ecb2245196 (patch)
tree7d0c8b128070eac293ce2606acb4e55de5843ba8 /lisp/cedet/srecode/mode.el
parent29cdc13ed61e5a64ba30df1030029898a26b7947 (diff)
parentaf3ccb5cc061bccab1c9b024ea444d01c0767767 (diff)
downloademacs-266a86bd7fedf743225c2497956b73ecb2245196.tar.gz
Merge changes from emacs-23 branch
Diffstat (limited to 'lisp/cedet/srecode/mode.el')
-rw-r--r--lisp/cedet/srecode/mode.el84
1 files changed, 46 insertions, 38 deletions
diff --git a/lisp/cedet/srecode/mode.el b/lisp/cedet/srecode/mode.el
index f1590ed5ec0..32bf665d06c 100644
--- a/lisp/cedet/srecode/mode.el
+++ b/lisp/cedet/srecode/mode.el
@@ -112,7 +112,13 @@
["Dump Dictionary"
srecode-dictionary-dump
:active t
- :help "Calculate a dump a dictionary for point."
+ :help "Calculate and dump a dictionary for point."
+ ])
+ (semantic-menu-item
+ ["Show Macro Help"
+ srecode-macro-help
+ :active t
+ :help "Display the different types of macros available."
])
)
)
@@ -196,43 +202,44 @@ MENU-DEF is the menu to bind this into."
(setq context (car-safe (srecode-calculate-context)))
(while subtab
- (setq ltab (oref (car subtab) templates))
- (while ltab
- (setq temp (car ltab))
-
- ;; Do something with this template.
-
- (let* ((ctxt (oref temp context))
- (ctxtcons (assoc ctxt alltabs))
- (bind (if (slot-boundp temp 'binding)
- (oref temp binding)))
- (name (object-name-string temp)))
-
- (when (not ctxtcons)
- (if (string= context ctxt)
- ;; If this context is not in the current list of contexts
- ;; is equal to the current context, then manage the
- ;; active list instead
- (setq active
- (setq ctxtcons (or active (cons ctxt nil))))
- ;; This is not an active context, add it to alltabs.
- (setq ctxtcons (cons ctxt nil))
- (setq alltabs (cons ctxtcons alltabs))))
-
- (let ((new (vector
- (if bind
- (concat name " (" bind ")")
- name)
- `(lambda () (interactive)
- (srecode-insert (concat ,ctxt ":" ,name)))
- t)))
-
- (setcdr ctxtcons (cons
- new
- (cdr ctxtcons)))))
-
- (setq ltab (cdr ltab)))
- (setq subtab (cdr subtab)))
+ (when (srecode-template-table-in-project-p (car subtab))
+ (setq ltab (oref (car subtab) templates))
+ (while ltab
+ (setq temp (car ltab))
+
+ ;; Do something with this template.
+
+ (let* ((ctxt (oref temp context))
+ (ctxtcons (assoc ctxt alltabs))
+ (bind (if (slot-boundp temp 'binding)
+ (oref temp binding)))
+ (name (object-name-string temp)))
+
+ (when (not ctxtcons)
+ (if (string= context ctxt)
+ ;; If this context is not in the current list of contexts
+ ;; is equal to the current context, then manage the
+ ;; active list instead
+ (setq active
+ (setq ctxtcons (or active (cons ctxt nil))))
+ ;; This is not an active context, add it to alltabs.
+ (setq ctxtcons (cons ctxt nil))
+ (setq alltabs (cons ctxtcons alltabs))))
+
+ (let ((new (vector
+ (if bind
+ (concat name " (" bind ")")
+ name)
+ `(lambda () (interactive)
+ (srecode-insert (concat ,ctxt ":" ,name)))
+ t)))
+
+ (setcdr ctxtcons (cons
+ new
+ (cdr ctxtcons)))))
+
+ (setq ltab (cdr ltab))))
+ (setq subtab (cdr subtab)))
;; Now create the menu
(easy-menu-filter-return
@@ -273,6 +280,7 @@ MENU-DEF is the menu to bind this into."
This command will insert whichever srecode template has a binding
to the current key."
(interactive)
+ (srecode-load-tables-for-mode major-mode)
(let* ((k last-command-event)
(ctxt (srecode-calculate-context))
;; Find the template with the binding K