Skip to main content

Baty.net

A blog about everything by Jack Baty 👋

Category: Emacs

Prevent Org-todo from messing with windows

When I have two Emacs windows split side-by-side in a frame, calling org-todo opened a full-width window at the bottom of the frame. This would be fine, but then when dismissing the selection window, it would wipe my previous window layout and I’d be left with a single giant window.

I found this to work:

(setq org-use-fast-todo-selection 'expert)

The default, I think, is “auto”

Org-web-tools

I just wanted to give a shout-out to Adam Porter for his Org-web-tools Emacs package.

I only discovered his package a month or so ago and I’ve used it daily since. Put a URL in the clipboard, then in an Org-document run M-x org-web-tools-insert-web-page-as-entry and bam!, the page is converted into Org’s format and inserted as a heading in the current file. For example, here’s Jason Velazquez’s post about Blogging Platforms, all tucked away nicely in my “Blogging Platforms” Denote note…

Hiding scheduled TODO items in Org-mode

Many of my TODO items in Org-mode include a SCHEDULED property, which lets me ignore them until a specified date in the future. This keeps my Org agenda nice and tidy.

Something that always bugged me is that this worked fine in the Agenda, but not the global TODO list. It finally bothered me enough that I went looking for a solution, which I found in like twenty seconds:

(setq org-agenda-tags-todo-honor-ignore-options t)

Using tags for org-refile-targets

Today I learned that I can use tags in Org files as a filter for org-refile-targets. My refile targets are mapped to org-agenda-files but limit them to only top-level headings in order to keep the list under control. Once in a while, though, I would like to make a more deeply nested heading available for refiling. I can do this by using (:tag . "refile"). Who knew?!

(setq org-refile-targets '((org-agenda-files :maxlevel . 1)
                           (org-agenda-files :tag . "refile")))

Converting Markdown to Org-mode syntax in current buffer

There are some great tools for bringing web content into Markdown files, but few that offer the same utility for Org-mode (Orgdown) files.

For example, I use Markdownload extension all the time. It works great with nearly every site I use it on, but instead of Markdown, I’d prefer having Org syntax, so I’ve worked around it by creating a function1 which converts the current region from Markdown to Org.

(defun jab/md-to-org-region (start end)
  "Convert region from markdown to org, replacing selection"
  (interactive "r")
  (shell-command-on-region start end "pandoc -f markdown -t org" t t))

I copy the Markdown from the Markdownload window, paste it into an Org buffer, and run the function. It’s not perfect, but until someone creates an “Orgdownload” extension, it’ll do. (Pretty please, will someone create an Orgdownload extension?)