Property lists in elisp

I know a little elisp, and I'm trying to figure out how to call a function that takes a list of properties as one of its arguments. The specific rudel-join-session function from the Rudel package; I am trying to configure it so that Rudel will automatically join the session when Emacs starts. I'm not sure how property lists work, so I tried to do this:

 (rudel-join-session (list :backend 'obby :host "foo" :port 6522 :username "username" :color "blue" :global-password "" :user-password "" )) 

I get an error message:

Invalid type argument: listp, obby

I assume this is a misuse of property lists. Any idea what the correct syntax is?

+4
source share
2 answers

No, this is the correct list of properties. I noticed this snippet in rudel.el file:

 (let* ((backend (cdr (plist-get info :backend))) 

This means that the :backend parameter must be a cons cell. All the documentation that I can find suggests that rudel-join-session is invoked interactively, in which case the program code is created programmatically, and I cannot understand how difficult it is to comment out the code, what it should have been. But the first thing I will try is the following:

 (rudel-join-session (list :backend '(dummy . obby) ...)) 

Thus, the expression (cdr (plist-get info :backend)) will be evaluated by the obby , which may be what the rest of the code expects.

+6
source

Alternatively, you can view the contents of rudel-session-initiation.el .

This file contains the rudel-configured-sessions variable rudel-configured-sessions for more information, there is a documentation line that explains in more detail "session information property lists".

In the same file, there is rudel-session-initiation-adjust-info , which resolves backend links in plists, replacing them with actual backend objects. This function replaces the backend name of type obby or obby with the cons-cell of the form ('obby . #<backend object>) . Internally, it uses rudel-backend-get , as you suspected.

+1
source

All Articles