emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org mode issue file
@ 2010-06-13 16:23 David Maus
  0 siblings, 0 replies; only message in thread
From: David Maus @ 2010-06-13 16:23 UTC (permalink / raw)
  To: org-mode


[-- Attachment #1.1.1: Type: text/plain, Size: 834 bytes --]

Hello all,

The Org mode issue file located at

http://orgmode.org/worg/org-issues.php

was just updated with a explanations about the nomenclature of
keywords and tags, how the recorded issues flow inside the file, and
some remarks on operating on this file collaboratively.

Most notably the issue file is supposed to supersede the old todo
file[1], thus it includes a section with the open development task of
the old todo file.

I've attached a copy of the introduction to the issue and a
preliminary version of a library to operate on the issue file from
withing Gnus and Wanderlust.  Please see the commentary section of
org-issue.el for the functions it provides.

Regards and happy hacking,

  -- David

[1] http://orgmode.org/todo.html
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.1.2: org-issue.el --]
[-- Type: application/octet-stream, Size: 8225 bytes --]

;;; org-issue.el --- Simple mailing list based issue tracker for Org mode
;;
;; Author: David Maus <dmaus [at] ictsoc.de>
;;
;; Copyright (C) 2010 by David Maus
;;
;; This file is NOT part of Gnu Emacs.
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
;;
;;; History:
;;
;; 2010-06-13  David Maus  <dmaus@ictsoc.de>
;;
;;   * org-issue.el: Initial revision.
;;
;;; Commentary:
;;
;; This file contains helper functions to maintain Org mode's issue
;; file from within Wanderlust and Gnus.
;;
;; Available functions:
;;
;; `org-issue-new': File a news issue for current message Create a new
;;                  TODO in `org-issue-issue-file' below the headline
;;                  "New Issues" with keyword NEW.  If customization
;;                  variable `org-issue-message-flag' is non-nil and
;;                  flagging messages is supported, the current issue
;;                  is flagged.
;;
;; `org-issue-close': Close issue of current message.
;;
;; `org-issue-tag'  : Tag issue of current message.
;;
;; `org-issue-update-message-flag' : Update message flag according to
;;                                   issue file.  If the issue for
;;                                   current message is closed or
;;                                   turned into a development task,
;;                                   the message flag is removed.
;;
;; `org-issue-link-gmane' : An Org mode web link pointing to current
;;                          message on gmane is pushed to killring and
;;                          clipboard.
;;

;;; Code:
(defcustom org-issue-issue-file "~/code/org-mode/Worg/org-issues.org"
  "Path to Org mode's issue file."
  :type 'file
  :group 'org-issue)

(defcustom org-issue-message-flag 'issue
  "Flag that indicates an issue.
Set this to nil if you do not want messages to be flagged.  The
flag is added in removed by the functions `org-issue-new',
`org-issue-close',  and `org-issue-update'."
  :type 'symbol
  :group 'org-issue)

(defun org-issue-replace-brackets (s)
  "Return S with all square brackets replace by parentheses."
  (while (string-match "\\[" s)
    (setq s (replace-match "(" nil nil s)))
  (while (string-match "\\]" s)
    (setq s (replace-match ")" nil nil s)))
  s)

