Skip to main content

Questions tagged [funcall]

The tag has no usage guidance.

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

proper syntax for funcall to frameset-to-register

I tried to evaluate the following, but a strange message appears (*) and the register ends up being empty: does anyone know why? (funcall #'frameset-to-register "r") (*) #s(frameset-register ...
user43824's user avatar
6 votes
2 answers
230 views

Call function without calling advice defined on it

I sometimes want to bypass the advice I have defined on some function. Something like: (call-without-advice #'fn ...)
HappyFace's user avatar
  • 860
0 votes
3 answers
159 views

Is there a code example demonstrating a meaningful usage of the built-in function `funcall`?

In order to understand what the symbol funcall means I have checked out its documentation. If I understand it right after reading the docs this symbol represents a function which in my eyes can be ...
oOosys's user avatar
  • 475
0 votes
1 answer
24 views

Setting of face using funcall

I am using funcall to set a typeface by calling a function select-typeface. I would like to remove select-typeface, calling (face (funcall level-typeface depth match). Cannot simply do (let ( (face (...
Dilna's user avatar
  • 1
0 votes
3 answers
57 views

Problems using a function reference from a plist

I'm trying to (funcall) a function reference I have in a plist. (defun helper-get-filename () "Argument Helper to get a filename." (read-file-name "-l <filename>: " "...
ocodo's user avatar
  • 1,222
1 vote
1 answer
273 views

How do I call a function within a lambda?

I would like to define a function that generates lambdas, as such: (defun my-func (FUNCTION) (lambda () (FUNCTION))) But when I evaluate the following (defun my-func1 () (message &...
Tian's user avatar
  • 288
0 votes
2 answers
88 views

funcall inside local-set-key

Programming Perl in cperl-mode I often use _ symbol, so I decided to remap it with / symbol, so I could type faster. I created the following functions: (defun add-underscore () (interactive) (...
user4035's user avatar
  • 1,069
2 votes
2 answers
504 views

Call apply with a macro

Is there a way to expand a macro using a list of arguments? I tried using apply but then I get an error that the "function" my/x-becomes-nil is invalid. (defmacro my/x-becomes-nil (variable ...
Tohiko's user avatar
  • 1,649
0 votes
1 answer
261 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 ...
nomad's user avatar
  • 257
1 vote
1 answer
894 views

How to call a function that is the value of a variable?

Can someone explain to me why the code below throws an error (void-function fn)? (let ((lexical-binding t) (fn (lambda (y) (+ y 4))) (x 4)) (pcase x (10 (- x 2)) (4 (fn x)))) ...
Tohiko's user avatar
  • 1,649
3 votes
1 answer
219 views

Inconsistent behavior when calling #'funcall with a macro

I would have thought that both of the funcall's the follow would have yielded the same result, but they don't and I'm trying to understand why. (defmacro test/z () "z") (funcall (function test/z)) ;;...
theia-jane's user avatar
1 vote
2 answers
28 views

Function within a function produces side-effect but failes to deliver logic test

This is a simple logic test that makes use of down-list and asks if another nested pair of parenthesis exits or not. (not (eql (point) (progn (ignore-errors (down-list)) (point))...
Sati's user avatar
  • 815
1 vote
1 answer
83 views

Why funcall doesn't work from a closure

I'm having difficulty to call a function passed as an argument. Why the following snippet doesn't work, and how can I make it work? lexical-binding is set to t (defun on-success (data) (print "...
iLemming's user avatar
  • 1,273
1 vote
1 answer
58 views

Evaluate allows for combinations whose operators are compound expressions

I find the amazing power of scheme in sicp Exercise 1.4. Observe that our model of evaluation allows for combinations whose operators are compound expressions. Use this observation to describe ...
Wizard's user avatar
  • 1,261
1 vote
2 answers
62 views

I want to simplify repeated calls in my init.el file

I've got a lot of: (desktop-save-mode 1) (show-paren-mode 1) which I'd like to collapse into: (mapcar (lambda (fn) (fn 1)) '(desktop-save-mode show-paren-mode)) but I get an error: Symbol’s ...
ftravers's user avatar
  • 105
4 votes
1 answer
1k views

Difference between apply and funcall

(describe-function apply) says: apply is a built-in function in ‘src/eval.c’. ...
Realraptor's user avatar
  • 1,293
0 votes
0 answers
165 views

Defining function that takes funciton as argument results in "Wrong type argument: commandp, (bm-my bm-next)"

When using the below and invoking the function via <leader>Bn I get an error of command-execute: Wrong type argument: commandp, (bm-my bm-next) (defun bm-my (a) (interactive) (a) (bm-show-...
Chris Stryczynski's user avatar
1 vote
1 answer
185 views

function that takes a function as argument and returns a new function

I'd like to write an elisp-function that has a function as argument and returns a new function. Let's say the new function double-the-function should write the returned value of the argument-function ...
rl1's user avatar
  • 356
4 votes
2 answers
208 views

Calling a function with a shorter but unknown argument signature length

Is there a terse idiomatic way of calling a function in the manner of funcall (dereferencing function symbols) when that function may have a variably shorter function signature? Say for example: a ...
ebpa's user avatar
  • 7,529