• Stars
    star
    601
  • Rank 71,825 (Top 2 %)
  • Language
    Emacs Lisp
  • License
    GNU General Publi...
  • Created almost 6 years ago
  • Updated 12 months ago

Reviews

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

Repository Details

Show source files' TODOs (and FIXMEs, etc) in Magit status buffer

magit-todos

https://melpa.org/packages/magit-todos-badge.svg https://stable.melpa.org/packages/magit-todos-badge.svg

This package displays keyword entries from source code comments and Org files in the Magit status buffer. Activating an item jumps to it in its file. By default, it uses keywords from hl-todo, minus a few (like NOTE).

Contents

Screenshots

screenshots/matrix.png

Items from Org files can be displayed, and can be fontified like in Org buffers:

screenshots/fancy-org.png

Items can also be automatically grouped in a customizable way, which can be helpful in large repos:

screenshots/emacs-grouped.png

This shows grouping items by the first path component, then keyword, then filename, and with optional keyword header fontification:

screenshots/emacs-grouped-by-path.png

Items in KEYWORD(username): format are also read:

screenshots/thiderman.png

Items specific to the current branch (or git diff) can be displayed in a separate list:

screenshots/branch-list.png

Installation

External scanner

One of the following external scanners is required:

  • ripgrep
  • git grep (built with PCRE support)
  • GNU grep (built with PCRE support)

Most Linux systems should have the latter two by default, but some non-standard systems may not. For example, on MacOS you may use Homebrew to install ripgrep, or git with PCRE support, like: brew reinstall --with-pcre2 git.

Emacs package

If you installed from MELPA, you’re done!

Manually

Install these required packages:

  • async
  • dash
  • f
  • hl-todo
  • magit
  • pcre2el
  • s

Then put this file in your load-path, and put this in your init file:

