emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* ECB and org-mode
@ 2009-10-12 12:32 Eric S Fraga
  2009-10-12 13:06 ` Carsten Dominik
  0 siblings, 1 reply; 15+ messages in thread
From: Eric S Fraga @ 2009-10-12 12:32 UTC (permalink / raw)
  To: emacs-orgmode

Hello!

I use ECB-mode when programming, especially for Java.  Although I used
to have ECB activate and deactivate automatically when entering and
leaving programing language modes, I found it annoying.  I now simply
keep ECB active when I'm programming.  As a result, I noticed that
org-mode is supported quite nicely by ECB (or vice versa depending on
your point of view ;-).  Highly complementary, actually, as it allows
me to have an overview visible at all times regardless of the
expansion of the org-mode file.

There is one minor niggle, however: when I use the "method" view in
ECB to jump to a different location in my org-mode files, the location
is not made visible as it is when you jump into an org-mode file via
other means.  I note that the variable org-show-hierarchy-above has a
number of options covered but not ECB.  Is there a more general way of
having org-mode show where I am when I've jumped into the middle of a
collapsed section?

Thanks,
eric

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-12 12:32 ECB and org-mode Eric S Fraga
@ 2009-10-12 13:06 ` Carsten Dominik
  2009-10-12 15:31   ` Eric S Fraga
  0 siblings, 1 reply; 15+ messages in thread
From: Carsten Dominik @ 2009-10-12 13:06 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode

Hi Eric,

you would have to find out which function is the one doing the jumping  
to the
method.  With some luck there will be a hook called after jumping  
somewhere.  With no luck, one can still advise this function.  A good  
function to call for this is org-bookmark-jump-unhide.

HTH

- Carsten

On Oct 12, 2009, at 2:32 PM, Eric S Fraga wrote:

> Hello!
>
> I use ECB-mode when programming, especially for Java.  Although I used
> to have ECB activate and deactivate automatically when entering and
> leaving programing language modes, I found it annoying.  I now simply
> keep ECB active when I'm programming.  As a result, I noticed that
> org-mode is supported quite nicely by ECB (or vice versa depending on
> your point of view ;-).  Highly complementary, actually, as it allows
> me to have an overview visible at all times regardless of the
> expansion of the org-mode file.
>
> There is one minor niggle, however: when I use the "method" view in
> ECB to jump to a different location in my org-mode files, the location
> is not made visible as it is when you jump into an org-mode file via
> other means.  I note that the variable org-show-hierarchy-above has a
> number of options covered but not ECB.  Is there a more general way of
> having org-mode show where I am when I've jumped into the middle of a
> collapsed section?
>
> Thanks,
> eric
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-12 13:06 ` Carsten Dominik
@ 2009-10-12 15:31   ` Eric S Fraga
  2009-10-13  8:00     ` Carsten Dominik
  0 siblings, 1 reply; 15+ messages in thread
From: Eric S Fraga @ 2009-10-12 15:31 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

At Mon, 12 Oct 2009 15:06:24 +0200,
Carsten Dominik wrote:
> 
> Hi Eric,
> 
> you would have to find out which function is the one doing the jumping
> to the
> method.  With some luck there will be a hook called after jumping
> somewhere.  With no luck, one can still advise this function.  A good
> function to call for this is org-bookmark-jump-unhide.

Thanks for the pointer.  The method, in ecb, is tree-buffer-select
which is part of tree-buffer.  I'm still tracing the code but I should
have enough to do what you suggest, especially through advise (there's
no hook that I can see unfortunately).

Thanks again,
eric

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-12 15:31   ` Eric S Fraga
@ 2009-10-13  8:00     ` Carsten Dominik
  2009-10-13 19:07       ` Eric S Fraga
  2009-10-14 17:18       ` Eric S Fraga, Eric S Fraga
  0 siblings, 2 replies; 15+ messages in thread
From: Carsten Dominik @ 2009-10-13  8:00 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode


On Oct 12, 2009, at 5:31 PM, Eric S Fraga wrote:

