<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/feed.xslt.xml" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Emacs - philnewton.net</title>
    <description></description>
    <link>https://www.philnewton.net/blog/categories/emacs</link>
    <atom:link href="https://www.philnewton.net/blog/categories/emacs/feed/" rel="self" type="application/rss+xml" />

    
      <item>
        <title>Updated Pocket highlights bookmarklet</title>
        <description>&lt;p&gt;
A couple of years ago I wrote &lt;a href=&quot;/blog/copy-pocket-highlights-bookmarklet/&quot;&gt;a small bookmarklet&lt;/a&gt; for copying &lt;a href=&quot;https://getpocket.com&quot;&gt;Pocket&lt;/a&gt; article
highlights to an &lt;code&gt;org-mode&lt;/code&gt; file. Pocket recently made some large updates to
their site which modified the markup and broke the bookmarklet (and also ruined
their iOS app).
&lt;/p&gt;

&lt;p&gt;
I&apos;ve written a new version of the bookmarklet. It works the same as before and
will copy highlights to the clipboard, wrapped in &lt;code&gt;org-mode&lt;/code&gt; quote blocks.
&lt;/p&gt;

&lt;p&gt;
Drag the button below to your bookmarks toolbar, and then click it when viewing
any highlighted article in Pocket to copy notes to the clipboard (tested in
Firefox):
&lt;/p&gt;

