From: Urs Liska
Date: Tue, 19 Jan 2016 09:52:33 +0000 (+0100)
Subject: #4747: Remove (all) uses of is-absolute?
X-Git-Tag: release/2.19.36-1~9
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f30a8189adbbeefa2103e2c2e194040f66bc2291;p=lilypond.git
#4747: Remove (all) uses of is-absolute?
The check for absolute paths in in output-ps.scm
and -svg.scm is unnecessary because
(car ly:input-file-line-char-column a-location)
always returns an absolute, slashified path
Now is-absolute? is not used anymore by LilyPond itself.
---
diff --git a/scm/output-ps.scm b/scm/output-ps.scm
index 70b13848e4..69f2772039 100644
--- a/scm/output-ps.scm
+++ b/scm/output-ps.scm
@@ -157,10 +157,6 @@
(ly:in-event-class? cause t))
point-and-click))))
(let* ((location (ly:input-file-line-char-column music-origin))
- (raw-file (car location))
- (file (if (is-absolute? raw-file)
- raw-file
- (string-append (ly-getcwd) "/" raw-file)))
(x-ext (ly:grob-extent grob grob X))
(y-ext (ly:grob-extent grob grob Y)))
@@ -175,7 +171,7 @@
;; Backslashes are not valid
;; file URI path separators.
(ly:string-percent-encode
- (ly:string-substitute "\\" "/" file))
+ (ly:string-substitute "\\" "/" (car location)))
(cadr location)
(caddr location)
diff --git a/scm/output-svg.scm b/scm/output-svg.scm
index 78bda3c35b..ca086318d7 100644
--- a/scm/output-svg.scm
+++ b/scm/output-svg.scm
@@ -485,18 +485,14 @@
(else (any (lambda (t)
(ly:in-event-class? cause t))
point-and-click)))
- (let* ((location (ly:input-file-line-char-column music-origin))
- (raw-file (car location))
- (file (if (is-absolute? raw-file)
- raw-file
- (string-append (ly-getcwd) "/" raw-file))))
-
+ (let* ((location (ly:input-file-line-char-column music-origin)))
+
(ly:format "\n"
;; Backslashes are not valid
;; file URI path separators.
(ly:string-percent-encode
- (ly:string-substitute "\\" "/" file))
-
+ (ly:string-substitute "\\" "/" (car location)))
+
(cadr location)
(caddr location)
(1+ (cadddr location))))))))