Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [defun]

The tag has no usage guidance.

7 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
207 views

Optional docstring in defun

After taking a look at the definition of defun in byte-run.el, it seems that the macro does some very interesting things regarding checking for the existence of a docstring. First, it uses a declare ...
Tianxiang Xiong's user avatar
1 vote
0 answers
32 views

How to define interactive function that will not auto-complete?

If I do this: (defun foo-bar-baz () (interactive) (message "foo-bar-baz")) And then M-x foo-baz RET (note no "bar") then completion matches foo-bar-baz and it executes. Is ...
John H.'s user avatar
  • 123
1 vote
0 answers
288 views

Defining a function that takes keyword arguments and a variable number of positional ones

I want to define a function that takes both keyword arguments (as in &key) and a variable number of positional ones (&rest). They should be independent of each other, the keyword list should ...
Nova's user avatar
  • 1,119
1 vote
0 answers
259 views

Sublime Text like Ctrl-Delete/Backspace

Is there any easy way (or maybe a package) which provides Ctrl-Del/Backspace behavior like in Sublime? The default rule of sublime is delete-to-next-word-boundary. I did not find similar options. ...
Daniel Hitzel's user avatar
0 votes
0 answers
38 views

Terminate custom avy repeated command

I am using a repeated command in doom-emacs on Mac OS which I borrowed from some other thread here: (defun avy-delete-line-repeat (count &optional all-frames) "Wrapper around `other-window' ...
Rareform's user avatar
  • 219
0 votes
0 answers
25 views

How to act on the currently highlighted selection of expand region mode in a function?

I am using er/expand-region in doom-emacs on Mac OS. I would like to combine yanking and expanding a region in a function, that is, automatically yank the selection of expand region with evil after ...
Rareform's user avatar
  • 219
0 votes
1 answer
86 views

Swap two pieces of text

I often find myself swapping pieces of text. How can I make a command to replace the current text with the latest kill, then put the text I just replaced at the position of the previous kill? Or is ...
Zaz's user avatar
  • 123