(require 'magit-todos)

Usage

Activate magit-todos-mode. Then open a Magit status buffer, or run magit-todos-list to show a dedicated to-do list buffer.

Key bindings

In Magit status buffer:

j T
Jump to the to-do list. If the section is empty (e.g. when using manual updates), it will scan for items.

With point in to-do list:

b
Show branch (git diff) to-do list.
B
Set commit reference used in branch to-do list.
j T
When configured for manual updates, manually update the to-do list.
j l
Open dedicated to-do list buffer.
RET
Show item at point, or open dedicated buffer if point is on top heading.
SPC
Peek at the item at point.

Commands

magit-todos-mode
Activate magit-todos-mode, which automatically inserts the to-do list in Magit status buffers.
magit-todos-list
Display the to-do list in a separate buffer. This also works outside of git repos.

Helm and Ivy are also supported. Note that the helm and ivy packages are not required, nor does this package depend on them; they are only used if present. Note as well that these commands can be used directly from source buffers, independently of Magit.

helm-magit-todos
Display the project to-do list with Helm.
ivy-magit-todos
Display the project to-do list with Ivy.

Tips

  • Customize settings in the magit-todos group.
  • Use dir-local variables to set per-repository settings. For example, to exclude files and directories from being scanned for to-dos in a repo:
    1. From a buffer in the repo’s directory (like a magit-status buffer), run the command add-dir-local-variable.
    2. Choose the mode magit-status-mode.
    3. Choose the variable magit-todos-exclude-globs.
    4. Input the glob value, like ("*.html") to exclude HTML files. (Note that the input is read as a lisp value, and this variable must be a list of strings.)
    5. Now Emacs will remember that setting in that repository. (You may also want to commit the .dir-locals.el file to the repo.)
  • The magit-todos-list command also works outside of git repos.

TRAMP

magit-todos attempts to work in remote repositories accessed via TRAMP. Note that if TRAMP can’t find the scanner configured in magit-todos-scanner, you may need to use directory-local variables to either add the correct path to tramp-remote-path or choose a different scanner.

Changelog

1.6

  • Emacs 26.1 or later is now required.

Added

  • Option magit-todos-submodule-list controls whether to-dos in submodules are displayed (default: off). (Thanks to Matsievskiy S.V.)
  • Option magit-todos-insert-after, which replaces magit-todos-insert-at. (The new option is more flexible, and it is automatically set from the old one’s value.)
  • Option magit-todos-filename-filter, which can be used to shorten filenames. (Thanks to Matsievskiy S.V.)

Changed

  • Option magit-todos-exclude-globs now excludes the `.git/` directory by default. (Thanks to Amorymeltzer.)
  • Library org is no longer loaded automatically, but only when needed. (This can reduce load time, especially if the user’s Org configuration is complex.) (#120. Thanks to Martin EdstrΓΆm and Johnny Sigman for suggesting.)

Fixed

  • Regexp overflow error for very long lines. (#131. Thanks to Laurence Warne.)
  • Option magit-todos-group-by respects buffer- and directory-local settings.
  • Insertion of blank lines between expanded sections.
  • Section insertion position at top of buffer and when chosen section doesn’t exist. (#139. Thanks to Sascha LΓΌdecke for reporting.)

Removed

  • Option magit-todos-insert-at, replaced by magit-todos-insert-after. (The old option will be removed in v1.8; customizations of it should be removed.)

Internal

  • Define jumper keys using a Transient suffix.
  • Use new git-testing function in Magit for remote directories. (#126. Thanks to Max Hollmann.)

1.5.3

Fixes

1.5.2

Fixes

  • Use magit-todos-exclude-globs in branch todo list.

1.5.1

Fixes

  • Add insertion function to end of magit-status-sections-hook.

1.5

Added

  • Support for remote repositories accessed via TRAMP. See usage notes.
  • Ivy history support. (Thanks to Brian Leung.)
  • Option magit-todos-branch-list-merge-base-ref.
  • Command magit-todos-branch-list-set-commit, bound to B with point in a to-do section.

Changed

  • Branch todo list now uses git merge-base to determine the ancestor commit to compare to HEAD.
  • Enable list-wide key bindings on both headings and to-do items.

Removed

  • Option magit-todos-branch-list-commit-ref, replaced by option magit-todos-branch-list-merge-base-ref.

1.4.3

Fixed

  • Don’t use --help option when testing git grep command, because it can launch a Web browser on some configurations or platforms (see #43).
  • Caching when branch diff list is displayed.
  • Commands magit-section-forward / backward sometimes skipped sections (see #66).

1.4.2

Fixed

1.4.1

Fixed

  • Compiler warning.

1.4

Added

  • Commands helm-magit-todos and ivy-magit-todos, which display items with Helm and Ivy. (Note that Helm and Ivy are not required, nor does this package depend on them; they are only used if present.)

Fixed

  • Warn about files containing lines too long for Emacs’s regexp matcher to handle, rather than aborting the scan (#63).

Updated

  • Use magit-setup-buffer instead of magit-mode-setup.

Internal

  • Add synchronous mode to scanner functions, which return results directly usable by other code.

1.3

Added

  • Branch diff task list. See new options magit-todos-branch-list and magit-todos-branch-list-commit-ref, and command magit-todos-branch-list-toggle, bound to b with point on to-do list heading. (#30, #77, #82. Thanks to Itamar Turner-Trauring and Arron Mabrey for the suggestion, and to SΓ©bastien Maret for implementing the commit-ref option.)

Internal

1.2

Added

  • Allow magit-todos-list to work outside git repos.
  • Option magit-todos-keyword-suffix replaces magit-todos-require-colon, allowing for common and custom suffixes after item keywords (e.g. to match items like TODO(user):). (Fixes #56. Thanks to Lowe Thiderman for suggesting.)
  • Optionally group and sort by item suffixes (e.g. handy when suffixes contain usernames).
  • Bind RET on top-level TODOs section heading to magit-todos-list command.

Fixed

Worked Around

  • Issue in async regarding deleted buffers/processes. This is not an ideal solution, but it solves the problem for now.

Removed

  • Option magit-todos-require-colon, replaced by magit-todos-keyword-suffix.

1.1.8

Fixed

  • Properly unbind key when mode is disabled. (#74. Thanks to Akira Komamura.)
  • Don’t show message when key is already bound correctly. (#75. Thanks to Akira Komamura.)

1.1.7

Fixed

  • Disable undo in hidden Org fontification buffer.
  • Expand top-level to-do list in magit-todos-list buffer.

1.1.6

Fixed

  • Insert root section in magit-todos-list command. (Really fixes #55. Thanks to Jonas Bernoulli.)

1.1.5

Fixed

1.1.4

Fixes

  • magit-todos-depth number-to-string conversion.

1.1.3

Fixes

1.1.2

Fixes

  • Convert magit-todos-depth setting appropriately for rg scanner.

1.1.1

Fixes

  • Ensure mode is activated in magit-todos-update command. (Fixes #54. Thanks to Sebastien Maret.)

1.1

Additions

  • Dedicated to-do list buffer.
  • Option magit-todos-exclude-globs, a list of glob patterns to ignore when searching for to-do items.
  • Kill running scans when Magit status buffer is closed.

Changes

  • Remove dependency on a.
  • Remove dependency on anaphora.

Fixes

1.0.4

Fixes

1.0.3

Fixes

  • Define variables earlier to avoid compiler warnings.
  • Remove unused var magit-todos-ignore-file-suffixes.

1.0.2

Fixes

  • regexp-quote item keywords when jumping to an item. (Fixes #36. Thanks to Derek Feichtinger.)
  • Ensure grep supports --perl-regexp.
  • Warn when unable to find a suitable scanner (i.e. rg, or a PCRE-compatible version of git or grep).

1.0.1

Fixes

  • Test whether git grep supports --perl-regexp by checking its --help output, rather than doing a search and checking for an error.
  • message instead of error for weird behavior. (This message exists to help track down an inconsequential bug.)
  • Remove unused magit-todos-ignore-directories option. (To be replaced in a future release.)

1.0.0

Initial release.

Credits

  • This package was inspired by magit-org-todos.
  • The ag support was made much simpler by the great pcre2el package by Jon Oddie.
  • Thanks to Jiangbin Zhao for his extensive testing and feedback.

License

GPLv3

More Repositories

1

org-super-agenda

Supercharge your Org daily/weekly agenda by grouping items
Emacs Lisp
1,182
star
2

org-ql

An Org-mode query language, including search commands and saved views
Emacs Lisp
1,159
star
3

emacs-package-dev-handbook

An Emacs package development handbook. Built with Emacs, by Emacs package developers, for Emacs package developers.
JavaScript
987
star
4

org-web-tools

View, capture, and archive Web pages in Org-mode
Emacs Lisp
519
star
5

org-sidebar

A helpful sidebar for Org mode
Shell
492
star
6

org-rifle

Rifle through your Org-mode buffers and acquire your target
Emacs Lisp
488
star
7

org-protocol-capture-html

Capture HTML from the browser selection into Emacs as org-mode content
Emacs Lisp
442
star
8

bufler.el

A butler for your buffers. Group buffers into workspaces with programmable rules, and easily switch to and manipulate them.
Emacs Lisp
378
star
9

ement.el

Matrix client for Emacs
Emacs Lisp
354
star
10

unpackaged.el

A collection of useful Emacs Lisp code that isn't substantial enough to be packaged
Emacs Lisp
345
star
11

solarized-everything-css

A collection of Solarized user-stylesheets for...everything?
CSS
275
star
12

burly.el

Save and restore frames and windows with their buffers in Emacs
Emacs Lisp
252
star
13

matrix-client.el

A Matrix client for Emacs! (deprecated in favor of Ement.el)
Emacs Lisp
241
star
14

prism.el

Disperse Lisp forms (and other languages) into a spectrum of colors by depth
Emacs Lisp
228
star
15

org-graph-view

View Org buffers as a clickable, graphical mind-map
Emacs Lisp
190
star
16

pocket-reader.el

Emacs client for Pocket reading list (getpocket.com)
Emacs Lisp
188
star
17

yequake

Drop-down Emacs frames, like Yakuake
Emacs Lisp
175
star
18

ts.el

Emacs timestamp and date-time library
Emacs Lisp
159
star
19

dogears.el

Never lose your place in Emacs again
Emacs Lisp
154
star
20

with-emacs.sh

Script to easily run Emacs with specified configurations
Shell
142
star
21

makem.sh

Makefile-like script for building and testing Emacs Lisp packages
Shell
128
star
22

plz.el

An HTTP library for Emacs
Emacs Lisp
126
star
23

bucket

A bucket for your shell (like a set of registers, or a clipboard manager)
Shell
118
star
24

restic-runner

Configure and run Restic more easily
Shell
108
star
25

hammy.el

Programmable, interactive interval timers (e.g. for working/resting)
Emacs Lisp
103
star
26

org-sticky-header

Show off-screen Org heading at top of window
Emacs Lisp
103
star
27

alpha-org

A powerful Org configuration
Emacs Lisp
100
star
28

org-make-toc

Automatic tables of contents for Org files
Shell
83
star
29

taxy.el

Programmable taxonomical hierarchies for arbitrary objects
Emacs Lisp
82
star
30

transclusion-in-emacs

Resources about implementing transclusion in Emacs
79
star
31

topsy.el

Simple sticky header showing definition beyond top of window
Emacs Lisp
77
star
32

org-bookmark-heading

Emacs bookmark support for Org-mode
Emacs Lisp
75
star
33

snow.el

Let it snow in Emacs!
Emacs Lisp
72
star
34

org-now

Conveniently show current Org tasks in a sidebar window
Emacs Lisp
50
star
35

bashcaster

An actually simple screen recorder for Linux
Shell
48
star
36

org-recent-headings

Go to recently used Org headings
Shell
47
star
37

obvious.el

Who needs comments when the code is so obvious
Emacs Lisp
46
star
38

frame-purpose.el

Purpose-specific frames for Emacs
Emacs Lisp
46
star
39

org-almanac

Almanac for Org mode
43
star
40

mosey.el

Mosey around inside your Emacs buffer
Emacs Lisp
37
star
41

org-html-theme-darksun

A Solarized Dark version of the Bigblow Org HTML export theme
JavaScript
36
star
42

salv.el

Local minor mode to save a buffer when Emacs is idle
Emacs Lisp
33
star
43

sword-to-org

Convert Sword modules to Org-mode outlines
Emacs Lisp
33
star
44

org-auto-expand

Automatically expand certain Org headings
Shell
28
star
45

mangle

Mangle man pages to show just the parts you need (suitable for aliasing to "man")
Shell
26
star
46

magit.sh

Run Magit in a separate Emacs instance
Shell
26
star
47

org-notely

Pop to new Org headings for quick notetaking
Shell
26
star
48

scrollkeeper.el

Configurable scrolling commands with visual guidelines, for Emacs
Emacs Lisp
22
star
49

ap.el

A simple, Emacs Lisp-focused Emacs config
Emacs Lisp
21
star
50

highlight-function-calls

Highlight function/macro calls in Emacs
Emacs Lisp
21
star
51

org-quick-peek

Quick inline peeks at agenda items and linked nodes in Org-mode
Emacs Lisp
21
star
52

defrepeater.el

Easily define repeatable Emacs commands
Emacs Lisp
20
star
53

pocket-lib.el

Emacs library for the getpocket.com API
Emacs Lisp
19
star
54

org-pocket

Tools to use Pocket with Org-mode
Emacs Lisp
16
star
55

elexandria

Alexandria-like library for Emacs Lisp
Emacs Lisp
13
star
56

sword-converter

Convert SWORD modules to JSON and SQLite and search the converted files
Emacs Lisp
13
star
57

frecency.el

Library to sort items by "frecency" in Emacs
Emacs Lisp
11
star
58

chromatext.el

Apply color gradients to lines of text in Emacs (possibly increasing legibility)
Emacs Lisp
9
star
59

plamix

Mix together M3U playlists, optionally with a desired duration, outputting either a list of files to STDOUT, or writing an M3U playlist to a file
Python
9
star
60

pyza

A command-line/terminal/console Songza player, using VLC or MPD to play audio
Python
8
star
61

melpa-stats

Stats tools for MELPA
Emacs Lisp
6
star
62

org-books

Tools for books in Org-mode
Emacs Lisp
5
star
63

rubbish.py

WIP: A CLI to the XDG trash bin in Python
Python
5
star
64

tp.el

Emacs text-property convenience library
Emacs Lisp
5
star
65

org-search-goto

org-search-goto
Emacs Lisp
5
star
66

buffer-groups.el

A lightweight, automatic grouping rule-based buffer grouper and switcher
Emacs Lisp
5
star
67

ibuffer-auto-groups

Automatically make groups for ibuffer
Emacs Lisp
5
star
68

ampd-tools

A small collection of MPD-related tools
Python
4
star
69

reddit-emacs-css

CSS for /r/emacs
CSS
4
star
70

ox-elisp

Export Org buffers to Emacs Lisp comments
Emacs Lisp
3
star
71

dbg.el

Simple debugging macros
Emacs Lisp
3
star
72

tabtint

Firefox extension which tints Firefox tabs to match color of web page
JavaScript
3
star
73

ya-solarized.el

Yet Another Solarized theme for Emacs
Emacs Lisp
2
star
74

overwatch-formula76

A racing custom game type for Overwatch
C
2
star
75

overwatch-custom-games

A collection of custom games for Overwatch
Emacs Lisp
2
star
76

listen.el

Audio/music player for Emacs
Emacs Lisp
2
star
77

elgantt

A Gantt Chart (Calendar) for Org Mode
Emacs Lisp
1
star
78

unsplash.hy

Hy
1
star
79

helm-swish

Like helm-swoop, but a little bit faster
Emacs Lisp
1
star
80

greek-hebrew-emacs

How to set up Emacs to easily type Greek and Hebrew
1
star
81

source-status-linker

Turns output of Source engine's status command into links to Steam user profiles
Python
1
star
82

github-solarized

A Solarized user stylesheet for GitHub made with Stylus
CSS
1
star
83

pentadactyl-tabmattach

JavaScript
1
star