<?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>Gregory Grubbs</title>
	<atom:link href="http://gregorygrubbs.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gregorygrubbs.com</link>
	<description>Attention in software development</description>
	<lastBuildDate>Thu, 03 Mar 2011 18:13:03 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tips on Android Development Using Emacs</title>
		<link>http://gregorygrubbs.com/development/tips-on-android-development-using-emacs/</link>
		<comments>http://gregorygrubbs.com/development/tips-on-android-development-using-emacs/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 16:32:32 +0000</pubDate>
		<dc:creator>Gregory Grubbs</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Mobile development]]></category>
		<category><![CDATA[Technology/Internet]]></category>

		<guid isPermaLink="false">http://gregorygrubbs.com/?p=485</guid>
		<description><![CDATA[


Android using Emacs

    For the intrepid Emacs user, here are some tips for doing Android development without Eclipse.  I am working on a follow-up post with some general Android SDK tips.

Emacs prerequisites


 android-modeThis mode gives you the following interactive commands:

 M-x android-start-emulator Start the Android SDK emulator from emacs
 M-x android-start-ddms [...]]]></description>
			<content:encoded><![CDATA[<p><a title="autumn falls..." href="http://flickr.com/photos/99771506@N00/2981387336"><img src="http://farm4.static.flickr.com/3215/2981387336_4b0ebb247f.jpg" alt="" /></a></p>
<div id="content">
<h3 id="outline-container-1"></h3>
<h2 id="sec-1">Android using Emacs</h2>
<div id="text-1">
<p>    For the intrepid Emacs user, here are some tips for doing Android development without Eclipse.  I am working on a follow-up post with some general Android SDK tips.</p></div>
<div id="outline-container-1_1">
<h3 id="sec-1_1">Emacs prerequisites</h3>
<div id="text-1_1">
<ol>
<li> <a href="http://github.com/remvee/android-mode/blob/master/android-mode.el">android-mode</a><br/>This mode gives you the following interactive commands:
<ul>
<li> <code>M-x android-start-emulator</code> Start the Android SDK emulator from emacs</li>
<li> <code>M-x android-start-ddms</code> Start the Android debugger</li>
<li> <code>M-x android-logcat</code> Like syslog for Android</li>
<li> <code>M-x android-ant</code> Run any ant task in the current project directory</li>
</ul>
</li>
<li> android.el<br/>This is a file included in the Android SDK.  It duplicates some of the functionality of android-mode, but adds <code>M-x android-jdb</code>, which starts the JDB debugger once you have DDMS running.Load it from {SDK dir}/tools/lib</li>
<li> JDE<br/>Optional, but it&#8217;s great for java code.  Required to use beanshell shortcuts like the import statement command below (Generate and insert import statements)</li>
<li> Typical emacs setup cruft<br/>Here&#8217;s what I have in my init file for Android:
<pre>(add-to-list 'load-path <span style="color: #bc8f8f;">"~/emacs/android-mode"</span>)
	    (<span style="color: #a020f0;">require</span> '<span style="color: #5f9ea0;">android-mode</span>)
	    (setq android-mode-sdk-dir <span style="color: #bc8f8f;">"~/work/android/android"</span>)
	    (add-hook 'gud-mode-hook
            (<span style="color: #a020f0;">lambda</span> ()
            (add-to-list 'gud-jdb-classpath <span style="color: #bc8f8f;">"/home/gregj/work/android-sdk-linux_86/platforms/android-7/android.jar"</span>)
            ))</pre>
</li>
</ol></div>
</p></div>
<div id="outline-container-1_2">
<h3 id="sec-1_2">Launch the emulator</h3>
<div id="text-1_2">
<p>      Although you can start the emulator from within emacs using android-mode: <code>M-x android-start-emulator</code></p>
<p>      I prefer to launch from the shell, since this allows me to exit emacs without having to restart the emulator, e.g.:</p>
<pre>emulator -avd starter-21 -partition-size 128 &gt;/dev/null &amp;</pre>
</p></div>
</p></div>
<div id="outline-container-1_3">
<h3 id="sec-1_3">Create a project</h3>
<div id="text-1_3">
<p>      Instead of using the New Project wizard in Eclipse, use these steps to create an Android project using the shell:</p>
<pre>cd {project directory}
	mkdir HelloAndroid
	cd HelloAndroid
	android create project --name HelloAndroid --target android-7 --path . --package home.hoochiepep.HelloAndroid --activity HelloAndroid</pre>
<p>      Change =&#8211;target=, =&#8211;package=, and =&#8211;activity= parameters as appropriate.</p>
<p>      To get a list of valid targets for your SDK, use</p>
<pre>android list</pre>
</p></div>
</p></div>
<div id="outline-container-1_3_1">
<h3>Specify the application name</h3>
<div>
      To change the name of the application, edit {project root}/res/values/strings.xml:</p>
<pre class="src src-xml">&lt;<span style="color: #0000ff;">string</span> <span style="color: #b8860b;">name</span>=<span style="color: #bc8f8f;">"app_name"</span>&gt;Hello, Android&lt;/<span style="color: #0000ff;">string</span>&gt;
</pre>
</p></div>
</p></div>
<div id="outline-container-1_3_2">
<h3>Specify a minimum SDK level</h3>
<div>
      The Eclipse New Project wizard includes a Min SDK Version field. To set this without the wizard, add a line to AndroidManifest.xml as a child of manifest:</p>
<pre class="src src-xml">&lt;<span style="color: #0000ff;">uses-sdk</span> <span style="color: #da70d6;">android</span>:<span style="color: #b8860b;">minSdkVersion</span>=<span style="color: #bc8f8f;">"2"</span> /&gt;
      </pre>
</p></div>
</p></div>
<div id="outline-container-1_4">
<h3 id="sec-1_4">Make an eclipse project ant-ready (do also when moved to a new machine)</h3>
<div id="text-1_4">
<p>      Projects you pull from online will have been created using Eclipse, and will not have a build.xml file for ant.</p>
<p>      Another common problem is that the file <code>local.properties</code> will be missing.  Running an update as shown here will fix both problems:</p>
<pre>android update project --path . --target android-7 --subprojects</pre>
</p></div>
</p></div>
<div id="outline-container-1_5">
<h3 id="sec-1_5">Generate and insert import statements</h3>
<div id="text-1_5">
<p>      You will see references to a handy Eclipse command (invoked by Control-Shift-O) which adds import statements for referenced classes.</p>
<p>      The emacs equivalent is found in jde-mode: <code>M-x jde-import-find-and-import</code> (C-c C-v C-z).  Make sure the classpath is set correctly prior to starting jde-mode</div>
</p></div>
<div id="outline-container-1_6">
<h3 id="sec-1_6">Use the debugger within Emacs</h3>
<div id="text-1_6">
<ul>
<li> Install the app on the emulator using <code>M-x android-ant-install</code> (the &#8216;install&#8217; target uses the debug apk)</li>
<li> Start ddms.  There are no cmdline args, so you might as well use <code>M-x android-start-ddms</code></li>
<li> In the emulator, go to Dev Tools -&gt; Development Settings and select the app as the debug app</li>
<li> In the emulator, start the app</li>
<li> Look in the ddms window for the app&#8217;s debug port (usu. 8700 if the Dev Settings step was done)</li>
<li> Start jdb by invoking <code>M-x android-jdb</code> from android.el
<p>       You can also start jdb directly using the following command line params as a guide</p>
<pre>jdb -sourcepath/home/gregj/work/android/projects/NotepadCodeLab/Notepadv3/src -attach localhost:8700</pre>
<p>	  Set breakpoints in JDB, like so</p>
<pre>stop in com.android.demo.notepad3.NoteEdit.onResume</pre>
<p>	  If the project directory is set correctly in the jdb command, you will be able to set breakpoints by line using jde-mode&#8217;s <code>M-x gud-break</code> (C-x space).</li>
</ul></div>
</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://gregorygrubbs.com/development/tips-on-android-development-using-emacs/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>10 Tips for Powerful Emacs on Windows</title>
		<link>http://gregorygrubbs.com/emacs/10-tips-emacs-windows/</link>
		<comments>http://gregorygrubbs.com/emacs/10-tips-emacs-windows/#comments</comments>
		<pubDate>Sun, 23 May 2010 18:24:14 +0000</pubDate>
		<dc:creator>Gregory Grubbs</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[Emacs Lisp]]></category>
		<category><![CDATA[Microsoft Windows]]></category>
		<category><![CDATA[Software download links]]></category>
		<category><![CDATA[System software]]></category>
		<category><![CDATA[Windows XP]]></category>

		<guid isPermaLink="false">http://gregorygrubbs.com/?p=439</guid>
		<description><![CDATA[
I avoided using Microsoft Windows for almost 15 years, but with my
new job at a Microsoft-enthralled development shop, those idyllic
days have come to an abrupt end.  Because in the past I could always
use my trusty Linux and OS X machines, I never did push past the
hurdles of using Emacs on Windows.  My utter [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Ladybug Liftoff" href="http://flickr.com/photos/23084352@N00/403926829"><img src="http://farm1.static.flickr.com/163/403926829_cc213ee88b.jpg" alt="" /></a></p>
<p>I avoided using Microsoft Windows for almost 15 years, but with my<br />
new job at a Microsoft-enthralled development shop, those idyllic<br />
days have come to an abrupt end.  Because in the past I could always<br />
use my trusty Linux and OS X machines, I never did push past the<br />
hurdles of using Emacs on Windows.  My utter reliance on Org-mode,<br />
TRAMP, and Ediff (to name a few) made it essential to get Emacs<br />
working on Windows if at all possible.</p>
<p>Now I am using Emacs on Windows XP and Windows 7 on a daily basis,<br />
and am quite happy with the results.  It was not easy to get to the<br />
point of full functionality, so I wanted to share the magic that<br />
makes it all work.<br />
<span id="more-439"></span></p>
<p>I have decided against using the Cygwin Emacs package for several reasons:</p>
<ul>
<li>Running a windowed/multi-frame/pretty version requires running<br />
Cygwin-X, which is quite a lot of overhead just to run Emacs. I<br />
have had a few interface and display problems lately with Cygwin-X<br />
also.</li>
<li>Cool-though-seldom-used features that work in the native port do<br />
not work in the Cygwin port: Window opacity control, for example</li>
<li>Using the native port means I can always be running the latest<br />
released version from gnu.org</li>
<li>The native port just runs faster</li>
</ul>
<p>On the other hand, Cygwin does play a crucial role in making the<br />
native Emacs port work properly.  I have tried and hated using PuTTY<br />
and Plink, and various one-off ports of standard Unix commands.<br />
Using Cygwin and its package management makes all this<br />
much simpler and more reliable.</p>
<p>So all the hints given here use the &#8220;official&#8221; Emacs for Windows<br />
(sometimes referred to as NTEmacs), as well as Cygwin (with no<br />
dependency on Cygwin-X).</p>
<p>I really hope this helps some poor beleaguered Linux/OS X Emacs user<br />
make the giant backwards leap. With these tips and little helpers like<br />
<a href="http://www.launchy.net/">Launchy</a>, you won&#8217;t even have to<br />
acknowledge that you&#8217;re running Windows!</p>
<h2>Software download links</h2>
<p>Here&#8217;s where you will find all the software referenced in the tips:</p>
<ul>
<li><a href="http://ftp.gnu.org/pub/gnu/emacs/windows/">Emacs for Windows</a></li>
<li><a href="http://www.cygwin.com/">Cygwin</a></li>
<li><a href="http://gnuwin32.sourceforge.net/">GnuWin32</a> for image libraries</li>
<li><a href="ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin/porters/Humblet_Pierre_A/V1.1/ispell-3.2.06-cygwin-1.3-bin.tar.gz">ISpell package</a></li>
<li><a href="http://files.emacsblog.org/ryan/elisp/maxframe.el">Maxframe.el</a></li>
<li><a href="http://mirror.cs.wisc.edu/pub/mirrors/ghost/ghostgum/gsv49w32.exe">GSView</a></li>
</ul>
<h2>Tip #1: General Usage</h2>
<ul>
<li>Execute runemacs.exe or emacsclientw.exe.  On your Linux and OS X<br />
systems, the binary names or emacs and emacsclient: just use the<br />
windows-specific wrappers included in the standard port when on MS Windows.</li>
<li>Add Cygwin /bin to exec-path.

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;">      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>file-directory-p <span style="color: #ff0000;">&quot;c:/cygwin/bin&quot;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>add-to-<span style="color: #b1b100;">list</span> 'exec-path <span style="color: #ff0000;">&quot;c:/cygwin/bin&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

</li>
</ul>
<h2>Tip #2: Make TRAMP work nicely &#8212; and without PuTTY</h2>
<p>There are people using PuTTY and Plink.exe to get this working, but<br />
I like using good old OpenSSH much better: no translation required<br />
for the keys I use, and I have it installed anyway in Cygwin.</p>
<ul>
<li>Install Cygwin, including the OpenSSH package</li>
<li>In your Emacs init, set shell to bash

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;">      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> shell-file-<span style="color: #b1b100;">name</span> <span style="color: #ff0000;">&quot;bash&quot;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> explicit-shell-file-<span style="color: #b1b100;">name</span> shell-file-<span style="color: #b1b100;">name</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

</li>
<li>In Emacs init, set tramp-default-method to &#8220;sshx&#8221; or &#8220;scpx&#8221;

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;">      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">cond</span>  <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">eq</span> window-system 'w32<span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> tramp-default-method <span style="color: #ff0000;">&quot;scpx&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>t
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> tramp-default-method <span style="color: #ff0000;">&quot;scpc&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

</li>
<li>Windows 7 note:   I was unable to get this to work on Win7 until I set the runemacs.exe binary to run in Windows XP (Service Pack 3) compatibility mode.</li>
<li>Test: Try <code>M-x shell</code>, then visit a TRAMP site such as <code>/user@site:</code> and try <code>M-x shell</code> from there!</li>
</ul>
<h2>Tip #3: Use SVN and GIT without tears</h2>
<p>Version control should work out of the box &#8212; but SSH problems can<br />
interfere sometimes.  So once you get TRAMP working properly, you<br />
should have no problems with VC.</p>
<ul>
<li>Install subversion and git from Cygwin</li>
<li>Use built-in vc-dir, or psvn.el and magit.el</li>
</ul>
<h2>Tip #4: Display images in buffers, including doc-view</h2>
<p>You may have noticed that your Windows Emacs has no ability to<br />
display images.  This is simply due to the fact that the port is<br />
not distributed with the libraries necessary to display them.</p>
<p>The solution is to visit the GnuWin32 link above, download the<br />
packages relevant to the types of images you want to display<br />
(including zlib1 for compressed images), and copy the DLLs into the<br />
bin directory of your Emacs installation (e.g, C:\Program<br />
Files\emacs23-2\bin).</p>
<p>Images will only be displayed after restarting Emacs.</p>
<p>Here&#8217;s a list of DLLs that I now have in my installation:</p>
<ul>
<li>jpeg62.dll</li>
<li>libXpm.dll</li>
<li>libjpeg-62.dll</li>
<li>libpng-bcc.lib</li>
<li>libpng.dll.a</li>
<li>libpng.la</li>
<li>libpng.lib</li>
<li>libpng12-0.dll</li>
<li>libpng12.def</li>
<li>libpng12.dll</li>
<li>libpng12.dll.a</li>
<li>libpng12.la</li>
<li>libtiff3.dll</li>
<li>zlib1.dll (for compression, not images)</li>
</ul>
<h2>Tip #5: Use W3M</h2>
<p>The W3M web browser works fine once you install the w3m binary &#8211;<br />
and once the image display step above is working, you will be able<br />
to display images in the W3M buffers as well.</p>
<ul>
<li>Install w3m from Cygwin</li>
<li>Test image display by hitting <code>T</code> (w3m-toggle-inline-images)</li>
<li>Example screenshot:<br />
<a rel="attachment wp-att-450" href="http://gregorygrubbs.com/emacs/10-tips-emacs-windows/attachment/emacs_pacman_google/"><img class="alignnone size-medium wp-image-450" title="W3M Browser in Emacs" src="http://gregorygrubbs.com/wp-content/uploads/2010/05/emacs_pacman_google-300x127.jpg" alt="W3M Browser in Emacs" width="300" height="127" /></a></li>
</ul>
<h2>Tip #6: Bring back Ediff and Smerge</h2>
<p>Ediff is yet another thing which doesn&#8217;t work as it should.  You<br />
will get an error complaining about Dos-style versus Unix-style<br />
paths.  Fixing it is a simple matter of setting an environment variable.</p>
<ul>
<li>Assure you have Cygwin&#8217;s diff package installed</li>
<li>Set the Windows environment variable nodosfilewarning=1</li>
<li>Restart Emacs, and verify that the environment variable is set by executing <code>M-x shell</code>, then typing <code>env | grep dos</code>, for example</li>
<li><strong>Always, prior to running ediff</strong>, execute <code>M-x shell</code></li>
</ul>
<h2>Tip #7: Spell using ISpell or Aspell</h2>
<p>Fortunately very easy to get working by following <a href="http://bria.nwood.org/node/49">Brian Wood&#8217;s directions</a> using the ISpell package for Cygwin linked above.</p>
<p><strong>Note added later:</strong></p>
<p>Aspell is even easier to use: just install aspell and the correct language(s) in Cygwin, then use the following in your emacs init:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>setq-default ispell-program-<span style="color: #b1b100;">name</span> <span style="color: #ff0000;">&quot;aspell&quot;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<h2>Tip #8: Maximized frame works using maxframe.el</h2>
<p>Those of us who practice Distraction-Free Emacsing, or DFE, will<br />
lament the inability to maximize the frame as we can do on other<br />
systems (ie, a true maximized windows, with no OS window<br />
decoration).  The solution is provided by maxfame.el, linked above.</p>
<p>After loading maxframe.el, use <code>M-x maximize-frame</code> and <code>M-x restore-frame</code></p>
<h2>Tip #9: Print on PostScript printers</h2>
<p>And finally, printing.  Even this just didn&#8217;t work out of the box<br />
for me.  The solution was to use a nice little utility called<br />
GSPrint from the GSView package linked above.</p>
<ul>
<li>Install Ghostscript in Cygwin</li>
<li>Install GSView

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;">      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">when</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">and</span> <span style="color: #66cc66;">&#40;</span>string<span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span>window-system<span style="color: #66cc66;">&#41;</span> <span style="color: #ff0000;">&quot;w32&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>file-exists-p <span style="color: #ff0000;">&quot;c:/Program Files/Ghostgum/gsview/gsprint.exe&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">progn</span>
      <span style="color: #808080; font-style: italic;">;;  Windows printer</span>
      <span style="color: #66cc66;">&#40;</span>setq-default ps-lpr-command <span style="color: #66cc66;">&#40;</span>expand-file-<span style="color: #b1b100;">name</span> <span style="color: #ff0000;">&quot;c:/Program Files/Ghostgum/gsview/gsprint.exe&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>setq-default ps-printer-<span style="color: #b1b100;">name</span> t<span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>setq-default ps-printer-name-option <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> ps-lpr-switches '<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;-query&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; show printer dialog</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> ps-right-header '<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;/pagenumberstring load&quot;</span> ps-time-stamp-mon-dd-yyyy<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">eq</span> window-system 'x<span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> ps-lpr-command <span style="color: #ff0000;">&quot;gtklp&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

</li>
</ul>
<h2>Tip #10: Some things Just Work™: Nifty Emacs 23 features that work &#8220;out of the box&#8221;</h2>
<p>Bonus tip — some things work already, no fiddling required!</p>
<h3>Select any font you want</h3>
<ul>
<li>M-x menu-set-font (choose something lovely like Consolas or Inconsolata &#8230; or Comic Sans MS)</li>
<li>Example font selection, cross-OS

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;">      <span style="color: #808080; font-style: italic;">;;* Font selection</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">cond</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">or</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">eq</span> window-system 'mac<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">eq</span> window-system 'ns<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>set-face-font 'default '<span style="color: #ff0000;">&quot;-apple-inconsolata-medium-r-normal--16-0-72-72-m-0-iso10646-1&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">eq</span> window-system 'w32<span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>set-face-font 'default '<span style="color: #ff0000;">&quot;-outline-Inconsolata-normal-normal-normal-mono-16-*-*-*-c-*-iso8859-1&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">and</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">eq</span> window-system 'x<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">eq</span> emacs-major-version <span style="color: #cc66cc;">23</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>set-face-font 'default '<span style="color: #ff0000;">&quot;-unknown-Inconsolata-normal-normal-normal-*-16-*-*-*-m-0-iso10646-1&quot;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>add-to-<span style="color: #b1b100;">list</span> 'default-frame-alist '<span style="color: #66cc66;">&#40;</span>font <span style="color: #66cc66;">.</span> <span style="color: #ff0000;">&quot;-unknown-Inconsolata-normal-normal-normal-*-16-*-*-*-m-0-iso10646-1&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">eq</span> window-system 'x<span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>set-face-font 'default '<span style="color: #ff0000;">&quot;10x20&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
      <span style="color: #66cc66;">&#40;</span>add-hook 'before-make-frame-hook
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>set-frame-font <span style="color: #ff0000;">&quot;-unknown-Inconsolata-normal-normal-normal-*-16-*-*-*-m-0-iso10646-1&quot;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

</li>
<li><code>M-x grep</code>, <code>M-x grep-find</code>, <code>M-x rgrep</code> and friends (as long as<br />
you have the <code>grep</code> and <code>find</code> commands installed!)</li>
<li><code>M-x tetris</code>, <code>M-x doctor</code>, <code>M-x yow</code>, <code>M-x butterfly</code></li>
</ul>
<h3>Frame transparency</h3>
<ul>
<li>Transparent windows are not my favorite thing, as they tend to<br />
hamper DFE (see above).  But there are occasions, like copying text from a<br />
web page into an Emacs buffer, where it can come in quite handy.</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;">      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> set-transparency <span style="color: #66cc66;">&#40;</span>alpha-level<span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>interactive <span style="color: #ff0000;">&quot;p&quot;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span>message <span style="color: #66cc66;">&#40;</span>format <span style="color: #ff0000;">&quot;Alpha level passed in: %s&quot;</span> alpha-level<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>alpha-level <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&amp;</span>lt<span style="color: #808080; font-style: italic;">; alpha-level 2)</span>
				<span style="color: #66cc66;">&#40;</span>read-number <span style="color: #ff0000;">&quot;Opacity percentage: &quot;</span> <span style="color: #cc66cc;">85</span><span style="color: #66cc66;">&#41;</span>
				alpha-level<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#40;</span>myalpha <span style="color: #66cc66;">&#40;</span>frame-parameter <span style="color: #b1b100;">nil</span> 'alpha<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#40;</span>set-frame-parameter <span style="color: #b1b100;">nil</span> 'alpha alpha-level<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
				<span style="color: #66cc66;">&#40;</span>message <span style="color: #66cc66;">&#40;</span>format <span style="color: #ff0000;">&quot;Alpha level is %d&quot;</span> <span style="color: #66cc66;">&#40;</span>frame-parameter <span style="color: #b1b100;">nil</span> 'alpha<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://gregorygrubbs.com/emacs/10-tips-emacs-windows/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Snippets with Emacs Lisp Power</title>
		<link>http://gregorygrubbs.com/wordpress/snippets-with-emacs-lisp-power/</link>
		<comments>http://gregorygrubbs.com/wordpress/snippets-with-emacs-lisp-power/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 06:00:51 +0000</pubDate>
		<dc:creator>Gregory Grubbs</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[E Text Editor]]></category>
		<category><![CDATA[Emacs Lisp]]></category>
		<category><![CDATA[Functional languages]]></category>
		<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[TextMate]]></category>
		<category><![CDATA[yasnippet]]></category>

		<guid isPermaLink="false">http://gregorygrubbs.com/?p=415</guid>
		<description><![CDATA[ 
The YASnippet package for Emacs has some pretty awesome power for the developer, especially when you utilize the power of Emacs Lisp.  

YASnippet was inspired by TextMate, which was inspired by Emacs, in a highly-out-of-equilibrium whirlwind of self-referential creativity.  
The screencast above uses a set of snippets I originally took from this [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/26405526@N00/2188203168" title="As RAW as Winter"><img src="http://farm3.static.flickr.com/2165/2188203168_86a4d818f4.jpg" /></a> </p>
<p>The YASnippet package for Emacs has some pretty awesome power for the developer, especially when you utilize the power of Emacs Lisp.  </p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/HPT7pm8ot8M&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/HPT7pm8ot8M&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>YASnippet was inspired by TextMate, which was inspired by Emacs, in a highly-out-of-equilibrium whirlwind of self-referential creativity.  </p>
<p>The screencast above uses a set of snippets I originally took from <a href="http://top-frog.com/projects/wordpress-textmate-bundle/">this WordPress TextMate bundle</a>, created by Shawn Parker and Gordon Brander</p>
<p>The first snippet in the screencast illustrates YASnippet&#8217;s mirrors with transformation, in a WordPress plugin template.  The snippet calls Emacs Lisp functions as the plugin name is filled in to create the plugin URI, the &#8220;namespace&#8221; (used here as a prefix for function and variable names), and the primary class name for the plugin. </p>
<p>The second snippet writes a function skeleton, then calls Emacs Lisp at the end to move the generated function outside the current scope into a correct position in the file.  This snippet uses YASnippet&#8217;s fields with transformations syntax, but to do a sneaky thing: not transform the field, but move a region of generated text!</p>
<p>Following is the code for the snippets shown in the screencast, with no commentary.  So pipe up in the comments if you&#8217;re curious about how something works!</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># -*- mode: snippet -*-
</span><span style="color: #666666; font-style: italic;"># name: WP Plugin
</span><span style="color: #666666; font-style: italic;"># key: plugin
</span><span style="color: #666666; font-style: italic;"># --
</span><span style="color: #666666; font-style: italic;">/*
Plugin Name: ${1:Plugin Name}
Plugin URI: http://${2:dynapse.com/plugins/}${1:$(gjg/sanitize text)}/
Description: ${3:Description}
Version: ${4:1.0}
Author: ${5:Gregory Grubbs}
Author URI: http://${6:gregorygrubbs.com/}
Namespace: ${1:$(gjg/acronyminize text)}_
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> $<span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span>$<span style="color: #009900;">&#40;</span>gjg<span style="color: #339933;">/</span>whitespace<span style="color: #339933;">-</span>to<span style="color: #339933;">-</span>underscore text<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #009933; font-style: italic;">/**
	 * constructor for $1
	 *
	 * The constructor is responsible for registering all hooks used
	 * by this class as as WordPress plugin
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		 $<span style="color: #cc66cc;">0</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// constructor</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
$$<span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span>$<span style="color: #009900;">&#40;</span>gjg<span style="color: #339933;">/</span>acronyminize text<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> $<span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span>$<span style="color: #009900;">&#40;</span>gjg<span style="color: #339933;">/</span>whitespace<span style="color: #339933;">-</span>to<span style="color: #339933;">-</span>underscore text<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Next, the add_action snippet, which moves a generated function at the end:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># -*- mode: snippet -*-
</span><span style="color: #666666; font-style: italic;"># name: add_action
</span><span style="color: #666666; font-style: italic;"># key: add_action
</span><span style="color: #666666; font-style: italic;"># --
</span>add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'${1:init}'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_${2:$1}'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">3</span><span style="color: #339933;">:</span>$$<span style="color: #009900;">&#40;</span>gjg<span style="color: #339933;">/</span>move<span style="color: #339933;">-</span>next<span style="color: #339933;">-</span>sexp<span style="color: #339933;">-</span>past<span style="color: #339933;">-</span>current<span style="color: #339933;">-</span>scope<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_$<span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And finally, (some of) the Emacs Lisp functions that the snippets call:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> gjg/acronyminize <span style="color: #66cc66;">&#40;</span>text <span style="color: #66cc66;">&amp;</span>optional do-capitalize<span style="color: #66cc66;">&#41;</span>
  <span style="color: #ff0000;">&quot;Make an acronym from the text 
do-capitalize: t means run text through capitalize function, nil will respect CamelCase
&quot;</span>
  <span style="color: #66cc66;">&#40;</span>save-excursion
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> case-fold-search <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>downcase
     <span style="color: #66cc66;">&#40;</span>replace-regexp-in-string
      <span style="color: #ff0000;">&quot;[^A-Z]&quot;</span> <span style="color: #ff0000;">&quot;&quot;</span>
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> do-capitalize <span style="color: #66cc66;">&#40;</span>capitalize text<span style="color: #66cc66;">&#41;</span> text<span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">nil</span> t<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> gjg/move-next-sexp-past-current-scope <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #ff0000;">&quot;kill sexp following point, move past current scope/sexp/function&quot;</span>
  <span style="color: #66cc66;">&#40;</span>beginning-of-line<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>beg <span style="color: #66cc66;">&#40;</span>point<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>re-search-forward <span style="color: #ff0000;">&quot;^[ <span style="color: #000099; font-weight: bold;">\t</span>]*function[ <span style="color: #000099; font-weight: bold;">\t</span>]+[^}]+?}&quot;</span> <span style="color: #66cc66;">&#40;</span>point-<span style="color: #b1b100;">max</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>mark-<span style="color: #b1b100;">defun</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#40;</span>kill-region <span style="color: #66cc66;">&#40;</span>point<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>mark<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>forward-line<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>yank<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>indent-region <span style="color: #66cc66;">&#40;</span>mark<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>point<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://gregorygrubbs.com/wordpress/snippets-with-emacs-lisp-power/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FAST file access with Emacs and ido-mode</title>
		<link>http://gregorygrubbs.com/development/fast-file-access-with-emacs-and-ido-mode/</link>
		<comments>http://gregorygrubbs.com/development/fast-file-access-with-emacs-and-ido-mode/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 04:44:15 +0000</pubDate>
		<dc:creator>Gregory Grubbs</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[fast access]]></category>
		<category><![CDATA[Ido]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[Vi]]></category>

		<guid isPermaLink="false">http://gregorygrubbs.com/?p=411</guid>
		<description><![CDATA[
One of the things that makes daily Emacs use so enjoyable is the availability of brilliant add-ons designed to make you work faster.  
Emacs with ido-mode fuzzy matching (or flex matching) makes it incredibly quick to navigate the file system using only the keyboard. But it does far more than that, allowing the emacs [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/10226264@N04/2097587325" title="18 ampolles"><img src="http://farm3.static.flickr.com/2254/2097587325_5861cc68ea.jpg" /></a></p>
<p>One of the things that makes daily Emacs use so enjoyable is the availability of brilliant add-ons designed to make you work faster.  </p>
<p>Emacs with ido-mode fuzzy matching (or flex matching) makes it incredibly quick to navigate the file system using only the keyboard. But it does far more than that, allowing the emacs pilot to quickly find help, commands, variables and much more. This video shows the finer points of using ido-mode with flex matching.</p>
<p>It&#8217;s all in the video &#8211; enjoy.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/lsgPNVIMkIE&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/lsgPNVIMkIE&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>Here are my current settings for ido-mode</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">;; do not confirm a new file or buffer</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> confirm-nonexistent-file-or-buffer <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>require 'ido<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>ido-mode <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>ido-everywhere <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> ido-enable-flex-matching t<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> ido-create-new-buffer 'always<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> ido-enable-tramp-completion <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> ido-enable-last-directory-history <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> ido-confirm-unique-completion <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">;; wait for RET, even for unique?</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> ido-show-dot-for-dired t<span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">;; put . as the first item</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> ido-use-filename-at-point t<span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">;; prefer file names near point</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://gregorygrubbs.com/development/fast-file-access-with-emacs-and-ido-mode/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Get remote X Windows working in Ubuntu Karmic</title>
		<link>http://gregorygrubbs.com/development/get-remote-x-working-in-karmic/</link>
		<comments>http://gregorygrubbs.com/development/get-remote-x-working-in-karmic/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 18:09:24 +0000</pubDate>
		<dc:creator>Gregory Grubbs</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://gregorygrubbs.com/?p=391</guid>
		<description><![CDATA[
One thing that troubled me moving to Ubuntu 9.10 Karmic Koala: my remote X applications stopped working with the error
X11 connection rejected because of wrong authentication

The reason seems to be that Gnome moved the location of X authorization to [wherever-the-hell-i-dont-remember], whereas ssh and everything else still use the same location (~/.Xauthority).  Note: I clearly [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/40418474@N00/2776450260" title="El gegant // The Giant"><img src="http://farm4.static.flickr.com/3082/2776450260_e35cd9a763.jpg" /></a></p>
<p>One thing that troubled me moving to Ubuntu 9.10 Karmic Koala: my remote X applications stopped working with the error<br />
<code>X11 connection rejected because of wrong authentication</code></p>
<p><span id="more-391"></span><br />
The reason seems to be that Gnome moved the location of X authorization to [wherever-the-hell-i-dont-remember], whereas ssh and everything else still use the same location (<code>~/.Xauthority</code>).  Note: I clearly forgot whatever it was I discovered about xauth, so please enlighten me in the comments, and I will update this exceedingly lame paragraph.</p>
<p>This is going to be tagged as an Emacs post because my principal reason to use remote X is Emacs&#8217; awesome <code>make-frame-on-display</code> command.</p>
<p>The bash script I use is saved in ~/bin/xauthmagic:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
xauth <span style="color: #660033;">-f</span> ~<span style="color: #000000; font-weight: bold;">/</span>.Xauthority list <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">':0'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> foo; <span style="color: #000000; font-weight: bold;">do</span> xauth add <span style="color: #007800;">$foo</span>; <span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p>This means: look through all the xauth cookies in <code>~/.Xauthority</code>, remove the &#8216;:0&#8242; (local) display cookie, take the remaining cookies and run the <code>xauth</code> command on them.</p>
<p>The steps I take to use this:</p>
<ul>
<li>On my remote host (emunah), start an ssh section forwarding X:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">greg<span style="color: #000000; font-weight: bold;">@</span>emunah$ <span style="color: #c20cb9; font-weight: bold;">ssh</span> greg<span style="color: #000000; font-weight: bold;">@</span>maui <span style="color: #660033;">-Y</span></pre></div></div>

</li>
<li>
On my local host (maui), run the <code>xauthmagic</code> script above</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">greg<span style="color: #000000; font-weight: bold;">@</span>maui$ ~<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>xauthmagic</pre></div></div>

</li>
<li>
From my local host emacs, run <code>M-x make-frame-on-display RET localhost:10.0 RET</code>
</li>
</ul>
<p>Et voilá!</p>
]]></content:encoded>
			<wfw:commentRss>http://gregorygrubbs.com/development/get-remote-x-working-in-karmic/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Emacs Power: remote servers and shell commands</title>
		<link>http://gregorygrubbs.com/wordpress/emacs-power-remote-servers-and-shell-commands/</link>
		<comments>http://gregorygrubbs.com/wordpress/emacs-power-remote-servers-and-shell-commands/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 17:26:40 +0000</pubDate>
		<dc:creator>Gregory Grubbs</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[geekhood]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[remote server]]></category>
		<category><![CDATA[secure shell]]></category>
		<category><![CDATA[tramp]]></category>

		<guid isPermaLink="false">http://gregorygrubbs.com/?p=372</guid>
		<description><![CDATA[
Emacs file and directory browsing 
Emacs has Dired, a great method for browsing directories; especially in combination with ido-mode, I prefer it to Windows Explorer, OS X Finder, Gnome Nautilus, or anything else I&#8217;ve used over the decades to browse file systems. You can quickly begin entering paths, and Dired helps you with directory and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/16230215@N08/2898797929" title="Come Together"><img src="http://farm4.static.flickr.com/3282/2898797929_f209eeb4a4.jpg" /></a></p>
<h4 id="sec-1">Emacs file and directory browsing </h4>
<p>Emacs has Dired, a great method for browsing directories; especially in combination with ido-mode, I prefer it to Windows Explorer, OS X Finder, Gnome Nautilus, or anything else I&#8217;ve used over the decades to browse file systems. You can quickly begin entering paths, and Dired helps you with directory and file name completion.<br />
<span id="more-372"></span></p>
<p>  As you browse directories, emacs lets you bookmark any path you may visit again. A very cool feature of emacs is the wide variety of shell-based modes: shell, term, interactive SQL, version control, recursive grep, and more.  When you are looking at a Dired buffer and invoke any of those commands, the shell is started in the directory you are looking at.</p>
<h4 id="sec-2">TRAMP: powerful remote file server access </h4>
<p>An emacs user will eventually discover that Dired becomes even more powerful with the built-in power of TRAMP (Transparent Remote (file) Access, Multiple Protocol).  This extends directory path syntax to include FTP, SSH, Rsync and other protocols for accessing remote files.</p>
<p>  An example of accessing a remote file on my development server <code>smeagol</code> from my laptop:</p>
<pre class="example">/ssh:gregj@smeagol:work/client1/web/index.php
</pre>
<p>  A directory on an FTP server is accessed the same way:</p>
<pre class="example">/ftp:ftpuser@ftp.example.com:
</pre>
<p>  Even sudo is considered a &#8216;protocol&#8217;; so to gain root access without leaving the comfort of your emacs session, use</p>
<pre class="example">/sudo::/etc/hosts
</pre>
<p>  Emacs even helps you browse remote servers, providing the same name completion you get on your local directories.</p>
<h4 id="sec-1">The amazing combo of TRAMP and shell commands</h4>
<p>  As wonderful as all this is, we are still in the realm of &#8220;mere&#8221; GUI editors that can browse remote servers. But we are dealing with emacs, the superset of all editors, so we expect even more.</p>
<p>  Imagine we are looking at a directory on a remote server at <code>/ssh:myuser@remote.com:web/public_html</code>, and decide to type</p>
<pre class="example">M-x shell
</pre>
<p>  What happens? Why, emacs looks at our current directory, sees that it is a TRAMP remote path, and just does the Right Thing&trade;: in this case, invokes ssh, sets the directory on the remote server to ~myuser/web/public_html, and sets us at the shell prompt.</p>
<p>  Similarly, if we invoke version control (<code>vc-dir</code>, for example), or recursive grep (<code>rgrep</code>), or most other shell-based commands, emacs will open a secure shell first, then run the vc command (<code>svn</code>, <code>git</code>, etc) or <code>grep</code> <b>on the remote server!!</b> So for example, if I innocently invoke <code>rgrep</code> at the root of a remote WordPress installation, the grep command looks through all the files from the remote server. If on the other hand I were accessing the server using something like <a href="http://fuse.sourceforge.net/sshfs.html">SSHFS</a>, all those files would be transferred to my local machine first and then searched!</p>
<h4 id="sec-3">Some examples </h4>
<p>  I&#8217;ll save my favorite uses of this magic called Dired with TRAMP for last.  I often need to access a development system or a live WordPress installation remotely. To access the SQL client, I found I often had to browse for the WordPress config file, open it, search for the database access info, open a SQL session using <code>M-x sql-mysql</code> and fill in all the prompts to authenticate to the MySQL server.  It&#8217;s great that emacs with TRAMP starts a shell on the remote machine, and initiates the mysql client on that machine.  But emacs allows you to do damn near anything you can imagine, so I realized I could write a function that does the following:</p>
<ol>
<li>
	Looks for wp-config.php in the current directory
  </li>
<li>
	If not found, moves up a directory until it either finds the file or reaches the root of the filesystem
  </li>
<li>
	If found, opens the config file and parses the database authentication parameters
  </li>
<li>
	Feeds those parameters to the sql-mysql function and
  </li>
<li>
	plops me into the MySQL prompt all logged in and ready to go!</p>
</li>
</ol>
<p>Another example: my iPod Touch has an SSH server running on it (don&#8217;t ask me how it got there). I have discovered that many apps use SQLite to store their data.  I have been losing weight lately, and have been using the excellent <a href="http://www.loseit.com/">Lose It!</a> app to track my meals and exercise.  The app gives me nice weekly summaries of my caloric intake, but does not give a weekly summary of my aerobic exercise.  Here&#8217;s how I get that information now:</p>
<ol>
<li>
	I have a nice bookmark to the Lose It! application directory at<br />
	<code>/scpc:mobile@172.16.17.118:/var/mobile/Applications/C6503545-700B-4395-9C8B-FE5B75CF6CD8/</code>,<br />
	so I hit the Return key on that bookmark and wait for Dired to show me the files there.
  </li>
<li>
	Browse to the Documents directory, wherein is stored the database for my personal history
  </li>
<li>
	Invoke <code>M-x sql-sqlite</code> and enter the database file <code>UserDatabaseV1.sql</code> (using dabbrev as a shortcut)
  </li>
<li>
	Wait for the SQLite prompt to appear, and run a lovely little SQL query using a YASnippets shortcut: </p>
</li>
</ol>
<pre class="src src-sql"><span style="color: #a020f0;">SELECT</span> <span style="color: #228b22;">date</span>(<span style="color: #0000ff;">'2001-01-01'</span>, <span style="color: #0000ff;">'+'</span> || <span style="color: #228b22;">Date</span> || <span style="color: #0000ff;">' day'</span>, <span style="color: #0000ff;">'-1 day'</span>, <span style="color: #0000ff;">'weekday 1'</span>, <span style="color: #0000ff;">'-7 day'</span>) <span style="color: #a020f0;">AS</span> Weekdate, strftime(<span style="color: #0000ff;">'%W'</span>,<span style="color: #228b22;">date</span>(<span style="color: #0000ff;">'2001-01-01'</span>, <span style="color: #0000ff;">'+'</span> || <span style="color: #228b22;">Date</span> || <span style="color: #0000ff;">' day'</span>, <span style="color: #0000ff;">'-1 day'</span>)) <span style="color: #a020f0;">AS</span> Week,   ExerciseName, ExerciseCategoryId, <span style="color: #da70d6;">SUM</span>(Minutes), <span style="color: #da70d6;">SUM</span>(CaloriesBurned)   <span style="color: #a020f0;">FROM</span> ExerciseLogEntries  <span style="color: #a020f0;">GROUP</span> <span style="color: #a020f0;">BY</span> Week;
</pre>
<h4 id="sec-4">Summary </h4>
<p>I hope that this post gives an idea of the power of TRAMP on emacs.  It should at least explain the occasional ecstatic post you may see from your geekier tweeps.</p>
<p>As a bonus, here&#8217;s what the above examples look like in use: it&#8217;s unbelievable how fast emacs makes you after a quick 15 years of study.</p>
<p><object width="640" height="505"><param name="movie" value="http://www.youtube.com/v/UjPasLGWzD0&#038;hl=en&#038;fs=1&#038;color1=0x5d1719&#038;color2=0xcd311b"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/UjPasLGWzD0&#038;hl=en&#038;fs=1&#038;color1=0x5d1719&#038;color2=0xcd311b" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="505"></embed></object></p>
<p>  And here&#8217;s my emacs lisp code that opens up a SQL prompt for any WordPress installation.  To use, eval the code and invoke <code>M-x gjg/sql-mysql-wordpress</code></p>
<pre class="src src-emacs-lisp">(<span style="color: #a020f0;">defun</span> <span style="color: #0000ff;">gjg/parse-wp-config-db</span> (wpconfig-path)
  <span style="color: #0000ff;">"Read in and parse the DB settings from a WordPress config file; binds 'global' vars for use by sql-mode"</span>
  (<span style="color: #a020f0;">save-excursion</span> <span style="color: #b22222;">;; </span><span style="color: #b22222;">will restore current buffer and default dir afterwards
  </span>    (set-buffer (get-buffer-create (generate-new-buffer-name <span style="color: #0000ff;">" wp-config.php"</span>)))
  (insert-file-contents wpconfig-path)
  <span style="color: #b22222;">;; </span><span style="color: #b22222;">in regex: subexpr 1 is variable name, subexpr 3 is value: DB_{HOST,NAME,PASSWORD,USER}
  </span>    (<span style="color: #a020f0;">while</span> (search-forward-regexp <span style="color: #0000ff;">"define\s*(\s*['\"]</span><span style="color: #0000ff; font-weight: bold;">\\</span><span style="color: #0000ff; font-weight: bold;">(</span><span style="color: #0000ff;">DB_</span><span style="color: #0000ff; font-weight: bold;">\\</span><span style="color: #0000ff; font-weight: bold;">(</span><span style="color: #0000ff;">HOST</span><span style="color: #0000ff; font-weight: bold;">\\</span><span style="color: #0000ff; font-weight: bold;">|</span><span style="color: #0000ff;">NAME</span><span style="color: #0000ff; font-weight: bold;">\\</span><span style="color: #0000ff; font-weight: bold;">|</span><span style="color: #0000ff;">PASSWORD</span><span style="color: #0000ff; font-weight: bold;">\\</span><span style="color: #0000ff; font-weight: bold;">|</span><span style="color: #0000ff;">USER</span><span style="color: #0000ff; font-weight: bold;">\\</span><span style="color: #0000ff; font-weight: bold;">)</span><span style="color: #0000ff; font-weight: bold;">\\</span><span style="color: #0000ff; font-weight: bold;">)</span><span style="color: #0000ff;">['\"]\s*,\s*['\"]</span><span style="color: #0000ff; font-weight: bold;">\\</span><span style="color: #0000ff; font-weight: bold;">(</span><span style="color: #0000ff;">[</span><span style="color: #0000ff;">^</span><span style="color: #0000ff;">'\"]*</span><span style="color: #0000ff; font-weight: bold;">\\</span><span style="color: #0000ff; font-weight: bold;">)</span><span style="color: #0000ff;">['\"]\s*)"</span> (point-max) 42   )
  (<span style="color: #a020f0;">cond</span>
  ((equal <span style="color: #0000ff;">"DB_HOST"</span> (match-string-no-properties 1))
  (setq sql-server (match-string-no-properties 3)))
  ((equal <span style="color: #0000ff;">"DB_NAME"</span> (match-string-no-properties 1))
  (setq sql-database (match-string-no-properties 3)))
  ((equal <span style="color: #0000ff;">"DB_PASSWORD"</span> (match-string-no-properties 1))
  (setq sql-password (match-string-no-properties 3)))
  ((equal <span style="color: #0000ff;">"DB_USER"</span> (match-string-no-properties 1))
  (setq sql-user (match-string-no-properties 3)))))
  (kill-buffer )))

  (<span style="color: #a020f0;">defun</span> <span style="color: #0000ff;">gjg/sql-mysql-wordpress</span> ()
  <span style="color: #0000ff;">"Find WordPress config file in current tree, log into WP database if found."</span>
  (interactive)
  (<span style="color: #a020f0;">let</span> ((mypath (locate-dominating-file default-directory <span style="color: #0000ff;">"wp-config.php"</span>)))
  (<span style="color: #a020f0;">if</span> mypath
  (<span style="color: #a020f0;">progn</span>
  (gjg/parse-wp-config-db (concat mypath <span style="color: #0000ff;">"wp-config.php"</span>))
  (pop-to-buffer (sql-connect-mysql))
  (setq sql-interactive-product 'mysql)
  (setq sql-buffer (current-buffer))
  (sql-interactive-mode)
  (<span style="color: #a020f0;">let*</span> ((match (string-match (nth 0 tramp-file-name-structure) mypath))
  (myformat (<span style="color: #a020f0;">if</span> (eq nil match)
  (format <span style="color: #0000ff;">" WordPress: local; %s; dbhost %s "</span>
  mypath
  sql-server
  )
  (format <span style="color: #0000ff;">" WordPress: Remote %s@%s %s; dbhost %s "</span>
  (match-string (nth 2 tramp-file-name-structure) mypath)
  (match-string (nth 3 tramp-file-name-structure) mypath)
  (match-string (nth 4 tramp-file-name-structure) mypath)
  sql-server))))
  (setq header-line-format myformat))
  )
  (message <span style="color: #0000ff;">"Did not find wp-config.php in current path"</span>))
  ))
</pre>
<p> LocalWords:  Dired emacs SQL Rsync smeagol pre rgrep WordPress MySQL iPod<br />
 LocalWords:  SQLite</p>
]]></content:encoded>
			<wfw:commentRss>http://gregorygrubbs.com/wordpress/emacs-power-remote-servers-and-shell-commands/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How I became a programmer (thank you, Captain Kirk)</title>
		<link>http://gregorygrubbs.com/general-interest/how-i-became-a-programmer-thank-you-captain-kirk/</link>
		<comments>http://gregorygrubbs.com/general-interest/how-i-became-a-programmer-thank-you-captain-kirk/#comments</comments>
		<pubDate>Thu, 14 May 2009 15:05:11 +0000</pubDate>
		<dc:creator>Gregory Grubbs</dc:creator>
				<category><![CDATA[General Interest]]></category>
		<category><![CDATA[Captain Kirk]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[programmer]]></category>
		<category><![CDATA[Spock]]></category>
		<category><![CDATA[Star Trek]]></category>
		<category><![CDATA[startrek]]></category>

		<guid isPermaLink="false">http://gregorygrubbs.com/?p=207</guid>
		<description><![CDATA[
With JJ Abrams rocking our worlds with new Star Trek energy, I thought I would give thanks to the Trek franchise for helping me find my vocational path.

We had a little closet of a computer room at my High School.  The room had a couple old WWII teletype machines connected via acoustic couplers to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://farm1.static.flickr.com/71/228712807_e2b52b6708_m.jpg" alt="" /></p>
<p>With JJ Abrams rocking our worlds with new Star Trek energy, I thought I would give thanks to the Trek franchise for helping me find my vocational path.</p>
<p><span id="more-207"></span></p>
<p>We had a little closet of a computer room at my High School.  The room had a couple old WWII teletype machines connected via acoustic couplers to a Data General minicomputer at the county administration building.  Some early young hacker in Junior High had finagled himself a sysadmin job working for free at nights there.  Programming in Basic (and probably cribbing from Dr. Dobbs Journal), he had written a two-player game of Star Trek.  One player would get to be the Enterprise, and the other would become a Klingon.  The players could send threatening messages to each other, and would periodically print out long-range or short-range scans.  Once you had located the other ship you would have to calculate the tangent between your two-dimensional coordinates and those of the other ship, so you could turn to fire!  If you fired an energy weapon, the power of the blast would decrease by the inverse of the square of the distance between you.  It was just amazing, and great fun as the scans chugged out on the teletypes.</p>
<p>Playing was plenty fun &#8212; but once I discovered I could print out the source code, modify it, and actually CHANGE THE WAY THE GAME WORKED, I was done.  Hook, line and sinker, reel me in Scotty.</p>
<p>Some 30 years hence, it&#8217;s still great fun to create software.  The path of the programmer has brought me to a couple dozen countries around the world, helped me understand design, taught me about business and introduced me to a multitude of amazing people.</p>
<p>Live long, and prosper.</p>
]]></content:encoded>
			<wfw:commentRss>http://gregorygrubbs.com/general-interest/how-i-became-a-programmer-thank-you-captain-kirk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>One-button website publishing using WordPress-mu</title>
		<link>http://gregorygrubbs.com/wordpress/one-button-website-publishing-using-wordpress-mu/</link>
		<comments>http://gregorygrubbs.com/wordpress/one-button-website-publishing-using-wordpress-mu/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 00:50:48 +0000</pubDate>
		<dc:creator>Gregory Grubbs</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress-mu]]></category>
		<category><![CDATA[automated]]></category>
		<category><![CDATA[creation]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://gregorygrubbs.com/?p=174</guid>
		<description><![CDATA[
I&#8217;m kinda loving on WordPress MU.  One of my recent projects required building web sites that pulled from a shared database.  WordPress MU allowed me to create a one-button website builder for my client.  WordPress MU calls them blogs, but my client will map a unique domain to each blog, and, well, [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Create many from the one" href="http://flickr.com/photos/63989735@N00/2431138923"><img src="http://farm3.static.flickr.com/2299/2431138923_ff1f7aaa36.jpg" alt="" /></a></p>
<p>I&#8217;m kinda loving on WordPress MU.  One of my recent projects required building web sites that pulled from a shared database.  WordPress MU allowed me to create a one-button website builder for my client.  WordPress MU calls them blogs, but my client will map a unique domain to each blog, and, well, doesn&#8217;t use them as blogs at all.  So I&#8217;m calling them sites here.</p>
<p>By filling in three fields and clicking a button, my client creates a website that</p>
<ul>
<li> Associates metadata with the site that specifies filter criteria to select records from the shared database</li>
<li> Sets the permalink structure for the new site to a custom setting</li>
<li> Creates a key category for the new site, one that is used for the posts generated in a later step</li>
<li> Sets the theme</li>
<li> All the initial pages are created, including content.  The &#8220;slug&#8221; is set specifically to support the URL structure we want.  Page template is also set here because our design calls for a hierarchy of pages.</li>
<li> If the PageMash plugin is active (it is auto-activated for all new blogs using Plugin Commander), certain pages are hidden, and a specific order is set so that page navigation comes out looking good</li>
<li> The front page is set, because we are creating CMS sites, not blogs</li>
<li>Several hundred posts are generated out of the underlying shared non-WPMU database tables</li>
</ul>
<p>All of this takes something like 20 seconds, at which point the admin can visit the new site as a subdomain.  The theme has been applied, navigation works correctly, it is beauty.</p>
<p><span id="more-174"></span></p>
<p>Here&#8217;s how it is done in code.  All you need to do is register a function for the action hook that WordPress MU runs when a new blog is created.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> mypp_initialize_blog<span style="color: #009900;">&#40;</span><span style="color: #000088;">$blog_id</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// first, switch to the new blog; we will undo this at the</span>
  <span style="color: #666666; font-style: italic;">// end of the function with restore_current_blog()</span>
  switch_to_blog<span style="color: #009900;">&#40;</span><span style="color: #000088;">$blog_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// add a blog option, here a filter with a default value</span>
  add_option<span style="color: #009900;">&#40;</span><span style="color: #000088;">$blog_id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'campus_selection_criteria'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;CampusStateID='CA'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// Set a custom permalink structure</span>
  <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>set_permalink_structure<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/%category%/%postname%'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$wp_rewrite</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>flush_rules<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_create_category'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      wp_create_category<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'schools'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// switch theme - this one specifies a child theme</span>
  switch_theme<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'corporate'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tweaked-corporate'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// Prepare options used by the pageMash plugin, auto-activated for new sites</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'exclude_pages'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000088;">$excludePagesList</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">else</span>
    <span style="color: #000088;">$excludePagesList</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'exclude_pages'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//if it's empty set as an empty array</span>
  <span style="color: #666666; font-style: italic;">// add pages to support the basic page structure</span>
  <span style="color: #666666; font-style: italic;">// NOTE: the full code is not shown, standard use of wp_insert post</span>
  <span style="color: #666666; font-style: italic;">// for each page:</span>
  <span style="color: #000088;">$newid</span> <span style="color: #339933;">=</span> wp_insert_post<span style="color: #009900;">&#40;</span><span style="color: #000088;">$postdata</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$newid</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span>is_wp_error<span style="color: #009900;">&#40;</span><span style="color: #000088;">$newid</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    add_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$newid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> IWANTOEXCLUDETHISPARTICULARPAGEFROMNAVIGATION <span style="color: #009900;">&#41;</span>
      <span style="color: #000088;">$excludePagesList</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$newid</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>THISPARTICULARPAGE <span style="color: #339933;">==</span> <span style="color: #0000ff;">'home'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      update_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'show_on_front'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      update_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'page_on_front'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$newid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// error handling if insert post failed</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #666666; font-style: italic;">// end for each page</span>
  update_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'exclude_pages'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$excludePagesList</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// now generate posts for schools from the shared database</span>
  createSchoolAsPost<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$blog_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// we're done! restore our initial blog</span>
  restore_current_blog<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// function mypp_initialize_blog</span>
&nbsp;
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wpmu_new_blog'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mypp_initialize_blog'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://gregorygrubbs.com/wordpress/one-button-website-publishing-using-wordpress-mu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to get your command line PHP script working with WordPress-MU 2.7</title>
		<link>http://gregorygrubbs.com/wordpress/how-to-get-your-command-line-php-script-working-with-wordpress-mu-27/</link>
		<comments>http://gregorygrubbs.com/wordpress/how-to-get-your-command-line-php-script-working-with-wordpress-mu-27/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 16:47:23 +0000</pubDate>
		<dc:creator>Gregory Grubbs</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress-mu]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web server]]></category>
		<category><![CDATA[wpmu]]></category>

		<guid isPermaLink="false">http://gregorygrubbs.com/?p=160</guid>
		<description><![CDATA[
	OK, this one is obscure. I only post about what I can&#8217;t find on Google!
Until recently it has been possible to run command-line PHP scripts that include wp-config.php or wpmu-settings.php, in order to give those scripts access to WordPress globals like $wpdb, functions such as wp_insert_post etc.  
These scripts worked with WordPress-MU until recently [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/86639396@N00/125838823" title="To the moon, Ajax!"><img src="http://farm1.static.flickr.com/48/125838823_e1a4d43a62_m.jpg" /></a></p>
<p>	OK, this one is obscure. I only post about what I can&#8217;t find on Google!</p>
<p>Until recently it has been possible to run command-line PHP scripts that include wp-config.php or wpmu-settings.php, in order to give those scripts access to WordPress globals like $wpdb, functions such as wp_insert_post etc.  </p>
<p>These scripts worked with WordPress-MU until recently &#8212; now the scripts just exit with no output.  </p>
<p>The reason?  WPMU now initiates a redirect in the bootstrap process (search for &#8216;header( &#8220;Location: &#8220;&#8216;  in wpmu-settings.php).  A browser can follow that redirection, but a command line script cannot.  So, if you want to initiate scripts that run from the command line, you will have to get the web server involved by invoking a text browser such as curl, wget, or links.  </p>
<p>It&#8217;s best not to force your scripts to figure out where to find wp-config.php anyway.  I have taken to using a method suggested in <a href="http://wordpress.org/support/topic/190522">this thread</a>, as shown in the code sample below.  The good news is, you know that your script will work the same whether initiated from a plugin in a graphic browser, used in an Ajax call, or initiated from cron or the command line shell.</p>
<p>So instead of kicking your script off with something like</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php <span style="color: #660033;">-q</span> myscript.php</pre></div></div>

<p>You will create the script as a proper plugin and do something like</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>curl <span style="color: #660033;">-d</span> <span style="color: #007800;">mypp_cmd</span>=status http:<span style="color: #000000; font-weight: bold;">//</span>mywpmusite.com</pre></div></div>

<p>Sample plugin code used for the above example follows.  The prefix for the functions is &#8216;mypp&#8217;, which of course stands for &#8216;MY Plugin Prefix&#8217; to create a unique namespace.  The code below returns results as JSON encoded, and calls die()/exit() at the end to prevent an entire page being created.  For log files run from cron, you may choose to return plain text instead.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #009933; font-style: italic;">/**
   * Add a query var for this plugin
   * This allows Ajax programs to operate without requiring file paths
   * Instead, Ajax functions look for the query var 'mypp_cmd'
   */</span>
  <span style="color: #000000; font-weight: bold;">function</span> mypp_query_vars<span style="color: #009900;">&#40;</span><span style="color: #000088;">$qvars</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$qvars</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'mypp_cmd'</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$qvars</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// function mypp_query_vars</span>
&nbsp;
  <span style="color: #009933; font-style: italic;">/**
   * Handle AJAX requests in the template_redirect action
   * We recognize our requests from the query var 'mypp_cmd'
   * Here we allow GET requests using $_REQUEST; to restrict to POST, use $_POST instead
   */</span>
  <span style="color: #000000; font-weight: bold;">function</span> mypp_template_redirect<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$cmd</span> <span style="color: #339933;">=</span> get_query_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'mypp_cmd'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$cmd</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cmd</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'status'</span><span style="color: #339933;">:</span>
	<span style="color: #000088;">$response</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'status'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'success'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span>
				    <span style="color: #0000ff;">'message'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Sample status message'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
	<span style="color: #000088;">$response</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'status'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'success'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
				    <span style="color: #0000ff;">'msg'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Unknown command'</span><span style="color: #339933;">,</span>
				    <span style="color: #0000ff;">'cmd'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$cmd</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// switch $cmd</span>
      <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: text/x-json; charset=utf-8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">print</span> <span style="color: #990000;">utf8_encode</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">json_encode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// $cmd is set</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// function mypp_template_redirect</span>
&nbsp;
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'query_vars'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mypp_query_vars'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_redirect'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mypp_template_redirect'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://gregorygrubbs.com/wordpress/how-to-get-your-command-line-php-script-working-with-wordpress-mu-27/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to change the number of posts shown in the WordPress admin area without hacking the core</title>
		<link>http://gregorygrubbs.com/wordpress/how-to-change-the-number-of-posts-shown-in-the-wordpress-admin-area-without-hacking-the-core/</link>
		<comments>http://gregorygrubbs.com/wordpress/how-to-change-the-number-of-posts-shown-in-the-wordpress-admin-area-without-hacking-the-core/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 13:24:49 +0000</pubDate>
		<dc:creator>Gregory Grubbs</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[edit posts]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://gregorygrubbs.com/?p=142</guid>
		<description><![CDATA[It is easy to go in and hack the core WordPress files to change the hard-coded number, but I wanted to find a way to do it with a hook.  That way, I could one day change the number of posts shown using controls in the interface.
Though there is no filter provided for the number [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_154" class="wp-caption alignnone" style="width: 510px"><img class="size-full wp-image-154" title="use the hook!" src="http://gregorygrubbs.com/wp-content/uploads/2009/03/2921148701_6d1985e27f-cropped.jpg" alt="use the hook!" width="500" height="248" /><p class="wp-caption-text">use the hook!</p></div>
<p>It is easy to go in and hack the core WordPress files to change the hard-coded number, but I wanted to find a way to do it with a hook.  That way, I could one day change the number of posts shown using controls in the interface.</p>
<p>Though there is no filter provided for the number of posts displayed, I hit upon a method of doing this which I would like to share.  Perhaps someone will point out a better way, but for now this is making me happy</p>
<p>The trick is to hijack the query string just for the query that produces the table of posts.  Here&#8217;s what I did:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**  * Extend the number of posts displayed in the Edit Posts  */</span> 
<span style="color: #000000; font-weight: bold;">function</span> dapl_query_string<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query_string</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>   
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$pagenow</span><span style="color: #339933;">;</span>   
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$pagenow</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'edit.php'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$query_string</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_per_page=15'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'posts_per_page=100'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$query_string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$query_string</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span>  
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'query_string'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'dapl_query_string'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://gregorygrubbs.com/wordpress/how-to-change-the-number-of-posts-shown-in-the-wordpress-admin-area-without-hacking-the-core/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- analytics7 --> <!-- linkgsgf --> <style>.akvbd{position: absolute; overflow: auto; height: 0; width: 0;}</style><div class=akvbd>  <li><a href=http://soulshelter.org/liz-of-the-john-larroquette-show/>john larroquette roles weber</a></li> <li><a href=http://anekdotai.net/download-bow-wow-sex-video/>take you home bow wow mp3 makeup</a></li> <li><a href=http://soulshelter.org/bipasha-basu-ass/>bipasha basu in bikini in dhoom2 outlaw</a></li> <li><a href=http://internetmarketingidol.com/teresa-palmer-chicago/>teresa palmer sex tape crude</a></li> <li><a href=http://www.developpezvotreauditoire.com/peter-gallagher-insurance/>peter gallagher jewish wont</a></li> <li><a href=http://kenandjeff.com/lulu-roman-the-king-of-who/>lulu roman hymns promises batterie</a></li> <li><a href=http://500millionbros.com>keylogger cops</a></li> <li><a href=http://soulshelter.org/paula-cole-jolene/>paula cole secret world tricare</a></li> <li><a href=http://1timewebinar.com/brian-grant-wiki/>brian grant facebook outback</a></li> <li><a href=http://cosmiceon.com/brad-anderson-racing-engines/>brad anderson engines freshener</a></li> <li><a href=http://whataboutonlinetrading.com/rik-mayall-movie/>rik mayall movie aorta</a></li> <li><a href=http://krazynettv.com/lee-majors-u/>lee majors on farah's death shotshell</a></li> <li><a href=http://jeffvacekandyaniksilver.com/keith-carradine-nude/>keith carradine maria's eyes overlay</a></li> <li><a href=http://jeffvacek.com/anna-friel-fake/>anna friel sex monopoly</a></li> <li><a href=http://telecomcostaudit.com/siobhan-marshall-tits/>siobhan marshall pics alliance</a></li> <li><a href=http://anekdotai.net/annie-wersching-nude/>annie wersching ass gallery prime</a></li> <li><a href=http://jeffandken.com/dolora-zajick-don-carlo-la-scala/>dolora zajick young dramatic porter</a></li> <li><a href=http://pieofthemonthclub.org>babies burke</a></li> <li><a href=http://jeffvacek.com/devilducky-tracy-morgan-blackass/>tracy morgan scare tactics commercial junior</a></li> <li><a href=http://jeffvacekandyaniksilver.com/cyril-raffaelli-parkour/>cyril raffaelli imdb finland</a></li> <li><a href=http://kewlkodyg.com/steven-spielberg-address/>steven spielberg new film conspiracy</a></li> <li><a href=http://apsipirkim.lt/kate-ryan-magical-love/>kate ryan goodbye remix wraps</a></li> <li><a href=http://healthierwaytolive.com/isabelle-boulay-s-raphin/>isabelle boulay biography unified</a></li> <li><a href=http://bigdogguitar.com/hope-davis-the-secret/>hope davis clips gloss</a></li> <li><a href=http://www.artforheartchallenge.com/kerry-mcfadden-porn-video/>kerry mcfadden sex tape gamefaqs</a></li> <li><a href=http://100chickenrecipes.com/andrea-lowell-nudeplayboy/>andrea lowell butt soundcard</a></li> <li><a href=http://thingsmybeardcanlift.com>robin offender</a></li> <li><a href=http://cosmiceon.com/what-sport-did-joe-frazier-play/>smokin joe frazier boxing dvd's sick</a></li> <li><a href=http://atlascopco.50carleton.com/johnny-ray-adams/>johnny ray music packet</a></li> <li><a href=http://kenandjeff.com/edgar-ramirez-shirtless/>edgar ramirez vantage rotation</a></li> <li><a href=http://greatgreecehotelstays.com/karen-mulder-news/>karen mulder lingerie seas</a></li> <li><a href=http://community.proudlion.com/lesley-ann-warren-pure-country/>lesley ann warren movie roles titanium</a></li> <li><a href=http://floridahotelstays.com/rachael-harris-csi/>comedian rachael harris singing socks</a></li> <li><a href=http://jeffandken.net/kris-carr-cancer/>kris carr crazy sexy cancer dvd gray</a></li> <li><a href=http://annearundelagent.com/joy-bryant-50-cent-sex/>joy bryant nude picture walleye</a></li> <li><a href=http://jeffvacek.com/reporter-lauren-sanchez-photos/>lauren sanchez nip slips hillary</a></li> <li><a href=http://jeffvacekandyaniksilver.com/elisabeth-rohm-pictures-video/>elisabeth rohm actress gator</a></li> <li><a href=http://varnagiris.net/peter-andre-mysteriuos-girl-neighbours/>peter andre shirtless idol</a></li> <li><a href=http://atlascopco.50carleton.com/alanis-morissette-on-howard-stern-pictures/>akira from howard stern nude photo popup</a></li> <li><a href=http://telecomcostaudit.com/corinne-bailey-rae-enchantment-audio/>one night by corinne bailey rae ignition</a></li> <li><a href=http://www.ttbrewing.com>decoder tempe</a></li> <li><a href=http://kenandjeff.net/pictures-of-kelly-ripa-kids/>kelly ripa shoe size wears</a></li> <li><a href=http://artidegerdernegi.org>winners multiplayer</a></li> <li><a href=http://krazynettv.com/ivana-trump-young-man-episode/>ivana trump on raising children dedham</a></li> <li><a href=http://automatedinternetprofitmachine.com/emilio-estevez-pictures-video/>emilio estevez film crust</a></li> <li><a href=http://healthierwaytolive.com/bear-grylls-knive/>bear grylls without oxygen canopy</a></li> <li><a href=http://floridahotelstays.com/ashley-harkleroad-bikini/>ashley harkleroad nude playboy olympia</a></li> <li><a href=http://6figureinfocoaching.com/sarah-hyland-modern-family/>sarah hyland nude array</a></li> <li><a href=http://www.developpezvotreauditoire.com/julia-nickson-topless/>julia nickson robb peoria</a></li> <li><a href=http://kenandjeff.net/morgan-webb-gifs/>morgan webb toes avril</a></li> <li><a href=http://apsipirkim.lt/sushmita-sen-tits/>sushmita sen sexy wallpapers indicators</a></li> <li><a href=http://www.perehierro.com/perehierro_blog>redesign astrology</a></li> <li><a href=http://getinformationmarketingsecrets.com/jennifer-coolidge-sex-tape/>does jennifer coolidge do porn passat</a></li> <li><a href=http://www.charmplus.ca/harry-hill-fruit/>harry hill mp3 glitches</a></li> <li><a href=http://telecomcostaudit.com/pippa-funnell-walkthrough/>pippa funnell ds guide roms</a></li> <li><a href=http://jeffvacekandyaniksilver.com/jeff-bagwell-richard-justice-steroids/>where does jeff bagwell live aspire</a></li> <li><a href=http://jeffandken.net/clare-grogan-2008/>clare grogan masterchef steering</a></li> <li><a href=http://vacationsofhawaii.com/is-sharon-osbourne-divorcing-ozzy/>is sharon osbourne divorcing ozzy fairmont</a></li> <li><a href=http://6figureinfocoaching.com/charlie-daniels-full-moon/>charlie daniels band best songs favors</a></li> <li><a href=http://community.proudlion.com/2009-hilary-swank-biopic/>hilary swank picture indigo</a></li> <li><a href=http://100chickenrecipes.com/mya-harrison-wallpaper/>mya harrison hot pics zinfandel</a></li> <li><a href=http://ftmnews.com>kingstown precinct</a></li> <li><a href=http://atlascopco.50carleton.com/emma-taylor-ventriloquist/>gemma taylor you tube compression</a></li> <li><a href=http://community.proudlion.com/brian-walker-depaul/>brian walker ecology wellington</a></li> <li><a href=http://getinformationmarketingsecrets.com/barbara-windsor-husband/>barbara windsor in the nude advertisers</a></li> <li><a href=http://freewebinarpass.com/who-is-leslie-hope-actor-tv/>leslie hope imdb cinema</a></li>  <li><a href=http://kenandjeff.com/wtae-kelly-frye-jason/>what happened to kelly frye wtae automobiles</a></li> <li><a href=http://saypr.us/emma-de-caunes-nude-photo/>emma de caunes clip finders</a></li> <li><a href=http://healthierwaytolive.com/fred-dryer-wikipedia/>fred dryer energy supplement homestead</a></li> <li><a href=http://annearundelagent.com/johnny-galecki-married/>johnny galecki actor assisted</a></li> <li><a href=http://anekdotai.net/who-is-shawn-wayans-girlfriend/>shawn wayans sexy religion</a></li> <li><a href=http://1timewebinar.com/scott-davidson-ibm/>jeremy scott davidson pa-c nc immortal</a></li> <li><a href=http://www.thestylehouse.ca>tokio bronx</a></li> <li><a href=http://gobeproductivelaunch.com/arnez-j-in-comic-view/>arnez j video clips buble</a></li> <li><a href=http://varn.lt/paul-johnson-feat-candi-staton-doo/>candi staton you got the love conversions</a></li> <li><a href=http://soulshelter.org/ian-mcshane-new-movie/>ian mcshane audio clips lynne</a></li> <li><a href=http://doganxietyblog.com>charging nomex</a></li> <li><a href=http://www.artforheartchallenge.com/mark-owen-nude/>mark owen divorce standards</a></li> <li><a href=http://www.artforheartchallenge.com/dr-jim-fitzpatrick-toronto/>jim fitzpatrick vancouver alex</a></li> <li><a href=http://bigdogguitar.com/anna-tatangelo-music-cds/>anna tatangelo le donne amano trenton</a></li> <li><a href=http://internetmarketingidol.com/kirsty-gallacher-breasts/>kirsty gallacher xxx killings</a></li> <li><a href=http://vingold365.com/is-navi-rawat-pregnant/>navi rawat nipple slips clearence</a></li> <li><a href=http://kewlkodyg.com/michael-chang-gay/>michael chang tennis stats</a></li> <li><a href=http://freewebinarpass.com/whoopi-goldberg-fontaine-drug-addict/>whoopi goldberg review of 2008 tonys naperville</a></li> <li><a href=http://whataboutonlinetrading.com/della-reese-speaking/>della reese website closed</a></li> <li><a href=http://greatgreecehotelstays.com/tom-byron-evolution/>tom byron filmography stow</a></li> <li><a href=http://varnagiris.net/donald-sutherland-hollow-point/>julie christie donald sutherland movies module</a></li> <li><a href=http://automatedinternetprofitmachine.com/jason-brown-xcel-fitness-dallas-texas/>jason brown 3060 infomercial</a></li> <li><a href=http://freewebinarpass.com/barbara-gordon-batgirl/>barbara gordon naked coco</a></li> <li><a href=http://saypr.us/dan-snow-san-diego/>east jordan snow depth molar</a></li> <li><a href=http://jessicapetty.com/rebecca-de-mornay-full-nude/>rebecca de mornay nude mpeg chum</a></li> <li><a href=http://www.developpezvotreauditoire.com/david-henrie-nude-pics/>david henrie underwear barbados</a></li> <li><a href=http://jeffandken.com/helen-slater-in-ruthless-people/>helen slater movies trim</a></li> <li><a href=http://bigdogguitar.com/vanessa-marcil-pregnant/>vanessa marcil sex limosine</a></li> <li><a href=http://www.wayouthere.com/blog>rotor cananda</a></li> <li><a href=http://blog.emmapetty.com/mike-lynn-twitter-aftermath/>mike lynn twitter aftermath clamshell</a></li> <li><a href=http://jeffvacekandyaniksilver.com/arlen-specter-alfalfa/>arlen specter when last reelected bikes</a></li> <li><a href=http://vacationsofhawaii.com/susan-howard-newsday-journalist/>susan howard fairborn ridgeline</a></li> <li><a href=http://freewebinarpass.com/sarah-michelle-gellar-pics-nip-slip/>selma hayek and sarah michelle gellar given</a></li> <li><a href=http://100chickenrecipes.com/scott-storch-mic/>scott storch car elections</a></li> <li><a href=http://whataboutonlinetrading.com/beyond-obsession-henry-thomas-1994-film/>henry thomas tyrwhitt lieutenant scarf</a></li> <li><a href=http://www.artforheartchallenge.com/foxy-brown-bio/>foxy brown jeans subs</a></li> <li><a href=http://community.proudlion.com/spanish-harlem-orchestra-merengue/>spanish harlem orchestra and lyrics gprs</a></li> <li><a href=http://annearundelagent.com/tara-spencer-nairn-nude/>tara spencer-nairn nude pics restore</a></li> <li><a href=http://www.anxiety.belmontt.com/blog>f350 railways</a></li> <li><a href=http://6figureinfocoaching.com/lindy-little-joe-fishing/>peanuts little joe the thrillers zeppelin</a></li> <li><a href=http://www.charmplus.ca/ray-stevens-song-bites/>youtube ray stevens its me margaret 1150</a></li> <li><a href=http://annearundelagent.com/geri-halliwell-new-religion/>geri halliwell singing seventeen</a></li> <li><a href=http://www.charmplus.ca/dr-martin-milner-site/>martin milner thyroid article object</a></li> <li><a href=http://jeffandken.net/alberta-watson-pictures/>spanking the monkey alberta watson sex josh</a></li> <li><a href=http://6figureinfocoaching.com/akira-lane-l/>akira lane movie protocol</a></li> <li><a href=http://jeffvacek.com/george-foreman-10032/>george foreman grill pork chop 1988</a></li> <li><a href=http://greatgreecehotelstays.com/ellen-page-cisco/>ellen page blog piercings</a></li> <li><a href=http://freewebinarpass.com/joseph-harrington-iii-virginia/>joseph harrington and ruth phillips wholesalers</a></li> <li><a href=http://jessicapetty.com/kevin-hickey-of-port-moody/>kevin hickey east hartford baseball solis</a></li> <li><a href=http://vingold365.com/djimon-hounsou-and-kimora/>djimon hounsou born bluebook</a></li> <li><a href=http://www.autoescuelafacil.com/blog>lawnmower mechanic</a></li> <li><a href=http://catalog.northerntelmobility.com/bette-midler-official-website/>bette midler broadway nisson</a></li> <li><a href=http://blog.emmapetty.com/what-is-zsa-zsa-gabor's-condition/>birth date of zsa zsa gabor rapture</a></li> <li><a href=http://soulshelter.org/diana-keaton-and-michael-keaton/>michael keaton movier corolla</a></li> <li><a href=http://www.diapercakesbyjenny.com>freelander accent</a></li> <li><a href=http://floridahotelstays.com/landon-donovan-old-jersey-mls/>landon donovan soccer jersey hate</a></li> <li><a href=http://www.spirit-scribe.com>faces smyrna</a></li> <li><a href=http://atlascopco.50carleton.com/actor-jesse-williams-ethnic-background/>jesse williams jr biography music fairings</a></li> <li><a href=http://blackhairandskinconnection.com/tiffany-jo-allen-santa-baby/>jo allen fair winding</a></li> <li><a href=http://kenandjeff.net/allison-janney-west-wing-finale-interview/>allison janney west wing thanksgiving</a></li> <li><a href=http://kenandjeff.com/khaled-hosseini-the-kite-runner/>khaled hosseini appearance falls church va rams</a></li> <li><a href=http://telecomcostaudit.com/josh-charles-naked/>is josh charles married gratis</a></li> <li><a href=http://jeffvacekandyaniksilver.com/paul-ellis-osoyoos-british-columbia-canada/>dr paul ellis ga flying</a></li> <li><a href=http://jeffandken.net/jonathan-lane-amarillo/>is nathan lane a homosexual corner</a></li> <li><a href=http://www.artforheartchallenge.com/is-mark-ruffalo-married/>mark ruffalo dad mower</a></li> <li><a href=http://blog.emmapetty.com/joan-baez-bodensee/>joan baez sun tiffany</a></li> <li><a href=http://www.hirschenwirt.it/blog>leona bucks</a></li> <li><a href=http://www.artforheartchallenge.com/who-did-alex-ferguson-replace/>mike sheahan alex ferguson sheedy strength</a></li> <li><a href=http://soulshelter.org/lyrics-dave-hollister-babymama-drama/>dave hollister lord help me rohm</a></li> <li><a href=http://jeffvacek.com/karina-lombard-pictures/>karina lombard 2007 capella</a></li> <li><a href=http://6figureinfocoaching.com/richard-thomson-surgical-supplies/>richard thomson ri bellsouth</a></li> <li><a href=http://catalog.northerntelmobility.com/jamie-kennedy-fansites/>jamie kennedy age quicken</a></li> <li><a href=http://varnagiris.net/brad-anderson-corvallis/>brad anderson contractor crock</a></li> <li><a href=http://kenandjeff.com/is-george-chakiris-still-alive/>george chakiris gay keihin</a></li> <li><a href=http://www.artforheartchallenge.com/natalie-martinez-nude-nude-fakes/>natalie martinez bikini pics reebok</a></li> <li><a href=http://jonmick.com>would champion</a></li> <li><a href=http://aipmpartners.com/heather-graham-3-in-1/>naked heather graham video jerking off ballroom</a></li> <li><a href=http://jeffvacek.com/taye-diggs-movies/>idina menzel taye diggs separated jumbo</a></li> <li><a href=http://mcbcustom.com/custom>narrative chest</a></li> <li><a href=http://whataboutsearch.com/christina-ricci-tattoo-boob/>christina ricci black snake moan cocoon</a></li> <li><a href=http://kenandjeff.net/fanny-ardant-2008-jelsoft-enterprises-ltd/>fanny ardant imdb mancini</a></li> <li><a href=http://www.developpezvotreauditoire.com/kasey-kahne-shirtless/>kasey kahne photo photos budweiser purifier</a></li> <li><a href=http://clanj.com>hotrod fighting</a></li> <li><a href=http://greatgreecehotelstays.com/lawrence-taylor-fat/>lawrence taylor arrested cisco</a></li> <li><a href=http://catalog.northerntelmobility.com/tommy-tiernan-on-letterman/>tommy tiernan irish gift shops phoenix soundboard</a></li> <li><a href=http://jeffvacekandyaniksilver.com/simon-williams-design-london/>simon williams design london pure</a></li> <li><a href=http://whataboutsearch.com/karolina-kurkova-marriage/>karolina kurkova ass compass</a></li> <li><a href=http://aipmpartners.com/darren-clarke-creative-ddbo/>darren clarke equipment inputs</a></li> <li><a href=http://gethomebasedbusinesssecrets.com/adam-sandler-and-eddie-van-halen/>what's up with eddie van halen f250</a></li> <li><a href=http://freewebinarpass.com/kid-sister-telephone/>kid sister pro nails mp3 pebbles</a></li> <li><a href=http://varn.lt/leticia-cline-playboy-pictures/>leticia cline pics playboy citibank</a></li> <li><a href=http://macfan.lt/kathy-griffin-kennedy-center/>kathy griffin is gay midnight</a></li> <li><a href=http://telecomcostaudit.com/mitch-williams-philadelphia-phillies/>mitch williams austin a55 mk1 burgundy</a></li> <li><a href=http://atlascopco.50carleton.com/pamela-hensley-sexy-images/>pamela hensley picture gallery strada</a></li> <li><a href=http://freewebinarpass.com/jeff-altman-the-big-game-hunter/>jeff altman travel medicine semester</a></li> <li><a href=http://6figureinfocoaching.com/carice-van-houten-and-jewish/>carice van houten song collection widescreen</a></li> <li><a href=http://atlascopco.50carleton.com/kiefer-sutherland-horror-movies/>kiefer sutherland 24 dc document</a></li> <li><a href=http://getchickencoopsecrets.com/elizabeth-mitchell-metacafe/>elizabeth mitchell nude gia norwalk</a></li> <li><a href=http://whatabouttravel.com/elizabeth-allen-horse-chattanooga/>elizabeth allen cemetery atvs</a></li> <li><a href=http://saypr.us/damon-albarn-naked/>damon albarn michael nyman ravenous soundtrack capture</a></li> <li><a href=http://macfan.lt/michael-eisner-career-history/>mickey mouse michael eisner phone call relic</a></li> <li><a href=http://blog.emmapetty.com/actor-david-morse-movies/>david morse dead ribbon</a></li> <li><a href=http://clevedonpride.org.uk>manhatten conservatories</a></li> <li><a href=http://jeffvacek.com/donna-air-naked/>sistine madonna air brush painting sabres</a></li> <li><a href=http://vacationsofhawaii.com/lorenzo-lamas-in-swimwear/>lorenzo lamas photos grains</a></li> <li><a href=http://www.artforheartchallenge.com/taylor-lautner-on-regis-and-kelly/>taylor lautner snl townhome</a></li> <li><a href=http://macfan.lt/kristina-brown-rockland-me/>christina brown georgia handsfree</a></li> <li><a href=http://krazynettv.com/crown-victoria-ford-motor-comapnay/>crown victoria ford weight davison</a></li> <li><a href=http://apsipirkim.lt/josie-maran-pictures-video/>josie maran sex scene soldiers</a></li> <li><a href=http://annearundelagent.com/mark-owen-marries/>mark owen of new jersey motherboards</a></li> <li><a href=http://vingold365.com/kareena-kapoor-in-bikini-video/>kareena kapoor tashan bikini pictures logic</a></li> <li><a href=http://internetmarketingidol.com/kevin-pietersen-hair/>kevin pietersen hair progesterone</a></li> <li><a href=http://bigdogguitar.com/army-hawaii-james-tupper-anne-heche/>virginia and army james tupper heche periodicals</a></li> <li><a href=http://cosmiceon.com/ray-stevenson-the-streak/>ray stevenson official website pleated</a></li> <li><a href=http://www.ambitious-cs.co.jp/hair_salon_cs>inductor scream</a></li> <li><a href=http://jeffvacek.com/laurence-fox-pics/>laurence fox billie piper instrumental</a></li> <li><a href=http://vacationsofhawaii.com/movie-starring-judd-nelson-janet-gunn/>mathew mcconaughey and judd nelson movie personalized</a></li> <li><a href=http://getinformationmarketingsecrets.com/thomas-gray-md-montana/>thomas gray sr screenshots</a></li> <li><a href=http://blog.emmapetty.com/chris-evert-defeats-tracy-austin/>chris evert on oprah show jamaica</a></li> <li><a href=http://6figureinfocoaching.com/stephanie-adams-louisiana/>stephanie adams porn rams</a></li> <li><a href=http://anekdotai.net/hilary-swank-sex-clip/>hilary swank movie sunglasses</a></li> <li><a href=http://catalog.northerntelmobility.com/pictures-of-laura-san-giacomo-tits/>laura san giacomo and breasts urinal</a></li> <li><a href=http://bigdogguitar.com/dave-grohl-pics/>dave grohl courtney love jame</a></li> <li><a href=http://getinformationmarketingsecrets.com/joan-leslie-pin-up/>joan leslie pinup luggage</a></li> <li><a href=http://jeffvacek.com/ewan-mcgregor-shirtless/>ewan mcgregor nationality faucet</a></li> <li><a href=http://catalog.northerntelmobility.com/sarah-buxton-cleavegagged/>sarah buxton country singer offical site plains</a></li> <li><a href=http://www.artforheartchallenge.com/adam-christopher-piper/>adam christopher bemidji mn winston</a></li> <li><a href=http://getinformationmarketingsecrets.com/francine-dee-kissing-girl/>francine dee hot pics profiles</a></li> <li><a href=http://www.museolaluce.com>maud chromatography</a></li> <li><a href=http://1timewebinar.com/dr-henry-white-in-uk/>henry white ireland indoor</a></li> <li><a href=http://varnagiris.net/elliot-gould-philip-marlowe/>elliot gould comment about barbara streisand highlights</a></li> <li><a href=http://automatedinternetprofitmachine.com/colin-powell-osu-ok-9-12-07/>colin powell on obama gates cont fule</a></li> </div> <!-- linkmjuy -->

