Here is a terse snippet with which you can recreate the issue, I hope:
#+begin_src sh
for x in $(for y in $(cmdA '"'); do cmdB $y; done); do cmdC $x; done
#+end_src
Here if I try to operate with respect to parenthetical operations (e.g. delete surrounding), or if I simply try to fold/close-all, I get forward-sexp: Scan error: "Unbalanced parentheses", nnnnn, mmmmm
. If I remove '"'
this goes away, but this is valid sh, so I'm unclear why this is.
My version information is:
GNU Emacs 28.1 (build 1, x86_64-apple-darwin21.4.0, NS appkit-2113.40 Version 12.3.1 (Build 21E258)) of 2022-04-21
Doom core v3.0.0-dev HEAD -> master f51a2cdd3 2022-04-18 18:14:16 +0200
Doom modules v22.04.0-dev HEAD -> master f51a2cdd3 2022-04-18 18:14:16 +0200
If you have any ideas or if this is expected behavior, let me know.
C-M-f
on the first open paren givesNo next sexp
and similarly for others (that's in the Org mode buffer, not in thesh-mode
buffer where the syntax rules are appropriate). Paredit mode does not seem to make a difference, except that when enabling it in the Org mode buffer, I get an errorUnmatched bracket or quote
. The problem is the single"
in the argument ofcmdA
:sh-mode
knows how to make sense of that but Org mode does not. IIRC, the advice from the mailing list is: "you'll have to live with it". Versions: GNU Emacs 29.0.50, Org mode version 9.5.2+