> At Mon, 12 Oct 2009 15:06:24 +0200,
> Carsten Dominik wrote:
>>
>> Hi Eric,
>>
>> you would have to find out which function is the one doing the  
>> jumping
>> to the
>> method.  With some luck there will be a hook called after jumping
>> somewhere.  With no luck, one can still advise this function.  A good
>> function to call for this is org-bookmark-jump-unhide.
>
> Thanks for the pointer.  The method, in ecb, is tree-buffer-select
> which is part of tree-buffer.  I'm still tracing the code but I should
> have enough to do what you suggest, especially through advise (there's
> no hook that I can see unfortunately).

If you find a solution, please post, maybe I can install it in org.el,
using eval-after-load (I'm doing this already for a couple
of other packages that let you jump right in the middle of an Org file).

- Carsten

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-13  8:00     ` Carsten Dominik
@ 2009-10-13 19:07       ` Eric S Fraga
  2009-10-14 17:18       ` Eric S Fraga, Eric S Fraga
  1 sibling, 0 replies; 15+ messages in thread
From: Eric S Fraga @ 2009-10-13 19:07 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

At Tue, 13 Oct 2009 10:00:29 +0200,
Carsten Dominik wrote:
> 
> 
> On Oct 12, 2009, at 5:31 PM, Eric S Fraga wrote:
> 
> > At Mon, 12 Oct 2009 15:06:24 +0200,
> > Carsten Dominik wrote:
> >>
> >> Hi Eric,
> >>
> >> you would have to find out which function is the one doing the
> >> jumping
> >> to the
> >> method.  With some luck there will be a hook called after jumping
> >> somewhere.  With no luck, one can still advise this function.  A good
> >> function to call for this is org-bookmark-jump-unhide.
> >
> > Thanks for the pointer.  The method, in ecb, is tree-buffer-select
> > which is part of tree-buffer.  I'm still tracing the code but I should
> > have enough to do what you suggest, especially through advise (there's
> > no hook that I can see unfortunately).
> 
> If you find a solution, please post, maybe I can install it in org.el,
> using eval-after-load (I'm doing this already for a couple
> of other packages that let you jump right in the middle of an Org file).
> 
> - Carsten

I will do so.  I've been distracted by work :( but will return to this
when I get a chance!

thanks,
eric

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-13  8:00     ` Carsten Dominik
  2009-10-13 19:07       ` Eric S Fraga
@ 2009-10-14 17:18       ` Eric S Fraga, Eric S Fraga
  2009-10-14 17:57         ` Tassilo Horn
  2009-10-20 10:28         ` Carsten Dominik
  1 sibling, 2 replies; 15+ messages in thread
From: Eric S Fraga, Eric S Fraga @ 2009-10-14 17:18 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

At Tue, 13 Oct 2009 10:00:29 +0200, Carsten Dominik wrote:
> 
> [snipped: messages regarding jumping into org file from ECB tree buffer and
>  having the hierarchy displayed]
> 
> If you find a solution, please post, maybe I can install it in org.el,
> using eval-after-load (I'm doing this already for a couple
> of other packages that let you jump right in the middle of an Org file).

Carsten,

The following seems to work:

--8<---------------cut here---------------start------------->8---
(defadvice ecb-method-clicked (after esf/org-show-context)
  "Make sure hierarchy is visible when jumping into location from ECB tree buffer"
  (if (string= major-mode "org-mode")
      (org-show-context)
    )
  )
--8<---------------cut here---------------end--------------->8---

I have tested this but not exhaustively and so maybe it depends on
some of my specific org-mode settings.  I don't know if anybody else
uses ECB extensively but, if so, it would be great if they tried it.
I don't specifically (require 'ecb) anywhere so I don't think this is
required; I am, however, using emacs 23.1.  

Again, apologies for my minimal (yet increasing) elisp knowledge!

You're welcome to use this in any way you wish (and, before you ask
(;-), I am still awaiting a response from the FSF re: copyright
assignment as I posted the signed page several weeks ago now).

On a related note, I have not managed to figure out why the ECB tree
buffer shows only up to two levels of the org-mode heading hierarchy.
Ideally, I would like it to show all levels.  Is there a variable in
org-mode that may be affecting this?

