Joel Borggren-Franck | 2 Dec 2009 15:44
Picon
Picon
Favicon

Activating idle-summary for a single major-mode

Hi

I'm trying to activate semantic-idle-summary-mode automatically when
in java-major-mode (and only then). So far I have tried countless
permutations of add-hook (setq vs function, append vs prepend):

;; ;; Activate semantic-idle-summary-mode for Java
;; (defun my-java-mode-hook ()
;;   (semantic-idle-summary-mode 1))

;; (add-hook 'java-mode-hook 'my-java-mode-hook t)

But all I get is this:

File mode specification error: (error "Buffer Test.java was not set up
for parsing")

The funny thing is that I have no problem activating the mode manually
with M-x semantic-idle-summary-mode.

My semantic setup is as follows (and I'm running on cedet-1.0pre6):

;; CEDET/semantic
(load-file "~/lib/elisp/cedet/common/cedet.el")
(semantic-load-enable-minimum-features)
(global-semanticdb-minor-mode 0)
(setq semanticdb-default-save-directory "~/semantic")
(require 'semantic-gcc)

;; Add tags found by sematic to imenu
(Continue reading)

Eric M. Ludlam | 2 Dec 2009 18:42
Gravatar

Re: Activating idle-summary for a single major-mode

Hi,

The problem is that the mode hook is used to setup parsing information, 
and then after that, the parser setup is done in the mode-local-init-hook.

Semantic adds a 'semantic-init-hook' which you can use for when a buffer 
is setup for parsing.  Thus:

(add-hook 'semantic-init-hook
   (lambda () (when (eq major-mode 'my-mode)
                (semantic-idle-summary-mode)))))

should do the trick, where my-mode is java-mode or jdee-mode or some-such.

Eric

Joel Borggren-Franck wrote:
> Hi
> 
> I'm trying to activate semantic-idle-summary-mode automatically when
> in java-major-mode (and only then). So far I have tried countless
> permutations of add-hook (setq vs function, append vs prepend):
> 
> ;; ;; Activate semantic-idle-summary-mode for Java
> ;; (defun my-java-mode-hook ()
> ;;   (semantic-idle-summary-mode 1))
> 
> ;; (add-hook 'java-mode-hook 'my-java-mode-hook t)
> 
> But all I get is this:
(Continue reading)

Joel Borggren-Franck | 2 Dec 2009 20:41
Picon
Picon
Favicon

Re: Activating idle-summary for a single major-mode

On Wed, Dec 2, 2009 at 6:42 PM, Eric M. Ludlam <eric <at> siege-engine.com> wrote:
>
> The problem is that the mode hook is used to setup parsing information, and
> then after that, the parser setup is done in the mode-local-init-hook.
>
> Semantic adds a 'semantic-init-hook' which you can use for when a buffer is
> setup for parsing.  Thus:
>
> (add-hook 'semantic-init-hook
>  (lambda () (when (eq major-mode 'my-mode)
>               (semantic-idle-summary-mode)))))
>
> should do the trick, where my-mode is java-mode or jdee-mode or some-such.
>

Thanks for the fast reply. Unfortunately I'm having trouble making this work.

To rule out interference from my other emacs stuff I tried this:

Start emacs with --no-init and eval (using eval-region):

;; CEDET/semantic
(load-file "~/lib/elisp/cedet/common/cedet.el")
(semantic-load-enable-minimum-features)
(global-semanticdb-minor-mode 0)
(setq semanticdb-default-save-directory "~/semantic")
(require 'semantic-gcc)

;; use semantic for Java
(add-hook 'semantic-init-hook
(Continue reading)

Joel Borggren-Franck | 3 Dec 2009 09:43
Picon
Picon
Favicon

Re: Activating idle-summary for a single major-mode

On Wed, Dec 2, 2009 at 8:41 PM, Joel Borggren-Franck <jbf <at> kth.se> wrote:
>
> ;; use semantic for Java
> (add-hook 'semantic-init-hook
                                                  ^^^

In case someone else stumbles upon this, its semantic-init-hooks (with an s).

This solved the problem.

Thanks for the help!

Best Regards
Joel

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
Kiwon Um | 14 Dec 2009 08:09
Picon

Re: Bug when there are multiple targets

"Eric M. Ludlam" <eric <at> siege-engine.com> writes:

> Hi,
>
> Thanks for the more detailed description of the problem.  I was able
> to reproduce the bug, and I checked in some fixes to EDE to prevent
> the problem.
>
> For files that are shared, the installed pre-processor map will be for
> the "first" target, whatever that is.  If it matters, it could be made
> to ask which project to derive the preprocessor symbols from.
>

Hi,

Thanks for your fixes to the problem. But some semantic related
functions do not seem to work well, specifically the
semantic-ia-fast-jump function I broadly use.

In the mode-line, it shows:

   Primary-only method ede-system-include-path called on something not
an object.

Sincerely,

Kiwon Um

------------------------------------------------------------------------------
Return on Information:
(Continue reading)

Mathieu Suen | 18 Dec 2009 21:34
Picon
Favicon

Semantic parser for pepsi/cola

Hi,

I would like to write a semantic parser for pepsi/cola language:
http://piumarta.com/software/cola/

Where do you suggest me to start for learning the basic, wisent...?
Thanks

	Mth

	

	
		
___________________________________________________________________________ 
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Cedet-devel mailing list
Cedet-devel <at> lists.sourceforge.net
(Continue reading)

Eric M. Ludlam | 19 Dec 2009 03:59
Gravatar

Re: Semantic parser for pepsi/cola

Hi,

There is a manual for writing parsers in wisent in the 
cedet/semantic/doc directory.  Alternately, you could look at one of the 
simpler parsers such as the one in cedet/cogre/dot.wy, or 
cedet/semantic/wisent/wisent-java-tags.wy.

Eric

Mathieu Suen wrote:
> Hi,
> 
> I would like to write a semantic parser for pepsi/cola language:
> http://piumarta.com/software/cola/
> 
> Where do you suggest me to start for learning the basic, wisent...?
> Thanks
> 
>     Mth

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Eric M. Ludlam | 19 Dec 2009 04:00
Gravatar

Re: Bug when there are multiple targets

Hi,

If you run:

M-x toggle-debug-on-error RET

then it should provide more information about what is going in with a 
backtrace buffer.  That will be helpful to figure out what is going on.

Eric

Kiwon Um wrote:
> "Eric M. Ludlam" <eric <at> siege-engine.com> writes:
> 
>> Hi,
>>
>> Thanks for the more detailed description of the problem.  I was able
>> to reproduce the bug, and I checked in some fixes to EDE to prevent
>> the problem.
>>
>> For files that are shared, the installed pre-processor map will be for
>> the "first" target, whatever that is.  If it matters, it could be made
>> to ask which project to derive the preprocessor symbols from.
>>
> 
> Hi,
> 
> Thanks for your fixes to the problem. But some semantic related
> functions do not seem to work well, specifically the
> semantic-ia-fast-jump function I broadly use.
(Continue reading)

Kiwon Um | 19 Dec 2009 04:56
Picon

Re: Bug when there are multiple targets

"Eric M. Ludlam" <eric <at> siege-engine.com> writes:

> Hi,
>
> If you run:
>
> M-x toggle-debug-on-error RET
>
> then it should provide more information about what is going in with a
> backtrace buffer.  That will be helpful to figure out what is going
> on.

Hi,

I post the debugger's error message: 

Debugger entered--Lisp error: (error "Primary-only method ede-system-include-path called on
something not an object")
  signal(error ("Primary-only method ede-system-include-path called on something not an object"))
  error("Primary-only method %s called on something not an object" ede-system-include-path)
  eieio-generic-call-primary-only(ede-system-include-path (([object
ede-proj-target-makefile-program "test" t "test" "" ... nil ... nil nil nil "Makefile" t nil nil ... nil]
[object ede-proj-target-makefile-program "ball" t "ball" "" ... nil ... nil nil nil "Makefile" t nil nil
... nil])))
  ede-system-include-path(([object ede-proj-target-makefile-program "test" t "test" "" ("test.cpp"
"fem_test.cpp" "tetrahedron_test.cpp" "Matrix.cpp" "matrix_test.cpp" "fem_utils.cpp") nil
("fem.hpp" "Matrix.hpp" "TetrahedralMesh.hpp" "Tetrahedron.hpp" "Vector3D.hpp"
"fem_utils.hpp") nil nil nil "Makefile" t nil nil ("boost_unit_test_framework") nil] [object
ede-proj-target-makefile-program "ball" t "ball" "" ("fem.cpp" "Matrix.cpp" "fem_utils.cpp") nil
("Vector2D.hpp" "Vector3D.hpp" "blas_wrapper.h" "pcg_solver.h" "sparse_matrix.h" "util.h"
(Continue reading)

Eric M. Ludlam | 19 Dec 2009 05:22
Gravatar

Re: Bug when there are multiple targets

Thanks.  This made it obvious what is going on.  I have checked in a 
change to Semantic to deal with this case.

The solution is a bit simplistic, in that it just chooses the first 
target.  It may not always be correct, but it should at least do 
something useful.

Eric

Kiwon Um wrote:
> "Eric M. Ludlam" <eric <at> siege-engine.com> writes:
> 
>> Hi,
>>
>> If you run:
>>
>> M-x toggle-debug-on-error RET
>>
>> then it should provide more information about what is going in with a
>> backtrace buffer.  That will be helpful to figure out what is going
>> on.
> 
> Hi,
> 
> I post the debugger's error message: 
> 
> Debugger entered--Lisp error: (error "Primary-only method ede-system-include-path called on
something not an object")
>   signal(error ("Primary-only method ede-system-include-path called on something not an object"))
>   error("Primary-only method %s called on something not an object" ede-system-include-path)
(Continue reading)


Gmane