Linked Questions

0
votes
2answers
58 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
1answer
67 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 ...
1
vote
0answers
89 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
2answers
32 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 ...
34
votes
1answer
2k 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 ...
7
votes
1answer
437 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 ...
4
votes
2answers
330 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
1answer
270 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
1answer
267 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 0.200.10@25.3.1 (spacemacs), on Ubuntu 16.04 64 bit I am using cscope layer, it is great but with one ...
-1
votes
1answer
41 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 ...