Thanks,
eric

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-14 17:18       ` Eric S Fraga, Eric S Fraga
@ 2009-10-14 17:57         ` Tassilo Horn
  2009-10-15  6:52           ` Eric S Fraga, Eric S Fraga
  2009-10-20 10:28         ` Carsten Dominik
  1 sibling, 1 reply; 15+ messages in thread
From: Tassilo Horn @ 2009-10-14 17:57 UTC (permalink / raw)
  To: emacs-orgmode

Eric S Fraga <ucecesf@ucl.ac.uk> writes:

Hi Eric,

> (defadvice ecb-method-clicked (after esf/org-show-context)
>   "Make sure hierarchy is visible when jumping into location from ECB tree buffer"
>   (if (string= major-mode "org-mode")

Here, you want (eq major-mode 'org-mode).  Your version also works, but
only because string= converts symbols to their string name, and the
value of `major-mode' is a symbol.  The `eq' version is more efficient,
but mostly it's for style reasons.

> Again, apologies for my minimal (yet increasing) elisp knowledge!

Hey, it works!  What do you want more? ;-)

Bye,
Tassilo

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Re: ECB and org-mode
  2009-10-14 17:57         ` Tassilo Horn
@ 2009-10-15  6:52           ` Eric S Fraga, Eric S Fraga
  0 siblings, 0 replies; 15+ messages in thread
From: Eric S Fraga, Eric S Fraga @ 2009-10-15  6:52 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-orgmode

At Wed, 14 Oct 2009 19:57:42 +0200, Tassilo Horn wrote:
> Eric S Fraga <ucecesf@ucl.ac.uk> writes:
> >   (if (string= major-mode "org-mode")
> 
> Here, you want (eq major-mode 'org-mode).  Your version also works, but

Makes sense!  D'uh.  Of course there is a way of comparing modes.
This is *emacs*, after all!

[...]

> > Again, apologies for my minimal (yet increasing) elisp knowledge!
> 
> Hey, it works!  What do you want more? ;-)

I've learned even more today!  My knowledge of elisp may not be
increasingly exponentially but it is at least monotonic in the right
direction ;-).  I could ask for nothing more.

Thanks,
eric

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-14 17:18       ` Eric S Fraga, Eric S Fraga
  2009-10-14 17:57         ` Tassilo Horn
@ 2009-10-20 10:28         ` Carsten Dominik
  2009-10-20 16:11           ` Eric S Fraga
  1 sibling, 1 reply; 15+ messages in thread
From: Carsten Dominik @ 2009-10-20 10:28 UTC (permalink / raw)
  To: e.fraga; +Cc: emacs-orgmode

Hi Eric,

I have added this code to org.el, please verify that it works because  
I have wrapped
it into eval-after-load.

Thanks!

- Carsten

On Oct 14, 2009, at 7:18 PM, Eric S Fraga wrote:

> At Tue, 13 Oct 2009 10:00:29 +0200, Carsten Dominik wrote:
>>
>> [snipped: messages regarding jumping into org file from ECB tree  
>> buffer and
>> having the hierarchy displayed]
>>
>> If you find a solution, please post, maybe I can install it in  
>> org.el,
>> using eval-after-load (I'm doing this already for a couple
>> of other packages that let you jump right in the middle of an Org  
>> file).
>
> Carsten,
>
> The following seems to work:
>
> --8<---------------cut here---------------start------------->8---
> (defadvice ecb-method-clicked (after esf/org-show-context)
>  "Make sure hierarchy is visible when jumping into location from ECB  
> tree buffer"
>  (if (string= major-mode "org-mode")
>      (org-show-context)
>    )
>  )
> --8<---------------cut here---------------end--------------->8---
>
> I have tested this but not exhaustively and so maybe it depends on
> some of my specific org-mode settings.  I don't know if anybody else
> uses ECB extensively but, if so, it would be great if they tried it.
> I don't specifically (require 'ecb) anywhere so I don't think this is
> required; I am, however, using emacs 23.1.
>
> Again, apologies for my minimal (yet increasing) elisp knowledge!
>
> You're welcome to use this in any way you wish (and, before you ask
> (;-), I am still awaiting a response from the FSF re: copyright
> assignment as I posted the signed page several weeks ago now).
>
> On a related note, I have not managed to figure out why the ECB tree
> buffer shows only up to two levels of the org-mode heading hierarchy.
> Ideally, I would like it to show all levels.  Is there a variable in
> org-mode that may be affecting this?
>
> Thanks,
> eric

