Fix TAB no longer working in Org tables

This commit is contained in:
Kiana Sheibani 2024-03-30 21:02:59 -04:00
parent 3ea73ef58b
commit fdaadb17df
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -2600,13 +2600,22 @@ While this is a complex problem, the solution is actually rather simple: just re
"<tab>" nil) "<tab>" nil)
#+end_src #+end_src
This also means we don't need ~org-cycle~ to emulate indentation, which is nice. This also means we don't need ~org-cycle~ to emulate indentation, which is nice. Unfortunately, this breaks something else: ~org-cycle~ not only handles visibility cycling, but also navigating inside tables. This means that we need a little extra binding configuration so that we can make this properly work:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(after! org (let ((item
(setf (nth 4 org-emphasis-regexp-components) 20)) `(menu-item nil org-table-next-field
:filter ,(lambda (cmd)
(when (org-table-p)
cmd)))))
(map! :after org
:map evil-org-mode-map
:i "TAB" item
:i "<tab>" item))
#+end_src #+end_src
This makes it so that we only let tab keypresses fall through if we aren't in a table. (We'll just assume that we aren't going to be expanding any snippets while we're in a table.)
*** Project Links *** Project Links
It's sometimes nice to be able to click a link in an Org file that takes me to one of my projects. It's sometimes nice to be able to click a link in an Org file that takes me to one of my projects.