[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Semantic keys when needed
From: |
Oleksandr Gavenko |
Subject: |
Re: Semantic keys when needed |
Date: |
Fri, 15 Oct 2010 11:19:05 +0300 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4 |
On 12.10.2010 16:32, Andrea Crotti wrote:
First I add some global keys set for semantic but given that is not
supported everywhere now I use
--8<---------------cut here---------------start------------->8---
(defun activate-more-semantic-bindings ()
"add some other nice bindings to modes supported by semantic"
(interactive)
(local-set-key (kbd "M-n") 'senator-next-tag)
(local-set-key (kbd "M-p") 'senator-previous-tag)
(local-set-key [f6] 'senator-fold-tag-toggle)
;; narrows to the actual function or class analyzed
;; C-x n w to widen again
(local-set-key "\C-xnn" 'semantic-narrow-to-tag)
(local-set-key "\M-." 'semantic-complete-jump)
(local-set-key "\M-?" 'semantic-ia-fast-jump))
--8<---------------cut here---------------end--------------->8---
and I activate it only with some modes...
But isn't it possible to activate it WHEN semantic is supported?
"semantic-mode" is nil also when is actually supported (c/python) but I
think there must be a way to see where is supported, any hints?
I hope this help:
(unless (featurep 'cedet)
(when (or (and (= emacs-major-version 23) (= emacs-minor-version 2))
(>= emacs-minor-version 24))
(semantic-mode 1)
))
(when (featurep 'cedet)
(global-set-key (kbd "C-c , .") 'semantic-ia-fast-jump)
(global-set-key (kbd "C-c , d") 'semantic-ia-show-doc)
(global-set-key (kbd "C-c , D") 'semantic-ia-describe-class)
(global-set-key (kbd "C-c , c") 'semantic-ia-complete-symbol-menu)
)