X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=elisp%2Flilypond-mode.el;h=0bf05408e2075240253a54efb23876dc2d3ff236;hb=97a0169312a260933246ab224e4f8b0969871dd5;hp=fa7cffc439e85adb0c6ce9147419fc03aa66aa7f;hpb=99b6f3aa3558b01c9d4158b19a1f1794c534f89c;p=lilypond.git diff --git a/elisp/lilypond-mode.el b/elisp/lilypond-mode.el index fa7cffc439..0bf05408e2 100644 --- a/elisp/lilypond-mode.el +++ b/elisp/lilypond-mode.el @@ -1,7 +1,7 @@ ;;;; lilypond-mode.el -- Major mode for editing GNU LilyPond music scores ;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; Copyright (C) 1999--2014 Jan Nieuwenhuizen +;;;; Copyright (C) 1999--2015 Jan Nieuwenhuizen ;;;; Changed 2001--2003 Heikki Junes ;;;; * Add PS-compilation, PS-viewing and MIDI-play (29th Aug 2001) ;;;; * Keyboard shortcuts (12th Sep 2001) @@ -432,16 +432,16 @@ in LilyPond-include-path." (defcustom LilyPond-command-alist ;; Should expand this to include possible keyboard shortcuts which ;; could then be mapped to define-key and menu. - `( - ("LilyPond" . (,(concat LilyPond-lilypond-command " %s") "%s" "%l" "View")) - ("2PS" . (,(concat LilyPond-lilypond-command " -f ps %s") "%s" "%p" "ViewPS")) + '( + ("LilyPond" . ((LilyPond-lilypond-command " %s") "%s" "%l" "View")) + ("2PS" . ((LilyPond-lilypond-command " -f ps %s") "%s" "%p" "ViewPS")) ("Book" . ("lilypond-book %x" "%x" "%l" "LaTeX")) ("LaTeX" . ("latex '\\nonstopmode\\input %l'" "%l" "%d" "ViewDVI")) ;; refreshes when kicked USR1 - ("View" . (,(concat LilyPond-pdf-command " %f"))) - ("ViewPDF" . (,(concat LilyPond-pdf-command " %f"))) - ("ViewPS" . (,(concat LilyPond-ps-command " %p"))) + ("View" . ((LilyPond-pdf-command " %f"))) + ("ViewPDF" . ((LilyPond-pdf-command " %f"))) + ("ViewPS" . ((LilyPond-ps-command " %p"))) ;; The following are refreshed in LilyPond-command: ;; - current-midi depends on cursor position and @@ -616,24 +616,35 @@ Must be the car of an entry in `LilyPond-command-alist'." (LilyPond-command-select-buffer) (LilyPond-command-region (point-min) (point-max))) -(defun LilyPond-command-expand (string file) - (let ((case-fold-search nil)) - (if (string-match "%" string) - (let* ((b (match-beginning 0)) - (e (+ b 2)) - (l (split-file-name file)) - (dir (car l)) - (base (cadr l))) - (concat (substring string 0 b) - (shell-quote-argument (concat dir base)) - (LilyPond-command-expand - (concat - (let ((entry (assoc (substring string b e) - LilyPond-expand-alist))) - (if entry (cdr entry) "")) - (substring string e)) - file))) - string))) +(defun LilyPond-command-expand (arg file) + (cond + ((listp arg) + (mapconcat (lambda (arg) (LilyPond-command-expand arg file)) + arg + "")) + ((and (symbolp arg) (boundp arg) + ;; Avoid self-quoting symbols + (not (eq (symbol-value arg) arg))) + (LilyPond-command-expand (symbol-value arg) file)) + ((stringp arg) + (let ((case-fold-search nil)) + (if (string-match "%" arg) + (let* ((b (match-beginning 0)) + (e (+ b 2)) + (l (split-file-name file)) + (dir (car l)) + (base (cadr l))) + (concat (substring arg 0 b) + (shell-quote-argument (concat dir base)) + (LilyPond-command-expand + (concat + (let ((entry (assoc (substring arg b e) + LilyPond-expand-alist))) + (if entry (cdr entry) "")) + (substring arg e)) + file))) + arg))) + (t (error "Bad expansion `%S'" arg)))) (defun LilyPond-shell-process (name buffer command) (let ((old (current-buffer)))