ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Active urls?
@ 2001-05-30 15:03 Giuseppe Bilotta
  2001-05-31  7:50 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Giuseppe Bilotta @ 2001-05-30 15:03 UTC (permalink / raw)


Hello,

I tend to use/give lots of URL references in my document. I
``recently'' discovered the full power of \useurl (even if I'm
still not sure about the three-entries syntax), but I'd like to
know if it is possible to make URLs active without resorting to
\from[...], that is: is there a setup option that allows \url[...]
to give an active hyperling?

--
Giuseppe "Oblomov" Bilotta


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

* Re: Active urls?
  2001-05-30 15:03 Active urls? Giuseppe Bilotta
@ 2001-05-31  7:50 ` Hans Hagen
  2001-05-31 10:46   ` Re[2]: " Giuseppe Bilotta
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2001-05-31  7:50 UTC (permalink / raw)
  Cc: ntg-context

At 05:03 PM 5/30/01 +0200, Giuseppe Bilotta wrote:
>Hello,
>
>I tend to use/give lots of URL references in my document. I
>``recently'' discovered the full power of \useurl (even if I'm
>still not sure about the three-entries syntax), but I'd like to
>know if it is possible to make URLs active without resorting to
>\from[...], that is: is there a setup option that allows \url[...]
>to give an active hyperling?

probably something: 

\let\normalurl\url

\def\url[#1]{\useurl[dummy][#1]\normalurl[dummy]}

or 

\beginETEX \scantokens 

\def\url[#1]{\scantokens{\useurl[dummy][#1][#1]\normalurl[dummy]

\endETEX

untested of course

Hans 
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

* Re[2]: Active urls?
  2001-05-31  7:50 ` Hans Hagen
@ 2001-05-31 10:46   ` Giuseppe Bilotta
  2001-05-31 14:44     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Giuseppe Bilotta @ 2001-05-31 10:46 UTC (permalink / raw)
  Cc: ntg-context

Thursday, May 31, 2001 Hans Hagen wrote:

HH> At 05:03 PM 5/30/01 +0200, Giuseppe Bilotta wrote:
>>Hello,
>>
>>I tend to use/give lots of URL references in my document. I
>>``recently'' discovered the full power of \useurl (even if I'm
>>still not sure about the three-entries syntax), but I'd like to
>>know if it is possible to make URLs active without resorting to
>>\from[...], that is: is there a setup option that allows \url[...]
>>to give an active hyperling?

HH> probably something: 

HH> \let\normalurl\url

HH> \def\url[#1]{\useurl[dummy][#1]\normalurl[dummy]}

Uh ... that would let \url "merge" the functionality of \useurl
and \url, but that's not what I want. The problem is that if I
do:

\useurl[whatever][this.net.address]

\url[whatever]

then \url[whatever] gives this.net.address, but it's not active,
while \from[whatever] gives this.net.address, active.

\let\url=\from does not work. Any ideas?

--
Giuseppe "Oblomov" Bilotta


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

* Re: Re[2]: Active urls?
  2001-05-31 10:46   ` Re[2]: " Giuseppe Bilotta
@ 2001-05-31 14:44     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2001-05-31 14:44 UTC (permalink / raw)
  Cc: ntg-context

At 12:46 PM 5/31/01 +0200, you wrote:
>
>Thursday, May 31, 2001 Hans Hagen wrote:
>
>HH> At 05:03 PM 5/30/01 +0200, Giuseppe Bilotta wrote:
>>>Hello,
>>>
>>>I tend to use/give lots of URL references in my document. I
>>>``recently'' discovered the full power of \useurl (even if I'm
>>>still not sure about the three-entries syntax), but I'd like to
>>>know if it is possible to make URLs active without resorting to
>>>\from[...], that is: is there a setup option that allows \url[...]
>>>to give an active hyperling?
> 
>HH> probably something: 
>
>HH> \let\normalurl\url
>
>HH> \def\url[#1]{\useurl[dummy][#1]\normalurl[dummy]}
>
>Uh ... that would let \url "merge" the functionality of \useurl
>and \url, but that's not what I want. The problem is that if I
>do:
>
>\useurl[whatever][this.net.address]
>
>\url[whatever]
>
>then \url[whatever] gives this.net.address, but it's not active,
>while \from[whatever] gives this.net.address, active.
>
>\let\url=\from does not work. Any ideas?

well, i lack the time to look into it more depply, but you probably end up
with something hackery like: 

\setupinteraction[state=start]

\useurl [abc] [a.b.c]

\let\normalurl\url \unprotected \unexpanded\def\url[#1]%
  {\begingroup
   \let\url\normalurl
   \doifdefinedelse{\v!file:::#1}
     {\from[#1]}
     {\scantokens{\unprotect\useurl[\s!dummy][#1]\protect}%
      \from[\s!dummy]}%
   \endgroup}

\starttext

test \url[a.b.c] test \from[abc]

\stoptext

as said, too hackery, so why not change the \url's into \from's? 

Hans
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


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

end of thread, other threads:[~2001-05-31 14:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-30 15:03 Active urls? Giuseppe Bilotta
2001-05-31  7:50 ` Hans Hagen
2001-05-31 10:46   ` Re[2]: " Giuseppe Bilotta
2001-05-31 14:44     ` Hans Hagen

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 NNTP newsgroup(s).