From: Patrick Michael Niedzielski <patrickniedzielski@gmail.com>
To: emacs-devel@gnu.org
Subject: Wrong type error in dbus method
Date: Fri, 02 Jul 2010 02:23:51 +0000 [thread overview]
Message-ID: <4c2d4db9.df0ae50a.241a.0135@mx.google.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1187 bytes --]
Hi all,
I'm new here, but this is the last place I can find to look for help
regarding dbus and emacs specifics.
I am writing an elisp file to integrate GNU Emacs with Zeitgeist over
dbus. Because of the lack of good documentation on dbus in emacs and my
lack of experience with advanced elisp, I am coming up with the
following error in my method zeitgeist-send:
Wrong type argument: D-Bus, (zeitgeist-event-timestamp)
I have tried correcting the issue by placing :string before all the
arguments, but that gave me the error:
Wrong type argument: stringp, (zeitgeist-event-timestamp)
This makes no sense, as I am positive that the value of
(zeitgeist-event-timestamp) is a string.
If you need, the dbus documentation for zeitgeist is here:
http://zeitgeist-project.com/docs/0.4/dbus_api.html#index-0 The format
for it is asaasay.
I have attached the source code (it's a single file, a few functions).
Thanks for any help!
Patrick Niedzielski
--
Humm and Strumm <http://hummstrumm.blogspot.com/>, a Free Software 3D
adventure game for both Windows and *NIX.
freeSoftwareHacker(); <http://freesoftwarehacker.blogspot.com/>, a blog
about Free Software, music, and law.
[-- Attachment #2: zeitgeist.el --]
[-- Type: text/x-emacs-lisp, Size: 2328 bytes --]
(require 'dbus)
(defun zeitgeist-call (method &rest args)
"Call the zeitgeist method METHOD with ARGS over dbus"
(apply 'dbus-call-method
:session ; use the session (not system) bus
"org.gnome.zeitgeist.Engine" ; service name
"/org/gnome/zeitgeist/log/activity" ; path name
"org.gnome.zeitgeist.Log" ; interface name
method args))
(defun zeitgeist-event-timestamp ()
"Get the timestamp in zeitgeist format."
(let* ((now-time (current-time))
(hi (car now-time))
(lo (car (cdr now-time)))
(msecs (car (cdr (cdr now-time))))) ; This is *micro*seconds.
(number-to-string (+ (/ msecs 1000)
(* (+ lo (* hi 65536)) 1000))))) ; Convert system time to milliseconds.
(defun zeitgeist-event-interpretation (event)
"Get the Event Interpretation of EVENT."
(case event
('zeitgeist-open-event
"http://zeitgeist-project.com/ontologies/2010/01/27/zg#AccessEvent")
('zeitgeist-close-event
"http://zeitgeist-project.com/schema/1.0/core#CloseEvent")
('zeitgeist-create-event
"http://zeitgeist-project.com/schema/1.0/core#CreateEvent")
('zeitgeist-modify-event
"http://zeitgeist-project.com/schema/1.0/core#ModifyEvent")
(otherwise nil)))
(defun zeitgeist-send (event fileurl filemime)
"Send zeitgeist an event EVENT using the list FILEINFO."
(let ((event-interpretation (zeitgeist-event-interpretation event)))
(if (eq nil event-interpretation)
(message "YOU FAIL")
(zeitgeist-call "InsertEvents"
'(:string ""
:string (zeitgeist-event-timestamp)
:string event-interpretation
"http://zeitgeist-project.com/schema/1.0/core#UserActivity"
"app://emacs.desktop")
'((fileurl
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo/#Document"
"http://www.semanticdesktop.org/ontologies/nfo/#FileDataObject"
fileurl
filemime
(file-name-sans-versions fileurl)
"")) ; Some black magic later
'(:array)))))
(defun zeitgeist-open-file ()
"Tell zeitgeist we openned a file!"
(if (eq nil (buffer-file-name))
(message "You are not on a file.")
(zeitgeist-send 'zeitgeist-open-event buffer-file-name "text/plain")))
(zeitgeist-open-file)
next reply other threads:[~2010-07-02 2:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-02 2:23 Patrick Michael Niedzielski [this message]
2010-07-02 9:04 ` Wrong type error in dbus method Thien-Thi Nguyen
2010-07-03 8:59 ` Michael Albinus
2010-07-05 9:00 ` Thien-Thi Nguyen
2010-07-05 15:04 ` Drew Adams
2010-07-05 18:34 ` Michael Albinus
2010-07-05 19:03 ` Thien-Thi Nguyen
2010-07-05 19:35 ` Michael Albinus
2010-07-05 20:40 ` Chad Brown
2010-07-05 15:45 ` Patrick Michael Niedzielski
2010-07-05 18:40 ` Michael Albinus
2010-07-09 19:47 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4c2d4db9.df0ae50a.241a.0135@mx.google.com \
--to=patrickniedzielski@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.