Linked Questions
11 questions linked to/from Why can't I bind my function to a key or call it with M-x?
1
vote
1
answer
491
views
Keyboard shortcuts for applying a theme [duplicate]
I want to bind loading a specific theme to a key-binding.
However, this does not work.
(global-set-key (kbd "C-<f1>") '(load-theme 'zenburn))
I would like Ctrl and the F1 key to apply the ...
0
votes
2
answers
445
views
bind an insertion to a mouse click [duplicate]
I need to change a space to a | here and there and i guessed that the best possibility were to bind a mouse click and the insertion of the pipe
(global-set-key [s-mouse-1] '(insert "|"))
But when I ...
1
vote
0
answers
354
views
How do I define a function in my init.el and make it available with M-x? [duplicate]
I have the following function, which does what it says on the tin -- swaps the values of the ns-alternate-modifier and ns-right-alternate-modifier variables.
(defun swap-left-and-right-alt ()
"Swap ...
0
votes
2
answers
134
views
Very short key bindings for emacs commands [duplicate]
There are some text actions that I use so often in emacs that the user-made commands I currently use, invoked with the standard M-x ... RET procedure do not satisfy me.
I would like to replace their ...
0
votes
1
answer
110
views
Interactive call aware function test problem ( Wrong type argument: commandp ) [duplicate]
Below what the *Messages* buffer tells me:
Loading init.el (source)...
interactive-aware-fun called-interactively-p : nil
command-execute: Wrong type argument: commandp, interactive-aware-fun
and an ...
44
votes
1
answer
4k
views
What is the difference between a function and a command?
When posting questions and answers here, people sometimes use the terms "function" and "command" interchangeably. In other cases, people only use one of the two terms to discuss specific pieces of ...
11
votes
1
answer
1k
views
Magit custom commands
Magit displays the progression of multi-step commands with popup windows. For example, pressing c brings up the commit menu, whence pressing a will invoke magit-commit-amend.
I would like to include ...
5
votes
2
answers
654
views
Bind `C-x 8 l` to typing lambda (λ)
When I try to do this:
(global-set-key (kbd "C-x 8 l") (lambda () (insert "λ")))
It just doesn't work:
Wrong type argument: commandp (lambda nil (insert "λ"))
Does anyone know a decent way to do ...
5
votes
1
answer
391
views
Helm and custom commands
If I write a command that calls (interactive "f"), Emacs will prompt the user to select a file when the command is run interactively. With Helm enabled, this selection is done through Helm with no ...
0
votes
1
answer
816
views
Wrong type argument: commandp cscope
My question is how to let the command SPC-m-c-Cget the function name automatically?
I am using [email protected] (spacemacs), on Ubuntu 16.04 64 bit
I am using cscope layer, it is great but with one ...
-1
votes
1
answer
414
views
how to get region start and region end from the whole buffer as variables to call another func
(defun buffer-to-shell()
(let (buffer mark-whole-buffer)))
(shell-command-on-region start end "sed s/foo/bar/") ;; start, end not defined
)
As you might see there are undefined variables start ...