mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
189 lines
7 KiB
HTML
189 lines
7 KiB
HTML
<!doctype html>
|
|
<meta charset=utf-8>
|
|
<meta name=viewport content=width=device-width>
|
|
<title>Using Emacs to Develop Mojo Apps for WebOS :: samhuri.net</title>
|
|
<link rel=stylesheet href=../assets/blog.css>
|
|
<link rel=alternate type=application/rss+xml href=http://samhuri.net/blog/sjs.rss title="sjs' blog">
|
|
<script>
|
|
var _gaq = _gaq || [];
|
|
_gaq.push( ['_setAccount', 'UA-214054-5']
|
|
, ['_trackPageview']
|
|
)
|
|
|
|
;(function() {
|
|
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true
|
|
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'
|
|
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s)
|
|
})()
|
|
</script>
|
|
<script src=http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js></script>
|
|
<script>
|
|
window.SJS = window.SJS || {}
|
|
SJS.filename = "2009-11-21_using-emacs-to-develop-mojo-apps-for-webos.html"
|
|
</script>
|
|
<script src=../assets/blog-all.min.js></script>
|
|
<header>
|
|
<h1><a href=index.html>sjs' blog</a></h1>
|
|
</header>
|
|
<nav id=breadcrumbs><a href=../>samhuri.net</a> → <a href=index.html>blog</a></nav>
|
|
<div id=posts>
|
|
|
|
<article>
|
|
<header>
|
|
<h1><a href=2009-11-21_using-emacs-to-develop-mojo-apps-for-webos.html>Using Emacs to Develop Mojo Apps for WebOS</a></h1>
|
|
<time>November 21, 2009</time>
|
|
</header>
|
|
<p>
|
|
The latest technology I've been learning is Palm's SDK for webOS,
|
|
Mojo. My first impression is that it's a great platform and
|
|
Palm could do a great job of 2.0 if they cut down on some of the
|
|
verbosity of gluing together the UI. I have learned to like
|
|
JavaScript over the years as I learned that despite its
|
|
warts <a href="http://ca.video.yahoo.com/watch/630959/2974197">there
|
|
are good parts</a> too. If you squint just right you can
|
|
see that it's scheme with Algol syntax. HTML and CSS are what
|
|
they are, but with WebKit running the show and only a single engine
|
|
to target it's not that bad. I've gone from Eclipse to Emacs
|
|
for the coding itself and highly recommend Emacs for Mojo
|
|
development. There is nothing that I miss from the Eclipse or
|
|
Komodo Edit thanks to the fact that Mojo uses open languages and
|
|
standards.
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
As far as actual development goes the Mojo documentation steers you
|
|
towards a combination of Eclipse, Palm's Mojo plugin for Eclipse,
|
|
and the Aptana Studio plugin. My editor of choice is Emacs but
|
|
I decided to give it a spin just to get started quickly, how bad
|
|
could it be? I'm not going to get into details but I will say that I
|
|
don't think I'll ever use Eclipse for anything; it's far too
|
|
sluggish and provides no compelling features for the languages
|
|
that I use. I tried Komodo Edit and it was significantly
|
|
better but still not for me. Emacs is great for editing HTML,
|
|
JavaScript, and CSS so all I really missed from the IDEs were the
|
|
shortcuts to package, install, and launch apps in the
|
|
emulator. I headed over to
|
|
the <a href="http://www.emacswiki.org/">Emacs Wiki</a> and
|
|
downloaded Jonathan
|
|
Arkell's <a href="http://www.emacswiki.org/emacs/MojoSdk">Mojo
|
|
support for Emacs</a> which provided a great base to get
|
|
started with. There are wrappers around (all?) of the Palm SDK
|
|
commands but it needed a bit of work to make it just do what I
|
|
wanted with as little input and thought as possible.
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
A couple of of Lisp hacking sessions later and I'm happy enough with
|
|
mojo.el to bump the version to v0.9. I've checked off what I
|
|
feel are the most important checkpoints on
|
|
the <a href="http://www.webos-internals.org/wiki/Comparison_of_Editors">webOS
|
|
Internals comparison of editors</a> and the framework is in
|
|
place to make implementing most of the remaining commands very
|
|
trivial. I might take a bit of time today to flesh things out
|
|
just to check more points off so people feel more confident that
|
|
it's a fully featured environment, because it certainly is.
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
It now requires json.el in order to parse appinfo.json. json.el
|
|
might be included with Emacs if you have a very recent version,
|
|
otherwise you can google for it or get it from
|
|
my <a href="https://github.com/samsonjs/config/tree/master/emacs.d">config
|
|
file repo on github</a> where you can also find my latest
|
|
version of mojo.el. You still just (require 'mojo) in your
|
|
.emacs file.
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
The wrappers around Palm SDK commands now search upwards for the
|
|
Mojo project root directory (from the default-directory for
|
|
current-buffer) and parse appinfo.json to give you sane defaults for
|
|
mojo-package, mojo-install, mojo-launch, mojo-delete, and
|
|
mojo-inspect. You can list installed apps and when entering app
|
|
ids there is completion and history, as you have come to expect in
|
|
Emacs. The most useful command for development is
|
|
mojo-package-install-and-inspect which does exactly what it says:
|
|
packages, installs, and launches the application for
|
|
inspection. No interaction is required as long as you are
|
|
editing a buffer inside your Mojo project.
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
If you read the install instructions in mojo.el and decide to setup
|
|
some keybindings then you will have single-task commands for
|
|
packaging, installing, launching, or all three steps at once.
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
Please give me some feedback if you try this out. I've
|
|
developed it on Mac OS X and Jonathan on Windows so please try it on
|
|
Linux and send me a patch or even better a pull request on github if
|
|
it needs some work. There is room for improvement. The next feature
|
|
on my radar before I would consider it worthy of a v1.0 tag is
|
|
intelligent switching to corresponding buffers,
|
|
e.g. mojo-switch-to-view, mojo-switch-to-assistant, things like
|
|
that. Basically things I miss from the Rails package for Emacs.
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p>Happy hacking!</p>
|
|
|
|
|
|
</article>
|
|
</div>
|
|
<p class=sep>༄</p>
|
|
<div id=around>
|
|
<a id=next href=2010-01-17_working-with-c-style-structs-in-ruby.html>Working with C-style structs in Ruby →</a>
|
|
<br style=clear:both>
|
|
</div>
|
|
<p id=need-js align=center><strong>(discussion requires JavaScript)</strong></p>
|
|
<div class=center id=sd-container><a id=sd href=#comment-stuff>show the discussion</a></div>
|
|
<div id=comment-stuff>
|
|
<div id=comments>
|
|
<div id=comments-spinner><img src=../assets/spinner.gif></div>
|
|
</div>
|
|
<form id=comment-form>
|
|
<input name=post type=hidden value=2009-11-21_using-emacs-to-develop-mojo-apps-for-webos.html>
|
|
<p><input name=name type=text placeholder=name></p>
|
|
<p><input name=email type=text placeholder=email></p>
|
|
<p><input name=url type=text placeholder=url></p>
|
|
<p><textarea name=body placeholder=thoughts></textarea></p>
|
|
<p align=center><input type=submit value='so there'></p>
|
|
</form>
|
|
</div>
|
|
<script type="text/html" id="comment_tmpl">
|
|
<div class=comment>
|
|
<p>
|
|
<% if (url) { %>
|
|
<a href="<%= url %>"><%= name %></a>
|
|
<% } else { %>
|
|
<%= name %>
|
|
<% } %>
|
|
@ <%= strftime('%F %r', new Date(timestamp)) %>
|
|
</p>
|
|
<blockquote><%= html %></blockquote>
|
|
</div>
|
|
</script>
|
|
<footer>
|
|
<a href=https://twitter.com/_sjs>@_sjs</a>
|
|
</footer>
|