* Links to C/C++ source code lines
@ 2011-10-13 15:44 Rafal
2011-10-21 17:32 ` Bastien
0 siblings, 1 reply; 5+ messages in thread
From: Rafal @ 2011-10-13 15:44 UTC (permalink / raw)
To: emacs-orgmode
Hi,
I wrote a small hook for creating org-mode links to C/C++ source code lines in
the form of a regexp so the links stay valid even if the source code changes
eg.
a source line
while(ptr < ptr_end)
has a link
file:/home/user/src/example.cpp::/while[ \t]*([ \t]*ptr[ \t]*<[ \t]*ptr_end[ \t]
*)#1/
The number after the hash is a sequence number in case there are more than one
such line
If you are interested: http://rafflo.w.interia.pl/org-c-link.el
regards,
Rafal
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Links to C/C++ source code lines
2011-10-13 15:44 Links to C/C++ source code lines Rafal
@ 2011-10-21 17:32 ` Bastien
2011-10-24 10:46 ` Rafal
0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2011-10-21 17:32 UTC (permalink / raw)
To: Rafal; +Cc: emacs-orgmode
Hi Rafal,
Rafal <rafflo@interia.pl> writes:
> I wrote a small hook for creating org-mode links to C/C++ source code lines in
> the form of a regexp so the links stay valid even if the source code changes
>
> eg.
> a source line
> while(ptr < ptr_end)
> has a link
> file:/home/user/src/example.cpp::/while[ \t]*([ \t]*ptr[ \t]*<[ \t]*ptr_end[ \t]
> *)#1/
>
> The number after the hash is a sequence number in case there are more than one
> such line
>
> If you are interested: http://rafflo.w.interia.pl/org-c-link.el
Looks nice, thanks. Just wondering: are you aware of the "A.3 Adding
hyperlink types" section in the manual? You core uses advice instead
of the `org-add-link-type' function -- is that on purpose?
Thanks!
--
Bastien
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Links to C/C++ source code lines
2011-10-21 17:32 ` Bastien
@ 2011-10-24 10:46 ` Rafal
2011-10-28 15:28 ` Bastien
0 siblings, 1 reply; 5+ messages in thread
From: Rafal @ 2011-10-24 10:46 UTC (permalink / raw)
To: emacs-orgmode
Bastien <bzg <at> altern.org> writes:
>
> Looks nice, thanks. Just wondering: are you aware of the "A.3 Adding
> hyperlink types" section in the manual? You core uses advice instead
> of the `org-add-link-type' function -- is that on purpose?
>
No, I missed that paragraph. That would be a cleaner solution-
I'll take a look at it. Thank for the hint!
regards,
Rafal
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Links to C/C++ source code lines
2011-10-24 10:46 ` Rafal
@ 2011-10-28 15:28 ` Bastien
2011-10-29 14:36 ` Rafal
0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2011-10-28 15:28 UTC (permalink / raw)
To: Rafal; +Cc: emacs-orgmode
Hi Rafal,
Rafal <rafflo@interia.pl> writes:
> Bastien <bzg <at> altern.org> writes:
>
>> Looks nice, thanks. Just wondering: are you aware of the "A.3 Adding
>> hyperlink types" section in the manual? You core uses advice instead
>> of the `org-add-link-type' function -- is that on purpose?
>
> No, I missed that paragraph. That would be a cleaner solution-
> I'll take a look at it. Thank for the hint!
Great -- let us know if you come up with an updated version of
your tool!
Regards,
--
Bastien
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Links to C/C++ source code lines
2011-10-28 15:28 ` Bastien
@ 2011-10-29 14:36 ` Rafal
0 siblings, 0 replies; 5+ messages in thread
From: Rafal @ 2011-10-29 14:36 UTC (permalink / raw)
To: emacs-orgmode
Bastien <bzg <at> altern.org> writes:
> >
> >> Looks nice, thanks. Just wondering: are you aware of the "A.3 Adding
> >> hyperlink types" section in the manual? You core uses advice instead
> >> of the `org-add-link-type' function -- is that on purpose?
> >
> > No, I missed that paragraph. That would be a cleaner solution-
> > I'll take a look at it. Thank for the hint!
>
I updated the code to get rid of the advice. I didn't introduce any new link
type so didn't use the `org-add-link-type'. Instead I used the
`org-store-link-functions' hook in place of the
`org-create-file-search-functions' and that seems to work fine.
Also I changed the name of the tool to org-cc-link.el to reflect the usage of
the cc-engine library. The new version is here
http://rafflo.w.interia.pl/org-cc-link.el
regards,
Rafal
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-10-29 14:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-13 15:44 Links to C/C++ source code lines Rafal
2011-10-21 17:32 ` Bastien
2011-10-24 10:46 ` Rafal
2011-10-28 15:28 ` Bastien
2011-10-29 14:36 ` Rafal
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).