Add to GNOME’s recently used files list

 

Add to GNOME’s recently used files list

http://zerotau.blogspot.com/2006/05/recent-documents-emacs-and-gnome.html describes how to add files opened in Emacs to GNOME’s recently used document list. Unfortunately the python script supplied an that page doesn’t work anymore with recent versions of GNOME.

As I didn’t find a better way I made my own version using PyGtk.

Download ref:addtorecent and put it in your $PATH, and add this to your .emacs file:

(defun fd-add-file-to-recent ()
  (when buffer-file-name
    (start-process "addtorecent" nil "addtorecent"
                   (concat "file://" buffer-file-name)
                   "text/plain"
                   "Emacs"
                   "emacsclient %F")))

(add-hook 'find-file-hook 'fd-add-file-to-recent)
downloads:
dir:

Make sure you have selected Emacs to open text/plain files in GNOME as GNOME doesn’t seem to use the given command.