From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cL3wBDtg52RuDQAASxT56A (envelope-from ) for ; Thu, 24 Aug 2023 15:50:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WO+VBDtg52QIKgAAauVa8A (envelope-from ) for ; Thu, 24 Aug 2023 15:50:51 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B46A55ADED for ; Thu, 24 Aug 2023 15:50:50 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=e2NARpYm; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1692885050; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Y6eBg4+vLPMrre3nQHJJwrz/cKkRafI6X6lAiXtemp4=; b=AU1Goaw59AusEAbK4ZI1SBVPhjch4tyrYnsS4I95/ls+bYlncgW7HtwCkdOnRRwIqTldzp Ncuiu/uDbj02xGdSOw96JVqSjBQJczZknaR34+EqZzfnjUaMqW7x4E4MWCCwWhtopZfEjc WSHmaeeB4U7I6lCDXGtcK2OmP6LQLacusB6YjLLigzOtIETfMu1yxz1zXt5oUxYjX3RjZA shvRmkyFs3hqNHYNb4WojUsYmKCAqGxJp9eSP5syTk3+T+1KpvpOMDMNtQIggNRD7lIuvw TlRBWhEjba+oszpKr/SZs80u7/FkpuEGHnLsl/ErRxnNWopZ88sZUWvQGQaemg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692885050; a=rsa-sha256; cv=none; b=WxJrkrNU+Jthf0vhkelOZIgERza5KFhPze7Z2vfVgn+tnjELsKWCnnYkfeNRuoeng+WXhC lXxXeySfvfRKRYW4kPi0o9OZiRBhrVvFiTYJGwCAMaY6v38/je5UO7P+M71bocL1TBYV1L dML0EUL8QP5Tocuu9mdl42shdXgik3xweGSnkPyeO/veMmrx3wprHHXKpnFnAdtY8Y1zrt PjNU6KpwJtAWtVTlJJZnambbOMlA0Etx1rlk6JcyWK5lyEMXGYSa/XbMBUKy7oL0JhfHce Is+Ov+VB5qEucCI8IsD8FJopt+aUkKs4bVLurSj/IJTiEbOW12Z/BhBuYDAYwQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=e2NARpYm; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZAjH-00052M-9V; Thu, 24 Aug 2023 09:50:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZAj8-00051k-9b for emacs-orgmode@gnu.org; Thu, 24 Aug 2023 09:50:23 -0400 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qZAj6-00009H-1X for emacs-orgmode@gnu.org; Thu, 24 Aug 2023 09:50:22 -0400 Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-4103aa6229cso38542861cf.2 for ; Thu, 24 Aug 2023 06:50:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692885016; x=1693489816; h=mime-version:message-id:date:subject:to:from:user-agent:from:to:cc :subject:date:message-id:reply-to; bh=Y6eBg4+vLPMrre3nQHJJwrz/cKkRafI6X6lAiXtemp4=; b=e2NARpYmw4iNTolKKSmjRAThx7SuG0A6/Rrz2LvIPlgNNw/6njPcgvV/48RF2DKmHJ DXADC5YkME26VuhAyCmlQ/NFYRYH1NtgypTU4dDFMgWqY3jRja/LEwNfxClJ2M4+mO5Q 9yWBIRc9OD2dzVkDwgUl3esA3TAtrYy0avD7XjuGtqYio4QXAiRrS8LIsNkPD3HozZdU bLG/WgCqCU3d6kzQiQCEhsysJuxb6zhbP6HOOnY9br9vmSymhpMrxvKoC03nffDZ1gfF srqBhL0phQIvnmrHMUR2dcFsyFT4JteQSmtu24OEd6A5tcCSpYdZB4DUut6flGo9UVJJ hGYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692885016; x=1693489816; h=mime-version:message-id:date:subject:to:from:user-agent :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Y6eBg4+vLPMrre3nQHJJwrz/cKkRafI6X6lAiXtemp4=; b=eZSp8C/u+0vW8awkShRQy3CauVDA2EzvQuCPQ9mEsMKajg1mKRpk3nTUnHN1By2mU8 EvB+DaIV08fE+1gZ+0Dvv0y+JxNUY3DI6n9mfyD8F1/c0ZN5pYZ7Ow9iKE0Js4l6MbtV JcfSJt0m7tMqij/2PTzbAuRgJK39SEfqHrycoLanggJ6EirNidI1nupZrM7TL9gW5LJt MMplyhYlEiYm3TJvmH2yNO7qzpIaYQikkSu2K+TxyTu9R1o+i29JrT8WN6kST/SZg1w2 b70IYANBHP2wc/h6ibUJYPfuKk+/W5Udq6vWAerVwXhw2UeqjYXWQYXjKkW3KytMYX1B butA== X-Gm-Message-State: AOJu0YzIORJls+0koRFe7bn7pbgsFjlB8THtzd2dxcy5CMb4qY3JSUxT HGwdkNpH43Ogf9ls4JpyzukQ5NFR2p4= X-Google-Smtp-Source: AGHT+IFvgunaXV6Q459w9K4qD/YGBhBwW1kJjZd8KhjbP8XBm2lSvpUzzjLwjDQLgTnQjYmhIdOypg== X-Received: by 2002:a05:622a:cc:b0:406:9466:6962 with SMTP id p12-20020a05622a00cc00b0040694666962mr18872076qtw.61.1692885016170; Thu, 24 Aug 2023 06:50:16 -0700 (PDT) Received: from laptop ([2601:84:847f:c697:2d4:9eff:feb6:970c]) by smtp.gmail.com with ESMTPSA id b4-20020ac801c4000000b004108ce94882sm3475973qtg.83.2023.08.24.06.50.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 06:50:15 -0700 (PDT) User-agent: mu4e 1.11.15; emacs 30.0.50 From: No Wayman To: emacs-orgmode@gnu.org Subject: Org mode version 9.7-pre (9.7-pre-n/a-g63e8ca @ /home/n/.emacs.d/elpaca/builds/org/); [PATCH] refactor org-babel-lilypond-compile-lilyfile Date: Thu, 24 Aug 2023 09:48:00 -0400 Message-ID: <87jztk1rdc.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::82e; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-qt1-x82e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.58 X-Spam-Score: -9.58 X-Migadu-Queue-Id: B46A55ADED X-Migadu-Scanner: mx1.migadu.com X-TUID: JN71Qvc7nMg2 --=-=-= Content-Type: text/plain; format=flowed The attached patch: - Improves the compilation message. (The target is the file, not LilyPond itself). - Refactors the body of the function to remove the many nondescript arg-n local variables. - Removes the optional TEST parameter, which is unused and better served through debugging tools. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-ob-lilypond.el-refactor-org-babel-lilypond-comp.patch >From 5765891b9de22260454d2cee8365c14841d0d744 Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer Date: Thu, 24 Aug 2023 09:32:27 -0400 Subject: [PATCH] lisp/ob-lilypond.el: refactor org-babel-lilypond-compile-lilyfile * ob-lilypond.el (org-babel-lilypond-compile-lilyfile): Correct compilation message. Remove superfluous local variables. Remove unused ad-hoc debugging TEST parameter. --- lisp/ob-lilypond.el | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/lisp/ob-lilypond.el b/lisp/ob-lilypond.el index 8b2bd231f..92cd59685 100644 --- a/lisp/ob-lilypond.el +++ b/lisp/ob-lilypond.el @@ -247,27 +247,21 @@ org-babel-lilypond-execute-tangled-ly (org-babel-lilypond-attempt-to-open-pdf org-babel-lilypond-temp-file) (org-babel-lilypond-attempt-to-play-midi org-babel-lilypond-temp-file))))) -(defun org-babel-lilypond-compile-lilyfile (file-name &optional test) +(defun org-babel-lilypond-compile-lilyfile (file-name) "Compile lilypond file and check for compile errors. FILE-NAME is full path to lilypond (.ly) file." - (message "Compiling LilyPond...") - (let ((arg-1 org-babel-lilypond-ly-command) ;program - ;; (arg-2 nil) ;infile - (arg-3 "*lilypond*") ;buffer - (arg-4 t) ;display - (arg-5 (if org-babel-lilypond-gen-png "--png" "")) ;&rest... - (arg-6 (if org-babel-lilypond-gen-html "--html" "")) - (arg-7 (if org-babel-lilypond-gen-pdf "--pdf" "")) - (arg-8 (if org-babel-lilypond-use-eps "-dbackend=eps" "")) - (arg-9 (if org-babel-lilypond-gen-svg "-dbackend=svg" "")) - (arg-10 (concat "--output=" (file-name-sans-extension file-name))) - (arg-11 file-name)) - (if test - `(,arg-1 ,nil ,arg-3 ,arg-4 ,arg-5 ,arg-6 ;; arg-2 - ,arg-7 ,arg-8 ,arg-9 ,arg-10 ,arg-11) - (call-process - arg-1 nil arg-3 arg-4 arg-5 arg-6 ;; arg-2 - arg-7 arg-8 arg-9 arg-10 arg-11)))) + (message "Compiling %s..." file-name) + (let ((args + (delq nil (list + (and org-babel-lilypond-gen-png "--png") + (and org-babel-lilypond-gen-html "--html") + (and org-babel-lilypond-gen-pdf "--pdf") + (and org-babel-lilypond-use-eps "-dbackend=eps") + (and org-babel-lilypond-gen-svg "-dbackend=svg") + (concat "--output=" (file-name-sans-extension file-name)) + file-name)))) + (apply #'call-process org-babel-lilypond-ly-command nil + "*lilypond*" 'display args))) (defun org-babel-lilypond-check-for-compile-error (file-name &optional test) "Check for compile error. -- 2.41.0 --=-=-=--