changelog shortlog graph tags branches changeset files file revisions raw help

Mercurial > core / annotate emacs/lib/scrum.el

changeset 698: 96958d3eb5b0
parent: af486e0a40c9
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 04 Oct 2024 22:04:59 -0400
permissions: -rw-r--r--
description: fixes
606
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
1
 ;;; scrum.el --- Scrum-like Planning and Roadmaps in Org  -*- lexical-binding: t; -*-
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
2
 
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
3
 ;; Copyright (C) 2024  Richard Westhaver
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
4
 
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
5
 ;; Author: Richard Westhaver <richard.westhaver@gmail.com>
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
6
 ;; Keywords: maint
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
7
 
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
8
 ;; This program is free software; you can redistribute it and/or modify
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
9
 ;; it under the terms of the GNU General Public License as published by
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
10
 ;; the Free Software Foundation, either version 3 of the License, or
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
11
 ;; (at your option) any later version.
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
12
 
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
13
 ;; This program is distributed in the hope that it will be useful,
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
14
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
15
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
16
 ;; GNU General Public License for more details.
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
17
 
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
18
 ;; You should have received a copy of the GNU General Public License
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
19
 ;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
20
 
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
21
 ;;; Commentary:
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
22
 
619
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
23
 ;; The point of this package is to enable an Emacs-native scrum
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
24
 ;; workflow. Many years ago I used to use the org-jira package and
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
25
 ;; mirror an external scrum/agile system (Jira).
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
26
 
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
27
 ;; Mind you, I wouldn't dare take a shot at Jira. As far as Products
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
28
 ;; go, when you need to work with hundreds of humans on software and
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
29
 ;; are given a short list you must choose from, it's often the best of
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
30
 ;; the worst.
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
31
 
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
32
 ;; The problem is however, that we don't need Products. What we need,
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
33
 ;; is a plan. How we achieve that end should be via the best and most
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
34
 ;; powerful tools possible.
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
35
 
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
36
 ;; In my opinion, Emacs Org Mode is the most powerful tool
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
37
 ;; available. It is not quite the best tool for the job, but this
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
38
 ;; isn't a problem because it is not a Product. We are given the
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
39
 ;; opportunity to make it the best tool possible, in the only way
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
40
 ;; possible - by doing it ourselves.
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
41
 
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
42
 ;; And yes, the aura of NIH syndrome may be strong here. Most of the
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
43
 ;; time you need to work with lots of folks who don't have the need or
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
44
 ;; patience to learn Org-mode. This package isn't for them. It's for
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
45
 ;; small groups of like-minded Lispers :).
35a579313b80 init ini and vc work
Richard Westhaver <ellis@rwest.io>
parents: 606
diff changeset
46
 
651
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
47
 ;;;; Refs
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
48
 ;; scrum: https://www.scrum.org/resources/what-scrum-module
606
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
49
 
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
50
 ;; roadmap: https://compiler.company/plan/roadmap.html
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
51
 
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
52
 ;; tasks: https://compiler.company/plan/tasks
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
53
 
651
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
54
 ;;;; API
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
55
 
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
56
 ;; The API is still very much a WIP. Assume everything below to be
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
57
 ;; theoretical.
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
58
 
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
59
 ;; - task dependencies
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
60
 ;;   - refer to org-depend.el for implementation details
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
61
 ;;   - org-trigger-hook and org-blocker-hook
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
62
 ;;   - org-todo-state-tags-triggers
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
63
 
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
64
 ;; - dynamic blocks
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
65
 ;;   - scrumboard
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
66
 ;;   - burndown
af486e0a40c9 multi-binaries, working on removing x.lisp
Richard Westhaver <ellis@rwest.io>
parents: 642
diff changeset
67
 
