Questions tagged [defstruct]
7 questions
3
votes
1 answer
with-slots with defstruct "class" instance
Is it possible to use a with-slots-type macro with an instance of a defstruct-defined class in emacs lisp? I tried and I'm getting this error:
eieio-oset: Wrong type argument: eieio-object, "some-string", obj.
Sample code:
(progn
(defstruct…

erjoalgo
- 853
- 1
- 5
- 18
2
votes
1 answer
What does hash s indicate in lisp
This is the result of
M-: (elfeed-search-selected :ignore-region)
#s(elfeed-entry
("www.cbc.com.com" . "https://www.cbc.com.com/defg/Polyglot-programming_%7E017e364530a5359046?source=rss")
"Polyglot programming - Abc"
…

american-ninja-warrior
- 3,773
- 2
- 21
- 40
1
vote
1 answer
How to override read-only slot of cl-defstruct?
I'm dealing with a third-party package that uses Structures - cl-defstructs.
One of the slots is :read-only t. I need to override that. I need to find a way to change the value in that slot and then pass the structure to a function, essentially…

iLemming
- 1,223
- 9
- 14
1
vote
1 answer
How to create a structure instance out of a -pkg.el file?
Package foo description is stored inside a file foo-VERSION/foo-pkg.el with a cl-defstruct definition that complies to package.el package-desc structure type with a package-desc-from-define constructor. Something like this (for the package…

PRouleau
- 744
- 3
- 10
1
vote
1 answer
emacs lisp error : Need a pre-parsed url
I'm trying to use tern with the latest version of emacs (27 : master branch) and I'm getting the following error :
Request failed: ((wrong-type-argument Need a pre-parsed URL.
[cl-struct-url http nil nil 127.0.0.1 39585 / nil nil nil nil t]…

boehm_s
- 183
- 2
- 7
0
votes
0 answers
How can I output the contents of a defstruct?
I sometimes find it useful to be able to take a struct object and see its slots and values. But if I evaluate a struct object I only see its values, not the names of the slots. E.g. if I have a struct like:
(cl-defstruct apple type color…

Alan
- 3
- 3
0
votes
1 answer
Accessing nested array elements from a class object
I am trying to access elements within the array generated by defstruct. More specifically, I would like to access the NOTER_DOCUMENT file path from org-noter's org-noter--session variable. The only way I managed to find was by indices with aref like…

Sati
- 775
- 6
- 21