Questions tagged [apply]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
52 views

funcall/apply lambda

Please look at the following elisp expressions. (funcall 'lambda '() 1) ;; or (apply 'lambda '() 1 ()) The interpreter says that lambda is not a valid function for both the above expressions. Why? Is ...
2
votes
1answer
44 views

Why can't I directly invoke the result of apply-partially?

I'm confused about return value of apply-partially. Documentation states that it returns a function, and source of the function shows that it actually retruns a lambda. But I can't invoke the return ...
0
votes
1answer
29 views

Source C code of function 'apply'

I referenced C-h f apply for the source code of "apply", it prompts References C code is not yet loaded. but does not hint the destination file. Execute grep-find within Emacs repo thus return no ...
1
vote
1answer
38 views

Use Elisp macro instead of two function arguments?

Is the following sort of shortcut macro possible to implement? (defmacro region-end-beg () "Replacement for '(region-end) (region-begin)' in source code" (...)) So that (buffer-substring (region-...
2
votes
1answer
194 views

Difference between apply and funcall

(describe-function apply) says: apply is a built-in function in ‘src/eval.c’. ...
3
votes
1answer
193 views

Rewriting `defadvice' as `advice-add' makes advice ineffective

I am trying to make undo-tree auto compress the history save file. The document suggests adding the following advice (defadvice undo-tree-make-history-save-file-name (after undo-tree activate) (...
0
votes
1answer
47 views

Apply of a logic function over a list

I'm trying to apply a logic function over a list, but: e.g.(apply 'and some_list) give me Invalid function: and. There is a way to apply a logical function to a list?
1
vote
1answer
141 views

Return Value of apply-partially

I'm playing around with apply-partially and I'm confused about what gets returned when calling this function. The documentation states that apply-partially returns a function, but then I'd expect to ...
3
votes
2answers
263 views

apply partially last arg

Is there something like apply-partially (apply-partially FUN &rest ARGS) Return a function that is a partial application of FUN to ARGS. ARGS is a list of the first N arguments to pass to FUN. ...
2
votes
1answer
71 views

Writing bytes to a file using library f.el [duplicate]

I'm trying to do something very simple, write bytes to a file using the f library: (require 'f) And I create a list of bytes: (setq random-data (loop for i from 0 to 40 collect (random 150))) So ...
0
votes
1answer
81 views

How can I use a var to provide multiple arguments to a function? [duplicate]

Here is a simple example in which I would like to replace (start-process "ls" "*temp*" "ls" "-l" "-a" "-t" "-r") ; this works with (setq some-var ????) ; <-- Need to figure this part out (start-...
2
votes
1answer
139 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, ...