emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* radio transmit links across files
@ 2007-03-04 11:52 Mark Aufflick
  2007-03-07  8:04 ` Carsten Dominik
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Aufflick @ 2007-03-04 11:52 UTC (permalink / raw)
  To: emacs-orgmode

Hi All,

I have to say I'm loving org-mode, I'm using it for taking notes and
writing papers for my (just started) Masters of law degree (a bit of a
change for a programmer!)

What I want to do is have a single file where I keep a list of terms,
acronyms, etc, and have that one file "radio" links out to any other
org mode file.

I know that I can make links across files to specific headings, but I
want the existance of a term in the file to automatically be linked in
other files - so the same functionality as radio links - but
transmitting across files.

Has anyone ever implemented such a beast?

At a guess I would need to extend org-update-radio-target-regexp to
run org-all-targets on the terms file. My lisp is fairly limited at
this stage, however, so any pointers would be appreciated!

Mark.

-- 
Mark Aufflick
 e: mark@aufflick.com
 w: mark.aufflick.com
 p: +61 438 700 647
 f: +61 2 9436 4737

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

* Re: radio transmit links across files
  2007-03-04 11:52 radio transmit links across files Mark Aufflick
@ 2007-03-07  8:04 ` Carsten Dominik
  2007-03-07 15:12   ` Eddward DeVilla
  0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2007-03-07  8:04 UTC (permalink / raw)
  To: Mark Aufflick; +Cc: emacs-orgmode

Hi Mark,

On Mar 4, 2007, at 12:52, Mark Aufflick wrote:

> Hi All,
>
> I have to say I'm loving org-mode, I'm using it for taking notes and
> writing papers for my (just started) Masters of law degree (a bit of a
> change for a programmer!)
>
> What I want to do is have a single file where I keep a list of terms,
> acronyms, etc, and have that one file "radio" links out to any other
> org mode file.
>
> I know that I can make links across files to specific headings, but I
> want the existance of a term in the file to automatically be linked in
> other files - so the same functionality as radio links - but
> transmitting across files.
>
> Has anyone ever implemented such a beast?
>
> At a guess I would need to extend org-update-radio-target-regexp to
> run org-all-targets on the terms file. My lisp is fairly limited at
> this stage, however, so any pointers would be appreciated!


Something like this could easily be implemented, as you say along
the lines of the radio targets, but making links to a different file.

The main problem with such an approach is that it quickly becomes
a performance issue.  It is ok for a few terms, but if you accumulate
a large number of terms, and if you want to use font-lock to activate
words as links, this means that after each letter you type, font-lock
will have to match all words in the current line against all those 
terms.
This can become slow.

Another approach would be to do it on demand, by replacing matches in
the file with explicit links like

#+LINK: term file:terms.org::%s

  word   ->  [[term:word][word]]

I guess the problem with this approach might be that you might also
*remove* terms, and so these links will point into nothingness.
A remedy would be to find all the term: links and remove them first, 
then
got through the file again and create new links.

- Carsten





>
> Mark.
>
> -- 
> Mark Aufflick
> e: mark@aufflick.com
> w: mark.aufflick.com
> p: +61 438 700 647
> f: +61 2 9436 4737
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

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

* Re: radio transmit links across files
  2007-03-07  8:04 ` Carsten Dominik
@ 2007-03-07 15:12   ` Eddward DeVilla
  2007-03-08  9:48     ` Carsten Dominik
  0 siblings, 1 reply; 5+ messages in thread
From: Eddward DeVilla @ 2007-03-07 15:12 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

On 3/7/07, Carsten Dominik <dominik@science.uva.nl> wrote:
> The main problem with such an approach is that it quickly becomes
> a performance issue.  It is ok for a few terms, but if you accumulate
> a large number of terms, and if you want to use font-lock to activate
> words as links, this means that after each letter you type, font-lock
> will have to match all words in the current line against all those
> terms.
> This can become slow.

Hi.  A question from the peanut gallery.  Could the checking to see if
a term matches be deferred until the user types a non-whitespace
character followed by either a whitespace character or a movement
operation?  If this is possible, it might speed things up a little.  I
don't know enough about how font-lock work to know if this reasonable.

Edd

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

* Re: radio transmit links across files
  2007-03-07 15:12   ` Eddward DeVilla
@ 2007-03-08  9:48     ` Carsten Dominik
  2007-03-08 16:39       ` Eddward DeVilla
  0 siblings, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2007-03-08  9:48 UTC (permalink / raw)
  To: Eddward DeVilla; +Cc: emacs-orgmode


On Mar 7, 2007, at 16:12, Eddward DeVilla wrote:

> On 3/7/07, Carsten Dominik <dominik@science.uva.nl> wrote:
>> The main problem with such an approach is that it quickly becomes
>> a performance issue.  It is ok for a few terms, but if you accumulate
>> a large number of terms, and if you want to use font-lock to activate
>> words as links, this means that after each letter you type, font-lock
>> will have to match all words in the current line against all those
>> terms.
>> This can become slow.
>
> Hi.  A question from the peanut gallery.  Could the checking to see if
> a term matches be deferred until the user types a non-whitespace
> character followed by either a whitespace character or a movement
> operation?  If this is possible, it might speed things up a little.  I
> don't know enough about how font-lock work to know if this reasonable.

I don't think you can do this in font-lock.  Font-lock has many clever
mechanisms to defer font-locking of stuff that is not currently on the 
screen
etc, but the current line is always done immediately, I think.

The problem with your proposal is also that you may be inserting or
deleting characters in the middle of a word, and a whitespace-based
approach would not work then.

- Carsten

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

* Re: radio transmit links across files
  2007-03-08  9:48     ` Carsten Dominik
@ 2007-03-08 16:39       ` Eddward DeVilla
  0 siblings, 0 replies; 5+ messages in thread
From: Eddward DeVilla @ 2007-03-08 16:39 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

On 3/8/07, Carsten Dominik <dominik@science.uva.nl> wrote:
> I don't think you can do this in font-lock.  Font-lock has many clever
> mechanisms to defer font-locking of stuff that is not currently on the
> screen
> etc, but the current line is always done immediately, I think.

I figured as much.  It's not worth it then.  At least not for me.

> The problem with your proposal is also that you may be inserting or
> deleting characters in the middle of a word, and a whitespace-based
> approach would not work then.

I figured hooking whitespace as well as movement would catch it.  So
you type or delete inside a word and then reposition the cursor some
how (arrow keys, search, C-e, mouse, etc.) then recheck the line you
were on when you started to move.  I don't know if that would be
possible to catch cursor movement.  There would probably be corner
cases with string-insert-rectangle, search and replace and other
operations that perform automated edits.

In any case, if font-lock can't support it, I don't think it would be
worth it to DIY it.

Edd

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

end of thread, other threads:[~2007-03-08 16:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-04 11:52 radio transmit links across files Mark Aufflick
2007-03-07  8:04 ` Carsten Dominik
2007-03-07 15:12   ` Eddward DeVilla
2007-03-08  9:48     ` Carsten Dominik
2007-03-08 16:39       ` Eddward DeVilla

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).