gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Recent documents: Emacs and GNOME integration


From: Piotr Zielinski
Subject: Recent documents: Emacs and GNOME integration
Date: 11 May 2006 18:20:44 -0700
User-agent: G2/0.2

I'm not sure whether this has been already done, but here's a short
piece of elisp that adds every file open in emacs to the system-wide
list of recently used files. It will work for systems using Recent File
Storage Specification [1], such as GNOME [2]. Hopefully, GNOME Deskbar
Applet [3] will soon be able to use that list, giving you something
close to a system-wide equivalent of the excellent iswitchb mode [4].

(defun local-add-file-to-recent ()
  (when buffer-file-name
    (start-process "addtorecent.py" nil "addtorecent.py"
                           (concat "file://" buffer-file-name)
"text/plain")))

(add-hook 'find-file-hook 'local-add-file-to-recent)

The code uses my python script "addtorecent.py" [5,6] that adds a given
URI to the XML file "~/.recently-used".  (I couldn't find any
command-line tool that does this, tell me if you know of something.)
Is there an Emacs package for xml manipulation (adding new nodes,
etc.)?

Recently-used.el [7] works in the opposite direction: it makes the
system-wide list of recently used files available to Emacs.

Piotr

[1] http://www.freedesktop.org/wiki/Standards_2frecent_2dfile_2dspec
[2] http://www.gnome.org/
[3] http://raphael.slinckx.net/deskbar/
[4] http://www.emacswiki.org/cgi-bin/wiki/IswitchBuffers
[5] http://www.cl.cam.ac.uk/~pz215/files/addtorecent.py
[6]
http://zerotau.blogspot.com/2006/05/recent-documents-emacs-and-gnome.html
[7]
http://groups.google.co.uk/group/gnu.emacs.sources/browse_thread/thread/bdbcb675fbaf0f58/cbf56d13e10fb56b



reply via email to

[Prev in Thread] Current Thread [Next in Thread]