From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Egli Subject: Re: [PATCH] Call `start-process-shell-command' with just 3 arguments. Date: Thu, 17 Jun 2010 10:58:49 +0200 Message-ID: <87ocfa3uie.fsf@saadawi.sbszh.ch> References: <1276757087-23110-1-git-send-email-dmaus@ictsoc.de> <1276757087-23110-2-git-send-email-dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=36141 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPAwG-0004wl-6p for emacs-orgmode@gnu.org; Thu, 17 Jun 2010 04:59:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OPAwE-0002ZH-6s for emacs-orgmode@gnu.org; Thu, 17 Jun 2010 04:59:08 -0400 Received: from lo.gmane.org ([80.91.229.12]:44668) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OPAwD-0002Yd-Ra for emacs-orgmode@gnu.org; Thu, 17 Jun 2010 04:59:06 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OPAwB-0001xx-To for emacs-orgmode@gnu.org; Thu, 17 Jun 2010 10:59:03 +0200 Received: from gateway01.sbszh.ch ([217.162.18.85]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Jun 2010 10:59:03 +0200 Received: from christian.egli by gateway01.sbszh.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Jun 2010 10:59:03 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Hi David David Maus writes: > * org-taskjuggler.el (org-export-as-taskjuggler-and-open): > Call `start-process-shell-command' with 3 arguments. > Passing more than 3 arguments is strongly discouraged. See > docstring of `start-process-shell-command'. Excellent, thanks for this patch. That is an elegant solution, it should also work in older Emacsen. I was going to do it in a more complicated way, querying for Emacs versions, etc. There is one little nit though: > - (start-process-shell-command command nil command file-name))) > + (let* ((file-name (buffer-file-name (org-export-as-taskjuggler))) > + (command (concat "TaskJugglerUI " file-name))) > + (start-process-shell-command command nil command))) The first argument to start-process-shell-command is the name for the process. I guess it would be nicer if this name didn't contain the filename. So maybe something along the following would be nicer: (let* ((file-name (buffer-file-name (org-export-as-taskjuggler))) (process-name "TaskJugglerUI") (command (concat process-name " " file-name))) (start-process-shell-command process-name nil command))) I just checked in a patch to that effect in the taskjuggler-export branch. Also a patch is attached. Thanks Christian --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Change-invocation-of-start-process-shell-command-to-.patch Content-Description: Patch for taskjuggler export >From 2a52eea0d0d20bfcf68375b3aa2fe5bdf402e2d3 Mon Sep 17 00:00:00 2001 From: Christian Egli Date: Thu, 17 Jun 2010 10:37:59 +0200 Subject: [PATCH] Change invocation of start-process-shell-command to avoid warnings Newer Emacsen changed the API of start-process-shell-command and issue a warning if called with more than 3 args. --- lisp/ChangeLog | 6 ++++++ lisp/org-taskjuggler.el | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d351a8a..f3ca66c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2010-06-17 Christian Egli + + * org-taskjuggler.el (org-export-as-taskjuggler-and-open): Fix + the invocation of start-process-shell-command to avoid + warnings in newer Emacsen + 2010-06-08 Christian Egli * org-taskjuggler.el (org-export-taskjuggler-old-level): diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el index f64138e..01bfc47 100644 --- a/lisp/org-taskjuggler.el +++ b/lisp/org-taskjuggler.el @@ -326,9 +326,10 @@ defined in `org-export-taskjuggler-default-reports'." "Export the current buffer as a TaskJuggler file and open it with the TaskJuggler GUI." (interactive) - (let ((file-name (buffer-file-name (org-export-as-taskjuggler))) - (command "TaskJugglerUI")) - (start-process-shell-command command nil command file-name))) + (let* ((file-name (buffer-file-name (org-export-as-taskjuggler))) + (process-name "TaskJugglerUI") + (command (concat process-name " " file-name))) + (start-process-shell-command process-name nil command))) (defun org-taskjuggler-parent-is-ordered-p () "Return true if the parent of the current node has a property -- 1.7.0.4 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit -- Christian Egli Swiss Library for the Blind, Visually Impaired and Print Disabled Grubenstrasse 12, CH-8045 Zürich, Switzerland --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--