Linked Questions

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 ...
smilingbuddha's user avatar
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 ...
gboffi's user avatar
  • 624
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 ...
David Moles's user avatar
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 ...
Ewan Delanoy's user avatar
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 ...
oOosys's user avatar
  • 505
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 ...
itsjeyd's user avatar
  • 14.9k
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 ...
Matthew Piziak's user avatar
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 ...
Czipperz's user avatar
  • 317
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 ...
Patrick Steele's user avatar
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 ...
sflee's user avatar
  • 103
-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 ...
xetra11's user avatar
  • 167