<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/assets/atom.xsl" type="text/xsl"?><feed
	xmlns="http://www.w3.org/2005/Atom"
	xmlns:thr="http://purl.org/syndication/thread/1.0"
	xml:lang="en-US"
	><title>Sacha Chua - tag - agenda</title>
	<subtitle>Emacs, sketches, and life</subtitle>
	<link rel="self" type="application/atom+xml" href="https://sachachua.com/blog/tag/agenda/feed/atom/index.xml" />
  <link rel="alternate" type="text/html" href="https://sachachua.com/blog/tag/agenda" />
  <id>https://sachachua.com/blog/tag/agenda/feed/atom/index.xml</id>
  <generator uri="https://11ty.dev">11ty</generator>
	<updated>2013-01-14T13:00:00Z</updated>
<entry>
		<title type="html">Emacs Org: Task-related keyboard shortcuts for the agenda</title>
		<link rel="alternate" type="text/html" href="https://sachachua.com/blog/2013/01/emacs-org-task-related-keyboard-shortcuts-agenda/"/>
		<author><name><![CDATA[Sacha Chua]]></name></author>
		<updated>2013-01-14T19:57:01Z</updated>
    <published>2013-01-14T13:00:00Z</published>
    <category term="emacs" />
<category term="org" />
		<id>https://sachachua.com/blog/?p=24335</id>
		<content type="html"><![CDATA[<p>I really love the way you can tweak Emacs&#8217; keyboard shortcuts and functionality to fit the way you want to work. Here are three keyboard shortcuts I&#8217;ve added to my Org agenda to make it even easier to work with tasks.</p>
<p><code>x</code>: Mark the current task as done. Same as typing <code>t x</code>, but somehow it feels like it has more oomph as a single-character shortcut.</p>
<p><code>X</code>: Mark the current task as done and create a new task at the same level, taking advantage of the task template I&#8217;d previously created in <code>org-capture-templates</code>.</p>
<p><code>N</code>: Create a new note or task at the current position.</p>
<p><b>Make it easy to mark a task as done</b></p>
<pre class="src src-emacs-lisp">(<span style="color: #a52a2a;font-weight: bold">defun</span> <span style="color: #008b8b">sacha/org-agenda-done</span> (<span style="color: #228b22">&amp;optional</span> arg)
  <span style="background-color: #f2f2f2">"Mark current TODO as done.</span>
<span style="background-color: #f2f2f2">This changes the line at point, all other lines in the agenda referring to</span>
<span style="background-color: #f2f2f2">the same tree node, and the headline of the tree node in the Org-mode file."</span>
  (interactive <span style="color: #ff00ff;background-color: #f2f2f2">"P"</span>)
  (org-agenda-todo <span style="color: #ff00ff;background-color: #f2f2f2">"DONE"</span>))
<span style="color: #ff0000">;; </span><span style="color: #0000ff">Override the key definition for org-exit</span>
(define-key org-agenda-mode-map <span style="color: #ff00ff;background-color: #f2f2f2">"x"</span> 'sacha/org-agenda-done)</pre>
<p><b>Make it easy to mark a task as done and create a follow-up task</b></p>
<pre class="src src-emacs-lisp">  (<span style="color: #a52a2a;font-weight: bold">defun</span> <span style="color: #008b8b">sacha/org-agenda-mark-done-and-add-followup</span> ()
    <span style="background-color: #f2f2f2">"Mark the current TODO as done and add another task after it.</span>
<span style="background-color: #f2f2f2">Creates it at the same level as the previous task, so it's better to use</span>
<span style="background-color: #f2f2f2">this with to-do items than with projects or headings."</span>
    (interactive)
    (org-agenda-todo <span style="color: #ff00ff;background-color: #f2f2f2">"DONE"</span>)
    (org-agenda-switch-to)
    (org-capture 0 <span style="color: #ff00ff;background-color: #f2f2f2">"t"</span>))
<span style="color: #ff0000">;; </span><span style="color: #0000ff">Override the key definition</span>
(define-key org-agenda-mode-map <span style="color: #ff00ff;background-color: #f2f2f2">"X"</span> 'sacha/org-agenda-mark-done-and-add-followup)</pre>
<p><b>Capture something based on the agenda position</b></p>
<pre class="src src-emacs-lisp">(<span style="color: #a52a2a;font-weight: bold">defun</span> <span style="color: #008b8b">sacha/org-agenda-new</span> ()
  <span style="background-color: #f2f2f2">"Create a new note or task at the current agenda item.</span>
<span style="background-color: #f2f2f2">Creates it at the same level as the previous task, so it's better to use</span>
<span style="background-color: #f2f2f2">this with to-do items than with projects or headings."</span>
  (interactive)
  (org-agenda-switch-to)
  (org-capture 0))
<span style="color: #ff0000">;; </span><span style="color: #0000ff">New key assignment</span>
(define-key org-agenda-mode-map <span style="color: #ff00ff;background-color: #f2f2f2">"N"</span> 'sacha/org-agenda-new)</pre>
<p><a href="http://dl.dropbox.com/u/3968124/sacha-emacs.html">Check out my Emacs configuration</a> for other ideas.</p>
<p>You can <a href="https://sachachua.com/blog/2013/01/emacs-org-task-related-keyboard-shortcuts-agenda/#comment">view 5 comments</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2013%2F01%2Femacs-org-task-related-keyboard-shortcuts-agenda%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></content>
		</entry>
</feed>