mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Help on action


Chronological Thread 
  • From: Henri Lesourd <address@hidden>
  • To: Alvaro Tejero Cantero <address@hidden>
  • Cc: address@hidden, var=/home/henri/.address@hidden
  • Subject: Re: [TeXmacs] Help on action
  • Date: Thu, 27 Jan 2005 14:14:15 +0100



Alvaro Tejero Cantero wrote:

Hello,

I am still fiddling with it: for the path of the file, I would like to use find-file, since it searches in several directories (i.e. first locally, then a repository of pdf files...). But <find-file|path1|path2|<merge|key|.pdf>> gives me a url like

file:///home/qoptik/Literatur/Simon1994a.pdf

which acroread doesn't like. So my current problem is getting substring to work in order to strip file:// (7 characters) out of find-files' output:

<action|stripme|(display (substring (get-env "var") 7 9))>

TeXmacs complains in the terminal:

<unnamed port>:1:10: In procedure substring in expression (substring
(get-env "var") 2 ...):
<unnamed port>:1:10: Argument 2 out of range: 2


[Afterwards I would substitute '9' with (string-lenght (get-var "var")) or, better (string-length s) if I manage to (let s (get-var "var")), which I don't, in the body of the action, prior to the (system... ) call.]

Most probably, the "var" variable has no value when you do :
<<
<action|stripme|(display (substring (get-env "var") 7 9))>
>>

what output do you obtain if you write :
<<
<action|stripme|(display* "{{" (get-env "var") "}}")>
>>

if you just get :
<<
{{}}
>>

on the console when you double-click the "stripme", then it means that your "var" variable
has not been defined. By the way, the following code :
<<
<assign|var|<find-file|~|.bashrc>>
<action|stripme|(begin (display* "var=" (get-env "var") "\n"))>
<action|stripme2|(with s (get-env "var") (display* "var=" (substring s 7 (string-length s)) "\n"))>
>>

perfectly works, when clicking first on "stripme", next on "stripme2", I obtain :
<<
var=file:///home/henri/.bashrc
var=/home/henri/.bashrc
>>




Archive powered by MHonArc 2.6.19.

Top of page