From: Christian Egli <christian.egli@sbszh.ch>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Call `start-process-shell-command' with just 3 arguments.
Date: Thu, 17 Jun 2010 10:58:49 +0200 [thread overview]
Message-ID: <87ocfa3uie.fsf@saadawi.sbszh.ch> (raw)
In-Reply-To: 1276757087-23110-2-git-send-email-dmaus@ictsoc.de
[-- 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
prev parent reply other threads:[~2010-06-17 8:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ocfa3uie.fsf@saadawi.sbszh.ch \
--to=christian.egli@sbszh.ch \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).