Linked Questions

2 votes
1 answer

buffer-file-name is a function, so why doesn't M-x buffer-file-name work? [duplicate]

When trying to run it I get M-x buffer-file-name [No match] But it has a function help entry via C-h f and I can evaluate it with M-: buffer-file-name. So why isn't it accessible via M-x?
djechlin's user avatar
  • 923
3 votes
0 answers

Bind a key to a lambda: what am I doing wrong? [duplicate]

I'm reading about some concepts of Emacs Lisp. The lambda's seems interesting to me. After reading the manuals about lambda's in Emacs Lisp, I decided to play with it. For example, I have this ...
ReneFroger's user avatar
  • 3,880
0 votes
2 answers

How do I define a function to execute as a command with M-x? [duplicate]

I wish to M-x my-func and let my code run. This seems basic but where can I get more documentation about this, if possible inside emacs itself?
Mini kute's user avatar
1 vote
2 answers

Are commands not equivalent to functions in Emacs? [duplicate]

The documentation for M-x says: M-x runs the command execute-extended-command (found in global-map), which is an interactive compiled Lisp function in ‘simple.el’. It is bound to <execute>, <...
herophant's user avatar
  • 223
0 votes
1 answer

Why can't I bind tab to multiple spaces? [duplicate]

I'm trying to bind tab to either a tab or multiple spaces in Latex/ESS-noweb mode but I can't get it to work. I tried (local-set-key (kbd "<tab>") 'self-insert-command) which didn't work, and ...
user avatar
1 vote
1 answer

What makes an elisp function available with M-x [duplicate]

Why some functions in simple.el are invokable with M-x and some others aren't? For example I can do M-x what-line but I can't do M-x line-number-at-pos.
element's user avatar
  • 47
46 votes
2 answers

What's the difference between a buffer, a file, a window, and a frame?

When posing questions on this site, people sometimes talk about "windows" when they mean "frames," and "buffers" or "files" when they mean "windows." So: Q: What is the difference between a buffer, ...
Dan's user avatar
  • 33.1k
17 votes
2 answers

How can I prevent a command from using specific windows?

Typically, I have a frame split into four windows, where two at the bottom are dedicated to my *compilation* and *grep* buffers. When browsing compilation errors, next-error will eventually replace my ...
piwi's user avatar
  • 273
16 votes
1 answer

Why can't I bind my function to a key or call it with M-x?

I wrote a function, and I want to call it via M-x, and bind it to a key. This is my function: (defun my-function () (message "This is a great function")) If I try to call it with M-x my-function,...
15 votes
1 answer

Evil cursor change by state

Until today, when I was in the normal state in evil, the cursor was a block, and it would switch to an I-beam when in insert state. Something changed, however, and the cursor is now always the I-beam....
Ryan's user avatar
  • 4,049
8 votes
1 answer

Wrong number of arguments on lambda key binding

I am not able to figure out what is wrong in this elisp form: (define-key ggtags-mode-map (kbd "M-.") (lambda () (interactive) (ggtags-find-tag-dwim) (recenter))) I keep getting this ...
SFbay007's user avatar
  • 584
10 votes
1 answer

How to right align region and/or line?

We can center text with M-x center-region and M-o M-s. Is there something similar for right-alignment? Example before: Item 0: value | Item 100:...
Mark Karpov's user avatar
  • 4,963
5 votes
2 answers

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

What is the difference between reftex-citation and org-reftex-citation?

What is the difference between reftex-citation and org-reftex-citation? And where can I find the documentation for org-reftex-citation referenced in this answer? [1] Emacs manual: Creating citations
Christoph's user avatar
  • 399
6 votes
2 answers

Searching all installed mode maps for a specific key binding

When deciding on which key binding I want for a specific command, it would be very nice to know if any of my installed mode maps (global, major and minor) have already used this key binding for some ...
whacka's user avatar
  • 383

15 30 50 per page