Questions tagged [list]

is for the list object in Lisp programming. A list represents a sequence of zero or more elements. Emacs Lisp relies extensively on the list data structure; it is a fundamental building block. Emacs provides many facilities for building, modifying, extending, and efficiently handling list data structures.

Filter by
Sorted by
Tagged with
3
votes
1answer
140 views

Why is this function not pure

I just spent a significant amount of time debugging an issue that boils down to the following: (defun my-new-alist () `((x . nil))) (setq a (my-new-alist)) (setq b (my-new-alist)) (push 1 (alist-...
9
votes
2answers
140 views

Proper reinitialization of a list? What is happening under the hood?

I'm teaching myself some more elisp and have encountered the following problem: If I want to reset a list variable it won't get updated after the first evaluation. Here is some example code: (defun ...
15
votes
1answer
2k views

Is '(a . b) really a list?

I'm really confused with the . notation. Is '(a . b) a list? (listp '(a . b)) returns t but when I want to know its length (length '(a . b)) gives an error Wrong type argument: listp, b. The same is ...
2
votes
1answer
252 views

Change level into list in org mode

I have following text which are expressed in level 5 ***** It's better to be first than it is to be better. ***** The basic issue in marketing is creating a category you can be first in. It’s the law ...
4
votes
1answer
246 views

Check box add date in org mode

I have a book list contained which will be read or had done. Like this * English books [0/2] - [ ] bible - [ ] When I use C-c C-c to check, is it possible to add date behind or add low level ...
2
votes
1answer
157 views

turn a list into a set of arguments for a function [duplicate]

I have a defun get-quotes with one mandatory and 2 optional arguments. I would like to do something like this: (let ((articles '("/home/matt/art/mice.pdf" '("/home/matt/art/cats.pdf" "Smith, ...
0
votes
1answer
60 views

list data structure split across files?

If I were trying to use a list as a data structure -- and it was getting really big -- is there a precedent of breaking it up and having it span files? One particular list of mine is looking very tree-...
2
votes
1answer
63 views

How to add-to-list to read-in file contents

When I do this (setq v (f-read-text "s.el")) where s.el is of this form ((thing1 . thing2) (thing3 . thing4)) I get v back as one long string. And (setq v (append (f-read-text "s.el"))) doesn't seem ...
2
votes
2answers
621 views

Append lists smartly?

How do I append two lists together, and delete duplicates? For example: (setq list1 ("a" "b" "c")) (setq list2 ("b" "c" "d")) (setq list3 (a b c)) (setq list4 (c d e)) ;; use case (append-list-to-...
2
votes
1answer
3k views

Indenting lists in org-mode

I copied and paste text in an org file and formatted it as a list: - Funded pensions :: As explained more fully in Chapter 3, funded pensions are paid on behalf of its members. How can I have the ...
4
votes
2answers
445 views

How can I paste paragraph not to interrupt numbers in list org mode?

In list environment, after I copy several paragraphs, the next item number will change into number 1, How can I deal with that? For example, 1. aaa 2. aaa 3. aaa bbb <---this is what I copied ...
5
votes
2answers
1k views

How to iterate over JSON list and select one element

Say I have a list of names with ids, in JSON: (let ((json-object-type 'plist)) (setq mylist (json-read-from-string "[{\"name\": \"Adam\", \"id\": \"1\"}, {\"...
3
votes
1answer
380 views

how to automatically add org-emphasis properties to list titles?

I use org-mode lists, both plain-text lists and numbered lists. I precede my lists with a "list title," which for me is any line ending in a colon. Grocery list: - tomatoes - spinach - blueberries I'...
2
votes
1answer
300 views

how to parameterize prompt for interactive/command?

background I had elisp code (in this very small git repo) like (defun bulk-replace-file (filepath) (interactive "FPath to file to bulk-replace: ") (bulk-replace-file-non-interactive filepath) ) ...
3
votes
1answer
235 views

What's difference between + and - in the list in org mode

I find I can create bullets with the - and + both. How can I decide when to use + and -

1 2
3