<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sacha chua :: enterprise 2.0 consultant, storyteller, geek &#187; emacs</title>
	<atom:link href="http://sachachua.com/wp/category/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://sachachua.com/wp</link>
	<description>I help organizations and people learn how to connect and collaborate more effectively using Web 2.0 tools.</description>
	<lastBuildDate>Fri, 12 Mar 2010 13:00:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Behind the scenes: Livin&#8217; la Vida Emacs</title>
		<link>http://sachachua.com/wp/2009/12/behind-the-scenes-livin-la-vida-emacs/</link>
		<comments>http://sachachua.com/wp/2009/12/behind-the-scenes-livin-la-vida-emacs/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 13:37:00 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[democamp]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[emacspeak]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[speaking]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/2009/12/07/behind-the-scenes-livin-la-vida-emacs/</guid>
		<description><![CDATA[In October 2006, I gave a short presentation on Livin’ la Vida Emacs (or the Emacs editor as a way of life). It was well-received—in fact, so well-received that folks in the audience anticipated my punchlines and I ended up shifting parts of my talk around.  

People said:
Last, and certainly not least was Sacha [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/12/behind-the-scenes-livin-la-vida-emacs/">Behind the scenes: Livin&rsquo; la Vida Emacs</a></p>
]]></description>
			<content:encoded><![CDATA[<p>In October 2006, I gave a short presentation on Livin’ la Vida Emacs (or the Emacs editor as a way of life). It was well-received—in fact, so well-received that folks in the audience anticipated my punchlines and I ended up shifting parts of my talk around. <img src='http://sachachua.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/eoyi2vrsWow&amp;hl=en_US&amp;fs=1&amp;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/eoyi2vrsWow&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>People said:</p>
<blockquote><p>Last, and certainly not least was Sacha Chua. If we could harness it I&#8217;m pretty sure we could power a few small cities of the energy that&#8217;s contained in this one, tiny person &#8211; especially when you get her talking about Emacs. Sacha&#8217;s demo, entitled, &#8220;Livin&#8217; la vida Emacs&#8221; was hands down the most entertaining of the evening. Sacha has basically taken this simple, extendable text editor and pushed it about as far as it can go &#8211; at DemoCamp10 she pulled back the curtain and showed us all her little systems and apps she&#8217;s created in it. I like my GUI/Windows so the whole text-based thing isn&#8217;t for me but it certainly was interesting to see just how strung out she&#8217;s got that machine.</p>
</blockquote>
<p>Ryan Coleman</p>
<blockquote><p>Sacha Chua showed off what can be done in the scriptable environment, in this case emacs, as she went from Text editor, to a.i. doctor, to game engine to task / email organizer and beyond. Sacha was six feet tall on that stage, even though she did not actual levitate at anytime (although she came close, as always). A Tour de force of the Emacs, a text editing tool built in a interpreted lisp language environment, bascially a personalized productivity platform which allows for massive customization. Sacha had the crowd entertained and enthralled. (Sacha blogged her own impressions and mentions that Emacs was speaking to her!)</p>
</blockquote>
<p>Ian Irving</p>
<blockquote><p>Within Toronto’s Web community, Sacha Chua has become one of the leading “personalities”. Armed with infectious enthusiasm, charm and smarts, she would be an excellent person to hire once she graduates from UoT. The key question is how best to use her talents. It would probably be as a customer service rep, who can come into a bad situation and get everyone happy by the time she leaves. If I was an HR person from Microsoft, IBM, etc. I’d be knocking on Sacha’s door ASAP.</p>
</blockquote>
<p>Mark Evans, consultant</p>
<p>Why? Probably because in addition to my natural sugar high, I was also presenting something that was awesomely, arcanely geeky. =)</p>
<p>I hadn’t figured out how to make a screencast on Linux, so the actual display on my screen is lost to time. I do, however, have the source code that I used to step through my speech&#8211;including speaking cues, as I didn’t want to mess up the presentation in front of Toronto’s technorati! So here’s the <a href="http://sachachua.com/notebook/emacs/democamp.el">source code</a>, for your amusement. I set up two of my function keys to go forward and backward, executing the parenthesized expressions. I also set up a hidden window that could handle my speaking cues so that Emacs could remind me what the next &#8220;slide&#8221; was before I transitioned to it, for smoother flow. <code>emacspeak-speak-buffer</code> is a function that reads the current window&#8217;s text using the Emacspeak speech interface with the Festival synthesizer I&#8217;d configured. At some point, I switched to a more interactive demo, but I still had the speaking cues remind me of the sequence. So yes, Emacs really was telling me what to say. <img src='http://sachachua.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </p>
<pre class="code"><span class="comment-delimiter">;; </span><span class="comment">Emacs as a text editor
</span>
(<span class="keyword">progn</span> <span class="comment-delimiter">;; </span><span class="comment">Setup
</span>  (<span class="keyword">defvar</span> <span class="variable-name">democamp/presentation-file</span> <span class="string">"~/democamp.el"</span>)
  (<span class="keyword">defvar</span> <span class="variable-name">democamp/cue-buffer</span> <span class="string">"*DemoCamp*"</span>)
  (<span class="keyword">defun</span> <span class="function-name">democamp/next</span> ()
    (interactive)
    (<span class="keyword">let</span> (start sexp)
      (<span class="keyword">with-current-buffer</span> (find-file-noselect democamp/presentation-file)
        (setq start (point))
        (forward-sexp)
        (setq sexp (buffer-substring-no-properties start (point))))
      (eval (read sexp))))

  (<span class="keyword">defun</span> <span class="function-name">democamp/previous</span> ()
    (interactive)
    (<span class="keyword">let</span> (start sexp)
      (<span class="keyword">with-current-buffer</span> (find-file-noselect democamp/presentation-file)
        (setq start (point))
        (backward-sexp)
        (setq sexp (buffer-substring-no-properties (point) start)))
      (eval (read sexp))))

  (<span class="keyword">defun</span> <span class="function-name">democamp/repeat</span> ()
    (interactive)
    (<span class="keyword">let</span> (start sexp)
      (<span class="keyword">with-current-buffer</span> (find-file-noselect democamp/presentation-file)
        (setq start (point))
        (backward-sexp)
        (setq sexp (buffer-substring (point) start))
        (forward-sexp))
      (eval (read sexp))))

  (<span class="keyword">defun</span> <span class="function-name">democamp/say</span> (text)
    (<span class="keyword">with-current-buffer</span> (get-buffer-create democamp/cue-buffer)
      (erase-buffer)
      (insert text)
      (goto-char (point-min))
      (call-interactively 'emacspeak-speak-buffer)))
  (global-set-key (kbd <span class="string">"&lt;f12&gt;"</span>) 'democamp/next)
  (global-set-key (kbd <span class="string">"S-&lt;f12&gt;"</span>) 'democamp/previous)
  (global-set-key (kbd <span class="string">"C-&lt;f12&gt;"</span>) 'democamp/repeat)
)

<span class="comment-delimiter">;; </span><span class="comment">Window register a
</span>(<span class="keyword">progn</span>
  (menu-bar-mode 1)
  (tool-bar-mode 1)
  (set-face-attribute 'default nil <span class="builtin">:height</span> 200)
  (find-file <span class="string">"~/hello.txt"</span>)
  (democamp/say <span class="string">"I don't know why people are so intimidated by Emacs. It's a text editor. It has menus and toolbars and everything."</span>)
  (frame-configuration-to-register ?a)) 

(<span class="keyword">progn</span>
  (democamp/say <span class="string">"Spell-check, too."</span>)
  (load-library <span class="string">"flyspell"</span>)
  (load-library <span class="string">"emacspeak-flyspell"</span>)
  (setq emacspeak-flyspell-highlight-personality nil)
  (flyspell-mode 1))

<span class="comment-delimiter">;; </span><span class="comment">Emacs learning curve
</span><span class="comment-delimiter">;; </span><span class="comment">Frame configuration b
</span>(<span class="keyword">progn</span>
  (find-file <span class="string">"~/tmp/learningcurves.jpg"</span>)
  (democamp/say <span class="string">"So why are people terrified of Emacs?"</span>))

(<span class="keyword">progn</span>
  (set-face-attribute 'default nil <span class="builtin">:height</span> 700)
  (delete-other-windows)
  (sit-for 1)
  (animate-sequence (list <span class="string">"Livin' la Vida Emacs"</span> <span class="string">"DemoCamp10"</span> <span class="string">"Sacha Chua"</span> <span class="string">"Oct 23, 2006"</span>) 1))

(<span class="keyword">progn</span>
  (set-face-attribute 'default nil <span class="builtin">:height</span> 200)
  (democamp/say <span class="string">"Emacs comes with a psychotherapist."</span>)
  (doctor))
(<span class="keyword">progn</span>
  (democamp/say <span class="string">"an adventure game"</span>)
  (dunnet))
(<span class="keyword">progn</span>
  (democamp/say <span class="string">"random geek stuff"</span>)
  (hanoi 3))
(<span class="keyword">progn</span>
  (democamp/say <span class="string">"even Snake"</span>)
  (delete-other-windows)
  (snake))
(<span class="keyword">progn</span>
  (democamp/say <span class="string">"And of course, my favorite game, Nethack."</span>)
  (load-library <span class="string">"nethack-config"</span>)
  (nethack))
(democamp/say <span class="string">"Some of it is useful"</span>)
<span class="comment-delimiter">;; </span><span class="comment">Flashcard
</span>(<span class="keyword">progn</span>
  (democamp/say <span class="string">"Flashcards"</span>)
  (load-library <span class="string">"flashcard-config"</span>)
  (find-file <span class="string">"~/notebook/japan/japanese.deck"</span>)
  (goto-char (point-max)))
<span class="comment-delimiter">;; </span><span class="comment">With fortunes
</span>(<span class="keyword">progn</span>
  (democamp/say <span class="string">"And you can mash things together"</span>)
  (load-library <span class="string">"fortune"</span>)
  (setq fortune-file <span class="string">"/usr/share/games/fortunes/computers"</span>)
  (fortune)
  (delete-other-windows))
(<span class="keyword">progn</span>
  (find-file-other-window <span class="string">"~/notebook/japan/japanese.deck"</span>)
  (goto-char (point-max)))

<span class="comment-delimiter">;; </span><span class="comment">Planner
</span>(democamp/say <span class="string">"Now the wild stuff starts."</span>)
(<span class="keyword">progn</span>
  (planner-goto-today)
  (delete-other-windows)
  (democamp/say <span class="string">"Emacs: more than just an editor. It's a way of life."</span>))

<span class="comment-delimiter">;; </span><span class="comment">- Show tasks
</span>(democamp/say <span class="string">"I use Emacs to manage my tasks with Planner."</span>)
(democamp/say <span class="string">"I can even keep detailed time logs!"</span>)
(<span class="keyword">progn</span>
  (load-library <span class="string">"/usr/src/planner-el/planner-timeclock-summary.el"</span>)
  (planner-timeclock-summary-show (planner-today)))

<span class="comment-delimiter">;; </span><span class="comment">- Show notes
</span>(democamp/say <span class="string">"... blog..."</span>)
<span class="comment-delimiter">;; </span><span class="comment">- Jump to URL in w3m
</span>(democamp/say <span class="string">"... surf the Web (with tabbed browsing and a custom keymap!)"</span>)
33<span class="comment-delimiter">;; </span><span class="comment">- Jump to URL in Firefox
</span>(democamp/say <span class="string">"Although sometimes you really want Firefox."</span>)
<span class="comment-delimiter">;; </span><span class="comment">- Jump to task from mail message
</span>(democamp/say <span class="string">"I can hyperlink to pretty much anything."</span>)
(democamp/say <span class="string">"People's contact information"</span>)
(democamp/say <span class="string">"E-mail, etc."</span>)
(democamp/say <span class="string">"Which comes in handy when I need to create tasks from mail messages."</span>)
<span class="comment-delimiter">;; </span><span class="comment">Add note to BBDB from mail message
</span>(<span class="keyword">progn</span>
  (democamp/say <span class="string">"Keeping track of the number of recipients"</span>)
  (planner-visit-link <span class="string">"pos://~/.gnus#19820"</span>))
(democamp/say <span class="string">"BBDB indicators"</span>)

<span class="comment-delimiter">;; </span><span class="comment">Reply to message with nickname,
</span>(<span class="keyword">progn</span>
  (democamp/say <span class="string">"CRM in e-mail: Nicknames..."</span>)
  (planner-visit-link <span class="string">"pos://~/.gnus#16025"</span>))

<span class="comment-delimiter">;; </span><span class="comment">and show how it shows up in BBDB record and ping code
</span>(<span class="keyword">progn</span>
  (democamp/say <span class="string">"... notes..."</span>)
  (planner-visit-link <span class="string">"pos://~/.gnus#18804"</span>))

(<span class="keyword">progn</span>
  (democamp/say <span class="string">"... pings..."</span>)
  (planner-visit-link <span class="string">"pos://~/.gnus#16932"</span>))

(democamp/say <span class="string">"... filters..."</span>)
(democamp/say <span class="string">"So those are just a few examples of the crazy stuff you can do if you have an infinitely tweakable environment."</span>)
(democamp/say <span class="string">"Sacha, remember to plug in the speakers."</span>)
(democamp/say <span class="string">"Demo Campers, welcome to Emacs. What else do you want it to do?"</span>)
</pre>
<p>I love pushing the envelope. I love getting to know my tools inside and out (I enjoy reading source code!) and then making them do things other people can’t imagine. I love tweaking processes in real life, too, making them better and better every time. That’s just part of the way I <strike>work</strike> have fun. =)</p>
<p>How can you rock your next technical demo?</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/12/behind-the-scenes-livin-la-vida-emacs/">Behind the scenes: Livin&rsquo; la Vida Emacs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2009/12/behind-the-scenes-livin-la-vida-emacs/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Automating tedious wiki editing tasks with Emacs and w3m</title>
		<link>http://sachachua.com/wp/2009/11/automating-tedious-wiki-editing-tasks-with-emacs-and-w3m/</link>
		<comments>http://sachachua.com/wp/2009/11/automating-tedious-wiki-editing-tasks-with-emacs-and-w3m/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 19:24:31 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/2009/11/17/automating-tedious-wiki-editing-tasks-with-emacs-and-w3m/</guid>
		<description><![CDATA[I needed to update many of the links in our wiki because a team member left, so I had to reupload all of her files to a shared service and change all the URLs to point to the new files. Unfortunately, the file service didn’t send me the former URLs of the files, so that [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/11/automating-tedious-wiki-editing-tasks-with-emacs-and-w3m/">Automating tedious wiki editing tasks with Emacs and w3m</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I needed to update many of the links in our wiki because a team member left, so I had to reupload all of her files to a shared service and change all the URLs to point to the new files. Unfortunately, the file service didn’t send me the former URLs of the files, so that was going to be a manual process. Our wiki had 149 pages in it. Not fun.</p>
<p>After a few pages of editing (and correcting the occasional typo that crept in as I changed URLs), I decided to partially automate the process. Using a smidgen of Emacs Lisp, I created a function that pasted text into a temporary buffer, performed whatever automatic fixes it could make, prompted me for any URLs it didn’t recognize, remembered the old URL – new URL mapping I defined, and copied the text back.</p>
<p>The function looked somewhat like this:</p>
<style type="text/css">
pre.code { background: black; color: white }
.code .comment { background: black; border: 0 }
      .comment {
        /* font-lock-comment-face */
        color: #ff7f24;
      }
      .comment-delimiter {
        /* font-lock-comment-delimiter-face */
        color: #ff7f24;
      }
      .doc {
        /* font-lock-doc-face */
        color: #ffa07a;
      }
      .function-name {
        /* font-lock-function-name-face */
        color: #87cefa;
      }
      .keyword {
        /* font-lock-keyword-face */
        color: #00ffff;
      }
      .negation-char {
      }
      .regexp-grouping-backslash {
        /* font-lock-regexp-grouping-backslash */
        font-weight: bold;
      }
      .regexp-grouping-construct {
        /* font-lock-regexp-grouping-construct */
        font-weight: bold;
      }
      .string {
        /* font-lock-string-face */
        color: #ffa07a;
      }
      .variable-name {
        /* font-lock-variable-name-face */
        color: #eedd82;
      }
</style>
<pre class="code">(<span class="keyword">defvar</span> <span class="variable-name">sacha/wiki-links</span> nil <span class="doc">"Associative list of (old-url . new-url)."</span>)
(<span class="keyword">defun</span> <span class="function-name">sacha/wiki-fix</span> ()
  (interactive)
  (<span class="keyword">with-temp-buffer</span>
    <span class="comment-delimiter">;; </span><span class="comment">Insert text from clipboard
</span>    (yank)
    (goto-char (point-min))
    <span class="comment-delimiter">;; </span><span class="comment">Look for all the links
</span>    (<span class="keyword">while</span> (re-search-forward
            <span class="string">"\\[</span><span class="string"><span class="regexp-grouping-backslash">\\</span></span><span class="string"><span class="regexp-grouping-construct">(</span></span><span class="string">[</span><span class="string"><span class="negation-char">^</span></span><span class="string">|]+</span><span class="string"><span class="regexp-grouping-backslash">\\</span></span><span class="string"><span class="regexp-grouping-construct">)</span></span><span class="string">|</span><span class="string"><span class="regexp-grouping-backslash">\\</span></span><span class="string"><span class="regexp-grouping-construct">(</span></span><span class="string">[</span><span class="string"><span class="negation-char">^</span></span><span class="string">\]]+</span><span class="string"><span class="regexp-grouping-backslash">\\</span></span><span class="string"><span class="regexp-grouping-construct">)</span></span><span class="string">\\]"</span> nil t)
      <span class="comment-delimiter">;; </span><span class="comment">Check if it's one of the links I want to replace
</span>      (<span class="keyword">if</span> (or (string-match-p <span class="string">"viewpage"</span> (match-string 2))
              (string-match-p <span class="string">"lsoohoo"</span> (match-string 2)))
          (replace-match
           (<span class="keyword">save-match-data</span>
             <span class="comment-delimiter">;; </span><span class="comment">Prompt and the entry to the map if it does not yet exist
</span>             (<span class="keyword">unless</span> (assoc (match-string 2) sacha/wiki-links)
               (add-to-list 'sacha/wiki-links
                            (cons (match-string 2)
                                  (read-string (concat (match-string 1)
                                                       <span class="string">"? "</span>)))))
             <span class="comment-delimiter">;; </span><span class="comment">pick up the corresponding URL
</span>             (cdr (assoc (match-string 2) sacha/wiki-links)))
           t t nil 2)))
    <span class="comment-delimiter">;; </span><span class="comment">Copy the text into the clipboard
</span>    (kill-new (buffer-string))))
</pre>
<p>I used <code>M-x global-set-key</code> to bind a convenient function key to it (F12, I think), and then it was just a matter of clicking on each page, clicking on Edit, typing Ctrl-C to copy the text, switching to Emacs, pressing F12, switching back to my browser, typing Ctrl-V, and saving the wiki page. I also added some lines (not shown here) to convert the previous wiki gardener&#8217;s full links to intrawiki links, change server URLs, and do other fun things.</p>
<p>I thought about fully automating it (somehow hooking into w3, perhaps?), but that seemed to be more trouble than needed. Besides, it was good to review all the pages.</p>
<p>As a result of this Emacs wizardry, processing all 149 wiki pages took me a few hours instead of a few days. Yay!</p>
<p>Of course, I finished the last wiki page, I found out that I needed to change the servers in the URL. I decided to go ahead and fully automate the darn thing.</p>
<p>I extracted a list of URLs for the wiki by viewing the tree version of the wiki index. It used Javascript, so I couldn&#8217;t just pull the URLs out of the source code. Fortunately, the Firebug plugin for Firefox lets me copy the rendered HTML, so I used that instead. Some judicious text-editing later (<code>replace-regexp</code> rocks), I had a list of URLs to the different pages. I knew I needed to put in some kind of delay when loading web pages. <code>sleep-for</code> let me spread out my requests so I didn&#8217;t hammer the server too badly. Reading the w3m.el source code turned up <code>w3m-async-exec</code>. Once I set that to nil, requesting web pages and running code on the results turned out to be straightforward. Selecting the right widgets was a bit of a hack (<code>re-search-forward</code> here, <code>w3m-previous-anchor</code> there), but hey, it worked. After confirming it by manually running it on a few pages, I left it merrily running in the background.</p>
<p>Here it is (some tweaking required):
<pre class="code">(<span class="keyword">defun</span> <span class="function-name">sacha/edit-wiki-page</span> ()
  (interactive)
  (<span class="keyword">let</span> ((buffer (current-buffer))
        (w3m-async-exec nil)
        (delay 5)) <span class="comment-delimiter">;; </span><span class="comment">number of seconds
</span>    <span class="comment-delimiter">;; </span><span class="comment">While not at the end of the buffer
</span>    (<span class="keyword">while</span> (not (eobp))
      <span class="comment-delimiter">;; </span><span class="comment">Load the URL on the current line
</span>      (w3m-browse-url
       (buffer-substring
        (line-beginning-position)
        (line-end-position)))
      <span class="comment-delimiter">;; </span><span class="comment">Look for the edit button
</span>      (goto-char (point-min))
      (<span class="keyword">when</span> (search-forward <span class="string">"Edit"</span> nil t)
        <span class="comment-delimiter">;; </span><span class="comment">Click it
</span>        (w3m-view-this-url)
        <span class="comment-delimiter">;; </span><span class="comment">Look for the Minor change checkbox
</span>        (goto-char (point-min))
        (<span class="keyword">when</span> (search-forward <span class="string">"Minor change"</span> nil t)
          <span class="comment-delimiter">;; </span><span class="comment">The text area is the second widget back
</span>          (w3m-previous-anchor 2)
          <span class="comment-delimiter">;; </span><span class="comment">Open the text area in a temporary buffer for editing
</span>          (w3m-view-this-url)
          <span class="comment-delimiter">;; </span><span class="comment">Do the changes
</span>          (<span class="keyword">while</span> (re-search-forward <span class="string">"https?://example.com/path"</span> nil t)
            (replace-match <span class="string">"http://path.example.com"</span> t t nil 0))
          <span class="comment-delimiter">;; </span><span class="comment">Save the value
</span>          (w3m-form-input-textarea-set)
          (<span class="keyword">when</span> (search-backward <span class="string">"Save"</span> nil t)
            (w3m-view-this-url))))
      (switch-to-buffer buffer)
      (forward-line)
      (sleep-for delay))))</pre>
<p>I’m sure this kind of automation might be possible with lots of hacking in Mozilla Firefox, and I’ve seen great scripts for the Mac, too. But I know Emacs, I’m comfortable digging into source code, and I can make things work.</p>
<p>Awesome. =D</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/11/automating-tedious-wiki-editing-tasks-with-emacs-and-w3m/">Automating tedious wiki editing tasks with Emacs and w3m</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2009/11/automating-tedious-wiki-editing-tasks-with-emacs-and-w3m/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Thinking about Planner/EmacsWiki versus Wordpress</title>
		<link>http://sachachua.com/wp/2009/11/thinking-about-planneremacswiki-versus-wordpress/</link>
		<comments>http://sachachua.com/wp/2009/11/thinking-about-planneremacswiki-versus-wordpress/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 12:08:00 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/2009/11/03/thinking-about-planneremacswiki-versus-wordpress/</guid>
		<description><![CDATA[Was it really only less than two years ago that I shifted from my venerable Planner-based wiki/blog to my Wordpress-powered one after experimenting with syndicating my entries into Wordpress?
I miss writing in wiki markup on Emacs and knowing that publishing would Just Work. I miss being able to dynamically expand entries from my address book [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/11/thinking-about-planneremacswiki-versus-wordpress/">Thinking about Planner/EmacsWiki versus Wordpress</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Was it really only less than two years ago that I shifted from my venerable <a href="http://sachachua.com/notebook/wiki/2008.01.13.php">Planner-based wiki/blog</a> to my <a href="http://sachachua.com/wp/">Wordpress-powered one</a> after experimenting with <a href="http://sachachua.com/wp/2007/11/27/okay-were-in-business-5-years-of-my-life-in-wordpress/">syndicating my entries</a> into Wordpress?</p>
<p>I miss writing in wiki markup on Emacs and knowing that publishing would Just Work. I miss being able to dynamically expand entries from my address book in a way that automatically links to people’s blogs. (Or Twitter accounts, if I were going to do this now.) ScribeFire is a pain on my Eee (needs more horizontal screen space), and I have a hard time marking up the occasional bit of HTML in weblogger.el. Windows Live Writer is pretty slick (particularly with the SnagIt Screen Capture plugin and the Amazon Book Linker), but I can live without it. Or maybe I can resurrect that Wordpress Emacs client Ashish mentioned.</p>
<p>Let me think about the differences in experiences.</p>
<ul>
<li><strong>I wanted to support comments, but I didn’t want to spend a lot of time hacking on some custom commenting system.</strong> This was a big issue for me. I found some commenting scripts, but dealing with spam was a pain, so I switched to Wordpress. If I switched back to Emacs for my blog, I’d probably use something like <a href="http://disqus.com">Disqus</a> to handle the conversation, and just find some way of backing up the comments regularly.</li>
<li><strong>I wanted to make it easy to navigate posts.</strong> I modified Planner to generate a more <a href="http://sachachua.com/notebook/wiki/WikiIndex.php">browsable blog index</a>, but it’s still not as slick as what you’d see with Wordpress. On this Wordpress blog, I like offering people random blog posts (good for me too – great way to rediscover old posts and make serendipitous connections!), related posts, and posts on the same day. I can do posts on the same day in Planner with a custom hook, but the others would require some hacking. Also, Planner is very much day-based, while Wordpress lists N posts per page and has good category lists.</li>
<li><strong>I wanted to make it easy to edit posts.</strong> In my Emacs-based system, I published to RSS when I saved a note in the Remember window. I had a hack that made it possible to propagate changes from an already-published post to my Wordpress blog, but it wasn’t completely reliable. </li>
<li><strong>Scheduling posts is handy, too. </strong>I hadn’t gotten around to figuring out how to build a post scheduler for Emacs. I suppose if I wasn’t picky about the time it went out, I could simply write posts on different days and then publish notes conditionally, plus have some kind of hook to notice if any of the current page’s posts should be published in the RSS feed, plus some way to handle previous days, plus maybe a server-friendly way to do this for the times when I’m not going to be online every day. Right.</li>
</ul>
<p>That said, I miss automatically sharing some details of what I’m working on (with details deleted before publishing so that they’re available offline), publicly crossing off tasks, and other cool things.</p>
<p>Planner’s model for task planning isn’t quite compatible with Org’s model, and I’ve been using Org + Toodledo more these days.</p>
<p>What am I really looking for here?</p>
<ul>
<li>A quick, reliable way to post from a text editor, so that I can do it from the Eee. <strong>Hmm, the WP Postie plugin will probably do the trick.</strong></li>
<li>Easy way to share/review tasks: Toodledo export of week’s tasks?</li>
<li>And maybe a custom plugin for weekly displays, org agendas, that sort of thing.</li>
</ul>
<p>Hmm….</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/11/thinking-about-planneremacswiki-versus-wordpress/">Thinking about Planner/EmacsWiki versus Wordpress</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2009/11/thinking-about-planneremacswiki-versus-wordpress/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Thoughts on Toodledo versus Emacs Org</title>
		<link>http://sachachua.com/wp/2009/06/thoughts-on-toodledo-versus-emacs-org/</link>
		<comments>http://sachachua.com/wp/2009/06/thoughts-on-toodledo-versus-emacs-org/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 01:44:53 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[highlight]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/2009/06/10/thoughts-on-toodledo-versus-emacs-org/</guid>
		<description><![CDATA[It&#8217;s been a couple of months since I switched to using the Toodledo instead of Emacs Org to manage my tasks. I decided to use Toodledo because I wanted a to-do list that I could access on any computer and on my iPod Touch, so that I could capture tasks from anywhere. I liked Toodledo [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/06/thoughts-on-toodledo-versus-emacs-org/">Thoughts on Toodledo versus Emacs Org</a></p>
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a couple of months since I switched to using the Toodledo instead of Emacs Org to manage my tasks. I decided to use Toodledo because I wanted a to-do list that I could access on any computer and on my iPod Touch, so that I could capture tasks from anywhere. I liked Toodledo more than I liked Remember the Milk because Toodledo&#8217;s tagging and time-tracking features fit the way I work. I also liked how I could ask my virtual assistant to fill in templates&#8211;for example, preparation tasks for upcoming presentations&#8211;based on certain dates.</p>
<p>I still like Toodledo, but I feel an unsatisfied itch. Toodle-do is a great Getting Things Done system for capturing and tracking tasks, but even though it has some support for defining short-, medium-, and long-term goals, I wasn&#8217;t using them because they were split up on multiple screens. I missed the outlines of Org where I could define my higher-level goals, easily add new ones, and create tasks and subtasks. I missed the close integration with my schedule and the ability to easily see my historical task information. I missed the distinction between scheduled dates and deadlines, and the calculation of days until something is due.</p>
<p>So I think it&#8217;s time to switch back, at least temporarily. Maybe I can find a way to seamlessly synchronize my Org files so that changes are reflected on the different computers I&#8217;m on, and maybe I can find a way to easily capture or review tasks while I&#8217;m on the go. Perhaps I&#8217;ll continue working on org-toodledo so that I can export tasks from Org to the web-based interface. That way, I can quickly review today&#8217;s tasks while I&#8217;m out and about.</p>
<p>Hmm&#8230;</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/06/thoughts-on-toodledo-versus-emacs-org/">Thoughts on Toodledo versus Emacs Org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2009/06/thoughts-on-toodledo-versus-emacs-org/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Nothing quite like Org for Emacs</title>
		<link>http://sachachua.com/wp/2009/04/nothing-quite-like-org-for-emacs/</link>
		<comments>http://sachachua.com/wp/2009/04/nothing-quite-like-org-for-emacs/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 14:32:05 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[highlight]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/2009/04/06/nothing-quite-like-org-for-emacs/</guid>
		<description><![CDATA[I&#8217;ve been trying lots of different Web-based GTD task managers like Remember the Milk, Toodledo, and GTDAgenda. I&#8217;m slowly coming to the conclusion that there&#8217;s nothing quite like Org for Emacs. 
Here&#8217;s what I like about the other services:

Both Remember the Milk and Toodledo have iPhone/iPod Touch interfaces, so I can review, check off, and [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/04/nothing-quite-like-org-for-emacs/">Nothing quite like Org for Emacs</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying lots of different Web-based GTD task managers like <a href="http://www.rememberthemilk.com">Remember the Milk</a>, <a href="http://www.toodledo.com">Toodledo</a>, and <a href="http://www.gtdagenda.com">GTDAgenda</a>. I&#8217;m slowly coming to the conclusion that there&#8217;s nothing quite like <a href="http://orgmode.org/">Org for Emacs</a>. </p>
<p>Here&#8217;s what I like about the other services:
<ul>
<li>Both Remember the Milk and Toodledo have iPhone/iPod Touch interfaces, so I can review, check off, and create tasks anywhere.</li>
<li>All those services allow me to e-mail tasks to an address.</li>
<li>It&#8217;s easy to filter tasks by context.</li>
<li>I can share my tasks with my assistant so that he or she can remind me of the tasks I&#8217;ve scheduled for the day.</li>
</ul>
<p>Here&#8217;s what I like about Org:
<ul>
<li>I can use templates and outlines to organize my tasks however I want.</li>
<li>I can set deadlines, scheduled tasks, and prior notice easily.</li>
<li>I can track time more finely than Toodledo can.</li>
<li>I can use Org as an activity log.</li>
<li>I can schedule tasks onto specific timeslots.</li>
</ul>
<p>Of all the options I&#8217;ve tried, Toodledo is closest to where I am with Org, although it still doesn&#8217;t do everything. </p>
<p>Some options are:
<ul>
<li>Use worg or develop a web-based interface for displaying tasks based on my Org file</li>
<li>Write code for synchronizing Org with Toodledo or RememberTheMilk, making lots of geeks happy in the process =)</li>
</ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=91fba46e-ed29-8637-a258-ee7f1942881a" /></div>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/04/nothing-quite-like-org-for-emacs/">Nothing quite like Org for Emacs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2009/04/nothing-quite-like-org-for-emacs/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Planning meetings, get-togethers, and interviews with AgreeADate</title>
		<link>http://sachachua.com/wp/2009/02/planning-meetings-get-togethers-and-interviews-with-agreeadate/</link>
		<comments>http://sachachua.com/wp/2009/02/planning-meetings-get-togethers-and-interviews-with-agreeadate/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 03:59:17 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5723</guid>
		<description><![CDATA[One of the reasons why I love thinking of ways to help people rock even more is that I often end up learning a lot in the process.
For example, last week, I needed to coordinate schedules with Katie Bartlett, Jeff Widman&#8217;s assistant, for a chat with Jeff about networking. I thought about how much e-mail [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/02/planning-meetings-get-togethers-and-interviews-with-agreeadate/">Planning meetings, get-togethers, and interviews with AgreeADate</a></p>
]]></description>
			<content:encoded><![CDATA[<p>One of the reasons why I love thinking of ways to help people rock even more is that I often end up learning a lot in the process.</p>
<p>For example, last week, I needed to<strong> coordinate schedules</strong> with Katie Bartlett, Jeff Widman&#8217;s assistant, for a chat with Jeff about networking. I thought about how much e-mail was sent back-and-forth figuring out <strong>times and timezones</strong>, and I multiplied that by the number of appointments Katie probably needed to arrange. <strong>That sounded like a lot of work.</strong> If I could find a tool to make that easier for our appointment, and she used that tool to organize lots of other appointments, then that would be great!</p>
<p>I checked out a couple of tools such as <a href="http://timetomeet.com">TimeToMeet</a>, <a href="http://scheduleonce.com">ScheduleOnce</a>, and <a href="http://www.agreeadate.com">AgreeADate</a>. Of the tools I tried, I liked AgreeADate the most because it made it easy to create different kinds of schedules and it supported timezones. I sent Katie a few potential timeslots for my chat with Jeff. After she replied, I confirmed the time that was mutually convenient. <strong>That wasn&#8217;t hard at all.</strong></p>
<p>Then I explored the other features. I found out that I could create a schedule where people could pick a slot. AgreeADate allowed me to specify <strong>how many people each timeslot was limited to, and how many slots people could choose.</strong> This opened up all sorts of possibilities, and has become my favorite feature!</p>
<p>Things that I&#8217;d formerly had been worried about scheduling became so much easier to schedule because I could create all the slots in parallel and then let people choose the slots that hadn&#8217;t been taken yet. For example, I&#8217;d been meaning to try outsourcing some technical and personal tasks, but <strong>scheduling interview times sounded like a hassle.</strong> With this system, I just had to <strong>set all the slots up and invite people to choose</strong> the timeslot most convenient for them. Yay!</p>
<p>AgreeADate isn&#8217;t perfect, but it makes scheduling things so much easier for me, and it <strong>lowers the barrier</strong> enough for me to go and make things happen. In the past week that I&#8217;ve been trying it out, I&#8217;ve:</p>
<ul>
<li>scheduled a capoeira trial</li>
<li>scheduled a conference call</li>
<li>set up interviews for a system administrator and a virtual assistant, and</li>
<li>set up lunch with a poll on where to eat.</li>
</ul>
<p>You know, stuff that would&#8217;ve taken way too much e-mail if I had to do it by hand. =)</p>
<p>I&#8217;d like to see it integrated with my Google Calendar, and one of the AgreeADate folks told me that that&#8217;s the next thing on their roadmap. I found myself wondering which slots I&#8217;d tentatively offered for other events, and being able to see all the tentative slots overlaid on my calendar would be fantastic.</p>
<p>In the meantime, I read the confirmation e-mails in Emacs Gnus, use Remember and Org to create an appointment hyperlinked to that mail, and then use my own code, the twit.el library, and the <a href="http://www.twittercal.com">Twittercal</a> service to create an appointment on my Google Calendar (on google.com), which is then shared with my Google Calendar on sachachua.com thanks to the joys of Google Apps. It&#8217;s quite Rube Goldberg-esque (as many of my bubblegum-and-string tricks are), but so far, it works. Maybe this&#8217;ll be something I&#8217;ll outsource (except perhaps without the Gnus + Remember + Org part) once I&#8217;ve gotten that virtual assistance thing sorted out. =)</p>
<p>For the geeks, some Emacs Lisp to mash together with Org, TwitterCal, Google Calendar, and twit.el (some wizardry required):</p>
<pre>(defun sacha/org-as-gcal-quick-add ()
  "Convert the current SCHEDULED: timestamp and header into a GCal quick add item."
  (save-excursion
    (org-back-to-heading t)
    (setq end (save-excursion (outline-next-heading) (point)))
    (when (re-search-forward org-scheduled-time-regexp
			     end t)
      (let (ts default-time stamp plain s0 srp s1 s2)
	(setq ts (match-string 1)
	      default-time (apply 'encode-time (org-parse-time-string ts)))
	(when (or (setq stamp (string-match org-stamp-time-of-day-regexp ts))
		  (setq plain (string-match org-plain-time-of-day-regexp ts)))
	  (setq s0 (match-string 0 ts)
		srp (and stamp (match-end 3))
		s1 (match-string (if plain 1 2) ts)
		s2 (match-string (if plain 8 (if srp 4 6)) ts)))
	(cond
	 (s2
	  (concat (org-no-properties (org-get-heading t)) " on "
		  (format-time-string "%x" default-time) " from "
		  (org-get-time-of-day s1 'string t) " to "
		  (org-get-time-of-day s2 'string t)
		  ))
	 (s1

	  (concat (org-no-properties (org-get-heading t)) " on "
		  (format-time-string "%x" default-time) " from "
		  (org-get-time-of-day s1 'string t)
		  ))
	 (t
	  (concat (org-no-properties (org-get-heading t)) " on "
		  (format-time-string "%x" default-time)
		  )
	  ))))))

(defun sacha/org-to-twittercal (string)
  "Post STRING to TwitterCal. See http://www.twittercal.com for details."
  (interactive (list (read-string "Event: " (sacha/org-as-gcal-quick-add))))
  (twit-post-function twit-update-url (concat "d gcal " string)))</pre>
<p>I&#8217;ll keep you posted on my experiments! =)</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/02/planning-meetings-get-togethers-and-interviews-with-agreeadate/">Planning meetings, get-togethers, and interviews with AgreeADate</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2009/02/planning-meetings-get-togethers-and-interviews-with-agreeadate/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Upcoming talk: Totally Rocking Your Drupal Development Environment</title>
		<link>http://sachachua.com/wp/2009/01/upcoming-talk-totally-rocking-your-drupal-development-environment/</link>
		<comments>http://sachachua.com/wp/2009/01/upcoming-talk-totally-rocking-your-drupal-development-environment/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 20:08:23 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[drupal]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[abstract]]></category>
		<category><![CDATA[bio]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5649</guid>
		<description><![CDATA[On February 12, at 12 EST, I&#8217;ll be giving a teleconference presentation to the IBM Drupal Users Group. =) It&#8217;s internal-only, but I wanted to post it here because I often need to look up my abstracts and bios. The abstract is the same as the talk I submitted to DrupalCon09 (Totally Rocking Your Development [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/01/upcoming-talk-totally-rocking-your-drupal-development-environment/">Upcoming talk: Totally Rocking Your Drupal Development Environment</a></p>
]]></description>
			<content:encoded><![CDATA[<p>On February 12, at 12 EST, I&#8217;ll be giving a teleconference presentation to the IBM Drupal Users Group. =) It&#8217;s internal-only, but I wanted to post it here because I often need to look up my abstracts and bios. The abstract is the same as the talk I submitted to <a href="http://dc2009.drupalcon.org/session/totally-rocking-your-development-environment">DrupalCon09 (Totally Rocking Your Development Environment)</a>, but I&#8217;ll add some more IBM-specific tips.</p>
<p><strong>Abstract:</strong></p>
<blockquote><p>Are you a lazy developer? If you aren&#8217;t, you should be! Find out about editor tricks that can save you hours and hours of effort and frustration. Learn about browser tips that make it easy to test your sites with different users, track down elusive bugs, and test. Develop the virtue of laziness by automating as much as you can with makefiles, the Drupal Shell, regression tests, and other goodies. Share your best tips during this interactive session. Use your new free time to rock even more!
</p></blockquote>
<p><strong>Bio</strong></p>
<p>
<blockquote>Sacha Chua has an unshakable belief that life is too short to waste doing repetitive tasks that can be automated, an irrational love for tweaking her development environment, and an irresistible urge to share whatever she&#8217;s learned along the way. To learn more about her and Web 2.0, Drupal, Emacs, and other things she&#8217;s interested, visit [INTERNAL IBM URL] or <a href="http://livinganawesomelife.com">http://LivingAnAwesomeLife.com</a> (personal blog).</p></blockquote>
<p>Inside IBM and want to get a copy of the calendar invite? Contact William Shaouy.</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/01/upcoming-talk-totally-rocking-your-drupal-development-environment/">Upcoming talk: Totally Rocking Your Drupal Development Environment</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2009/01/upcoming-talk-totally-rocking-your-drupal-development-environment/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Emacs basics: Changing the background color</title>
		<link>http://sachachua.com/wp/2009/01/emacs-basics-changing-the-background-color/</link>
		<comments>http://sachachua.com/wp/2009/01/emacs-basics-changing-the-background-color/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 21:22:09 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[wickedcoolemacs]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5635</guid>
		<description><![CDATA[One of the first things you&#8217;ll probably want to change about Emacs is the default face. This controls the foreground color, the background color, the font, and other attributes. For example, many graphical environments give Emacs a background of white. If you prefer a black background (which can be less tiring during long periods of [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/01/emacs-basics-changing-the-background-color/">Emacs basics: Changing the background color</a></p>
]]></description>
			<content:encoded><![CDATA[<p>One of the first things you&#8217;ll probably want to change about Emacs is the default face. This controls the foreground color, the background color, the font, and other attributes. For example, many graphical environments give Emacs a background of white. If you prefer a black background (which can be less tiring during long periods of use), you can change the background to black my customizing the default face.</p>
<p>To change the background color and other attributes, use the command <code>M-x customize-face</code>, and specify <code>default</code> as the face to customize. Change the attributes and the sample text will reflect your settings. When you are satisfied, select <b>Save for future sessions</b>. Your changes will be saved to ~/.emacs and reloaded the next time you start the editor.</p>
<hr size="1"/>
<p>This is a draft for <a href="http://sachachua.com/wp/category/wickedcoolemacs">Wicked Cool Emacs</a>, a book that will be published by <a href="http://www.nsp.com">No Starch Press</a>. (if we manage to get it all together! =)</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/01/emacs-basics-changing-the-background-color/">Emacs basics: Changing the background color</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2009/01/emacs-basics-changing-the-background-color/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Emacs, file-cache, and ido</title>
		<link>http://sachachua.com/wp/2009/01/emacs-file-cache-and-ido/</link>
		<comments>http://sachachua.com/wp/2009/01/emacs-file-cache-and-ido/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 00:56:12 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5572</guid>
		<description><![CDATA[
(require 'filecache)
(require 'ido)
(defun file-cache-ido-find-file (file)
  "Using ido, interactively open file from file cache'.
First select a file, matched using ido-switch-buffer against the contents
in `file-cache-alist'. If the file exist in more than one
directory, select directory. Lastly the file is opened."
  (interactive (list (file-cache-ido-read "File: "
           [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/01/emacs-file-cache-and-ido/">Emacs, file-cache, and ido</a></p>
]]></description>
			<content:encoded><![CDATA[<pre>
(require 'filecache)
(require 'ido)
(defun file-cache-ido-find-file (file)
  "Using ido, interactively open file from file cache'.
First select a file, matched using ido-switch-buffer against the contents
in `file-cache-alist'. If the file exist in more than one
directory, select directory. Lastly the file is opened."
  (interactive (list (file-cache-ido-read "File: "
                                          (mapcar
                                           (lambda (x)
                                             (car x))
                                           file-cache-alist))))
  (let* ((record (assoc file file-cache-alist)))
    (find-file
     (expand-file-name
      file
      (if (= (length record) 2)
          (car (cdr record))
        (file-cache-ido-read
         (format "Find %s in dir: " file) (cdr record)))))))

(defun file-cache-ido-read (prompt choices)
  (let ((ido-make-buffer-list-hook
	 (lambda ()
	   (setq ido-temp-list choices))))
    (ido-read-buffer prompt)))
(add-to-list 'file-cache-filter-regexps "docs/html")
(add-to-list 'file-cache-filter-regexps "\\.svn-base$")
(add-to-list 'file-cache-filter-regexps "\\.dump$")
(defmacro sacha/file-cache-setup-tree (prefix shortcut directories)
  "Set up the file-cache tree for PREFIX using the keyboard SHORTCUT.
DIRECTORIES should be a list of directory names."
  `(let ((file-cache-alist nil)
	 (directories ,directories))
     (file-cache-clear-cache)
     (while directories
       (file-cache-add-directory-using-find (car directories))
       (setq directories (cdr directories)))
     (setq ,(intern (concat "sacha/file-cache-" prefix "-alist")) file-cache-alist)
     (defun ,(intern (concat "sacha/file-cache-ido-find-" prefix)) ()
       (interactive)
       (let ((file-cache-alist ,(intern (concat "sacha/file-cache-" prefix "-alist"))))
	 (call-interactively 'file-cache-ido-find-file)))
     (global-set-key (kbd ,shortcut)
		     (quote ,(intern (concat "sacha/file-cache-ido-find-" prefix))))))
</pre>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2009/01/emacs-file-cache-and-ido/">Emacs, file-cache, and ido</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2009/01/emacs-file-cache-and-ido/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Emacs: Working with multiple source trees</title>
		<link>http://sachachua.com/wp/2008/12/emacs-working-with-multiple-source-trees/</link>
		<comments>http://sachachua.com/wp/2008/12/emacs-working-with-multiple-source-trees/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 20:00:33 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[elisp]]></category>
		<category><![CDATA[emacs-lisp]]></category>
		<category><![CDATA[file-cache]]></category>
		<category><![CDATA[ido]]></category>
		<category><![CDATA[macro]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5463</guid>
		<description><![CDATA[As a developer, I often find myself working with multiple trees of source code. Sometimes, I&#8217;m comparing the trunk and the branches. Sometimes, I&#8217;m copying ideas from one place to another. Sometimes, I&#8217;m working on one project and an urgent defect comes in for a different project. With good development environments such as Eclipse, I&#8217;d [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/12/emacs-working-with-multiple-source-trees/">Emacs: Working with multiple source trees</a></p>
]]></description>
			<content:encoded><![CDATA[<p>As a developer, I often find myself working with multiple trees of source code. Sometimes, I&#8217;m comparing the trunk and the branches. Sometimes, I&#8217;m copying ideas from one place to another. Sometimes, I&#8217;m working on one project and an urgent defect comes in for a different project. With good development environments such as Eclipse, I&#8217;d still need to click on the project or directory in order to change my context, and then use a keyboard shortcut to find the resource in that tree. </p>
<p>With an awesome development environment like my customized Emacs, however, I can easily juggle multiple source trees. Here&#8217;s the macro I wrote to make setting this up much easier:</p>
<pre>
(defmacro sacha/file-cache-setup-tree (prefix shortcut directories)
  "Set up the file-cache tree for PREFIX using the keyboard SHORTCUT.
DIRECTORIES should be a list of directory names."
  `(let ((file-cache-alist nil)
	 (directories ,directories))
     (file-cache-clear-cache)
     (while directories
       (file-cache-add-directory-using-find (car directories))
       (setq directories (cdr directories)))
     (setq ,(intern (concat "sacha/file-cache-" prefix "-alist")) file-cache-alist)
     (defun ,(intern (concat "sacha/file-cache-ido-find-" prefix)) ()
       (interactive)
       (let ((file-cache-alist ,(intern (concat "sacha/file-cache-" prefix "-alist"))))
	 (call-interactively 'file-cache-ido-find-file)))
     (global-set-key (kbd ,shortcut)
		     (quote ,(intern (concat "sacha/file-cache-ido-find-" prefix))))))
</pre>
<p>With that, I can use the following to map C-c p to finding files in my personal directories:</p>
<pre>
(sacha/file-cache-setup-tree
 "personal"
 "C-c p"
 '("/var/www/html/drupal"
   "~/elisp"
   "~/personal"))
</pre>
<p>I&#8217;ve also set up keyboard shortcuts for the other trees I&#8217;m working on.</p>
<p>You&#8217;ll need file-cache, ido, and probably something like this:</p>
<pre>
(require 'filecache)
(require 'ido)
(defun file-cache-ido-find-file (file)
  "Using ido, interactively open file from file cache'.
First select a file, matched using ido-switch-buffer against the contents
in `file-cache-alist'. If the file exist in more than one
directory, select directory. Lastly the file is opened."
  (interactive (list (file-cache-ido-read "File: "
                                          (mapcar
                                           (lambda (x)
                                             (car x))
                                           file-cache-alist))))
  (let* ((record (assoc file file-cache-alist)))
    (find-file
     (expand-file-name
      file
      (if (= (length record) 2)
          (car (cdr record))
        (file-cache-ido-read
         (format "Find %s in dir: " file) (cdr record)))))))

(defun file-cache-ido-read (prompt choices)
  (let ((ido-make-buffer-list-hook
	 (lambda ()
	   (setq ido-temp-list choices))))
    (ido-read-buffer prompt)))
(add-to-list 'file-cache-filter-regexps "docs/html")
(add-to-list 'file-cache-filter-regexps "\\.svn-base$")
(add-to-list 'file-cache-filter-regexps "\\.dump$")
</pre>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/12/emacs-working-with-multiple-source-trees/">Emacs: Working with multiple source trees</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2008/12/emacs-working-with-multiple-source-trees/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs, Org, and BBDB: Hyperlinking names to blogs</title>
		<link>http://sachachua.com/wp/2008/12/emacs-org-and-bbdb-hyperlinking-names-to-blogs/</link>
		<comments>http://sachachua.com/wp/2008/12/emacs-org-and-bbdb-hyperlinking-names-to-blogs/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 02:48:44 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[bbdb]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[org]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5461</guid>
		<description><![CDATA[Back when I used Planner for Emacs, I coded some shortcuts to make it easier to write about the people I met and the conversations I had. I used the hippie-expand module to complete names from my Big Brother Database addressbook, and I wrote a function that converted those names into links to people&#8217;s blogs [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/12/emacs-org-and-bbdb-hyperlinking-names-to-blogs/">Emacs, Org, and BBDB: Hyperlinking names to blogs</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Back when I used Planner for Emacs, I coded some shortcuts to make it easier to write about the people I met and the conversations I had. I used the hippie-expand module to complete names from my Big Brother Database addressbook, and I wrote a function that converted those names into links to people&#8217;s blogs or websites whenever I published my blog posts as HTML.</p>
<p>I switched to Wordpress for my blog because I got tired of trying to figure out a way to enable comments without getting mired in spam-fighting. That meant I could explore other Emacs personal information managers like Org, which I turned into my main task manager. I often used the Wordpress interface to write blog posts. I sometimes used Windows Live Writer to write posts about books (there&#8217;s a good book review plugin that makes this easy). I also sometimes used Emacs and Org to draft blog posts using Org&#8217;s friendlier markup, exporting snippets to HTML that I then pasted into my blog posts.</p>
<p>Reading the posts on <a href="http://planet.emacsen.org">Planet Emacsen</a> reminded me that my customized configuration was pretty darn sweet. That and the conversation notes I&#8217;ve been blogging lately encouraged me to dust off my configuration files and get them to work under Org. So here&#8217;s the code:</p>
<pre>
 (defun sacha/org-bbdb-get (path)
   "Return BBDB record for PATH."
   (car (bbdb-search (bbdb-records) path path path)))

 (defun sacha/org-bbdb-export (path desc format)
   "Create the export version of a BBDB link specified by PATH or DESC.
 If exporting to HTML, it will be linked to the person's blog,
 www, or web address. If exporting to LaTeX FORMAT the link will be
 italicised. In all other cases, it is left unchanged."
     (cond
      ((eq format 'html)
       (let* ((record
             (sacha/org-bbdb-get path))
            url)
       (setq url (and record
                      (or (bbdb-record-getprop record 'blog)
                          (bbdb-record-getprop record 'www)
                          (bbdb-record-getprop record 'web))))
       (if url
           (format "&lt;a href=\"%s\"&gt;%s&lt;/a&gt;"
                   url (or desc path))
         (format "&lt;em&gt;%s&lt;/em&gt;"
                 (or desc path)))))
      ((eq format 'latex) (format "\\textit{%s}" (or desc path)))
      (t (or desc path))))

 (defadvice org-bbdb-export (around sacha activate)
   "Override org-bbdb-export."
   (setq ad-return-value (sacha/org-bbdb-export path desc format)))

 ;;;_+ Hippie expansion for BBDB; map M-/ to hippie-expand for most fun
 (add-to-list 'hippie-expand-try-functions-list 'sacha/try-expand-bbdb-annotation)
 (defun sacha/try-expand-bbdb-annotation (old)
   "Expand from BBDB. If OLD is non-nil, cycle through other possibilities."
   (unless old
     ;; First time, so search through BBDB records for the name
     (he-init-string (he-dabbrev-beg) (point))
     (when (&gt; (length he-search-string) 0)
       (setq he-expand-list nil)
       (mapcar
        (lambda (item)
        (let ((name (bbdb-record-name item)))
          (when name
            (setq he-expand-list
                  (cons (org-make-link-string
                       (org-make-link "bbdb:" name)
                       name)
                        he-expand-list)))))
        (bbdb-search (bbdb-records)
                     he-search-string
                     he-search-string
                     he-search-string
                     nil nil))))
   (while (and he-expand-list
               (or (not (car he-expand-list))
                   (he-string-member (car he-expand-list) he-tried-table t)))
     (setq he-expand-list (cdr he-expand-list)))
   (if (null he-expand-list)
       (progn
         (if old (he-reset-string))
         nil)
     (progn
       (he-substitute-string (car he-expand-list) t)
       (setq he-expand-list (cdr he-expand-list))
       t)))
</pre>
<p>If you&#8217;ve got Org and BBDB, drop this into your ~/.emacs and fiddle with it. =)</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/12/emacs-org-and-bbdb-hyperlinking-names-to-blogs/">Emacs, Org, and BBDB: Hyperlinking names to blogs</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2008/12/emacs-org-and-bbdb-hyperlinking-names-to-blogs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Emacs w3m: Open pages in external browsers</title>
		<link>http://sachachua.com/wp/2008/09/emacs-w3m-open-pages-in-external-browsers/</link>
		<comments>http://sachachua.com/wp/2008/09/emacs-w3m-open-pages-in-external-browsers/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 13:26:51 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[wickedcoolemacs]]></category>
		<category><![CDATA[w3m]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5138</guid>
		<description><![CDATA[Sometimes w3m is not enough. To make it easier to open the current page in a browser such as Mozilla Firefox, add the following to your ~/.emacs:

(defun wicked/w3m-open-current-page-in-firefox ()
  "Open the current URL in Mozilla Firefox."
  (interactive)
  (browse-url-firefox w3m-current-url)) ;; (1)

(defun wicked/w3m-open-link-or-image-in-firefox ()
  "Open the current link or image in Firefox."
 [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/09/emacs-w3m-open-pages-in-external-browsers/">Emacs w3m: Open pages in external browsers</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Sometimes w3m is not enough. To make it easier to open the current page in a browser such as Mozilla Firefox, add the following to your <em>~/.emacs</em>:</p>
<pre>
(defun wicked/w3m-open-current-page-in-firefox ()
  "Open the current URL in Mozilla Firefox."
  (interactive)
  (browse-url-firefox w3m-current-url)) ;; (1)

(defun wicked/w3m-open-link-or-image-in-firefox ()
  "Open the current link or image in Firefox."
  (interactive)
  (browse-url-firefox (or (w3m-anchor) ;; (2)
                          (w3m-image)))) ;; (3)
</pre>
<p>This defines a function that uses the current URL being browsed(1) and another function that takes the URL of the link at point(2). If no link is found, it takes the URL of the image at point(3). </p>
<p>You can use other browse-url functions instead of <code>browse-url-firefox</code>. For example, replacing <code>browse-url-firefox</code> with <code>browse-url-kde</code> will open the page, link, or image in Konqueror, KDE&#8217;s web browser.</p>
<p>I like binding <kbd>f</kbd> to the function that opens the current URL in Mozilla Firefox and <kbd>F</kbd> to the function that opens the current link or image in Mozilla Firefox. To do the same, add the following to your <em>~/.emacs</em>:</p>
<pre>
(eval-after-load 'w3m
  (progn
    (define-key w3m-mode-map "f" 'wicked/w3m-open-current-page-in-firefox)
    (define-key w3m-mode-map "F" 'wicked/w3m-open-link-or-image-in-firefox)))
</pre>
<p>&#8212;<br />
This is part of the <a href="http://sachachua.com/wp/category/wickedcoolemacs">book that I&#8217;m writing about Emacs</a>, which will be published by No Starch Press if I manage to get it together in time.</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/09/emacs-w3m-open-pages-in-external-browsers/">Emacs w3m: Open pages in external browsers</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2008/09/emacs-w3m-open-pages-in-external-browsers/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Emacs and w3m: Making tabbed browsing easier</title>
		<link>http://sachachua.com/wp/2008/09/emacs-and-w3m-making-tabbed-browsing-easier/</link>
		<comments>http://sachachua.com/wp/2008/09/emacs-and-w3m-making-tabbed-browsing-easier/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 12:43:41 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[wickedcoolemacs]]></category>
		<category><![CDATA[w3m]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/2008/09/12/emacs-and-w3m-making-tabbed-browsing-easier/</guid>
		<description><![CDATA[If you browse with a lot of open tabs, like I do, w3m will be much easier to use once you remap w3m-next-buffer and w3m-previous-buffer onto single-key shortcuts, allowing you to press a key to quickly flip between tabs.
By default, w3m-previous-buffer is mapped to C-c C-p and w3m-next-buffer is mapped to C-c C-n. On a [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/09/emacs-and-w3m-making-tabbed-browsing-easier/">Emacs and w3m: Making tabbed browsing easier</a></p>
]]></description>
			<content:encoded><![CDATA[<p>If you browse with a lot of open tabs, like I do, w3m will be much easier to use once you remap <code>w3m-next-buffer</code> and <code>w3m-previous-buffer</code> onto single-key shortcuts, allowing you to press a key to quickly flip between tabs.</p>
<p>By default, <code>w3m-previous-buffer</code> is mapped to <kbd>C-c C-p</kbd> and <code>w3m-next-buffer</code> is mapped to <kbd>C-c C-n</kbd>. On a QWERTY keyboard, you may want to remap <code>w3m-previous-buffer</code> to <kbd>q</kbd> and <code>w3m-next-buffer</code> to <kbd>w</kbd>. You&#8217;ll probably also want to remap <code>w3m-close-window</code> (which had been bound to <kbd>q</kbd>), and <kbd>x</kbd> is a good keybinding for that. To make all these changes, add the following to your <em>~/.emacs</em>:</p>
<pre>
(eval-after-load 'w3m
  '(progn
     (define-key w3m-mode-map "q" 'w3m-previous-buffer)
     (define-key w3m-mode-map "w" 'w3m-next-buffer)
     (define-key w3m-mode-map "x" 'w3m-close-window)))
</pre>
<p>If you use a Dvorak keyboard layout, you can bind <kbd>.</kbd> to <code>w3m-previous-buffer</code> and <kbd>,</kbd> to <code>w3m-next-buffer</code> instead. Just add the following code to your <em>~/.emacs</em>:</p>
<pre>
(eval-after-load 'w3m
  '(progn
     (define-key w3m-mode-map "." 'w3m-previous-buffer)
     (define-key w3m-mode-map "," 'w3m-next-buffer)))
</pre>
<p>(This is part of the draft for my <a href="http://sachachua.com/wp/category/wickedcoolemacs">book on Emacs</a>, to be published by No Starch Press if I&#8217;m not too late.)</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/09/emacs-and-w3m-making-tabbed-browsing-easier/">Emacs and w3m: Making tabbed browsing easier</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2008/09/emacs-and-w3m-making-tabbed-browsing-easier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs: Jump to anything</title>
		<link>http://sachachua.com/wp/2008/09/emacs-jump-to-anything/</link>
		<comments>http://sachachua.com/wp/2008/09/emacs-jump-to-anything/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 13:51:52 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/2008/09/05/emacs-jump-to-anything/</guid>
		<description><![CDATA[I just came across the Anything extension for Emacs. After you load anything.el, you can type M-x anything RET and a substring of, well, anything. Looks like a handy shortcut. It&#8217;s like Quicksilver, but for Emacs. Grab anything-config.el for a bunch of useful functions.
Here&#8217;s my current configuration:

(require 'anything)
(require 'anything-config)
(setq anything-sources
      [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/09/emacs-jump-to-anything/">Emacs: Jump to anything</a></p>
]]></description>
			<content:encoded><![CDATA[<p>I just came across the <a href="http://www.emacswiki.org/cgi-bin/wiki/Anything">Anything</a> extension for Emacs. After you load anything.el, you can type M-x anything RET and a substring of, well, anything. Looks like a handy shortcut. It&#8217;s like Quicksilver, but for Emacs. Grab <a href="http://www.emacswiki.org/cgi-bin/wiki/download/anything-config.el">anything-config.el</a> for a bunch of useful functions.</p>
<p>Here&#8217;s my current configuration:</p>
<pre>
(require 'anything)
(require 'anything-config)
(setq anything-sources
      (list anything-c-source-buffers
            anything-c-source-file-name-history
            anything-c-source-info-pages
            anything-c-source-man-pages
	    anything-c-source-file-cache
            anything-c-source-emacs-commands))
(global-set-key (kbd "M-X") 'anything)
</pre>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/09/emacs-jump-to-anything/">Emacs: Jump to anything</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2008/09/emacs-jump-to-anything/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Emacs and W3M: Toggling between work and the Web</title>
		<link>http://sachachua.com/wp/2008/08/emacs-and-w3m-toggling-between-work-and-the-web/</link>
		<comments>http://sachachua.com/wp/2008/08/emacs-and-w3m-toggling-between-work-and-the-web/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 12:24:12 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[wickedcoolemacs]]></category>
		<category><![CDATA[w3m]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5088</guid>
		<description><![CDATA[Here&#8217;s a handy shortcut that toggles between the W3M web browser and other buffers you&#8217;re working on. I use it to quickly switch between code and documentation (or your favorite timewasting site, as it also makes a handy boss key).
Define the function by adding the following code to your ~/.emacs:

(defun wicked/toggle-w3m ()
  "Switch to [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/08/emacs-and-w3m-toggling-between-work-and-the-web/">Emacs and W3M: Toggling between work and the Web</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a handy shortcut that toggles between the W3M web browser and other buffers you&#8217;re working on. I use it to quickly switch between code and documentation (or your favorite timewasting site, as it also makes a handy boss key).</p>
<p>Define the function by adding the following code to your ~/.emacs:</p>
<pre>
(defun wicked/toggle-w3m ()
  "Switch to a w3m buffer or return to the previous buffer."
  (interactive)
  (if (derived-mode-p 'w3m-mode)
      ;; Currently in a w3m buffer
      ;; Bury buffers until you reach a non-w3m one
      (while (derived-mode-p 'w3m-mode)
	(bury-buffer))
    ;; Not in w3m
    ;; Find the first w3m buffer
    (let ((list (buffer-list)))
      (while list
	(if (with-current-buffer (car list)
	      (derived-mode-p 'w3m-mode))
	    (progn
	      (switch-to-buffer (car list))
	      (setq list nil))
	  (setq list (cdr list))))
      (unless (derived-mode-p 'w3m-mode)
	(call-interactively 'w3m)))))
</pre>
<p>Then bind it to a shortcut key sequence (F7 F7 in this example) by adding the following code to your ~/.emacs:</p>
<pre>
(global-set-key (kbd "<f7> </f7><f7>") 'wicked/toggle-w3m)
</f7></pre>
<p>You can then use F7 F7 to switch back and forth between your web browser and whatever else you&#8217;re working on.</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/08/emacs-and-w3m-toggling-between-work-and-the-web/">Emacs and W3M: Toggling between work and the Web</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2008/08/emacs-and-w3m-toggling-between-work-and-the-web/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Emacs and w3m: Fake your user agent</title>
		<link>http://sachachua.com/wp/2008/08/emacs-and-w3m-fake-your-user-agent/</link>
		<comments>http://sachachua.com/wp/2008/08/emacs-and-w3m-fake-your-user-agent/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 23:49:14 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[wickedcoolemacs]]></category>
		<category><![CDATA[emacs-lisp]]></category>
		<category><![CDATA[user-agent]]></category>
		<category><![CDATA[w3m]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5076</guid>
		<description><![CDATA[
In an ideal world, you would never need to make your browser pretend to be a different browser. In reality, a number of websites check for specific browsers such as Mozilla or Internet Explorer, or even specific versions of those browsers. Other websites check for popular search engine crawlers such as the Googlebot in order [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/08/emacs-and-w3m-fake-your-user-agent/">Emacs and w3m: Fake your user agent</a></p>
]]></description>
			<content:encoded><![CDATA[<p>
In an ideal world, you would never need to make your browser pretend to be a different browser. In reality, a number of websites check for specific browsers such as Mozilla or Internet Explorer, or even specific versions of those browsers. Other websites check for popular search engine crawlers such as the Googlebot in order to display content optimized for that search engine. You may want to change your user agent to work around such limitations, or you might want to change your user agent string just for fun.
</p>
<p>
The following code allows you to set your user agent (wicked/w3m-set-user-agent), reload the current page using a specified user agent (wicked/w3m-reload-this-page-with-user-agent), and define regular expression matches for URLs to control user agent strings (wicked/w3m-fake-user-agent-sites). To use this, add the following to your ~/.emacs:
</p>
<p><pre class="example">
 (defvar wicked/w3m-fake-user-agents ;; (1)
   `(("w3m" . ,(concat "Emacs-w3m/" emacs-w3m-version " " w3m-version))
     ("ie6" . "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)")
     ("ff3" . "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1")
     ("ff2" . "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080208 Firefox/2.0.0.13")
     ("ie7" . "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727)")
     ("ie5.5" . "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)")
     ("iphone" . "Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_0 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5A347 Safari/525.20")
     ("safari" . "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_2; en-us) AppleWebKit/525.13 (KHTML, like Gecko) Version/3.1 Safari/525.13")
     ("google" . "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"))
   "*Associative list of user agent names and strings.")

 (defvar wicked/w3m-fake-user-agent-sites ;; (2)
   '(("^https?://www\\.useragentstring\\.com" . "ff2"))
   "*Associative list of regular expressions matching URLs and the agent keyword or value.
 The first matching entry will be used.")

 (defun wicked/w3m-set-user-agent (agent)
   "Set the user agent to AGENT based on `wicked/w3m-fake-user-agents'.
 If AGENT is not defined in `wicked/w3m-fake-user-agents', it is used as the user agent.
 If AGENT is empty, the default w3m user agent will be used."
   (interactive
    (list
     (completing-read "User-agent [w3m]: "
                    (mapcar 'car wicked/w3m-fake-user-agents)
                    nil nil nil nil "w3m"))) ;; (3)
   (if agent
       (progn
        (setq w3m-user-agent
              (or
               (and (string= agent "") (assoc "w3m" wicked/w3m-fake-user-agents)) ;; (4)
               (cdr (assoc agent wicked/w3m-fake-user-agents)) ;; (5)
               agent)) ;; (6)
        (setq w3m-add-user-agent t))
     (setq w3m-add-user-agent nil)))

 (defun wicked/w3m-reload-this-page-with-user-agent (agent)
   "Browse this page using AGENT based on `wicked/w3m-fake-user-agents'.
 If AGENT is not defined in `wicked/w3m-fake-user-agents', it is used as the user agent.
 If AGENT is empty, the default w3m user agent will be used."
   (interactive (list (completing-read "User-agent [w3m]: "
                    (mapcar 'car wicked/w3m-fake-user-agents)
                    nil nil nil nil "w3m")))
   (let ((w3m-user-agent w3m-user-agent)
       (w3m-add-user-agent w3m-add-user-agent))
     (wicked/w3m-set-user-agent agent) ;; (7)
     (w3m-reload-this-page)))

 (defadvice w3m-header-arguments (around wicked activate) ;; (8)
   "Check `wicked/w3m-fake-user-agent-sites' for fake user agent definitions."
   (let ((w3m-user-agent w3m-user-agent)
         (w3m-add-user-agent w3m-add-user-agent)
         (sites wicked/w3m-fake-user-agent-sites))
     (while sites
       (if (string-match (caar sites) (ad-get-arg 1))
         (progn
           (wicked/w3m-set-user-agent (cdar sites))
           (setq sites nil))
       (setq sites (cdr sites))))
     ad-do-it))
</pre>
</p>
<p>
wicked/w3m-fake-user-agents sets up a number of common user agents(1) using examples from <a href="http://www.useragentstring.com">http://www.useragentstring.com</a>. If you frequently use other user agents, add them to this associative list. wicked/w3m-fake-user-agent-sites sets up some rules for URLs so that you can work around specific websites(2). The first matching rule will be used.
</p>
<p>
wicked/w3m-set-user-agent can be called from a w3m browser session to set the user agent for all new pages visited. By default, it uses the w3m user agent(3). It will also use the w3m user agent if the agent is blank(4). If the user agent is one of the frequently-used agents defined in wicked/w3m-fake-user-agents, then the corresponding user agent string will be used(5). If not, the string will be used as-is(6). If the agent is nil, the user agent string will be disabled.(7)
</p>
<p>
You can check a single page using a different user agent by using M-x wicked/w3m-reload-this-page-with-user-agent. It temporarily sets the user agent and then reloads the current page.(7)
</p>
<p>
The last segment of code modifies the behavior of w3m-header-arguments(8), matching wicked/w3m-fake-user-agents against the URL. This temporarily sets the user agent for matching sites.</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/08/emacs-and-w3m-fake-your-user-agent/">Emacs and w3m: Fake your user agent</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2008/08/emacs-and-w3m-fake-your-user-agent/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Emacs and w3m: Quick searches</title>
		<link>http://sachachua.com/wp/2008/08/emacs-and-w3m-quick-searches/</link>
		<comments>http://sachachua.com/wp/2008/08/emacs-and-w3m-quick-searches/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 02:14:59 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5072</guid>
		<description><![CDATA[A number of browsers allow you to define quick searches so that you can type keywords into your address bar in order to search predetermined sites. With a little bit of code, you can do this in Emacs, too. In this project, you&#8217;ll learn how to set up your own keywords to work with w3m [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/08/emacs-and-w3m-quick-searches/">Emacs and w3m: Quick searches</a></p>
]]></description>
			<content:encoded><![CDATA[<p>A number of browsers allow you to define quick searches so that you can type keywords into your address bar in order to search predetermined sites. With a little bit of code, you can do this in Emacs, too. In this project, you&#8217;ll learn how to set up your own keywords to work with w3m and browse-url, so you can use your keywords for browsing both inside and outside Emacs.</p>
<p>First, set up keywords by adding the following lines to your ~/.emacs. We&#8217;ll use an associative list of regular expressions and substitutions, like this:</p>
<pre>
(setq wicked/quick-search-alist
      '((&quot;^g?:? +\\(.*\\)&quot; . ;; Google Web
         &quot;http://www.google.com/search?q=\\1&quot;)

        (&quot;^g!:? +\\(.*\\)&quot; . ;; Google Lucky
         &quot;http://www.google.com/search?btnI=I%27m+Feeling+Lucky&amp;q=\\1&quot;)

	(&quot;^dict:? +\\(.*\\)&quot; . ;; Dictionary
	 &quot;http://dictionary.reference.com/search?q=\\1&quot;)))
</pre>
<p>This will turn &quot;g keyword1 keyword2&quot; into a Google search for keyword1 and keyword2.</p>
<p>Next, define advice for the functions that open URLs. Before-type advice allows you to modify arguments before the function is run, and we&#8217;ll use that to change the URLs. To modify the URL behavior of w3m, add the following to your ~/.emacs:</p>
<pre>
(require 'cl-seq)
(defadvice w3m-goto-url (before wicked activate)
  &quot;Use the quick searches defined in `wicked/quick-search-alist'.&quot;
  (let* ((my-url (replace-regexp-in-string
		  &quot;^ *\\| *$&quot; &quot;&quot;
		  (replace-regexp-in-string &quot;[ \t\n]+&quot; &quot; &quot; (ad-get-arg 0))))
	 (match (assoc-if
		 (lambda (a) (string-match a my-url))
		 wicked/quick-search-alist)))
    (if match
	(ad-set-arg 0 (replace-regexp-in-string
		       (car match) (cdr match) my-url)))))
</pre>
<p>This sets up your quick searches for use within w3m. To set up quick searches for use with browse-url and external browsers, add the following to your ~/.emacs:</p>
<pre>
(defadvice browse-url (before wicked activate)
  &quot;Use the quick searches defined in `wicked/quick-search-alist'.&quot;
  (let* ((my-url (replace-regexp-in-string
		  &quot;^ *\\| *$&quot; &quot;&quot;
		  (replace-regexp-in-string &quot;[ \t\n]+&quot; &quot; &quot; (ad-get-arg 0))))
	 (match (assoc-if
		 (lambda (a) (string-match a my-url))
		 wicked/quick-search-alist)))
    (if match
	(ad-set-arg 0 (replace-regexp-in-string
		       (car match) (cdr match) my-url)))))
</pre>
<p>To try out your searches, use M-x browse-url RET g emacs RET to do a Google search for all things Emacs, and use M-x w3m-goto-url (usually bound to g) inside w3m to use the quick searches.</p>
<p>You can define more quick searches like this:</p>
<pre>
(add-to-list 'wicked/quick-search-alist
          '(&quot;^ew:? *?\\(.*\\)&quot; . ;; Emacs Wiki Search
            &quot;http://www.emacswiki.org/cgi-bin/wiki?search=\\1&quot;))
</pre>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/08/emacs-and-w3m-quick-searches/">Emacs and w3m: Quick searches</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2008/08/emacs-and-w3m-quick-searches/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sweet! Facebook in Emacs!</title>
		<link>http://sachachua.com/wp/2008/08/sweet-facebook-in-emacs/</link>
		<comments>http://sachachua.com/wp/2008/08/sweet-facebook-in-emacs/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 01:18:50 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5066</guid>
		<description><![CDATA[So here&#8217;s how to access Facebook from w3m, one of the web browsers in
Emacs:
1. Enable cookies by setting w3m-use-cookies to t.
2. Go to http://m.facebook.com .
3. Choose the HTTP login.
4. Log in with your username and password.
Hooray for mobile interfaces that don&#8217;t require Javascript! =D
So far, it seems to work. I can update my status! Sweet!
Next [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/08/sweet-facebook-in-emacs/">Sweet! Facebook in Emacs!</a></p>
]]></description>
			<content:encoded><![CDATA[<p>So here&#8217;s how to access Facebook from w3m, one of the web browsers in<br />
Emacs:</p>
<p>1. Enable cookies by setting w3m-use-cookies to t.<br />
2. Go to http://m.facebook.com .<br />
3. Choose the HTTP login.<br />
4. Log in with your username and password.</p>
<p>Hooray for mobile interfaces that don&#8217;t require Javascript! =D</p>
<p>So far, it seems to work. I can update my status! Sweet!</p>
<p>Next step: Figure out how to set up shimbun for Facebook mail so that I can read my Facebook mail like a newsgroup&#8230;</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/08/sweet-facebook-in-emacs/">Sweet! Facebook in Emacs!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2008/08/sweet-facebook-in-emacs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Why browse the Web in Emacs?</title>
		<link>http://sachachua.com/wp/2008/08/why-browse-the-web-in-emacs/</link>
		<comments>http://sachachua.com/wp/2008/08/why-browse-the-web-in-emacs/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 00:57:20 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[wickedcoolemacs]]></category>
		<category><![CDATA[browsing]]></category>
		<category><![CDATA[w3]]></category>
		<category><![CDATA[w3m]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5064</guid>
		<description><![CDATA[&#8220;Are you browsing Slashdot in Emacs?&#8221;, W- asked me after he glanced at my screen.
With Emacs&#8217; reputation for including everything _and_ the kitchen sink, you probably won&#8217;t be surprised to hear that there&#8217;s more than one way to surf the Internet using your text editor. With today&#8217;s Javascript- and image-heavy websites, it can be hard [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/08/why-browse-the-web-in-emacs/">Why browse the Web in Emacs?</a></p>
]]></description>
			<content:encoded><![CDATA[<p>&#8220;Are you browsing Slashdot in Emacs?&#8221;, W- asked me after he glanced at my screen.</p>
<p>With Emacs&#8217; reputation for including everything _and_ the kitchen sink, you probably won&#8217;t be surprised to hear that there&#8217;s more than one way to surf the Internet using your text editor. With today&#8217;s Javascript- and image-heavy websites, it can be hard to believe that anyone would use a text-based browser with limited support for many of the things we take for granted. Still, a Web browser in your text editor can be surprisingly useful. Here are some of the reasons why you might like it:</p>
<ul>
<li><b>Browsing is faster and less distracting.</b> Forget flashing ads, garish colors, and large images. When you surf the Web in Emacs, you can focus on reading, and you can use all the typical Emacs shortcuts for navigating around. You can view images when you want to.<br />
 If you need to see something that Emacs doesn&#8217;t support, you can easily open the current page in an external Web browser.</li>
<li><b>You can integrate it into your work.</b> With a little bit of Emacs Lisp, you can qucikly look up information on the Web based on what you&#8217;re currently working on. For example, PHP mode comes with a shortcut that lets you look up the current function&#8217;s documentation in the PHP manual. You can look up bug report details, dictionary definitions, and Wikipedia pages with minimal typing, too. If you use Emacspeak, you can set up the web browser to speech-synthesize more than what&#8217;s displayed on screen. The more you use Emacs, the more benefits you get from the integration.</li>
<li><b>You can customize everything.</b> You can customize your Emacs experience quickly and easily, and if you spend a lot of time on the Net, you&#8217;ll appreciate having your own shortcuts and functions. For example, I&#8217;ve completely remapped my keyboard shortcuts to support tabbed browsing on a Dvorak keyboard, and I&#8217;ve defined a few functions to make frequently-used commands much easier. You can even use functions to process Web pages and either summarize the information you&#8217;re interested in or make pages more navigable. It&#8217;s all just Emacs Lisp.</li>
<li><b>You&#8217;re safe from browser exploits.</b> No Javascript pop-ups, no image bugs, no browser-based malware that can take over your comuter or steal data. Just content.</li>
<li><b>You need less memory.</b> Why open up a memory-intensive graphical Web-based browser when you&#8217;ve got Emacs open anyway?</li>
</ul>
<p>There&#8217;s more than one way to browse the Web in Emacs, of course. Browse-url is a package that makes it easy to open URLs in your preferred browser or browsers. For example, you can use it to browse the Web in Mozilla Firefox, and (of course) you can use it to browse the Web within Emacs itself. For browsing within Emacs, you can use w3m.el, an interface to the external W3M browser, or w3, a Web browser written entirely in Emacs Lisp. Of the two, I prefer w3m.el, which is much faster and more featureful than w3. Both can display graphics, tables, and frames, and w3 supports stylesheets.</p>
<p>More about Emacs and browsing the Web soon! Planned projects for this chapter of <a href="http://sachachua.com/category/wp/wickedcoolemacs">Wicked Cool Emacs</a>:</p>
<pre>
*** Project XXX: Browse the Web
*** Project XXX: Open the current webpage in an external browser
*** Project XXX: Different browsers for different pages
*** Project XXX: Toggle between Web and work
*** Project XXX: Quick search
*** Project XXX: Customize your keymap
*** Project XXX: Download files
*** Project XXX: Add access keys
*** Project XXX: Use social bookmarking
*** Project XXX: Typeahead
*** Project XXX: Preview HTML
*** Project XXX: Read Web pages as news
</pre>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/08/why-browse-the-web-in-emacs/">Why browse the Web in Emacs?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2008/08/why-browse-the-web-in-emacs/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Drupal, Emacs, and templates: Module update functions</title>
		<link>http://sachachua.com/wp/2008/08/drupal-emacs-and-templates-module-update-functions/</link>
		<comments>http://sachachua.com/wp/2008/08/drupal-emacs-and-templates-module-update-functions/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 19:00:46 +0000</pubDate>
		<dc:creator>Sacha Chua</dc:creator>
				<category><![CDATA[drupal]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[yasnippet]]></category>

		<guid isPermaLink="false">http://sachachua.com/wp/?p=5044</guid>
		<description><![CDATA[Drupal&#8217;s coding conventions make it easier to hook into system behavior, but they also result in a lot of repetitive typing. For example, you can run code when upgrading a module by putting the code in a function named modulename_update_N() in your module&#8217;s install file. I found myself scrolling up and copy-pasting stuff too many [...]<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/08/drupal-emacs-and-templates-module-update-functions/">Drupal, Emacs, and templates: Module update functions</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Drupal&#8217;s coding conventions make it easier to hook into system behavior, but they also result in a lot of repetitive typing. For example, you can run code when upgrading a module by putting the code in a function named <i>modulename</i>_update_<i>N</i>() in your module&#8217;s install file. I found myself scrolling up and copy-pasting stuff too many times, so I decided to automate it instead.</p>
<p>I&#8217;ve been using <a href="http://sachachua.com/wp/2008/07/26/yet-another-snippet-mode-for-emacs/">yasnippet</a> for my Emacs templates. All I needed to do to automate that little update bit was to write some code that figured out what the next update number should be. Here&#8217;s the snippet file I&#8217;ve just added (~/elisp/snippets/php-mode/drupal-mode/_update):</p>
<pre>
function `(sacha/drupal-module-name)`_update_`(sacha/drupal-module-update-number)`() {
  $ret = array();
  $0
  $ret[] = array(
    'success' => true,
    'query' => '$1',
  );
  return $ret;
}
</pre>
<p>The relevant functions from my ~/.emacs:</p>
<pre>
(defun sacha/drupal-module-update-number ()
  "Return the number of the next module update function.
This is one more than the highest number used so far.
This function should be called in a module's .install file."
  (save-excursion
    (save-restriction
      (widen)
      (goto-char (point-min))
      (let ((module-name (sacha/drupal-module-name))
	    (max 0))
	(while (re-search-forward
		(concat "function[ \t\n]+" module-name "_update_\\([0-9]+\\)") nil t)
	  (setq max (max (string-to-number (match-string 1)) max)))
	(number-to-string (1+ max))))))

(defun sacha/drupal-module-name ()
  "Return the Drupal module name for .module and .install files."
  (file-name-sans-extension (file-name-nondirectory (buffer-file-name))))
</pre>
<p>I can&#8217;t think of how I&#8217;d do that in Eclipse. =) Don&#8217;t get me wrong&#8211;I still like Eclipse&#8211;but I heart being able to hack my editor on the fly.</p>
<p>Post from: <a href="http://sachachua.com/wp">sacha chua :: enterprise 2.0 consultant, storyteller, geek</a>.
Check out my blog for tips on <a href="http://sachachua.com/wp/category/va">managing virtual assistants</a>, <a href="http://sachachua.com/wp/category/drupal">Drupal</a>, and other topics!<br/><br/><a href="http://sachachua.com/wp/2008/08/drupal-emacs-and-templates-module-update-functions/">Drupal, Emacs, and templates: Module update functions</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sachachua.com/wp/2008/08/drupal-emacs-and-templates-module-update-functions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>


