emacs-evil / evil

The extensible vi layer for Emacs.
GNU General Public License v3.0
3.37k stars 282 forks source link

`evil-jump-item` does work for `cond` in emacs-lisp #1517

Open junwei-wang opened 3 years ago

junwei-wang commented 3 years ago

Issue type

Environment

Emacs version: GNU Emacs 27.2 (build 1, x86_64-apple-darwin20.6.0, NS appkit-2022.60 Version 11.6 (Build 20G165)) of 2021-09-23 Operating System: macOS Big Sur version 11.6 Evil version: Evil version 1.14.0 Evil installation type: Doom Emacs Graphical/Terminal: X Tested in a make emacs session (see CONTRIBUTING.md): No

Reproduction steps

Expected behavior

Try evil-jump-item when the point is on the parenthesis of the left cond, it will jump to last right parenthesis.

Actual behavior

Try evil-jump-item when the point is on the parenthesis of the left cond, it jump to the second last parenthesis.

Further notes

i-yamane commented 2 years ago

I got the same issue and found a workaround that works fine for me: use M-x org-edit-src-code whenever I want to view or edit a src block.

The cause of the issue is not evil but org-mode that changes the syntax table so that we can use < and > for useful features in org-mode. The side effect is it makes emacs regard < and > as parentheses unlike in emacs-lisp-mode. This affects scan-lists function that those jump commands (e.g., evil-jump-item and forward-list) eventually use at the core.

To me, it seems difficult to change the syntax table only for part of a buffer, so I decided to just stay with the syntax table defined by org-mode.