• Stars
    star
    3
  • Rank 3,844,602 (Top 78 %)
  • Language
    Emacs Lisp
  • Created over 5 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tame your lists in a drawer

org-drawer-list

https://gitlab.com/d12frosted/org-drawer-list/badges/master/pipeline.svg

Small utility library for dealing with lists in an org-mode drawer. This library provides the following functions:

  • org-drawer-list - returns the content of the named drawer as a list;
  • org-drawer-list-add - adds the value to the list under the named drawer;
  • org-drawer-list-remove - removes the value from the list under the named drawer;
  • org-drawer-list-contains - returns first element of the named drawer that is equal to a given element.
  • org-drawer-list-block - returns the region of the named drawer; when asked creates a missing drawer.

Every function works also in the agenda buffer.

Please refer to each function’s documentation for more information.

Projects using this library

  • orgability - reading list manager for Emacs with offline access support

User story

Imagine that you want to maintain a list of resources for each heading. One of the possible ways to organise it is to use custom drawers.

* fancy topic
:RESOURCES:
- resource one
- resource two
:END:

Easy and straight-forward. But manually updating this list is tedious, because manual work is tedious. And it doesn’t scale. Especially if you wish to write a program that leverages lists in custom drawers.

That’s where org-drawer-list comes to the rescue!

Getting the list of resources

(org-drawer-list "resources")
;; => ("resource one" "resource two")

(org-drawer-list "topics")
;; => nil

Adding resource

(org-drawer-list-add "resources" "resource three")
;; => "resource three"
* fancy topic
:RESOURCES:
- resource one
- resource two
- resource three
:END:

Removing resource

(org-drawer-list-remove "resources" "resource three")
;; => 1
* fancy topic
:RESOURCES:
- resource one
- resource two
:END:

Contains test

(org-drawer-list-contains "resources" "resource one")
;; => "resource one"

(org-drawer-list-contains "resources" "i don't exist")
;; => nil

(org-drawer-list-contains "resources" "one" #'string-suffix-p)
;; => "resource one"

Installation

Currently, this package is not available on MELPA, so you’ll have to manually install it.

use-package + quelpa

(use-package org-drawer-list
  :quelpa (org-drawer-list
           :fetcher github
           :repo "d12frosted/org-drawer-list"))

Testing

Ideally, you should use Cask for running tests. So first you need to install cask. If you are using emacs-plus, then you need to ignore dependencies during cask installation.

$ brew install cask --ignore-dependencies

One you have cask, you need to install all dependencies.

$ cask install

Now you can run tests.

$ cask exec ert-runner

Contributing

Everyone is welcome to contribute to org-drawer-list project. Feature requests, proposals, issue reports, documentation improvements, code patches - just to name few things that the project can gain from.

Please note that the main upstream of org-drawer-list is located on GitLab, and it’s advisable to send your contributions there. But they can be accepted also via email and GitHub.

This project has automated tests that are run on GitLab. If you are contributing outside of GitLab, please run the tests manually. For more information please refer to relevant section in readme file or contact me via email.

Happy hacking!

More Repositories

1

homebrew-emacs-plus

Emacs Plus formulae for the Homebrew package manager
Ruby
2,143
star
2

vulpea

A collection of functions for note taking based on `org` and `org-roam`.
Emacs Lisp
222
star
3

flyspell-correct

Distraction-free words correction with flyspell via selected interface.
Emacs Lisp
196
star
4

environment

dotfiles
Emacs Lisp
121
star
5

elpa-mirror

Mirror for some Emacs package archives
Emacs Lisp
96
star
6

dotbot-brew

Install brew packages using dotbot
Python
42
star
7

vino

It's your cellar, your dear cantina.
Emacs Lisp
36
star
8

counsel-osx-app

Launch OSX applications via ivy interface
Emacs Lisp
24
star
9

UnityLibrarySwitcher

Unity plugin for switching build targets, git branches without endless assets reimport. Not maintained anymore.
C#
19
star
10

git-config-manager

Manage git repository configurations with ease
Haskell
8
star
11

mirror-elpa

(To) mirror Emacs Lisp Package Archive(s)
Shell
8
star
12

d12frosted.io

Personal site
Haskell
8
star
13

orgability

Reading list manager for Emacs with offline access support.
Emacs Lisp
7
star
14

publicatorg

Make your vulpea notes public
Emacs Lisp
5
star
15

fancy-yank

apply transformation upon yanking
Emacs Lisp
4
star
16

emacs-addiction-mode

M-x doctor instead of C-x C-c
Emacs Lisp
4
star
17

barberry.io

Emacs Lisp
4
star
18

emacs-ukrainian-input-method

Ukrainian macOS-like input method
Emacs Lisp
4
star
19

emacs-plus-basis

Emacs Lisp
3
star
20

CanonicalPath

Abstract data type for canonical paths with some pretty operations. Not maintained anymore.
Haskell
3
star
21

env-extra

Safe helpers for accessing and modifying environment variables
Haskell
2
star
22

talks

TeX
2
star
23

d12frosted

1
star
24

path-extra

Path helpers for my personal projects
Haskell
1
star
25

bomberman-player

Haskell
1
star
26

fish-mode

Major mode for editing fish shell scripts
Emacs Lisp
1
star