(defun org-issue-get-msginfo ()
  "Return cons with message id in car and subject in cdr."
  (cond
   ((eq major-mode 'wl-summary-mode)
    (org-issue-get-msginfo:wl))
   ((memq major-mode '(gnus-summary-mode gnus-article-mode))
    (org-issue-get-msginfo:gnus))
   (t
    (error "Unsupported mailer mode: %s" major-mode))))

(defun org-issue-get-msginfo:gnus ()
  "Return cons with message id in car and subject in cdr.
Operates on Gnus messages."
  (let ((header (with-current-buffer gnus-summary-buffer
		  (gnus-summary-article-header))))
    (cons
     (url-hexify-string
      (org-remove-angle-brackets
       (mail-header-id header)))
     (org-issue-replace-brackets
      (mail-header-subject header)))))

(defun org-issue-get-msginfo:wl ()
  "Return cons with message id in car and subject in cdr.
Operates on Wanderlust messages."
  (let* ((num (wl-summary-message-number))
	 (ent (if (fboundp 'elmo-message-entity)
		  (elmo-message-entity
		   wl-summary-buffer-elmo-folder num)
		(elmo-msgdb-overview-get-entity
		 num (wl-summary-buffer-msgdb)))))
    (cons (url-hexify-string
	   (org-remove-angle-brackets
	    (org-wl-message-field 'message-id ent)))
	  (org-issue-replace-brackets
	   (org-wl-message-field 'subject ent)))))

(defun org-issue-exists-p (id)
  "Return non-nil, if an issue identified by ID exists."
  (let ((visiting (find-buffer-visiting org-issue-issue-file))
	e)
    (with-current-buffer (or visiting
			     (find-file-noselect org-issue-issue-file))
      (setq e (org-find-entry-with-id (format "mid:%s" id)))
      (unless visiting (kill-buffer)))
    e))

(defun org-issue-link-gmane (&optional msginfo)
  "Return web link to gmane for current message.
If called interactively, the link is also pushed to clipboard and
killring."
  (interactive)
  (let* ((msginfo (or msginfo (org-issue-get-msginfo)))
	 (gmane (format
		 "[[http://news.gmane.org/find-root.php?message_id=%s][%s]]"
		 (car msginfo) (cdr msginfo))))
    (if (called-interactively-p)
	(org-kill-new gmane)
      (when (fboundp 'x-set-selection)
	(ignore-errors (x-set-selection 'PRIMARY gmane))
	(ignore-errors (x-set-selection 'CLIPBOARD gmane))))
    gmane))

(defun org-issue-template-body (msginfo)
  "Return string with remember template body.
MSGINFO is a cons with message id in car and message subject in
cdr."
  (concat
   "* NEW " (cdr msginfo) "%!\n"
   "  %u\n"
   "  :PROPERTIES:\n"
   "  :ID: mid:" (car msginfo) "\n"
   "  :END:\n\n"
   "    - Gmane :: " (org-issue-link-gmane msginfo)))

(defun org-issue-new ()
  "File new issue for current message."
  (interactive)
  (let* ((msginfo (org-issue-get-msginfo))
	 (org-remember-templates
	  `(("Issue" ?i ,(org-issue-template-body msginfo)
	     ,org-issue-issue-file "New Issues" nil))))
    (if (org-issue-exists-p (car msginfo))
	(error "Already filed: %s" (cdr msginfo))
      (if org-issue-message-flag
	  (org-issue-flag-message org-issue-message-flag))
      (org-remember))))

(defun org-issue-flag-message (flag &optional remove)
  "Flag current message.
FLAG is the desired message flag.
If optional argument REMOVE is non-nil, remove the flag."
  (cond
   ((eq major-mode 'wl-summary-mode)
    (org-issue-flag-message:wl flag remove))
   (t
    (error "Unsupported mailer mode: %s" major-mode))))

(defun org-issue-flag-message:wl (flag remove)
  "Flag current Wanderlust message."
  (let* ((num (wl-summary-message-number))
	 (folder wl-summary-buffer-elmo-folder)
	 (flags (elmo-get-global-flags
		 (elmo-message-flags folder num))))
    (elmo-message-set-global-flags
     folder num (if remove (delq flag flags)
		  (if (memq flag flags) flags (cons flag flags))))))

(defun org-issue-tag ()
  "Tag issue of current message."
  (interactive)
  (let ((msginfo (org-issue-get-msginfo))
	(visiting (find-buffer-visiting org-issue-issue-file)))
    (unless (org-issue-exists-p (car msginfo))
      (error "No such issue: %s" (cdr msginfo)))
    (with-current-buffer (or visiting
			     (find-file-noselect org-issue-issue-file))
      (save-excursion
	(goto-char (org-find-entry-with-id (format "mid:%s" (car msginfo))))
	(org-set-tags-command))
      (unless visiting (kill-buffer)))))

(defun org-issue-close ()
  "Close issue of current message."
  (interactive)
  (let ((msginfo (org-issue-get-msginfo))
	(visiting (find-buffer-visiting org-issue-issue-file)))
    (unless (org-issue-exists-p (car msginfo))
      (error "No such issue: %s" (cdr msginfo)))
    (with-current-buffer (or visiting
			     (find-file-noselect org-issue-issue-file))
      (save-excursion
	(goto-char (org-find-entry-with-id (format "mid:%s" (car msginfo))))
	(org-todo 'done))
      (unless visiting (kill-buffer)))
    (org-issue-flag-message t)))

(defun org-issue-update-message-flag ()
  "Update message flag according to issue file."
  (interactive)
  (let ((msginfo (org-issue-get-msginfo))
	(visiting (find-buffer-visiting org-issue-issue-file))
	state)
    (unless (org-issue-exists-p (car msginfo))
      (error "No such issue: %s" (cdr msginfo)))
    (with-current-buffer (or visiting
			     (find-file-noselect org-issue-issue-file))
      (save-excursion
	(goto-char (org-find-entry-with-id (format "mid:%s" (car msginfo))))
	(setq state (string= (org-entry-get nil "TODO") "NEW")))
      (unless visiting (kill-buffer)))
    (org-issue-flag-message (not state))))

(provide 'org-issue)

;;; org-issue.el ends here

[-- Attachment #1.1.3: org-issue-introduction.txt --]
[-- Type: text/plain, Size: 4787 bytes --]

                      Open issues with Org mode
                      =========================

Date: 2010-06-13 18:21:25 CEST


Table of Contents
=================
Introduction 
    Nomenclature 
    Document structure and maintenance 
    Using this file 


Introduction 
~~~~~~~~~~~~~

This is a simple mailing list based tracker for issues and other
things about Org mode.  It is a replacement of the abandoned todo file
and incorporates it's structure and parts of the nomenclature.  The
purpose of this document is to keep track of issues, i.e. anything
that requires some kind of actions, and other things like
announcements, hacks, feature ideas and the like.

Nomenclature 
=============

On this page, TODO keywords are used in the following way:

     *Keyword*         Intention                                                                                                                                      
    -----------------+-----------------------------------------------------------------------------------------------------------------------------------------------
     *NEW*             A new issue that is not yet classifed.                                                                                                         
     *TODO*            A task to be done.  This includes but is not limited to answers to user requests, development or documentation tasks.                          
     *ASSIGNED*        Someone started to take care of this task.  A property *ASSIGNEE* should provide a hint on who it is.                                          
     *IDEA*            A new idea, I have not yet decided what if anything I will do about it.                                                                        
     *WISH*            A wish, probably voiced by someone on  emacs-orgmode@gnu.org.  This is less than a new idea, more a change in existing behavior.               
     *DECLINED*        A feature or idea that was declined. Still in the list so that people can see it, complain, or still try to convince Carsten to implement it.  
     *INCONSISTENCY*   Some behavior in Org-mode that is not as clean and consistent as it should be.                                                                 
     *BUG*             This needs to be fixed, as soon as possible.                                                                                                   
     *DONE*            Well, done is done.                                                                                                                            

In addition, tags are used to provide more detailed context
information.  Currently these tags are used in this file:

     *Tag*     Context                                                
    ---------+-------------------------------------------------------
     *Babel*   Issue concerning the library of [Babel]                  
     *Mobil*   Issue concerning [MobileOrg]                             
     *Patch*   A patch is available via Org mode's [Patchwork tracker]  


     [Babel]: http://orgmode.org/worg/org-contrib/babel/index.php
     [MobileOrg]: http://mobileorg.ncogni.to/
     [Patchwork tracker]: http://patchwork.newartisans.com/project/org-mode/list/

Document structure and maintenance 
===================================

New issues hitting the Org mode [mailing list] are recorded on a
(almost) daily basis using a yet to be published library that allows
operating on the issue file from within Wanderlust and (partly) Gnus.

They are first filed to the heading *New Issues*.

In a second step issues beneath this heading are reviewed.  If an
issue triggers a development task it is properly classified (keywords,
tag) and refiled to heading *Development Task*.  If it is already
closed according to the mailing list, it is immediately closed and
moved to *Closed issues*.  If it cannot yet be classified or closed,
it stays where it is.


[mailing list]: http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Using this file 
================

This file is hosted and published on [Worg].  So you can either read the
file via your browser or check out Worg's git repository.

Everyone is encouraged to use this file to facilitate collaboration in
solving issue and extending Org mode.  Thus, you can operate on the
entries as you wish, as long as the ID property is kept intact.

Operating on this file includes, but is not limited to, classifying
new issues, doing research on an outstanding task, or grouping related
issues into a development task.  If you start to take care of an open
issue or task, please put a token in a headline property called
"ASSIGNEE", so others can see that you started to take care of this
issue.

[Worg]: http://orgmode.org/worg/


[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-13 16:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-13 16:23 Org mode issue file David Maus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).