emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: [PATCH] Call `start-process-shell-command' with just 3 arg


From: Christian Egli
Subject: [Orgmode] Re: [PATCH] Call `start-process-shell-command' with just 3 arguments.
Date: Thu, 17 Jun 2010 10:58:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hi David


David Maus <address@hidden> 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

>From 2a52eea0d0d20bfcf68375b3aa2fe5bdf402e2d3 Mon Sep 17 00:00:00 2001
From: Christian Egli <address@hidden>
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  <address@hidden>
+
+       * 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  <address@hidden>
 
        * 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

-- 
Christian Egli
Swiss Library for the Blind, Visually Impaired and Print Disabled
Grubenstrasse 12, CH-8045 Zürich, Switzerland

reply via email to

[Prev in Thread] Current Thread [Next in Thread]