Thank you for telling me about the different types of maps.
The issue is as @NickD pointed out in their answer https://emacs.stackexchange.com/a/59269/9874 and the example use-package code puts all the bindings into the global map.
ie org-mode puts the binding to "" in org-mode-map so you need to use that map.
Because my configuration is based on ...
You ask several related questions, but this is the main one, I think:
How does one find out what name emacs gives to a key such as the one labeled pause/break on my keyboard?
For Emacs's description of a key, use C-h k.
So C-h k, then hit the Pause key. Emacs probably tells you this:
<pause> is undefined
So you now know that Emacs describes that key ...
Add at least one additional definition:
(global-set-key (kbd "C-i") 'universal-argument)
(define-key universal-argument-map (kbd "C-i") 'universal-argument-more)
See additional universal-... definitions in both bindings.el and simple.el that may be rebound if so desired.
The part you need to look at is the interactive declaration which in this case is (interactive "P"). This means that C-u is passing the argument (4) to org-timer-start. So you need to assign the lambda
to a key in whatever keymap you want that will be active when you want to use it. The keymap ...
I have the following in my .emacs:
(lambda (arg) (interactive "P")
(let ((separator (pcase arg
(format-time-string (concat "%Y" separator "%m&...
You can define your own function that does all the things you want it to do and bind it to a key:
(defun my-day-page ()
(org-agenda-list nil nil 1 nil)
(define-key global-map [f10] 'my-day-page)
See the doc for org-agenda-list (C-h f org-agenda-list RET) for the meaning of the arguments: the third argument (the ...
Currently, probably the best way to discover keybindings is by using the which-key package. This package is central in distributions like Spacemacs and Doom emacs.
It provides various commands for discovering available keybindings, e.g. which-key-show-top-level and the which-key-show-(full)-major/minor-mode(-keymap)s.
The which-key buffer can be shown ...
Are you sure you need new key-bindings? Did you know that you can call code blocks from other code blocks? See https://orgmode.org/manual/Evaluating-Code-Blocks.html
You can bind code block by name in the header (e.g. :var x=random) to a variable, and call it by using the variable within the block.
Also, especially if this is for debugging purposes, you can ...
Calling org-store-link by C-c l in file.tex buffer will store a link in the org-stored-links variable.
Then, calling org-insert-link by C-c C-l in notes.org buffer will insert the link to your org file by selecting the right stored link in the prompt.
C-u invokes the function universal-argument, and you want
to ensure that eval-last-sexp is called as if you invoked it
interactively, which is done with call-interactively. You can
simulate universal-argument by let-binding current-prefix-arg.
Putting that all together for C-u C-x C-e:
(global-set-key (kbd "C-c c") (lambda ()
M-S-Z would mean Meta + Shift + Z. But Z (uppercase) is itself what Emacs uses for Shift> + z.
There's likely no key on your keyboard corresponding to S-Z. That's why you say it doesn't work.
If you use C-h b you'll find your key binding listed OK. And if you use C-h w zap-up-to-char-backward you'll see that it says it's bound to M-S-Z.
The problem is ...
Each command that sets the mark pushes the previous mark onto a stack. More precisely, the previous position is added to the mark ring (the difference between a mark and a ring is that accessing the front of the ring doesn't remove the element, but pushes it to the other side of the ring).
To get to the next-to-last position, use C-1 C-SPC or C-u C-SPC. ...
Org mode does a bunch of context-dependent actions by binding a key (e.g. C-c C-c or C-c RET) to a generic function (org-ctrl-c-ctrl-c or org-ctrl-c-ret). The function looks around to determine a context (am I in a header? or a source block? or a table? etc.) and then calls another function (e.g. org-insert-heading) depending on that context.
I don't know ...
Modifier key s- is called "Super". (event-modifiers 's-Y) returns (super), which says that s-Y uses (only) the super modifier.
See the Emacs manual, node Modifier Keys. What physical keyboard key, if any, might correspond to this logical modifier key depends on your system and hardware.
(event-convert-list '(super ?y)) returns 8388729, which is ...
The mode sets up its own keymap which overrides the global map. The :bind mechanism creates a binding in the global map, but in an Org mode file, the key is looked up in the mode map before the global map, so you get the definition in the mode map.
The usual way to override this is by using the mode hook. Add to your init file the following code:
You are successfully binding C-c C-n in the global keymap, which is the lowest-priority keymap.
Some major mode binding will be taking precedence, as:
Sequences consisting of ‘C-c’ followed by a control character or a digit are reserved for major modes.
-- C-hig (elisp)Key Binding Conventions
I strongly recommend reading this article in full. It should ...
In most cases, an emacs instance runs for a very long time: what comes and goes is the buffer visiting a file. So instead of killing emacs as a whole, it is probably more useful to kill the buffer that is visiting the file.
You do that with kill-buffer (usually bound to C-x k): if the buffer is modified it will ask you whether you want to kill it anyway and ...
(kbd "s-s") works just fine for me. Verified in both 27.1 and 26.3.
I suspect your window manager is capturing this sequence, and Emacs never sees it at all.
What does typing C-hks-s tell you?
If Emacs doesn't register the s-s, then I think you'll find that never actually reached Emacs, and you should start looking at your window manager's ...
I think it's a bug.
If you don't use that alist as the KEYMAP arg, but instead you create a keymap, assign it to a variable, use define-key with (kbd "C-n") etc., and use that variable as the KEYMAP arg, then it works.
Please consider using M-x report-emacs-bug, to report this.
(setq toto-map (make-sparse-keymap))
(defun foo () "..." (...
You can see what you've done with C-h l (aka M-x view-lossage).
As for putting a kind of "safety fence", it should be fairly easy to do, by placing an appropriate function of pre-command-hook. You could start with something like:
'(self-insert-command next-line previous-line right-char left-char
As you're not going to use the region between point and mark, consider another approach using save-excursion, like this one:
"Autoimport word at point."
(let ((word-at-point (thing-at-point 'word)))
(insert (concat "import ...
Not that I know of, but Org mode provides the ingredients to roll your own easily:
(defun org-table-goto-beginning ()
(defun org-table-goto-end ()
(define-key org-mode-map (kbd "C-c t b") #'org-table-goto-beginning)
(define-key org-mode-map (kbd &...
Using use-package's :bind by setting the binding to nil worked for me in similar cases, but I use it with :straight org-plus-contrib and I do not know if this approach applies the same with built-in org:
:bind (:map org-mode-map
("C-," . nil)
("C-'" . nil)))
Not sure I understand your question. Are you asking how, in each major mode, to bind to C-o whatever that mode normally binds to C-e?
If so, then in after-change-major-mode-hook add a function such as this:
(defun my-remap-C-e-to-C-o ()
"Remap whatever command is locally bound to `C-e` to `C-o`."
(let* ((map (current-local-map))
I can't really answer on why some keybinding are put under , and some under C-c.
To know the difference between the two, you can check what bindings they prefix with the shortcut , C-h and C-c C-h.
Other usefull bindings are:
C-h m to show what the current major mode bindings are
C-h k C-c [ to know what's bound to C-c [
C-h f org-agenda-file-to-front ...
Have a look at Adding keymaps to src blocks by John Kitchin. It does more than you want. You can edit src blocks as you would normally edit code of that type. There is a link to a file in org-mode that you can download and evaluate to make this available for you. You will need to adapt the recipes he gives for your needs.
The major problem is defining the ...
Assuming that helm-projectile is doing this:
(define-key projectile-mode-map [remap projectile-grep] #'helm-projectile-grep)
You would disable that with:
(define-key projectile-mode-map [remap projectile-grep] nil)