Questions tagged [lambda]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer

How to call a interactive function with prompt from a lambda?

I have this little LaTeX helper function: (defun my--insert-chord (chord) "Prompt for a CHORD and insert it at point. TODO: make it agnostic to the package used." (interactive "...
Alessandro Bertulli's user avatar
2 votes
2 answers

Lexical capture/access local scope in function, the same way as lambda

I'd like to use a function reference in place of a lambda, however the lambda in question captures a lot of locally scoped vars declared in an enclosing let. For example: (let ((x 1)(y 2)(z 3) (...
ocodo's user avatar
  • 1,222
0 votes
1 answer

How to disassemble an lambda/anonymous function given its hex adress but not name?

Assume that we have: (defalias 'my-f (lambda () (message "a"))) (byte-compile 'my-f) => #f(compiled-function () #<bytecode 0x1dc01052127a>) (setq my-g (byte-compile (...
Daanturo's user avatar
  • 180
1 vote
1 answer

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
1 answer

bind-keys with a macro for lambda functions

I am trying to bind keys to a lambda function using bind-key.el. I have the following factor macro ;; taken from Emacs Doom (defmacro cmd! (&rest body) (declare (doc-string 1) (pure t) (side-...
Tohiko's user avatar
  • 1,639
12 votes
2 answers

Is it possible to attach generated doc string to a lambda?

Emacs docs say that when doc string is put inside of lambda or defun it's “stored directly in the function object”. However, we can change docs of named functions like this: (put 'my-function-name '...
Mark Karpov's user avatar
  • 4,933