Subject: 28.0.50; Wring pair-mode in m4 and similar modes

From: Ergus <[email-masked]>
Date: Fri, 14 Aug 2020 21:58:14 +0200

--text follows this line--

Using emacs to edit an m4 file I see that there is an issue recognizing
the corresponding pairs in some cases like when using "case".

For example:

```
[
case $word in
	i?86)
             something ;;
         bla)
             bla ;;
  esac
]
```

all the commands like forward-list or modes like show-paren-mode
highlight the parentesis after i?86 as the closing for the first
one. While the really closing one looks unpaired.

Try

emacs -Q file.m4
M-x show-paren-mode
yank the example code and go to [.
And see

In GNU Emacs 28.0.50 (build 17, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3)
  of 2020-08-12 built on Ergus
Repository revision: fd6058b8fb07329bdd7d36cd05f4be1c5c691f9f
Repository branch: master
System Description: Arch Linux

Recent messages:
next-line: End of buffer [6 times]
Current locus from *grep*
Mark saved where search started
Show-Paren mode enabled
Making completion list...
Quit
Type "q" in help window to restore its previous buffer.
Making completion list...
completing-read-default: Command attempted to use minibuffer while in minibuffer
funcall-interactively: End of buffer

Configured using:
  'configure --prefix=/home/ergo/.local/ --with-mailutils --with-json'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2

Important settings:
   value of $LANG: en_US.UTF-8
   locale-coding-system: utf-8-unix

Major mode: m4

Minor modes in effect:
   show-paren-mode: t
   tooltip-mode: t
   global-eldoc-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa
derived epg epg-config gnus-util rmail rmail-loaddefs
text-property-search time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils cl-extra pp cl-print ibuf-ext
ibuffer ibuffer-loaddefs help-fns radix-tree help-mode cus-start
cus-load paren misearch multi-isearch find-dired dired dired-loaddefs
ffap url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map seq url-vars thingatpt
grep compile comint ansi-color ring vc-git diff-mode easymenu easy-mmode
cl-loaddefs cl-lib m4-mode term/tmux term/xterm xterm byte-opt gv
bytecomp byte-compile cconv tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 102679 15950)
  (symbols 48 9862 1)
  (strings 32 29160 1933)
  (string-bytes 1 868059)
  (vectors 16 13716)
  (vector-slots 8 153782 8256)
  (floats 8 36 675)
  (intervals 56 1332 0)
  (buffers 992 15))