Questions tagged [defun]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
16 votes
3 answers
789 views

Defun inside let with lexical binding gives byte-compile warning "the function is not known to be defined"

I want to get the effect of a static variable by using defun inside of let with lexical binding to create a closure. However, when byte-compiling the file, I get a warning. Am I doing something wrong, ...
Rose Kunkel's user avatar
5 votes
2 answers
313 views

Create a function that returns a new function definition

I'm creating a modular system for my use of Emacs, so I can call modules on the fly, as I need them. Just like a lazy call, but I must explicitly call them. Anyways, I found this riddle, I want a ...
BuddhiLW's user avatar
  • 297
4 votes
1 answer
250 views

Make a variable visible to some functions only

Consider the following metacode: ;;; -*- lexical-binding: t -*- (defvar var1 ...) (defvar var2 ...) (defun main () "Main entry point" ...) (defun func1 ...) (defun func2 ...) ... (defun funcn ...)...
antonio's user avatar
  • 1,822
1 vote
2 answers
632 views

copy string at point func

I'm trying to build a simple proc that copies the text on which the point is set and returns the point to where it was, but can't make it work properly. Before you say "thing-at-point" - I ...
user2141046's user avatar
0 votes
2 answers
75 views

Defmacro: Create functions from a list o functions

I have this code: (defmacro with-ignore-mouse-events (&rest body) "Macro to ignore mouse events before evaluating BODY." `(progn (when (input-pending-p) (let ((event (...
Gabriele's user avatar
  • 1,564