606
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
68
 ;;; Code:
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
69
 (require 'ulang)
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
70
 (require 'uml-mode)
623
a304c9713a51 init graph.el
Richard Westhaver <ellis@rwest.io>
parents: 619
diff changeset
71
 
a304c9713a51 init graph.el
Richard Westhaver <ellis@rwest.io>
parents: 619
diff changeset
72
 (defgroup scrum nil
a304c9713a51 init graph.el
Richard Westhaver <ellis@rwest.io>
parents: 619
diff changeset
73
   "CC Scrum Framework.")
a304c9713a51 init graph.el
Richard Westhaver <ellis@rwest.io>
parents: 619
diff changeset
74
 
632
bbd9024f2fe2 lib/rt upgrades and refactoring
Richard Westhaver <ellis@rwest.io>
parents: 623
diff changeset
75
 (defvar scrum-properties '("SPRINT" "EPIC" "RELEASE" "TASKID" "PROJECT" "COMMIT" "GOAL"))
bbd9024f2fe2 lib/rt upgrades and refactoring
Richard Westhaver <ellis@rwest.io>
parents: 623
diff changeset
76
 
bbd9024f2fe2 lib/rt upgrades and refactoring
Richard Westhaver <ellis@rwest.io>
parents: 623
diff changeset
77
 (defvar scrum-tags '("demo" "mvp" "release" "major-release" "ua" "qa"))
606
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
78
 
638
6c0e4a44c082 dblocks
Richard Westhaver <ellis@rwest.io>
parents: 632
diff changeset
79
 (defun org-dblock-write:scrumboard ()
6c0e4a44c082 dblocks
Richard Westhaver <ellis@rwest.io>
parents: 632
diff changeset
80
   "Generate a 'scrumboard'.")
6c0e4a44c082 dblocks
Richard Westhaver <ellis@rwest.io>
parents: 632
diff changeset
81
 
6c0e4a44c082 dblocks
Richard Westhaver <ellis@rwest.io>
parents: 632
diff changeset
82
 ;; TODO 2024-09-06: eplot
6c0e4a44c082 dblocks
Richard Westhaver <ellis@rwest.io>
parents: 632
diff changeset
83
 (defun org-dblock-write:burndown ()
6c0e4a44c082 dblocks
Richard Westhaver <ellis@rwest.io>
parents: 632
diff changeset
84
   "Generate a 'burndown' chart in the current buffer.")
6c0e4a44c082 dblocks
Richard Westhaver <ellis@rwest.io>
parents: 632
diff changeset
85
 
642
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
86
 ;;; Projects
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
87
 ;; defining 'project' machinery here because we don't have a better
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
88
 ;; place to put it. These functions are intended to map projects
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
89
 ;; from 'skel' and 'project.el' into our task-based org system.
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
90
 
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
91
 ;; Projects can contain many subprojects, which are identified by org
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
92
 ;; headings with a 'PROJECT' todo keyword. Projects and sub-projects
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
93
 ;; all have a 'VERSION' property assigned which can't be
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
94
 ;; inherited. The 'PROJECT' property itself can be inherited.
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
95
 
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
96
 ;; project-info
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
97
 (defcustom org-project-info-order '(details status tasks churn log files)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
98
   "Order in which sections of the 'project-info' dblock will appear."
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
99
   :type 'list
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
100
   :group 'scrum)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
101
 
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
102
 (defun org-dblock-write:project-info (params)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
103
   "Generate a project-info section.
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
104
 
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
105
 The following keyword parameters can be passed to the info dynamic block:
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
106
 
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
107
 :location Set or override the project location which is inferred by
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
108
           checking for a LOCATION property in the current tree, followed
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
109
           by the value of the `project-current' function.
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
110
 
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
111
 :branch Set or override the project branch to display info for. Default
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
112
         branch name is 'default'.
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
113
 
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
114
 :files When nil don't include the files table.
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
115
 :churn When nil don't include the vc churn report.
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
116
 :log when nil don't include the vc log.
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
117
 :status when nil don't include vc status.
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
118
 :details When nil don't include the project details section."
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
119
   (let ((location (or (when-let ((param (plist-get params :location)))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
120
                         (cl-coerce param 'string))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
121
                       (org-entry-get (point) "LOCATION")
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
122
                       (when-let ((kw (org-collect-keywords '("LOCATION"))))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
123
                         (cadar kw))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
124
                       (project-root (project-current))))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
125
         (point (point))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
126
         (files (if-let ((val (plist-member params :files)))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
127
                    (cadr val)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
128
                  t))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
129
         (churn (if-let ((val (plist-member params :churn)))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
130
                    (cadr val)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
131
                  t))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
132
         (status (if-let ((val (plist-member params :log)))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
133
                     (cadr val)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
134
                   t))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
135
         (log (if-let ((val (plist-member params :status)))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
136
                  (cadr val)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
137
                t))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
138
         (tasks (if-let ((val (plist-member params :tasks)))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
139
                    (cadr val)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
140
                  t))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
141
         (details (if-let ((val (plist-member params :details)))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
142
                      (cadr val)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
143
                    t)))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
144
     (message "Generating info for project: %s" location)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
145
     (let* ((project (project-current nil location))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
146
            (project-name (project-name project))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
147
            (project-root (project-root project)))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
148
       (dolist (i org-project-info-order)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
149
         (pcase i
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
150
           ('details (when details
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
151
                       (message "building project details...")
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
152
                       (insert "#+CALL: project-details() :dir " project-root "\n")
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
153
                       (org-babel-execute-maybe)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
154
                       (org-table-align)))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
155
           ('status (when status
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
156
                      (message "building project status...")
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
157
                      (insert "#+CALL: hg-status() :dir " project-root "\n")))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
158
           ('tasks (when tasks
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
159
                     (message "building project tasks...")
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
160
                     (insert "#+CALL: project-tasks() :dir " project-root "\n")))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
161
           ('churn (when churn
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
162
                     (message "building project vc churn...")
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
163
                     (insert "#+CALL: hg-churn() :dir " project-root "\n")))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
164
           ('log (when log
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
165
                   (message "building project vc log...")))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
166
           ('files (when files
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
167
                     (message "building project file table...")
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
168
                     (insert "#+CALL: project-files() :dir " project-root "\n")))))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
169
       (org-babel-execute-region point (point)))))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
170
 
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
171
 (defun org-project-info ()
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
172
   "Insert or update a project-info dblock."
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
173
   (interactive)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
174
   (if (re-search-forward (rx bol "#+BEGIN:" (+ space) "project-info") nil t)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
175
       (progn
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
176
         (if (fboundp 'org-fold-show-entry)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
177
             (org-fold-show-entry)
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
178
           (with-no-warnings (org-show-entry)))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
179
         (beginning-of-line))        
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
180
     (org-create-dblock (list :name "project-info")))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
181
   (org-update-dblock))
f58f3b88c49e move project-info to scrum
Richard Westhaver <ellis@rwest.io>
parents: 638
diff changeset
182
 
606
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
183
 (provide 'scrum)
6fc04c4d465c emacs and rocksdb upgrades
Richard Westhaver <ellis@rwest.io>
parents:
diff changeset
184
 ;;; scrum.el ends here