diff options
author | Tassilo Horn <tassilo@member.fsf.org> | 2011-05-04 01:39:04 +0530 |
---|---|---|
committer | Manish Sinha <manishsinha@ubuntu.com> | 2011-05-04 01:39:04 +0530 |
commit | a25eef09bd1f471b981713b161a20b4269c01bb7 (patch) | |
tree | ff4747ad8de68ddf5c4d9d0b02c9d607951d6476 /emacs | |
parent | 3b381fe9f0fb0ea9bf5d58adba4fbb4133178618 (diff) |
Fixed the emacs dataprovider which the dbus call was done before saving the file and when the dbus call fails, save was affected
Diffstat (limited to 'emacs')
-rwxr-xr-x | emacs/zeitgeist.el | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/emacs/zeitgeist.el b/emacs/zeitgeist.el index 602b31b..d77f813 100755 --- a/emacs/zeitgeist.el +++ b/emacs/zeitgeist.el @@ -1,5 +1,6 @@ ;;; The Zeitgeist Emacs Script -- integrates Emacs with Zeitgeist. ;;; Copyright (C) 2010, Patrick M. Niedzielski <PatrickNiedzielski@gmail.com> +;;; Copyright (C) 2011, tsdh <tassilo@member.fsf.org> ;;; ;;; This program is free software: you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by @@ -119,20 +120,23 @@ (let ((event-interpretation (zeitgeist-event-interpretation event))) (if (eq nil event-interpretation) (message "YOU FAIL") - (zeitgeist-call "InsertEvents" - (list (list :struct (list "" - (zeitgeist-event-timestamp) - event-interpretation - "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#UserActivity" - "application://emacs23.desktop") - (list (list (concat "file://" fileurl) - "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document" - "http://www.semanticdesktop.org/ontologies/nfo#FileDataObject" - (concat "file://" (file-name-directory fileurl)) - filemime - (file-name-nondirectory (file-name-sans-versions fileurl)) - "")) ; Some black magic later? - '(:array :byte 0))))))) + (condition-case err + (zeitgeist-call + "InsertEvents" + (list (list :struct (list "" + (zeitgeist-event-timestamp) + event-interpretation + "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#UserActivity" + "application://emacs23.desktop") + (list (list (concat "file://" fileurl) + "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document" + "http://www.semanticdesktop.org/ontologies/nfo#FileDataObject" + (concat "file://" (file-name-directory fileurl)) + filemime + (file-name-nondirectory (file-name-sans-versions fileurl)) + "")) ; Some black magic later? + '(:array :byte 0)))) + (error (message "ERROR (ZEITGEIST): %s" (cadr err))))))) (defun zeitgeist-open-file () "Tell zeitgeist we opened a file!" |