ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: ntg-context@ntg.nl
Subject: Re: Re[2]: Active urls?
Date: Thu, 31 May 2001 16:44:02 +0200	[thread overview]
Message-ID: <3.0.6.32.20010531164402.01ac0aa0@server-1> (raw)
In-Reply-To: <18415725155.20010531124626@bigfoot.com>

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


      reply	other threads:[~2001-05-31 14:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-30 15:03 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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3.0.6.32.20010531164402.01ac0aa0@server-1 \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).