all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] org-taskjuggler.el: Call start-process-shell-command with just 3 arguments
@ 2010-06-17  6:44 David Maus
  2010-06-17  6:44 ` [PATCH] Call `start-process-shell-command' " David Maus
  0 siblings, 1 reply; 3+ messages in thread
From: David Maus @ 2010-06-17  6:44 UTC (permalink / raw)
  To: emacs-orgmode

Compiler throws a warning about `org-export-as-taskjuggler-and-open'
calling `start-process-shell-command' with 4 arguments.  The function
accepts 4 arguments, but according to the docstring of 

GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0)
 of 2010-05-16 on raven, modified by Debian

using more then 3 arguments is highly discouraged.

David Maus (1):
  Call `start-process-shell-command' with just 3 arguments.

 lisp/org-taskjuggler.el |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Call `start-process-shell-command' with just 3 arguments.
  2010-06-17  6:44 [PATCH] org-taskjuggler.el: Call start-process-shell-command with just 3 arguments David Maus
@ 2010-06-17  6:44 ` David Maus
  2010-06-17  8:58   ` Christian Egli
  0 siblings, 1 reply; 3+ messages in thread
From: David Maus @ 2010-06-17  6:44 UTC (permalink / raw)
  To: emacs-orgmode

* 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'.
---
 lisp/org-taskjuggler.el |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org-taskjuggler.el b/lisp/org-taskjuggler.el
index f64138e..cb3b079 100644
--- a/lisp/org-taskjuggler.el
+++ b/lisp/org-taskjuggler.el
@@ -326,9 +326,9 @@ 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)))
+	 (command (concat "TaskJugglerUI " file-name)))
+    (start-process-shell-command command nil command)))
 
 (defun org-taskjuggler-parent-is-ordered-p ()
   "Return true if the parent of the current node has a property
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Call `start-process-shell-command' with just 3 arguments.
  2010-06-17  6:44 ` [PATCH] Call `start-process-shell-command' " David Maus
@ 2010-06-17  8:58   ` Christian Egli
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Egli @ 2010-06-17  8:58 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1284 bytes --]

Hi David


David Maus <dmaus@ictsoc.de> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch for taskjuggler export --]
[-- Type: text/x-diff, Size: 1797 bytes --]

From 2a52eea0d0d20bfcf68375b3aa2fe5bdf402e2d3 Mon Sep 17 00:00:00 2001
From: Christian Egli <christian.egli@alumni.ethz.ch>
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  <christian.egli@sbszh.ch>
+
+	* 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  <christian.egli@sbszh.ch>
 
 	* 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


[-- Attachment #3: Type: text/plain, Size: 133 bytes --]


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

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-17  8:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-17  6:44 [PATCH] org-taskjuggler.el: Call start-process-shell-command with just 3 arguments David Maus
2010-06-17  6:44 ` [PATCH] Call `start-process-shell-command' " David Maus
2010-06-17  8:58   ` Christian Egli

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.