From 717c432fcad35f004a9957bd2e0fca014039053c Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Mon, 7 Dec 2009 15:24:30 -0800 Subject: [PATCH] bumped mojo.el to 0.9.10 --- emacs | 2 +- emacs.d/mojo.el | 29 +++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/emacs b/emacs index e166eeb..aef4042 100644 --- a/emacs +++ b/emacs @@ -380,7 +380,7 @@ '(js2-bounce-indent-p t) '(js2-highlight-level 3) '(mojo-build-directory "~/Projects/brighthouse/webOS/build") - '(mojo-debug nil) + '(mojo-debug t) '(mojo-project-directory "~/Projects/brighthouse/webOS") '(remote-shell-program "/usr/bin/ssh") '(save-place t nil (saveplace)) diff --git a/emacs.d/mojo.el b/emacs.d/mojo.el index 15f66e1..7af7839 100644 --- a/emacs.d/mojo.el +++ b/emacs.d/mojo.el @@ -1,6 +1,6 @@ ;;; mojo.el --- Interactive functions for webOS development -;; 2009-12-04 15:44:24 -(defconst mojo-version "0.9.9") +;; 2009-12-07 14:28:52 +(defconst mojo-version "0.9.10") (require 'json) @@ -86,6 +86,7 @@ ideas. Send me a pull request on github if you hack on mojo.el.") ;; * C-c C-c S -- mojo-switch-to-stylesheet ;; * C-c C-c v -- mojo-switch-to-view ;; * C-c C-c SPC -- mojo-switch-file-dwim +;; * C-c C-c C-d -- mojo-target-device ;; * C-c C-c C-e -- mojo-emulate ;; * C-c C-c C-p -- mojo-package ;; * C-c C-c C-r -- mojo-package-install-and-inspect @@ -221,6 +222,7 @@ ideas. Send me a pull request on github if you hack on mojo.el.") ;; mojo-set-escape-html-in-templates ;; Enable or disable escaping of HTML in templates. + ;;; Customizable Options: ;; ;; Below are customizable option list: @@ -243,6 +245,16 @@ ideas. Send me a pull request on github if you hack on mojo.el.") ;; CHANGELOG ;; ========= ;; +;; sjs 2009-12-07 +;; v 0.9.10 (bug fix) +;; +;; - All arguments sent through mojo-cmd now quoted before being +;; sent to the shell (in case filenames contain spaces). Values +;; are unintelligently wrapped in double quotes, this is *not* +;; escaping, just brain-dead quoting. +;; +;; - New default key binding: C-c C-c C-d runs mojo-target-device +;; ;; sjs 2009-12-04 ;; v 0.9.9 (bug fix) ;; @@ -364,6 +376,7 @@ ideas. Send me a pull request on github if you hack on mojo.el.") * C-c C-c S -- \\[mojo-switch-to-stylesheet] * C-c C-c v -- \\[mojo-switch-to-view] * C-c C-c SPC -- \\[mojo-switch-file-dwim] + * C-c C-c C-d -- \\[mojo-target-device] * C-c C-c C-e -- \\[mojo-emulate] * C-c C-c C-p -- \\[mojo-package] * C-c C-c C-r -- \\[mojo-package-install-and-inspect] @@ -386,6 +399,7 @@ ideas. Send me a pull request on github if you hack on mojo.el.") ("\C-c\C-cS" . mojo-switch-to-stylesheet) ("\C-c\C-cv" . mojo-switch-to-view) ("\C-c\C-c " . mojo-switch-file-dwim) + ("\C-c\C-c\C-d" . mojo-target-device) ("\C-c\C-c\C-e" . mojo-emulate) ("\C-c\C-c\C-p" . mojo-package) ("\C-c\C-c\C-r" . mojo-package-install-and-inspect) @@ -464,6 +478,7 @@ NAME is the name of the scene." (defun mojo-emulate () "Launch the palm emulator." (interactive) + (mojo-target-emulator) ;; target emulator from now on (unless (mojo-emulator-running-p) (mojo-cmd "palm-emulator" nil))) @@ -1119,6 +1134,12 @@ This command only works on Unix-like systems." ((windows-nt) (concat mojo-sdk-directory "/bin/" cmd ".bat")) (t (concat mojo-sdk-directory "/bin/" cmd)))) +(defun mojo-quote (string) + "Wrap a string in double quotes. + +Used to quote filenames sent to shell commands." + (concat "\"" string "\"")) + ;;* lowlevel cmd (defun mojo-cmd (cmd args) "General interface for running mojo-sdk commands. @@ -1128,8 +1149,8 @@ CMD is the name of the command (without path or extension) to execute. ARGS is a list of all arguments to the command. These arguments are NOT shell quoted." (let ((cmd (mojo-path-to-cmd cmd)) - (args (mojo-string-join " " args))) - (if mojo-debug (message "running %s with args %s " cmd args)) + (args (mojo-string-join " " (mapcar 'mojo-quote args)))) + (when mojo-debug (message "running %s with args %s " cmd args)) (shell-command (concat cmd " " args)))) ;;* lowlevel cmd