Skip to main content

Questions tagged [property-lists]

Filter by
Sorted by
Tagged with
3 votes
2 answers
405 views

Plist is Better than Alist?

Alist and plist are very similar structures -- an alist with suitable functions can implement major features that plist provides: read/modify an existing key-value pair; write a new pair. If you’re ...
shynur's user avatar
  • 5,785
0 votes
1 answer
42 views

return full list of which element is a member

i know that member returns non-nil if the element is found in the list, but it only returns the tail of the list from element onwards. is there a way to return the full list it is a member of? my case:...
martian's user avatar
  • 598
0 votes
1 answer
196 views

How to know (in Elisp) what buffer was current when a command is invoked?

I want to give an arbitrary command some buffer-local behavior without advising it. (I can do it by advising, but I want to also be able to do it without advising.) E.g., just looking at some ...
Drew's user avatar
  • 78.5k
2 votes
1 answer
368 views

How can I get the effect of buffer-local symbol plist property values?

Does Emacs have a way to set buffer-local properties on symbols? It's well-known that there are buffer-local variables. But a property belongs to a symbol, not to a variable. Hence, if I have ...
Lassi's user avatar
  • 387
2 votes
1 answer
344 views

Convert an org table into a tree

I have an org table and I will like to convert in into a tree. So, from: | 1 | 2 | 3 | |---+---+---| | a | b | c | | l | m | n | I will like to go to: * a :PROPERTIES: :2: b :3: ...
deshmukh's user avatar
  • 1,912
7 votes
3 answers
358 views

Equivalent of let-alist for plists?

I'm curious if there's an equivalent for let-alist for plists. Namely, a macro for accessing plists in the manner that alists may be accessed as: (let-alist alist (if (and .title .body) ....
ebpa's user avatar
  • 7,559
2 votes
1 answer
668 views

How to add CSS support for the html-export in org mode for the properties drawer?

My org version is 9.1.14. Background info: I am trying to export my notes in org-mode to html. I would like to have my notes tagged with Category and Tags. I want to apply some CSS beautification ...
ticktock's user avatar
  • 189
3 votes
2 answers
1k views

How to modify multiple keys in a plist

I know I can do something like this: (setq org-format-latex-options (plist-put org-format-latex-options :scale 1.5) But what If I want to change another property, say :foreground, how do I do it? I ...
iLemming's user avatar
  • 1,293
2 votes
1 answer
4k views

Colon in Emacs Lisp [duplicate]

I came across this example: (setq h-data '((:num 1 :key "apple") (:num 9 :key "berry") (:num 2 :key "cactus") (:num 5 :key "dog") (:num 4 :...
AlwaysLearning's user avatar
1 vote
1 answer
1k views

elisp - How to dump plist to property value pairs

Below example dump it as a list, but I wish to dump it in property value pairs: #+BEGIN_SRC elisp :results output (defun dump-plist(obj level) (if (listp obj) (dolist (item obj) (dump-...
lucky1928's user avatar
  • 1,688
0 votes
2 answers
347 views

Why does `assoc` return nil for a plist?

I've got the following issue: (setq testvar '(link (:type "http" :path "//pygments.org/docs" :format bracket :raw-link "http://pygments.org/docs" :application nil))) (setq testvar (nth 1 testvar)) (...
Anton Linevych's user avatar
0 votes
5 answers
347 views

Is it possible to define all keywords' function definitions as plist-get?

I really, really like Clojure-style maps: {:keyword "value" :keyword2 'value2} which can be used like (get my-map :keyword) or, even better, (:keyword my-map) Can I teach Elisp how to do this?
Sean Allred's user avatar
  • 7,001
2 votes
1 answer
816 views

Read file lines into plist

I've been reading various tutorials on alist/plist access but can't figure this out. Let's say i have this file, test.txt: oranges 1 apples 2 grapes 3 I want to iterate this file line by line, and ...
anode1960's user avatar
2 votes
1 answer
248 views

EIEIO defclasses as plists

There is some support for defclasses as alists in EIEIO but I was wondering if there is any support to read/write a defclass as a property list (plist)? e.g. using the example (defclass record () ; ...
fommil's user avatar
  • 1,810
7 votes
2 answers
2k views

Why does emacs use both property lists and association lists?

http://www.gnu.org/software/emacs/manual/html_node/elisp/Plists-and-Alists.html gives some supposed differences between plists and alists. Basically it comes down to: Alists can be used as stacks, ...
kdb's user avatar
  • 1,591
8 votes
1 answer
2k views

Use of keyword symbols in property lists

According to the Emacs Lisp manual http://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Type.html A symbol whose name starts with a colon (‘:’) is called a keyword symbol. These ...
Håkon Hægland's user avatar
12 votes
3 answers
3k views

Function to merge two property lists?

I have not found a standard Elisp library function to merge two property lists, like this: (setq pl nil) (setq pl (plist-put pl 'key-1 'value-1)) (setq pl (plist-put pl 'key-2 'value-2)) I could ...
David J.'s user avatar
  • 1,869