- Carsten

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-20 10:28         ` Carsten Dominik
@ 2009-10-20 16:11           ` Eric S Fraga
  2009-10-20 16:14             ` Carsten Dominik
  2009-10-20 16:22             ` Carsten Dominik
  0 siblings, 2 replies; 15+ messages in thread
From: Eric S Fraga @ 2009-10-20 16:11 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

At Tue, 20 Oct 2009 12:28:44 +0200,
Carsten Dominik wrote:
> 
> Hi Eric,
> 
> I have added this code to org.el, please verify that it works because
> I have wrapped
> it into eval-after-load.
> 
> Thanks!
> 
> - Carsten

Sorry Carsten but this doesn't seem to work for me.  I am not sure if
things are being loaded in the wrong order or not.  I have tried with
emacs -q and then loaded org-mode and it still doesn't work.

Version information:

Org-mode version 6.31trans (release_6.31.131.g37a7)
GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) of 2009-09-14 on raven, modified by Debian

I am happy to try anything you'd like me to, of course.  If I execute
the defadvice directly, everything works just fine.

Thanks,
eric

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-20 16:11           ` Eric S Fraga
@ 2009-10-20 16:14             ` Carsten Dominik
  2009-10-20 16:24               ` Eric S Fraga
  2009-10-20 16:22             ` Carsten Dominik
  1 sibling, 1 reply; 15+ messages in thread
From: Carsten Dominik @ 2009-10-20 16:14 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode


On Oct 20, 2009, at 6:11 PM, Eric S Fraga wrote:

> At Tue, 20 Oct 2009 12:28:44 +0200,
> Carsten Dominik wrote:
>>
>> Hi Eric,
>>
>> I have added this code to org.el, please verify that it works because
>> I have wrapped
>> it into eval-after-load.
>>
>> Thanks!
>>
>> - Carsten
>
> Sorry Carsten but this doesn't seem to work for me.  I am not sure if
> things are being loaded in the wrong order or not.  I have tried with
> emacs -q and then loaded org-mode and it still doesn't work.
>
> Version information:
>
> Org-mode version 6.31trans (release_6.31.131.g37a7)
> GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) of  
> 2009-09-14 on raven, modified by Debian
>
> I am happy to try anything you'd like me to, of course.  If I execute
> the defadvice directly, everything works just fine.

Ahm, I never use ecb.  Is there actually a file ecb.el?  Even better:   
What is the name of the file that contains the definition of the  
function you re trying to advise?

The reason why I want to delay this until needed is because I want to  
avoid having to load the entire advice package before it is actually  
used.

- Carsten

>
> Thanks,
> eric

- Carsten

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-20 16:11           ` Eric S Fraga
  2009-10-20 16:14             ` Carsten Dominik
@ 2009-10-20 16:22             ` Carsten Dominik
  2009-10-20 16:29               ` Eric S Fraga
  1 sibling, 1 reply; 15+ messages in thread
From: Carsten Dominik @ 2009-10-20 16:22 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode


On Oct 20, 2009, at 6:11 PM, Eric S Fraga wrote:

> At Tue, 20 Oct 2009 12:28:44 +0200,
> Carsten Dominik wrote:
>>
>> Hi Eric,
>>
>> I have added this code to org.el, please verify that it works because
>> I have wrapped
>> it into eval-after-load.
>>
>> Thanks!
>>
>> - Carsten
>
> Sorry Carsten but this doesn't seem to work for me.  I am not sure if
> things are being loaded in the wrong order or not.  I have tried with
> emacs -q and then loaded org-mode and it still doesn't work.
>
> Version information:
>
> Org-mode version 6.31trans (release_6.31.131.g37a7)
> GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) of  
> 2009-09-14 on raven, modified by Debian
>
> I am happy to try anything you'd like me to, of course.  If I execute
> the defadvice directly, everything works just fine.

