Skip to content

Commit 7b248fd

Browse files
committed
Fix syntax highlighting in article
1 parent 2bc0275 commit 7b248fd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

org/_posts/2025-05-13-emacs_unset_keys.org

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Sometimes, we may want to unset a keybinding for a specific mode instead. Maybe
3131
** Pre Emacs 29 (built-in)
3232
Before Emacs 29, we have the function =local-unset-key= available. The article you are reading does not seem to end here, so what is the issue? If this solution worked, we wouldn't need the alternative solutions presented next, right? =local-unset-key= only takes in the key binding and removes it from the local map that is currently used. That means the mode map you want to remove from have to be active, and you can't just remove it with a single line. It makes for easy usage in a hook though:
3333

34-
#+BEGIN_SRC emacs-lisp
34+
#+BEGIN_SRC lisp
3535
(add-hook 'org-mode-hook (lambda ()
3636
(local-unset-key (kbd "S-<down>"))))
3737
#+END_SRC
@@ -43,7 +43,7 @@ The previous solution gets the job done, but it gets a bit clunky. We may want s
4343

4444
Instead of needing a hook, we now have a more clear way of unsetting it!
4545

46-
#+BEGIN_SRC emacs-lisp
46+
#+BEGIN_SRC lisp
4747
(keymap-unset org-mode-map "S-<up>")
4848
#+END_SRC
4949

@@ -59,7 +59,7 @@ This is getting out of hand! Now, there are two of them!
5959

6060
The package bind-key, from use-package (but can be used standalone!), also provides some functionality for unsetting keys in local mode maps! It can unset both global and local bindings:
6161

62-
#+BEGIN_SRC emacs-lisp
62+
#+BEGIN_SRC lisp
6363
;; Unbind in global map
6464
(unbind-key "S-<up>")
6565

0 commit comments

Comments
 (0)