Linking to Trac tickets in email

Since I do a lot of referring to Trac ticket numbers in email messages, most visibly on the xmlroff-list mailing list, I wrote an Emacs function that finds the Trac ticket references in the current buffer and inserts a sorted list of the ticket references and their URLs at the end of the buffer.

The code (if WordPress hasn’t done too much damage to it) is:

(defvar trac-base "http://xmlroff.org"
  "Base to use when inserting links to trac tickets in email.")

(defun trac-base-xmlroff ()
  (interactive)
  (setq trac-base "http://xmlroff.org")
  (message trac-base))

(defun insert-trac-links ()
  "Insert links for Trac links."
  (interactive)
  (let ((ticket-alist)
         (changeset-alist '()))
    (goto-char (point-min))
    (while
        (re-search-forward
         "#([0-9]+)" nil t)
      (setq ticket-alist
              (add-to-list 'ticket-alist
 		 (string-to-number
 		  (buffer-substring-no-properties
 		   (match-beginning 1)
 		   (match-end 1))))))
    (goto-char (point-max))
    (insert "\\n")
    (dolist (ticket (sort ticket-alist '<))
      (insert (format
        "#%s %s/ticket/%s\\n"
        ticket trac-base ticket)))))

I have a separate `trac-base-xxx' function for setting `trac-base' for each Trac that I regularly use, and I use GNUS customizations to call the appropriate `trac-base-xxx' function when I enter specific email folders.

Emacs at 100% CPU usage with Semantic

Another computer, another instance of the Emacs 22 snapshot heading towards 100% CPU usage when Semantic is active.

The solution I tried before makes the Synaptic package manager complain about the Semantic version whenever I install any package. This time, I followed advice from the Emacs wiki and applied a patch to semantic-idle.el in place, byte-compiled the file, and moved the new .elc file over the existing .elc file (in a different directory).

It’s working fine, and Synaptic isn’t complaining.

First xslide update in years

I recently checked into CVS the addition of a sub-menu for locating xsl:function elements. It is, as the title notes, the first update of the xslide XSL mode for Emacs in literally years.

xslide itself may be a dead end since its based on neither nXML nor Semantic, so it doesn’t quite work the same as the other modes that people use (nor does it matter that it predates nXML). I still use xslide (which is why I updated it), and I even copied it to make an Emacs mode for Ant build files, but it would be more useful if it could indicate when the XSLT stylesheet is not well-formed. Then again, perhaps that problem could be solved with Flymake mode and an XML parser.

tdtd available from svn.menteith.com

The source code for the tdtd Emacs code for DTDs is now available for checkout from https://svn.menteith.com/trunk/tdtd and for browsing from http://www.menteith.com/browser/trunk/tdtd.

I didn’t think it would happen straight after setting up the Trac, but I’d wanted to use tdtd on a new (virtual) PC, and it was preferable to put the code into the repository and check it out onto the new PC than to scp a copy onto the new PC and risk the copy becoming out of sync w.r.t. the other copies floating around on my computers. Of course, now those other copies have to be updated to use the Subversion version instead of either the RCS or the Ubuntu versions.

The website and repository for tdtd are provided by Menteith Consulting Ltd.

Firemacs

I installed the Firemacs Firefox add-on for making Firefox respond to Emacs shortcuts, but I ended up removing it: it seems that I’ve spent so long down-translating my fingers on non-Emacs applications like Firefox that it’s easier to continue that way than to change to using the keyboard properly (or “like god intended” as Norman Walsh put it at http://norman.walsh.name/2006/11/08/firefox20). Mind you, I’ll probably enable it again after the next time that I use C-n in a text box in the browser.

ECB, Semantic, and Emacs 22

When I started using ECB (http://ecb.sf.net) with the Ubuntu Emacs 22 snapshot (both X and GTK variants), the CPU usage soon shot up to 100% and stayed there.

The solution, posted at http://sourceforge.net/mailarchive/forum.php?thread_id=30578186&forum_id=1620, was to update the installed version of semantic-idle.el because of how Emacs 22 uses timers.

Unfortunately, I couldn’t find an easy way to persuade Emacs to load a version of CEDET built from CVS instead of from the Ubuntu Debian packages.

RSS for this blog via GNUS

Quoting the fifth comment in http://www.lshift.net/blog/2005/07/15/rss-via-gnus:

I finally got it to work! The trick is to set mm-url-use-external to t so that emacs uses an external program, by default wget, to fetch the feed, rather than its built-in http support.

I couldn’t have put it better myself (except perhaps to emphasise finally), and without that comment I would still be floundering. Thank you, Matthias.