| @@ -61,7 +61,17 @@ let launchpath () = · 60 unmodified lines |
| 61 | if emptystr conf.pathlauncher | 61 | if emptystr conf.pathlauncher |
| 62 | then adderrmsg "path launcher" "command set" | 62 | then adderrmsg "path launcher" "command set" |
| 63 | else | 63 | else |
| 64 | let cmd = Str.global_replace Re.percent !S.path conf.pathlauncher in | 64 | let n = |
| | 65 | match !S.layout with |
| | 66 | | l :: _ -> string_of_int l.pageno |
| | 67 | | _ -> E.s |
| | 68 | in |
| | 69 | let cmd = Str.global_replace Re.percents !S.path conf.pathlauncher in |
| | 70 | let cmd = |
| | 71 | if nonemptystr n |
| | 72 | then Str.global_replace Re.percentp n cmd |
| | 73 | else cmd |
| | 74 | in |
| 65 | match spawn cmd [] with | 75 | match spawn cmd [] with |
| 66 | | exception exn -> | 76 | | exception exn -> |
| 67 | adderrfmt "spawn" "failed to execute `%s': %s" cmd @@ exntos exn | 77 | adderrfmt "spawn" "failed to execute `%s': %s" cmd @@ exntos exn |
| @@ -2790,7 +2800,7 @@ let gotounder = function · 2722 unmodified lines |
| 2790 | "don't know where to save attachment" | 2800 | "don't know where to save attachment" |
| 2791 | else | 2801 | else |
| 2792 | let filename = Ffi.getfileannot opaque slinkindex in | 2802 | let filename = Ffi.getfileannot opaque slinkindex in |
| 2793 | let savecmd = Str.global_replace Re.percent filename conf.savecmd in | 2803 | let savecmd = Str.global_replace Re.percents filename conf.savecmd in |
| 2794 | let path = | 2804 | let path = |
| 2795 | getcmdoutput | 2805 | getcmdoutput |
| 2796 | (adderrfmt savecmd | 2806 | (adderrfmt savecmd |
| @@ -3118,7 +3128,7 @@ let save () = · 321 unmodified lines |
| 3118 | then adderrmsg "savepath-command is empty" | 3128 | then adderrmsg "savepath-command is empty" |
| 3119 | "don't know where to save modified document" | 3129 | "don't know where to save modified document" |
| 3120 | else | 3130 | else |
| 3121 | let savecmd = Str.global_replace Re.percent !S.path conf.savecmd in | 3131 | let savecmd = Str.global_replace Re.percents !S.path conf.savecmd in |
| 3122 | let path = | 3132 | let path = |
| 3123 | getcmdoutput | 3133 | getcmdoutput |
| 3124 | (adderrfmt savecmd "failed to obtain path to the saved copy: %s") | 3134 | (adderrfmt savecmd "failed to obtain path to the saved copy: %s") |