- ;; for mingw, the test must be inverted.
- (if (eq? PLATFORM 'windows)
- have-tty? (not have-tty?))))
+ (not have-tty?)))
+
+(define (run-editor uri)
+ (let*
+ ((command (apply get-editor-command (dissect-uri uri)))
+ (status (system command)))
+ (if (not (= status 0))
+ (begin
+ (format (current-error-port)
+ (_ "failed to invoke editor: ~a") command)
+ (exit 1)))))
+
+(define (run-browser uri)
+ (system
+ (if (getenv "BROWSER")
+ (format #f "~a ~a" (getenv "BROWSER") uri)
+ (format #f "firefox -remote 'OpenURL(~a,new-tab)'" uri))))
+
+
+(define (strip-framework-path var)
+ (define pat "lilypond/usr")
+ (if (getenv var)
+ (let*
+ ((val (getenv var))
+ (paths (string-split val #\:))
+ (without (remove (lambda (s) (string-contains s pat))
+ paths)))
+
+ (if (not (= (length without)
+ (length paths)))
+ (setenv var (string-join without ":"))))))