Hi List, 

I try to construct sequences of URL-Strings separated by one blank and
have been almost successfull - but I have to get rid of all the
backslashes '\' in the string sequence:

Here is the 'workhorse-function' for the task: 

,-----------------------------------------------------------------
| ### construct the url's
| (de replaceUrlWildcard (U W)
| (let Y (split (chop U) "*")
|    (glue "\" \"" (mapcar '((X) (pack (car Y) X  (cdr Y))) W)) ))
`-----------------------------------------------------------------

And here is the use case:

,-------------------------------------------------------------------------------------
| ### define the url's 
| (setq U_ref # URL 
|    "http://software-lab.de/doc/ref*.html"; )
| (setq W_ref  # wildcard replacements
|    (list "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P"
|    "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z" ))
| 
| ### make a sequence of url strings 
| (setq UrlStrings_ref (pack """" (replaceUrlWildcard U_ref W_ref) """"))  
`-------------------------------------------------------------------------------------

Thats what I get (strings seperated by one blank - with backslashes):

,-----------------------------------------------
|  ? (pack """" (replaceUrlWildcard U_ref W_ref) """")
|  
| "http://software-lab.de/doc/refA.html\";
| \"http://software-lab.de/doc/refB.html\";
| \"http://software-lab.de/doc/refC.html\";
| \"http://software-lab.de/doc/refD.html\";
| \"http://software-lab.de/doc/refE.html\";
| \"http://software-lab.de/doc/refF.html\";
| \"http://software-lab.de/doc/refG.html\";
| \"http://software-lab.de/doc/refH.html\";
| \"http://software-lab.de/doc/refI.html\";
| \"http://software-lab.de/doc/refJ.html\";
| \"http://software-lab.de/doc/refK.html\";
| \"http://software-lab.de/doc/refL.html\";
| \"http://software-lab.de/doc/refM.html\";
| \"http://software-lab.de/doc/refN.html\";
| \"http://software-lab.de/doc/refO.html\";
| \"http://software-lab.de/doc/refP.html\";
| \"http://software-lab.de/doc/refQ.html\";
| \"http://software-lab.de/doc/refR.html\";
| \"http://software-lab.de/doc/refS.html\";
| \"http://software-lab.de/doc/refT.html\";
| \"http://software-lab.de/doc/refU.html\";
| \"http://software-lab.de/doc/refV.html\";
| \"http://software-lab.de/doc/refW.html\";
| \"http://software-lab.de/doc/refX.html\";
| \"http://software-lab.de/doc/refY.html\";
| \"http://software-lab.de/doc/refZ.html";
`-----------------------------------------------

This is what I would need (strings separated by one blank,  no '\'):

,---------------------------------------
| "http://software-lab.de/doc/refA.html";
| "http://software-lab.de/doc/refB.html";
| "http://software-lab.de/doc/refC.html";
| "http://software-lab.de/doc/refD.html";
| "http://software-lab.de/doc/refE.html";
| "http://software-lab.de/doc/refF.html";
| "http://software-lab.de/doc/refG.html";
| "http://software-lab.de/doc/refH.html";
| "http://software-lab.de/doc/refI.html";
| "http://software-lab.de/doc/refJ.html";
| "http://software-lab.de/doc/refK.html";
| "http://software-lab.de/doc/refL.html";
| "http://software-lab.de/doc/refM.html";
| "http://software-lab.de/doc/refN.html";
| "http://software-lab.de/doc/refO.html";
| "http://software-lab.de/doc/refP.html";
| "http://software-lab.de/doc/refQ.html";
| "http://software-lab.de/doc/refR.html";
| "http://software-lab.de/doc/refS.html";
| "http://software-lab.de/doc/refT.html";
| "http://software-lab.de/doc/refU.html";
| "http://software-lab.de/doc/refV.html";
| "http://software-lab.de/doc/refW.html";
| "http://software-lab.de/doc/refX.html";
| "http://software-lab.de/doc/refY.html";
| "http://software-lab.de/doc/refZ.html";
`---------------------------------------

I could of course use query-replace in Emacs and delete the backslashes,
but I would like to have a correctly formated sequence of URL strings as
output: 

,---------------------------------------------
| "url-sting1" "url-string2" ... "url-stringN"
`---------------------------------------------

Any tips would be appreciated
TIA

-- 
Cheers,
Thorsten


-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to