I think now I just forgot the activate switch.  Could you please try  
again?
Thanks.

- Carsten

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-20 16:14             ` Carsten Dominik
@ 2009-10-20 16:24               ` Eric S Fraga
  0 siblings, 0 replies; 15+ messages in thread
From: Eric S Fraga @ 2009-10-20 16:24 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

At Tue, 20 Oct 2009 18:14:32 +0200,
Carsten Dominik wrote:
> On Oct 20, 2009, at 6:11 PM, Eric S Fraga wrote:

[...]

> > Sorry Carsten but this doesn't seem to work for me.  I am not sure if
> > things are being loaded in the wrong order or not.  I have tried with
> > emacs -q and then loaded org-mode and it still doesn't work.
> >

[...]

> 
> Ahm, I never use ecb.  Is there actually a file ecb.el?  Even better:
> What is the name of the file that contains the definition of the
> function you re trying to advise?

The method, ecb-method-clicked, can be found in ecb-method-browser.el,
at least on my system.  This is loaded by ecb.el through a require
statement.

> The reason why I want to delay this until needed is because I want to
> avoid having to load the entire advice package before it is actually
> used.

Understood!  And a welcome approach given my use of org-mode on very
slow computers!

HTH!

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-20 16:22             ` Carsten Dominik
@ 2009-10-20 16:29               ` Eric S Fraga
  2009-10-20 16:34                 ` Carsten Dominik
  0 siblings, 1 reply; 15+ messages in thread
From: Eric S Fraga @ 2009-10-20 16:29 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

At Tue, 20 Oct 2009 18:22:34 +0200,
Carsten Dominik wrote:

[...]

> 
> I think now I just forgot the activate switch.  Could you please try
> again?

Ah ha!  That did it.  Works just fine now.

I am not sure I entirely understand what you did (adding the
"activate" bit to the definition) but that's a bit of homework for me
in my eternal quest to understand elisp better... :-)

Thanks again,
eric

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ECB and org-mode
  2009-10-20 16:29               ` Eric S Fraga
@ 2009-10-20 16:34                 ` Carsten Dominik
  0 siblings, 0 replies; 15+ messages in thread
From: Carsten Dominik @ 2009-10-20 16:34 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode


On Oct 20, 2009, at 6:29 PM, Eric S Fraga wrote:

> At Tue, 20 Oct 2009 18:22:34 +0200,
> Carsten Dominik wrote:
>
> [...]
>
>>
>> I think now I just forgot the activate switch.  Could you please try
>> again?
>
> Ah ha!  That did it.  Works just fine now.
>
> I am not sure I entirely understand what you did (adding the
> "activate" bit to the definition) but that's a bit of homework for me
> in my eternal quest to understand elisp better... :-)

I think, if I define he advice after the function has been loaded,  
activate is needed.  Maybe if you, as did you, define the advice  
before the function is loaded, activation is automatic.

- Carsten

>
> Thanks again,
> eric

- Carsten

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-10-20 16:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-12 12:32 ECB and org-mode Eric S Fraga
2009-10-12 13:06 ` Carsten Dominik
2009-10-12 15:31   ` Eric S Fraga
2009-10-13  8:00     ` Carsten Dominik
2009-10-13 19:07       ` Eric S Fraga
2009-10-14 17:18       ` Eric S Fraga, Eric S Fraga
2009-10-14 17:57         ` Tassilo Horn
2009-10-15  6:52           ` Eric S Fraga, Eric S Fraga
2009-10-20 10:28         ` Carsten Dominik
2009-10-20 16:11           ` Eric S Fraga
2009-10-20 16:14             ` Carsten Dominik
2009-10-20 16:24               ` Eric S Fraga
2009-10-20 16:22             ` Carsten Dominik
2009-10-20 16:29               ` Eric S Fraga
2009-10-20 16:34                 ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).