alphapapa / org-now

Conveniently show current Org tasks in a sidebar window

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

org-now

This package provides commands to conveniently show Org headings in a sidebar window while you’re working on them. A heading in one of your Org files is defined as the “now” heading, and other headings are refiled to it with one command, and back to their original location with another.

The sidebar window is an indirect buffer created with org-tree-to-indirect-buffer, so you can work in it as you would a normal buffer. Being a special Emacs side window, it’s persistent, resisting being closed by accident by window management commands.

Note that this package adds Org UUIDs to entries in property drawers when they are refiled, to ensure they are tracked properly while they’re being moved.

Screenshots

There’s nothing special about the appearance of this package’s functionality. But here are two example screenshots.

By default, the sidebar’s outline is shown at level 2, so the “now” heading should be a top-level heading: images/screenshot1.png

The sidebar is just an Org buffer, so you can expand it, type into it, etc: images/screenshot2.png

Installation

Install these required packages:

Then put org-now.el in your load-path, and put this in your init file:

(require 'org-now)

Here’s a configuration with mnemonic keybindings that you may find convenient, using use-package and general:

(use-package org-now
  :general (:keymaps 'org-mode-map
                     :prefix "M-SPC"
                     "rl" #'org-now-link
                     "rn" #'org-now-refile-to-now
                     "rp" #'org-now-refile-to-previous-location))

Usage

When using org-now for the first time, you’ll be prompted to configure the org-now-location setting to point to a place in one of your Org files where you want to temporarily refile “now” tasks.

Commands

org-now
Show the org-now sidebar window, or select it if it’s already open. (The other commands do this automatically.)

Refiling commands: These commands are usable in regular Org buffers.

org-now-link
Add a link to the entry at point to the org-now buffer. This command works in any buffer that org-store-link can store a link for, not just in Org buffers.
org-now-refile-to-now
Refile entry at point to the org-now buffer.
org-now-refile-to-previous-location
Refile entry in org-now buffer back to its original location.

Agenda commands: These commands are usable in Org Agenda buffers.

org-now-agenda-link
Add a link to the entry at point to the org-now buffer.
org-now-agenda-refile-to-now
Refile entry at point to the org-now buffer.
org-now-agenda-refile-to-previous-location
Refile entry in org-now buffer back to its original location.

They’re also usable as Agenda “bulk” commands on marked entries. You can configure them like this:

(setf org-agenda-bulk-custom-functions
      '((?n org-now-agenda-refile-to-now)
        (?P org-now-agenda-refile-to-previous-location)))

Functions:

org-now-buffer
Return the org-now buffer, creating it if necessary. Useful in functions that may display the buffer, e.g. in org-sidebar. This function is autoloaded.

Hook examples

The org-now-hook option can be used to run user-defined functions after the org-now buffer is created. Here are two examples you might find useful.

Disable mode-line
If you don’t need or want the mode-line in the sidebar window, this function will disable it. In this case, it’s recommended to use something like real-auto-save-mode in Org buffers to ensure that refiled headings are automatically saved to disk, because you won’t be able to see the buffer’s modified status.
(lambda ()
  (setq mode-line-format nil))
Set org-level-1 heading to 10 point size
This is helpful when your org-now-location is a file, in which case headings will be top-level headings. This function can be used to reduce the font size so the headings fit better in the sidebar window. It works especially well if your org-level- faces each inherit from their higher-level face (i.e. org-level-2 inherits from org-level-1, etc.).
(lambda ()
  (face-remap-add-relative 'org-level-1 '(:height 100)))

Development

Bug reports, feature requests, suggestions — oh my!

License

GPLv3

About

Conveniently show current Org tasks in a sidebar window


Languages

Language:Emacs Lisp 100.0%