• Question about change in shell mode

    From Jim Diamond@zsd@jdvb.ca to gnu.emacs.help on Sat Jan 10 17:55:41 2026
    From Newsgroup: gnu.emacs.help

    (I posted this a week or so ago in the "wrong" emacs group, and just
    silence. Maybe that one is essentially dead, so I thought I'd try here.)

    In emacs 28.2 (started as "emacs -Q"), if I have a file

    ------------------------------------cut here---------------------
    #! /bin/sh

    while
    do
    done
    ------------------------------------cut here---------------------

    and I mark the region with the (partial) while loop and then
    M-x indent-region
    nothing changes.

    However, in emacs 30.2, the partial while loop changes to

    while
    do
    done

    The same thing happens with "until" loops, but not "for" loops.


    Other info: with no condition, in 30.2 with the cursor at the beginning of
    the "do" line, smie-config-show-indent (C-c ?) says
    Rules used: :elem basic -> 4, :after "while" -> nil
    whereas in

    for
    do
    done

    (i.e., a for loop with no loop variable or list) with the cursor at the beginning of the "do" line, smie-config-show-indent says
    Rules used: :before "do" -> 0

    For the "while", Emacs 28.2's smie reports this:
    Rules used: :before "do" -> 0


    Yes, I know I am missing the while condition there, and if I put it in,
    emacs 30.2 behaves itself. So I can deal with it.


    My question is this: is this an intentional change in smie? I browsed
    emacs' NEWS file and didn't see anything about a functional change in smie.


    Jim
    --- Synchronet 3.21a-Linux NewsLink 1.2