From 2927bcac90cb7c81fc022dfacf8bec2dac136984 Mon Sep 17 00:00:00 2001 From: Tristin Celestin Date: Thu, 28 Oct 2010 21:27:44 -0400 Subject: [PATCH] Changed mojo-emulator-running-p to detect when a (versioned) SDK is running on OS X. Added custom variable mojo-sdk-version --- src/code.el | 11 ++++++++++- src/template.el | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/code.el b/src/code.el index 187b38f..a290b7c 100644 --- a/src/code.el +++ b/src/code.el @@ -52,6 +52,11 @@ ("\C-c\C-c\C-t" . mojo-toggle-target)) :group 'mojo) +(defcustom mojo-sdk-version "" + "Version of the SDK installed. Since 1.4.5, the PDK and SDK are installed +at the same time, so there is only one var for both" + :version "1.4.5.465") + (defcustom mojo-sdk-directory (case system-type ((windows-nt) "c:/progra~1/palm/sdk") @@ -819,7 +824,11 @@ for the emulator. Deaults to \"tcp\".") "Determine if the webOS emulator is running or not. This command only works on Unix-like systems." - (= 0 (shell-command "ps x | fgrep 'Palm SDK' | fgrep -v fgrep >/dev/null 2>&1"))) + (case system-type + ((windows-nt) nil) + (darwin (= 0 (shell-command (concat "ps x | fgrep '" mojo-sdk-version "' | fgrep -v fgrep >/dev/null 2>&1")))) + (t (= 0 (shell-command "ps x | fgrep 'Palm SDK' | fgrep -v fgrep >/dev/null 2>&1"))))) + (defun mojo-emulator-responsive-p () "Determine if the webOS emulator is able to respond to commands yet. diff --git a/src/template.el b/src/template.el index 71e6121..e727076 100644 --- a/src/template.el +++ b/src/template.el @@ -26,6 +26,10 @@ ideas. Send me a pull request on github if you hack on mojo.el.") ;; ;; Below are customizable option list: ;; +;; `mojo-sdk-version' +;; Version of installed SDK +;; default = 1.4.5.465 +;; ;; `mojo-sdk-directory' ;; Path to where the mojo SDK is. ;; default = (case system-type