(buffer-file-name) returns a string without backquote-escaping the
whitespaces.

Heres a replacement (try evalling this somewhere in emacs after
'lilypond-mode is loaded).  Please test before including anywhere.

-anders



(defun subst-spc-w-bcksl (lista)                ; what a hack!
  ;; escape 'unescaped' space-characters:
  ;; 'string-to-list
  (let ((a (car lista))
        (b (car (cdr lista))))
    (cond ((null lista) '()) 
          ((and (= a 92) (= b 32))  ; check for already escaped whitespaces
           (cons a (cons b (subst-solo-spc-w-bcksl (cddr lista)))))
          ((= a 32)     ; insert backslash in front of whitespace
           (cons 92 (cons a (subst-solo-spc-w-bcksl (cdr lista)))))
          (t (cons a (subst-solo-spc-w-bcksl (cdr lista)))))))

(defun buffer-file-name-w-escaped-space ()
  (concat
   (subst-solo-spc-w-bcksl
    (string-to-list
     (buffer-file-name)))))

(defun LilyPond-get-master-file ()
  (or LilyPond-master-file
      ;; our new version of buffer-file-name
      (buffer-file-name-w-escaped-space)))


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to