MTorus provides functionality for switching buffers quickly and general navigation issues within emacs.

MTorus is not working with recent versions of GNU Emacs. Help in getting it working again would be most welcome!

Let me express this as a mathematician ;)

So, now you know it, ‘ight? ;)

‘kay for those who do not:

Q: Is this nearly a depiction of your model?

Thus now you have 2 dimensional navigation:

The project page is at SourceForge now.


All text hereafter only refers to the current, advanced version.

You mean the 2004 version, right? --CH
yes, Sebastian wrote most of this page. I still use my own version and I don’t know whether Sebastian is still using his or working on it – StefanKamphausen

Obtaining MTorus

MTorus is available via

Note that repository contains a very alpha version of mtorus. Both StefanKamphausen and me (SebastianFreundt) have very little spare time to fiddle around with it.

How to get started

    (require 'mtorus)

in your .emacs Now you have a useless element on your torus called mtorus-universe.

    M-x mtorus-create-ring RET

Enter some appropriate name for that ring. Go to a buffer which should be part of the ring created and enter

    M-x mtorus-create-element RET

When asked for a type just enter buffer or marker. These are the only types predefined by default.


To treat your command history with care, bind these commands to some keys.


Suggested Keybindings:

MTorus does look like another useful library/Thanks. So. What version of Emacs and OS are you using? On Emacs-21.3, Win98 I get errors/fixes like this after adding mtorus to load-path and requiring ‘mtorus.

Fixed now, I hope. 😊 – SebastianFreundt

Saving/Loading MTorus State

When I dump a torus to disk, it is dumped with the names of the buffers in the torus, not the names of the files that the buffers are linked to, or whatnot. What I’m wondering is, has anyone written any modifications to MTorus to support a “file” type? As it is, MTorus only references buffers/marks/rings and I have to load all the files before I can reference them in MTorus, which kind of defeats the purpose of saving a torus to disk… anyone have any suggestions?

Currently I (SebastianFreundt) use following snippet to read in a bunch of files from a directory:

    (defun mtorus-elcoll-create-directory-ring (directory file-name-regexp)
       "DDirectory: \nsMatch files: ")
      (let ((dir-elem
                :type 'ring
                :name (mtorus-utils-replace-regexp-in-string
                      ".+/\\(.+?\\)/?" "\\1" directory)
                :value directory
                :description "Directory ring"))))
        (setq mtorus-current-ring dir-elem)
        (mapc #'(lambda (file)
                  (let* ((buf
                          (or (get-file-buffer file)
                              (find-file file))))
                       :type 'buffer
                       :name (file-name-nondirectory file)
                       :value buf
                       :description "Directory file buffer."))))
            (directory-files directory t file-name-regexp nil t))))

This will soon show up in CVS HEAD as mtorus-element-collection.el (or something similar). On the other I have to notice that this is not yet GNUmacs compatible since it uses ‘directory-files’ so adapt it to your needs.

Actually this snippet should demonstrate how to create rings and ring elements non-interactively. – SebastianFreundt