New answers tagged


Without looking up any of the Org variables or functions you refer to, here's a guess at what you're trying to do. They both do the same thing: iterate over a list of file names, expanding them in directory org-gtd-folder, and setting the value of variable org-agenda-files to the resulting list of absolute file names. ;; Use `mapcar' (setq org-agenda-files ...


You're essentially saying you want to match any of a list of patterns. regexp-opt takes a list of strings and produces a single regexp which matches any of them. (regexp-opt '("no" "nix")) => "\\(?:n\\(?:ix\\|o\\)\\)" Note that the individual strings in the input list are not regexps -- the end result will be analogous to ...


(seq-filter (lambda (x) (and (not (string-match-p (regexp-quote "no") x)) (not (string-match-p (regexp-quote "nix") x)))) se-have) Or use cl-remove-if-not. Or use seq-filter or cl-remove-if-not twice, instead of and. And so on.


Note: A Lisp program should not try to modify self-evaluating forms or constant lists (bug#40671). These are internal data structures [Message 42]. Be aware that the final argument for append is not copied. ELISP> (setq var1 (vector 'a 'b)) ELISP> (symbol-value 'var1) [a b] ELISP> (setq lst (append var1 (list 1))) ELISP> (symbol-value 'lst) (a b ...


You can use the backquote mechanism in combination with ,@ to splice the value of a variable into a list; or equivalently, use append: (setq variable '(1 2 3)) (1 2 3) (setq another-variable `(-2 -1 0 ,@variable 4 5 6)) (-2 -1 0 1 2 3 4 5 6) ;; or... (setq another-variable (append '(-2 -1 0) variable '(4 5 6))) (-2 -1 0 1 2 3 4 5 6)

Top 50 recent answers are included