Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Is there a way to integrate Trac and Emacs? e.g. edit Wiki pages in org mode, edit and manage tickets from within emacs?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

There is a Trac Wiki page editing mode for Emacs. It is supposed to ease editing Trac Wiki pages but also help with diffing, merging, highlighting and completion.

It is also mentioned at the EmacsWiki and in a blog post.

share|improve this answer

Personally for ticket management I use a dirty script in org-babel-python that would retrieve the list of tickets inline, into my org page:

#+begin_src python :results output
base_url = "http://your.trac.site.url"
ticket_list_url = "http://your.trac.site/query?..."
headers = {"Cookie": "trac_form_token=token-from-browser-session; trac_auth=your-auth-from-browser-session"}

import requests
tasks_html = requests.get(ticket_list_url, headers=headers)

from HTMLParser import HTMLParser

class MyHtmlParser(HTMLParser):
  in_link = False
  link_href = None

  def handle_starttag(self, tag, attrs):
    attrs = dict(attrs)
    if tag == "a" and attrs["href"].startswith("/ticket"):
      self.in_link = True
      self.link_href = attrs["href"]
    else:
      self.in_link = False

  def handle_data(self, data):
    data = data.strip()
    if self.in_link and data and not data.startswith("#"):
      ticket_num = self.link_href[8:]
      print "*** #" + ticket_num + " [[" + base_url + self.link_href + "][" + data + "]]"

MyHtmlParser().feed(tasks_html.text)

#+end_src

The script requires pip install requests plus org-babel with python enabled. Plus you need to set your *_url & set auth headers from your browser session.

Org-babel scripts can be run with C-c C-c

Just in case someone needs a dirty solution for listing tickets from trac in an org page..

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.