&lt;p style=&quot;text-align: center; margin: 2em auto&quot;&gt;
&lt;a class=&quot;button&quot; href=&apos;javascript:(function(){let e=&quot;#+TITLE: &quot;+document.getElementsByTagName(&quot;h1&quot;)[0].innerHTML+&quot;\n\n&quot;;const n=document.querySelectorAll(&quot;.sidebar-anchor aside &gt; div &gt; div &gt; div &gt; button&quot;);n.forEach((n=&gt;{if(n.classList.contains(&quot;inline-button&quot;)||n.hasAttribute(&quot;aria-label&quot;))return;let t=n.innerHTML;void 0!==t&amp;&amp;&quot;&quot;!=t.trim()&amp;&amp;(e+=&quot;#+begin_quote\n&quot;,e+=t.trim()+&quot;\n&quot;,e+=&quot;#+end_quote\n\n&quot;)})),e+=&quot;*Source*: &quot;+document.getElementById(&quot;reader.external-link.view-original&quot;).href,navigator.clipboard.writeText(e);})()&apos;&gt;Copy Pocket Highlights&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
The un-minified source is below and can be modified to remove &lt;code&gt;org-mode&lt;/code&gt;
specific formatting if needed:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-javascript&quot;&gt;let to_clipboard   = &quot;#+TITLE: &quot; + document.getElementsByTagName(&apos;h1&apos;)[0].innerHTML + &quot;\n\n&quot;;
const all_highlights = document.querySelectorAll(&apos;.sidebar-anchor aside &amp;gt; div &amp;gt; div &amp;gt; div &amp;gt; button&apos;);

all_highlights.forEach((highlight) =&amp;gt; {
    if (highlight.classList.contains(&apos;inline-button&apos;) || highlight.hasAttribute(&apos;aria-label&apos;)) {
	return;
    }

    let highlight_text = highlight.innerHTML;
    if (typeof highlight_text !== &apos;undefined&apos; &amp;amp;&amp;amp; highlight_text.trim() != &apos;&apos;) {
	to_clipboard += &quot;#+begin_quote\n&quot;;
	to_clipboard += highlight_text.trim() + &quot;\n&quot;;
	to_clipboard += &quot;#+end_quote\n\n&quot;;
    }
});

to_clipboard += &quot;*Source*: &quot; + document.getElementById(&apos;reader.external-link.view-original&apos;).href;

navigator.clipboard.writeText(to_clipboard);
&lt;/pre&gt;
&lt;/div&gt;
</description>
        <pubDate>Mon, 07 Aug 2023 19:51:00 -0400</pubDate>
        <link>https://www.philnewton.net/blog/updated-pocket-highlights-bookmarklet/</link>
        <guid isPermaLink="true">https://www.philnewton.net/blog/updated-pocket-highlights-bookmarklet/</guid>
      </item>
    
      <item>
        <title>Filtering the Emacs dashboard agenda</title>
        <description>&lt;p&gt;
I use &lt;a href=&quot;https://github.com/emacs-dashboard/emacs-dashboard&quot;&gt;emacs-dashboard&lt;/a&gt; to show an overview of my work when I start Emacs. It
looks a little like this:
&lt;/p&gt;


&lt;figure&gt;
&lt;a href=&quot;/assets/blog/2021/emacs-dashboard.png&quot; alt=&quot;Emacs dashboard&quot; class=&quot;center bordered&quot; width=&quot;693&quot; loading=&quot;lazy&quot;&gt;&lt;img src=&quot;/assets/blog/2021/emacs-dashboard.png&quot; alt=&quot;Emacs dashboard&quot; class=&quot;center bordered&quot; width=&quot;693&quot; loading=&quot;lazy&quot;&gt;&lt;/a&gt;

&lt;/figure&gt;

&lt;p&gt;
The weekly agenda gives me a quick glance of what&apos;s scheduled for the week
ahead, as well as any upcoming deadlines, but I wanted to tweak it slightly to
remove some non-useful information.
&lt;/p&gt;

&lt;p&gt;
I use the &lt;code&gt;WAITING&lt;/code&gt; keyword to mark tasks that are waiting on someone else and
don&apos;t require my attention. I have a separate agenda command to show me all
&lt;code&gt;WAITING&lt;/code&gt; tasks and there&apos;s no need for these to show on my dashboard.
&lt;/p&gt;

&lt;p&gt;
The dashboard package provides a couple of different ways to customize the
agenda view. One of those is &lt;code&gt;dashboard-match-agenda-entry&lt;/code&gt;, which uses
&lt;code&gt;org-mode&lt;/code&gt;&apos;s tag and property matching to filter tasks.
&lt;/p&gt;

&lt;p&gt;
Limiting the dashboard agenda looks like this:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-emacs-lisp&quot;&gt;;; Match just one TODO keyword.
(setq dashboard-match-agenda-entry
      &quot;TODO=\&quot;TODO\&quot;&quot;)

;; Match multiple keywords.
(setq dashboard-match-agenda-entry
      &quot;TODO=\&quot;TODO\&quot;|TODO=\&quot;IN-PROGRESS\&quot;&quot;)

;; Match everything except WAITING.
(setq dashboard-match-agenda-entry
      &quot;-TODO=\&quot;WAITING\&quot;&quot;)
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
There is a lot more to &lt;a href=&quot;https://orgmode.org/manual/Matching-tags-and-properties.html&quot;&gt;&lt;code&gt;org-mode&lt;/code&gt;&apos;s matching system&lt;/a&gt;; I&apos;ve used it to create
custom views for &lt;a href=&quot;/blog/org-agenda-monthly-goals/&quot;&gt;displaying my monthly goals&lt;/a&gt;, but it can be used to match tags,
categories, and even properties like &lt;code&gt;Effort&lt;/code&gt;.
&lt;/p&gt;
</description>
        <pubDate>Mon, 01 Nov 2021 07:42:00 -0400</pubDate>
        <link>https://www.philnewton.net/blog/emacs-dashboard-agenda/</link>
        <guid isPermaLink="true">https://www.philnewton.net/blog/emacs-dashboard-agenda/</guid>
      </item>
    
      <item>
        <title>My Emacs Ledger reporting configuration</title>
        <description>&lt;p&gt;
&lt;a href=&quot;/blog/plaintext-accounting/&quot;&gt;I&apos;ve been using Ledger&lt;/a&gt; to keep track of my finances for several years, and one
feature I really like is the ability to run reports from within Emacs via
&lt;a href=&quot;https://github.com/ledger/ledger-mode&quot;&gt;ledger-mode&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Creating these reports is done by customizing the &lt;code&gt;ledger-reports&lt;/code&gt;
variable. It&apos;s also possible to set them using the &lt;code&gt;ledger-reports-add&lt;/code&gt;
function, but I prefer to set them all in one go during setup.
&lt;/p&gt;

&lt;p&gt;
My current list of reports looks like this:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-emacs-lisp&quot;&gt;(setq ledger-reports
 &apos;((&quot;bal&quot;            &quot;%(binary) -f %(ledger-file) bal&quot;)
   (&quot;bal this month&quot; &quot;%(binary) -f %(ledger-file) bal -p %(month) -S amount&quot;)
   (&quot;bal this year&quot;  &quot;%(binary) -f %(ledger-file) bal -p &apos;this year&apos;&quot;)
   (&quot;net worth&quot;      &quot;%(binary) -f %(ledger-file) bal Assets Liabilities&quot;)
   (&quot;account&quot;        &quot;%(binary) -f %(ledger-file) reg %(account)&quot;)))
&lt;/pre&gt;
&lt;/div&gt;

&lt;dl class=&quot;org-dl&quot;&gt;
&lt;dt&gt;&lt;code&gt;bal&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;Shows the balance of all accounts; this also includes individual
expenses (such as &lt;code&gt;Expense:Car:Gas&lt;/code&gt;) so it&apos;s a pretty long report.&lt;/dd&gt;

&lt;dt&gt;&lt;code&gt;bal this month&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;As above, but only includes transactions from the
current month.&lt;/dd&gt;

&lt;dt&gt;&lt;code&gt;bal this year&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;Same as &lt;code&gt;bal&lt;/code&gt;, but limited to the current year.&lt;/dd&gt;

&lt;dt&gt;&lt;code&gt;net worth&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;A short report that shows what I&apos;ve got in each account, as
well as what I owe on loans and credit cards.&lt;/dd&gt;

&lt;dt&gt;&lt;code&gt;account&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;This prompts for an account name and then shows its
transactions for the current file. This is useful for quickly seeing how
much money has been spent on a specific category during the year.&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;
Emacs reports that have the &lt;code&gt;%(ledger-file)&lt;/code&gt; token are run against the current
ledger file. I have my Ledger files stored in a &lt;a href=&quot;https://projectile.mx/&quot;&gt;projectile&lt;/a&gt; project so I can
quickly jump to them to run reports or make adjustments.
&lt;/p&gt;
</description>
        <pubDate>Mon, 25 Oct 2021 10:28:00 -0400</pubDate>
        <link>https://www.philnewton.net/blog/emacs-ledger-reports/</link>
        <guid isPermaLink="true">https://www.philnewton.net/blog/emacs-ledger-reports/</guid>
      </item>
    
      <item>
        <title>Managing RSS subscriptions with elfeed and Tiny Tiny RSS</title>
        <description>&lt;p&gt;
I&apos;ve been using &lt;a href=&quot;https://github.com/skeeto/elfeed&quot;&gt;elfeed&lt;/a&gt; as my primary RSS reader for a couple of years, but there
were a few things I missed about my previous web-based reader. One annoyance was
that items I read on my laptop weren&apos;t synced with whatever I read on my
desktop. I also missed having an online view for when I was out of the office.
&lt;/p&gt;

&lt;p&gt;
Fixing the second problem was easy: &lt;a href=&quot;https://tt-rss.org/&quot;&gt;Tiny Tiny RSS&lt;/a&gt; is a web-based RSS reader that
is free and open-source. I really like the interface, but I still wanted to read
things in &lt;code&gt;elfeed&lt;/code&gt; if possible. Thankfully there&apos;s a package called
&lt;a href=&quot;https://github.com/fasheng/elfeed-protocol&quot;&gt;elfeed-protocols&lt;/a&gt; that allows elfeed to sync with tt-rss.
&lt;/p&gt;


&lt;section id=&quot;outline-container-org4035d1f&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org4035d1f&quot;&gt;Configuring&lt;/h2&gt;
&lt;div class=&quot;outline-text-2&quot; id=&quot;text-org4035d1f&quot;&gt;
&lt;p&gt;
Getting everything setup is fairly straightforward:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-emacs-lisp&quot;&gt;(use-package elfeed
  :defer t
  :init
  (elfeed-protocol-enable)
  :custom
  (elfeed-use-curl t)
  (elfeed-feeds    &apos;((&quot;ttrss+https://user@my.ttrss.com&quot;
		      :password &quot;&amp;lt;password goes here&amp;gt;&quot;))))
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
The &lt;code&gt;elfeed-protocol-enable&lt;/code&gt; part turns on additional protocol support, and
&lt;code&gt;elfeed-feeds&lt;/code&gt; tells elfeed which tt-rss server to use.
&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;


&lt;section id=&quot;outline-container-orgd9449ed&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgd9449ed&quot;&gt;Tidying up the view&lt;/h2&gt;
&lt;div class=&quot;outline-text-2&quot; id=&quot;text-orgd9449ed&quot;&gt;
&lt;p&gt;
The default view takes up the full width of the window, which I find hard to read
on a large monitor. I use the following addition to narrow things down:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-emacs-lisp&quot;&gt;(use-package elfeed
  ;; &amp;lt;- Regular config goes here.
  :config
  (add-hook &apos;elfeed-show-mode-hook #&apos;sodaware/enhance-elfeed-readability))

(defun sodaware/enhance-elfeed-readability ()
  &quot;Clean up elfeed show buffer.&quot;
  (setq shr-width 80)
  (buffer-face-set &apos;fixed-pitch))
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
&lt;code&gt;elfeed&lt;/code&gt; uses Simple HTML Renderer (shr) to display articles, so this function
limits the width and sets the font to a fixed-width one.
&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;


&lt;section id=&quot;outline-container-orgdcefd31&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgdcefd31&quot;&gt;Marking items as read&lt;/h2&gt;
&lt;div class=&quot;outline-text-2&quot; id=&quot;text-orgdcefd31&quot;&gt;
&lt;p&gt;
Here’s a simple function that marks all RSS items as read before fetching new posts:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-emacs-lisp&quot;&gt;(defun sodaware/elfeed-all-read-refresh ()
  (interactive)
  (when (y-or-n-p &quot;Really mark all items as read?&quot;)
    (elfeed-mark-all-as-read)
    (elfeed-search-fetch nil)))
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
</description>
        <pubDate>Tue, 20 Jul 2021 19:50:00 -0400</pubDate>
        <link>https://www.philnewton.net/blog/rss-with-elfeed-and-ttrss/</link>
        <guid isPermaLink="true">https://www.philnewton.net/blog/rss-with-elfeed-and-ttrss/</guid>
      </item>
    
      <item>
        <title>MicroEMACS for the Atari ST</title>
        <description>&lt;p&gt;
One of my goals this year is to create some software for the Atari ST. For my
first project I wanted to use an environment that was &lt;i&gt;close&lt;/i&gt; to the one I used
growing up, but with improvements where possible.
&lt;/p&gt;

&lt;p&gt;
The first thing I wanted to improve was text editing. The original BASIC editor
I used lacks a lot of features I&apos;m used to: it can only edit one file at a time,
doesn&apos;t have copy/paste support, and navigating with a keyboard is quite
limited.
&lt;/p&gt;

&lt;p&gt;
A full-blown Emacs installation is a little large for the humble ST, but there
is an alternative: &lt;a href=&quot;https://en.wikipedia.org/wiki/MicroEMACS&quot;&gt;MicroEMACS&lt;/a&gt;.
&lt;/p&gt;


&lt;figure&gt;
&lt;a href=&quot;/assets/blog/2021/micro-emacs.png&quot; alt=&quot;Editing this post with MicroEMACS&quot; class=&quot;center bordered&quot; width=&quot;100%&quot;&gt;&lt;img src=&quot;/assets/blog/2021/micro-emacs.png&quot; alt=&quot;Editing this post with MicroEMACS&quot; class=&quot;center bordered&quot; width=&quot;100%&quot;&gt;&lt;/a&gt;

&lt;/figure&gt;

&lt;p&gt;
It doesn&apos;t have the full range of Emacs features, but it does have some handy
functionality:
&lt;/p&gt;

&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;Supports multiple buffers.&lt;/li&gt;
&lt;li&gt;Can mark regions and cut/yank them.&lt;/li&gt;
&lt;li&gt;Has tab completion for commands and filenames.&lt;/li&gt;
&lt;li&gt;Has much better keyboard support for moving around a buffer.&lt;/li&gt;
&lt;li&gt;Can use &lt;code&gt;C-s&lt;/code&gt; to search and .&lt;/li&gt;
&lt;li&gt;Can record keyboard macros.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
It doesn&apos;t do everything that modern Emacs does, but it&apos;s certainly an
improvement on the editor I originally used.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;http://www.atariuptodate.de/en/5046/microemacs&quot;&gt;MicroEMACS for the ST&lt;/a&gt; can be found on &lt;a href=&quot;http://www.atariuptodate.de/&quot;&gt;atariuptodate.de&lt;/a&gt;.
&lt;/p&gt;
</description>
        <pubDate>Mon, 24 May 2021 20:32:00 -0400</pubDate>
        <link>https://www.philnewton.net/blog/atari-microemacs/</link>
        <guid isPermaLink="true">https://www.philnewton.net/blog/atari-microemacs/</guid>
      </item>
    
      <item>
        <title>Distraction free writing with Emacs</title>
        <description>&lt;p&gt;
I use Emacs for all of my writing (including this blog). For a long time I used
the default environment, but I really missed the more focused approach of
applications like &lt;a href=&quot;http://www.hogbaysoftware.com/products/writeroom&quot;&gt;WriteRoom&lt;/a&gt;. So a few years ago I made an effort to streamline
my Emacs writing environment.
&lt;/p&gt;

&lt;p&gt;
With a few additional modes - and a small amount of elisp - I was able to get
Emacs looking like this:
&lt;/p&gt;


&lt;figure&gt;
&lt;a href=&quot;/assets/blog/2021/emacs-writing.png&quot; alt=&quot;Writing this post with Emacs&quot; class=&quot;center bordered&quot; width=&quot;100%&quot;&gt;&lt;img src=&quot;/assets/blog/2021/emacs-writing-thumb.jpg&quot; alt=&quot;Writing this post with Emacs&quot; class=&quot;center bordered&quot; width=&quot;100%&quot;&gt;&lt;/a&gt;

&lt;/figure&gt;

&lt;p&gt;
(The theme is doom-nord and font is Ubuntu.)
&lt;/p&gt;

&lt;p&gt;
It&apos;s a fairly simple setup with only a few different parts.
&lt;/p&gt;


&lt;section id=&quot;outline-container-orgb13bdde&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;orgb13bdde&quot;&gt;Removing distracting UI elements&lt;/h2&gt;
&lt;div class=&quot;outline-text-2&quot; id=&quot;text-orgb13bdde&quot;&gt;
&lt;p&gt;
I don&apos;t think a toolbar or menu is particularly distracting, but it&apos;s visual
clutter that I don&apos;t use. This code comes from my &lt;a href=&quot;/blog/minimal-emacs-config/&quot;&gt;minimal Emacs configuration&lt;/a&gt;
and hides these elements:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-emacs-lisp&quot;&gt;;; Hide the menu bar, tool bar, and scroll bars.
(when (fboundp &apos;menu-bar-mode)   (menu-bar-mode   -1))
(when (fboundp &apos;tool-bar-mode)   (tool-bar-mode   -1))
(when (fboundp &apos;scroll-bar-mode) (scroll-bar-mode -1))
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;


&lt;section id=&quot;outline-container-org380e009&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org380e009&quot;&gt;Centering and enlarging the text&lt;/h2&gt;
&lt;div class=&quot;outline-text-2&quot; id=&quot;text-org380e009&quot;&gt;
&lt;p&gt;
The majority of my writing is done inside org-mode, but I also use org-mode to
manage projects so I don&apos;t want every buffer to use these settings. For writing
projects I use a &lt;code&gt;.dir-locals.el&lt;/code&gt; file to automatically enable specific modes
and to increase the font size.
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-emacs-lisp&quot;&gt;((org-mode . ((eval . (progn (turn-off-auto-fill)
			     (text-scale-set 1)))
	      (fill-column              . 80)
	      (visual-fill-column-width . 80)
	      (olivetti-body-width      . 80)
	      (mode . olivetti)
	      (mode . visual-line)
	      (mode . visual-fill-column))))
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
The code in the &lt;code&gt;eval&lt;/code&gt; block turns off hard-wrapping, increases the font size,
and enables &lt;code&gt;olivetti-mode&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
I use &lt;a href=&quot;https://github.com/rnkn/olivetti&quot;&gt;olivetti&lt;/a&gt; to narrow the writing area to 80 characters which I find easier
to work with. &lt;a href=&quot;http://elpa.gnu.org/packages/darkroom.html&quot;&gt;darkroom&lt;/a&gt; is a good alternative to olivetti; it provides similar
functionality, but also more options and can even set an entirely different font
face when enabled.
&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;2021-08-11 edit&lt;/b&gt; - Updated &lt;code&gt;.dir-locals.el&lt;/code&gt; with new activation as &lt;b&gt;olivetti&lt;/b&gt;
has removed the &lt;code&gt;turn-on-olivetti-mode&lt;/code&gt; function.
&lt;/p&gt;

&lt;p&gt;
&lt;span class=&quot;separator&quot;&gt;~~~&lt;/span&gt;
&lt;br&gt;
If you found this helpful and would like to read more content like it,
&lt;a href=&quot;https://twitter.com/sodaware&quot;&gt;follow me on Twitter&lt;/a&gt;.

&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
</description>
        <pubDate>Mon, 10 May 2021 20:37:00 -0400</pubDate>
        <link>https://www.philnewton.net/blog/distraction-free-writing-with-emacs/</link>
        <guid isPermaLink="true">https://www.philnewton.net/blog/distraction-free-writing-with-emacs/</guid>
      </item>
    
      <item>
        <title>Automatically changing an org task's state when clocking time</title>
        <description>&lt;p&gt;
In &quot;&lt;a href=&quot;/blog/how-i-get-work-done-with-emacs/&quot;&gt;how I get work done with Emacs and org-mode&lt;/a&gt;&quot; I talked about how I manually
switch a task to &lt;code&gt;IN-PROGRESS&lt;/code&gt; when I start working on it. It&apos;s not a huge
inconvenience, but I did wonder if I could configure Emacs to do it for me.
&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;Of course&lt;/i&gt; there&apos;s a feature for that.
&lt;/p&gt;

&lt;p&gt;
There are two variables that can be used to configure org&apos;s behaviour when
clocking time:
&lt;/p&gt;

&lt;dl class=&quot;org-dl&quot;&gt;
&lt;dt&gt;&lt;code&gt;org-clock-in-switch-to-state&lt;/code&gt; &lt;/dt&gt;&lt;dd&gt;The state to change a task to when
clocking in.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;org-clock-out-switch-to-state&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;The state to change to when clocking out.&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;
Both of these variables can either be a &lt;code&gt;string&lt;/code&gt; which will be the new state, or
they can be a function. If they&apos;re a function it must accept ONE parameter - the
task&apos;s current state - and return the state to switch to.
&lt;/p&gt;

&lt;p&gt;
In practice it looks like this:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-emacs-lisp&quot;&gt;;; Always change the task to IN-PROGRESS.
(setq org-clock-in-switch-to-state &quot;IN-PROGRESS&quot;)

;; Use a function to decide what to change the state to.
(setq org-clock-in-switch-to-state #&apos;sodaware/switch-task-on-clock-start)

(defun sodaware/switch-task-on-clock-start (task-state)
  &quot;Change a task to &apos;IN-PROGRESS&apos; when TASK-STATE is &apos;TODO&apos;.&quot;
  (if (string= task-state &quot;TODO&quot;)
      &quot;IN-PROGRESS&quot;
      task-state))
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
It&apos;s a small change, but it smooths out a slight wrinkle in my workflow.
&lt;/p&gt;
</description>
        <pubDate>Mon, 19 Apr 2021 20:02:00 -0400</pubDate>
        <link>https://www.philnewton.net/blog/automatic-org-keyword-changes/</link>
        <guid isPermaLink="true">https://www.philnewton.net/blog/automatic-org-keyword-changes/</guid>
      </item>
    
      <item>
        <title>How I get work done with Emacs and org-mode</title>
        <description>&lt;p&gt;
I&apos;ve been a freelance developer for 12 years, and Emacs has been at the center
of my working environment for 10 of those. I use it for a &lt;b&gt;lot&lt;/b&gt; of things -
including writing this post - but today I&apos;m concentrating on my workflow.
&lt;/p&gt;

&lt;p&gt;
Here&apos;s how I use Emacs and org-mode during a regular day.
&lt;/p&gt;

&lt;section id=&quot;outline-container-org07cf2d7&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org07cf2d7&quot;&gt;The packages&lt;/h2&gt;
&lt;div class=&quot;outline-text-2&quot; id=&quot;text-org07cf2d7&quot;&gt;
&lt;p&gt;
There are two of packages that are central to my daily routine: &lt;code&gt;org-mode&lt;/code&gt; and
&lt;code&gt;projectile&lt;/code&gt;.
&lt;/p&gt;

&lt;p&gt;
&lt;code&gt;org&lt;/code&gt; itself is a text markup language with a lot of extras that make it great
for organizing work. &lt;code&gt;org-mode&lt;/code&gt; allows Emacs to extract this information and use
it for scheduling tasks, estimating task effort, tracking time, and a whole
bunch of other things. I remember reading that &lt;code&gt;org&lt;/code&gt; is a gateway drug that leads
to Emacs - that was certainly the case for me.
&lt;/p&gt;

&lt;p&gt;
&lt;code&gt;projectile&lt;/code&gt; adds functions for navigating between projects and files. A project
in the world of &lt;code&gt;projectile&lt;/code&gt; is a file directory, which is usually a git working
directory in my case. In a typical day I can work on a dozen different projects,
so being able to quickly jump between them is extremely helpful.
&lt;/p&gt;

&lt;p&gt;
I use a lot of other packages when doing actual work, but these two keep me
organized and allow me to quickly get to where I need to be.
&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;

&lt;section id=&quot;outline-container-org8e276a8&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org8e276a8&quot;&gt;The setup&lt;/h2&gt;
&lt;div class=&quot;outline-text-2&quot; id=&quot;text-org8e276a8&quot;&gt;
&lt;p&gt;
All of my org files live in &quot;~/Documents/org/&quot; and are synchronized between my
desktop and laptop.
&lt;/p&gt;

&lt;p&gt;
Each client has their own &lt;code&gt;.org&lt;/code&gt; file with headlines for each project that I&apos;m
working on. I also have &lt;code&gt;inbox.org&lt;/code&gt; which I use for capturing new tasks, and
&lt;code&gt;goals.org&lt;/code&gt; which contains my monthly goals.
&lt;/p&gt;

&lt;p&gt;
Major personal projects also have their own org files, although I&apos;m slowly
transitioning to &lt;a href=&quot;/blog/per-project-todo-files/&quot;&gt;per-project &quot;TODO.org&quot; files&lt;/a&gt; instead.
&lt;/p&gt;

&lt;p&gt;
All of these files are added to the &lt;code&gt;org-agenda-files&lt;/code&gt; list so that they show up
in my org agenda.
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-emacs-lisp&quot;&gt;;; For Emacs versions &amp;lt; 25
(setq org-agenda-files
      (find-lisp-find-files &quot;~/Documents/org&quot; &quot;\.org$&quot;))

;; For version &amp;gt;= 25
(setq org-agenda-files
      (directory-files-recursively &quot;~/Documents/org/&quot; &quot;\\.org$&quot;))
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
&lt;b&gt;Update&lt;/b&gt;: thank you to &lt;code&gt;kaiwen1&lt;/code&gt; on reddit for letting me know about &lt;code&gt;directory-files-recursively&lt;/code&gt;.
&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;

&lt;section id=&quot;outline-container-org4da5d82&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org4da5d82&quot;&gt;The agenda&lt;/h2&gt;
&lt;div class=&quot;outline-text-2&quot; id=&quot;text-org4da5d82&quot;&gt;
&lt;p&gt;
The org agenda is a powerful way to display tasks from across multiple
files. Agendas can be filtered to a time period, urgency, project, and much
more.
&lt;/p&gt;

&lt;p&gt;
My daily agenda looks something like this &lt;sup&gt;&lt;a id=&quot;fnr.1&quot; class=&quot;footref&quot; href=&quot;#fn.1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;:
&lt;/p&gt;


&lt;figure&gt;
&lt;a href=&quot;/assets/blog/2021/example-agenda.png&quot; alt=&quot;An example org-agenda&quot; class=&quot;center bordered&quot; width=&quot;700&quot; loading=&quot;lazy&quot;&gt;&lt;img src=&quot;/assets/blog/2021/example-agenda-thumb.jpg&quot; alt=&quot;An example org-agenda&quot; class=&quot;center bordered&quot; width=&quot;700&quot; loading=&quot;lazy&quot;&gt;&lt;/a&gt;

&lt;/figure&gt;

&lt;p&gt;
This view has 5 columns that display the following information:
&lt;/p&gt;

&lt;ol class=&quot;org-ol&quot;&gt;
&lt;li&gt;&lt;b&gt;Category&lt;/b&gt; - For freelance clients I use the client name, followed by the
project. This looks something like &lt;code&gt;client:project&lt;/code&gt;. Personal projects use
just the project slug.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Estimate&lt;/b&gt; - I try to keep individual tasks on this list to under 2
hours. If it&apos;s longer than that, it probably means I haven&apos;t broken it down
enough.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Scheduled date or deadline&lt;/b&gt; - When this is task is due or if I&apos;ve
scheduled it for a particular day.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Task name&lt;/b&gt; - This contains the task status, its priority, and its name.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Tag&lt;/b&gt; - This is used to identify project and client tasks, and also to
store my monthly goals. I used to use this for GTD-style contexts, but
seeing as 99% of my work is at the computer I didn&apos;t get much use from it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
The configuration for these columns is fairly simple:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-emacs-lisp&quot;&gt;(use-package org-agenda
  :after org
  :custom
  (org-agenda-prefix-format &apos;((agenda . &quot; %i %-20:c%?-12t%-6e% s&quot;)
			      (todo   . &quot; %i %-20:c %-6e&quot;)
			      (tags   . &quot; %i %-20:c&quot;)
			      (search . &quot; %i %-20:c&quot;))))
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
And the actual agenda configuration (without the code to &lt;a href=&quot;/blog/org-agenda-monthly-goals/&quot;&gt;display my monthly goals&lt;/a&gt;) looks like this:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-emacs-lisp&quot;&gt;(setq org-agenda-custom-commands
      &apos;((&quot;d&quot; &quot;Today&apos;s Tasks&quot;
	 ((agenda &quot;&quot; ((org-agenda-span 1)
		      (org-agenda-overriding-header &quot;Today&apos;s Tasks&quot;)))))))
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
To view my daily agenda, I&apos;ll run &lt;code&gt;M-x org-agenda&lt;/code&gt; (which I have bound to &lt;code&gt;C-c
a&lt;/code&gt;) and then select &lt;code&gt;d&lt;/code&gt; for the &quot;Today&apos;s Tasks&quot; view. It shows me everything I
have scheduled for the day, as well as due and upcoming deadlines.
&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;

&lt;section id=&quot;outline-container-org74eb38e&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org74eb38e&quot;&gt;The day plan&lt;/h2&gt;
&lt;div class=&quot;outline-text-2&quot; id=&quot;text-org74eb38e&quot;&gt;
&lt;p&gt;
At the start of the day I&apos;ll open my agenda and choose which tasks to work on,
based on due date and priority. I&apos;ll then block out time to work on them on my
paper day plan. I&apos;ll always leave some extra room for tasks that will pop up
during the day.
&lt;/p&gt;

&lt;p&gt;
The day planner itself is really simple and looks a bit like this (shortened to
save space):
&lt;/p&gt;

&lt;table class=&quot;table--full table--outlined table--example-schedule&quot;&gt;


&lt;colgroup&gt;
&lt;col  class=&quot;org-right&quot;&gt;

&lt;col  class=&quot;org-left&quot;&gt;

&lt;col  class=&quot;org-left&quot;&gt;

&lt;col  class=&quot;org-left&quot;&gt;

&lt;col  class=&quot;org-left&quot;&gt;

&lt;col  class=&quot;org-left&quot;&gt;
&lt;/colgroup&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th scope=&quot;col&quot; class=&quot;org-right&quot;&gt;&amp;#xa0;&lt;/th&gt;
&lt;th scope=&quot;col&quot; class=&quot;org-left&quot;&gt;Monday&lt;/th&gt;
&lt;th scope=&quot;col&quot; class=&quot;org-left&quot;&gt;Tuesday&lt;/th&gt;
&lt;th scope=&quot;col&quot; class=&quot;org-left&quot;&gt;Wednesday&lt;/th&gt;
&lt;th scope=&quot;col&quot; class=&quot;org-left&quot;&gt;Thursday&lt;/th&gt;
&lt;th scope=&quot;col&quot; class=&quot;org-left&quot;&gt;Friday&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&quot;org-right&quot;&gt;9-10&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;Task A&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class=&quot;org-right&quot;&gt;10-11&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;Task B&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class=&quot;org-right&quot;&gt;11-12&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;Task C&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class=&quot;org-right&quot;&gt;12-1&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;Lunch&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class=&quot;org-right&quot;&gt;1-2&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class=&quot;org-right&quot;&gt;2-3&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;Task C&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;td class=&quot;org-left&quot;&gt;&amp;#xa0;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;
I split my work day into blocks of one hour to make things easier; I&apos;ve tried
slots of 30 minutes long, but that felt less flexible and quickly fell apart if
something came up. I use red for billable tasks, green for personal projects,
and orange for essentials like exercise and eating.
&lt;/p&gt;

&lt;p&gt;
Although org-agenda can be used to create day plans that are similar to this, I
prefer having a paper copy in front of me. It lets me get a quick overview of
how busy the day is going to be, as well as how much is going to be spent on
billable time vs personal projects.
&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;

&lt;section id=&quot;outline-container-org3dc19be&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org3dc19be&quot;&gt;Adding new tasks&lt;/h2&gt;
&lt;div class=&quot;outline-text-2&quot; id=&quot;text-org3dc19be&quot;&gt;
&lt;p&gt;
I generally deal with two kinds of task: &lt;b&gt;proactive&lt;/b&gt;, and &lt;b&gt;reactive&lt;/b&gt;.
&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;Proactive&lt;/b&gt; tasks are things I&apos;ve already planned out; I can choose when to work
on them, and I know when they&apos;re due and what urgency level they are.
&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;Reactive&lt;/b&gt; tasks are when emails/calls/chat messages come in and I need to do
something about them. They may be urgent and need doing ASAP, or they may end up
on the proactive list.
&lt;/p&gt;

&lt;p&gt;
We&apos;ll start with &lt;b&gt;reactive&lt;/b&gt; tasks first.
&lt;/p&gt;

&lt;p&gt;
An example non-urgent request would be something like &quot;We&apos;re wanting to add a
new report to &amp;lt;product&amp;gt; by next month. Design and documentation attached&quot;&lt;sup&gt;&lt;a id=&quot;fnr.2&quot; class=&quot;footref&quot; href=&quot;#fn.2&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;.
&lt;/p&gt;

&lt;p&gt;
I&apos;ll open up the org file for this client, jump to the appropriate project node,
and add a new sub-task for this request. In this example it would look a bit
like this:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-org&quot;&gt;* TODO Create new &quot;days without an accident&quot; report [0/4]
  DEADLINE: &amp;lt;2021-04-30 Fri&amp;gt;
** TODO Email person re: new report
   SCHEDULED: &amp;lt;2021-04-15 Thu&amp;gt;
** TODO Create markup for new report
** TODO Add data backend to new report
** TODO Deploy new report to staging for tests
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
I&apos;d also break down each sub-task into individual steps and add estimates, but
that&apos;s a topic for another day.
&lt;/p&gt;

&lt;p&gt;
Once this is done, the first task will show up on my daily agenda. My weekly
agenda will also have a reminder that there&apos;s an upcoming deadline.
&lt;/p&gt;

&lt;p&gt;
For scheduling &lt;b&gt;proactive&lt;/b&gt; tasks I&apos;ll read through my list of tasks and assign
dates as needed. org-agenda can search for top-level TODO items and filter them
by category and context. It can also list &quot;stuck&quot; projects that don&apos;t have an
assigned next action.
&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;

&lt;section id=&quot;outline-container-org7e8246f&quot; class=&quot;outline-2&quot;&gt;
&lt;h2 id=&quot;org7e8246f&quot;&gt;Working on a task&lt;/h2&gt;
&lt;div class=&quot;outline-text-2&quot; id=&quot;text-org7e8246f&quot;&gt;
&lt;p&gt;
When it&apos;s time to work on a task, I&apos;ll use org&apos;s clock timer to track the time I
spend on it. Starting work looks like this:
&lt;/p&gt;

&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;I highlight the task in the agenda.&lt;/li&gt;
&lt;li&gt;Hit &lt;code&gt;&amp;lt;enter&amp;gt;&lt;/code&gt; to jump to its entry in the appropriate file.&lt;/li&gt;
&lt;li&gt;Switch the task to &lt;code&gt;IN-PROGRESS&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Start clocking time with &lt;code&gt;C-c C-x C-i&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Navigate to the project with &lt;code&gt;C-c p p&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Choose the file I need to be working on and start.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;C-c C-x C-o&lt;/code&gt; to stop the clock once I&apos;m done or need to switch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
&lt;aside class=&quot;note&quot;&gt;
Since writing this post I&apos;ve simplified up a few of these steps:
&lt;/p&gt;

&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;Clocking in can be done directly from the agenda (thanks to reddit user
&lt;code&gt;codygman&lt;/code&gt; for this tip).&lt;/li&gt;
&lt;li&gt;The task state can be &lt;a href=&quot;/blog/automatic-org-keyword-changes/&quot;&gt;automatically switched using org-clock-in-switch-to-state&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;/aside&gt;
&lt;/p&gt;

&lt;p&gt;
I know all the previous steps sound like a lot, but going from my agenda to
working on a task only takes a few seconds.
&lt;/p&gt;

&lt;p&gt;
Emacs also supports bookmarks, so if I want to start on something immediately
the next day, I&apos;ll leave a bookmark in the right spot so I can jump straight to
it.
&lt;/p&gt;

&lt;p&gt;
Tasks in org have a keyword at the start to indicate their status. I use the following keywords:
&lt;/p&gt;

&lt;ul class=&quot;org-ul&quot;&gt;
&lt;li&gt;&lt;code&gt;TODO&lt;/code&gt; - A task that I need to do.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;IN-PROGRESS&lt;/code&gt; - A task that I&apos;ve started and is actively being worked on.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TESTING&lt;/code&gt; - A task that is being tested and reviewed by the client.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;WAITING&lt;/code&gt; - A task where I&apos;m waiting on something - could be more
information about what needs doing, or it could need an external party to
review it.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;TO-DEPLOY&lt;/code&gt; - It&apos;s done and ready and waiting to deploy at a specific date &amp;amp;
time.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;DONE&lt;/code&gt; - It is done and nothing needs doing on it again.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;CANCELLED&lt;/code&gt; - The task/project was cancelled for one reason or another.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Because org-agenda can search for keywords, it&apos;s easy for me to check for
various tasks during my weekly review. For example, I can check through the
&lt;code&gt;WAITING&lt;/code&gt; list and see if I need to follow up on anything.
&lt;/p&gt;

&lt;p&gt;
I also use org for detailed project planning; it&apos;s great for breaking down a
task into chunks, adding estimates, and assigning to milestones. But this post
is already &lt;del&gt;boring&lt;/del&gt; long enough so I&apos;ll save that for another day.
&lt;/p&gt;

&lt;p&gt;
&lt;span class=&quot;separator&quot;&gt;~~~&lt;/span&gt;
&lt;br&gt;
If you found this helpful and would like to read more content like it,
&lt;a href=&quot;https://twitter.com/sodaware&quot;&gt;follow me on Twitter&lt;/a&gt;.

&lt;/p&gt;

&lt;style&gt;
.table--example-schedule {
    margin-bottom: 0.75em;
}

.table--example-schedule tbody tr td {
    border-bottom: 2px solid #d9d9d9;
    border-left: 2px solid #d9d9d9;
}

.table--example-schedule tbody tr td:first-child {
    border-left: 2px solid #909090;
}

.table--example-schedule tbody tr:last-child td {
    border-bottom
: 2px solid #909090;
}

.table--example-schedule tbody tr:nth-child(1) td:nth-child(2),
.table--example-schedule tbody tr:nth-child(3) td:nth-child(2),
.table--example-schedule tbody tr:nth-child(6) td:nth-child(2) {
    background: #fe2300;
}

.table--example-schedule tbody tr:nth-child(2) td:nth-child(2) {
    background: #00b56c;
}

.table--example-schedule tbody tr:nth-child(4) td:nth-child(2) {
    background: #fe9000;
}
&lt;/style&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;div id=&quot;footnotes&quot;&gt;
&lt;h2 class=&quot;footnotes&quot;&gt;Footnotes: &lt;/h2&gt;
&lt;div id=&quot;text-footnotes&quot;&gt;

&lt;div class=&quot;footdef&quot;&gt;&lt;sup&gt;&lt;a id=&quot;fn.1&quot; class=&quot;footnum&quot; href=&quot;#fnr.1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; &lt;div class=&quot;footpara&quot;&gt;&lt;p class=&quot;footpara&quot;&gt;
I&apos;ve been doing this job for 12 years but it&apos;s really hard to come up with
imaginary tasks.
&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;footdef&quot;&gt;&lt;sup&gt;&lt;a id=&quot;fn.2&quot; class=&quot;footnum&quot; href=&quot;#fnr.2&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; &lt;div class=&quot;footpara&quot;&gt;&lt;p class=&quot;footpara&quot;&gt;
At least with made up examples they include all the info I need first time.
&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;


&lt;/div&gt;
&lt;/div&gt;
</description>
        <pubDate>Thu, 15 Apr 2021 09:45:00 -0400</pubDate>
        <link>https://www.philnewton.net/blog/how-i-get-work-done-with-emacs/</link>
        <guid isPermaLink="true">https://www.philnewton.net/blog/how-i-get-work-done-with-emacs/</guid>
      </item>
    
      <item>
        <title>Moving text around in Emacs using move-text</title>
        <description>&lt;p&gt;
&lt;a href=&quot;https://github.com/emacsfodder/move-text&quot;&gt;&lt;code&gt;move-text&lt;/code&gt;&lt;/a&gt; is a simple Emacs package that lets you move a line or region around
using &lt;kbd&gt;M&lt;/kbd&gt; + &lt;kbd&gt;&amp;uarr;&lt;/kbd&gt; and
&lt;kbd&gt;M&lt;/kbd&gt; + &lt;kbd&gt;&amp;darr;&lt;/kbd&gt;. It&apos;s not limited to plain text
buffers - you can move lines of source code around too.
&lt;/p&gt;

&lt;p&gt;
In practice it looks like this:
&lt;/p&gt;


&lt;figure&gt;
&lt;a href=&quot;/assets/blog/2021/emacs-move-text.gif&quot; alt=&quot;Moving text around&quot; class=&quot;center bordered&quot; width=&quot;700&quot; loading=&quot;lazy&quot;&gt;&lt;img src=&quot;/assets/blog/2021/emacs-move-text.gif&quot; alt=&quot;Moving text around&quot; class=&quot;center bordered&quot; width=&quot;700&quot; loading=&quot;lazy&quot;&gt;&lt;/a&gt;

&lt;/figure&gt;

&lt;p&gt;
I prefer to use &lt;kbd&gt;Control&lt;/kbd&gt; + &lt;kbd&gt;Shift&lt;/kbd&gt; with the up and
down arrow keys, so my configuration looks like this:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-emacs-lisp&quot;&gt;(use-package move-text
  :bind
  ((&quot;C-S-&amp;lt;up&amp;gt;&quot;   . move-text-up)
   (&quot;C-S-&amp;lt;down&amp;gt;&quot; . move-text-down)))
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
Cutting and pasting a region is usually quicker, but for shuffling a few lines
around this method is quick enough.
&lt;/p&gt;
</description>
        <pubDate>Mon, 12 Apr 2021 19:52:00 -0400</pubDate>
        <link>https://www.philnewton.net/blog/moving-text-in-emacs/</link>
        <guid isPermaLink="true">https://www.philnewton.net/blog/moving-text-in-emacs/</guid>
      </item>
    
      <item>
        <title>Configuring bug-reference mode from within org-mode</title>
        <description>&lt;p&gt;
A few weeks ago I &lt;a href=&quot;https://www.monotux.tech/posts/2021/02/bug-reference-mode/&quot;&gt;learnt about &lt;code&gt;bug-reference-mode&lt;/code&gt;&lt;/a&gt;, a neat little Emacs
minor-mode that automatically links text to a bug tracker. A few of my projects
use bug trackers or GitHub issues, and different clients often have their own
systems.
&lt;/p&gt;

&lt;p&gt;
There are two variables that I usually want to set for &lt;code&gt;bug-reference-mode&lt;/code&gt;:
&lt;/p&gt;

&lt;dl class=&quot;org-dl&quot;&gt;
&lt;dt&gt;&lt;code&gt;bug-reference-url-format&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;The URL of an individual bug, with &lt;code&gt;%s&lt;/code&gt; used
as a placeholder for the bug ID.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;bug-reference-bug-regexp&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;The regular expression that finds bug ID
references. This is usually something like &lt;code&gt;#1234&lt;/code&gt;.&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;
I use directory local variables&lt;sup&gt;&lt;a id=&quot;fnr.1&quot; class=&quot;footref&quot; href=&quot;#fn.1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; for a lot of projects, but Emacs also
supports file local variables for more fine-grained settings. &lt;code&gt;org-mode&lt;/code&gt; has its
own syntax for setting file local variables, so I needed to adjust things
slightly to get it all working.
&lt;/p&gt;

&lt;p&gt;
Setting local variables for a bug tracker looks like this:
&lt;/p&gt;

&lt;div class=&quot;org-src-container&quot;&gt;
&lt;pre class=&quot;src src-org&quot;&gt;# Local Variables:
# mode: org
# bug-reference-url-format: &quot;https://example.org/tasks/%s&quot;
# bug-reference-bug-regexp: &quot;\\(#\\)\\([0-9]\\{8\\}\\)&quot;
# End:
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;
On my first attempt I skipped the &lt;code&gt;Local Variables:&lt;/code&gt; and &lt;code&gt;End:&lt;/code&gt; keywords, but
they are needed for org to pick these variables up.
&lt;/p&gt;
&lt;div id=&quot;footnotes&quot;&gt;
&lt;h2 class=&quot;footnotes&quot;&gt;Footnotes: &lt;/h2&gt;
&lt;div id=&quot;text-footnotes&quot;&gt;

&lt;div class=&quot;footdef&quot;&gt;&lt;sup&gt;&lt;a id=&quot;fn.1&quot; class=&quot;footnum&quot; href=&quot;#fnr.1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; &lt;div class=&quot;footpara&quot;&gt;&lt;p class=&quot;footpara&quot;&gt;
These are variables that are set for all files in a directory and its sub-directories.
&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;


&lt;/div&gt;
&lt;/div&gt;
</description>
        <pubDate>Mon, 29 Mar 2021 20:17:00 -0400</pubDate>
        <link>https://www.philnewton.net/blog/bug-reference-config-org-mode/</link>
        <guid isPermaLink="true">https://www.philnewton.net/blog/bug-reference-config-org-mode/</guid>
      </item>
    
  </channel>
</rss>
