On Sun, 23 Jan 2011, Hans Hagen wrote:

On 22-1-2011 1:20, Aditya Mahajan wrote:

A simple algorithm with assume that everything following the dot is the
extension, while that is certainly not the case here. We can definitely
restrict the search of extension to the last 10 or so characters of the
url, but there will be cases when such heuristics will fail.

it's not that complicated ... say that you patch this way:

function schemes.cleanname(specification)
   return (gsub(specification.original,"[^%a%d%.]+","-"))
end

local function fetch(specification)
   local original  = specification.original
   local scheme    = specification.scheme
   local cleanname = schemes.cleanname(specification)

that will be the current method. Now you can experiment with:

Can cleanname be passed as a parameter of the specification? Then we can have

local cleanname = specification.cleanname or schemes.cleanname(specification)

This way, I can only change the cleanname of the files that are downloaded by my module without affecting the cleanname for any other command that might want to download a file.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to