{"id":353,"date":"2011-11-15T15:45:21","date_gmt":"2011-11-15T20:45:21","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=353"},"modified":"2011-12-26T12:07:02","modified_gmt":"2011-12-26T17:07:02","slug":"using-key-chords-in-emacs","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=353","title":{"rendered":"Using Key Chords In Emacs"},"content":{"rendered":"\n<p>Last week I wrote about David Andersson&#8217;s <a href=\"http:\/\/irreal.org\/blog\/?p=344\">Key Chord Mode<\/a> that I discovered in the latest <a href=\"http:\/\/emacsrocks.com\/e07.html\">Emacs Rocks video<\/a>. I thought it was interesting and I enabled it in my Emacs by adding <\/p>\n<pre class=\"src src-emacs-lisp\">(<span style=\"color: #7f007f;\">require<\/span> '<span style=\"color: #008b8b;\">key-chord<\/span>)\r\n(key-chord-mode 1)\r\n(key-chord-define-global <span style=\"color: #8b2252;\">\"dq\"<\/span> 'dq)\r\n<\/pre>\n<p> to my scratch buffer and evaluating it just to play around with it a little. I thought it was pretty nifty but I didn&#8217;t think I would actually use it so I didn&#8217;t add it to my <code>init.el<\/code> file. <\/p>\n<p> Yesterday, as I was writing the <a href=\"http:\/\/irreal.org\/blog\/?p=351\">Automatic Lookup From Emacs<\/a> post, I wanted to set the function names in the first column of the table in a constant width font. In Org mode you do that by surrounding the name with equal signs like so <\/p>\n<pre class=\"example\">=lookup-google=\r\n<\/pre>\n<p> But the equal sign has a special meaning in an Org-mode table and it causes an error when you try to use it to mark an entry as constant width. So I set the first couple of names by hand like this <\/p>\n<pre class=\"example\">@&lt;code&gt;lookup-google@&lt;\/code&gt;\r\n<\/pre>\n<p> where the <code>@<\/code> tells the Org exporter to treat the following tag as an actual tag and not translate it to <code>&amp;lt;<\/code> and so on. The problem is that it&#8217;s a pain to type the tags because they&#8217;re shifted and the \u3010<span class=\"key\">@<\/span>\u3011 key is way at the top of the keyboard. <\/p>\n<p> I thought about writing a quick little function to do it for me but it hardly seemed worth the effort. Then I remembered <code>key-chord.el<\/code>, which was still enabled, so I added <\/p>\n<pre class=\"src src-emacs-lisp\">(key-chord-define-global <span style=\"color: #8b2252;\">\"&lt;&gt;\"<\/span> <span style=\"color: #8b2252;\">\"@&lt;&gt;\\C-b\"<\/span>)\r\n<\/pre>\n<p> to the scratch buffer and evaluated it. It seems like a small thing but it really made doing the rest of the table a snap. I just typed \u3010<span class=\"key\">Shift<\/span>+<span class=\"key\">&lt;<\/span>+<span class=\"key\">&gt;<\/span>\u3011 and <\/p>\n<pre class=\"example\">@&lt;|&gt;\r\n<\/pre>\n<p> where <code>|<\/code> represents the point, was inserted into the buffer. That&#8217;s handy enough that I <i>am<\/i> going to enable chord-mode in my <code>init.el<\/code> and add the <code>&lt;&gt;<\/code> chord for those, admittedly rare, times when I need to insert some HTML tags by hand. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week I wrote about David Andersson&#8217;s Key Chord Mode that I discovered in the latest Emacs Rocks video. I thought it was interesting and I enabled it in my Emacs by adding (require &#8216;key-chord) (key-chord-mode 1) (key-chord-define-global &#8220;dq&#8221; &#8216;dq) &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=353\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-353","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=353"}],"version-history":[{"count":2,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/353\/revisions"}],"predecessor-version":[{"id":414,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/353\/revisions\/414"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}