Subject: bug#59953: 28.2; c type modifiers only work as prefixes for font-lock, cc-mode

From: "Chris Hecker" <[email-masked]>
Date: Sat, 10 Dec 2022 22:31:18 +0000

cc-mode doesn't seem to recognize that c type specifiers can come in any 
order (and I prefer them after so they're modifying the base type), so 
the highlighting doesn't work right for the variable name.  Here's an 
example in a struct, works the same way in a function:

struct foo {
   unsigned int One;
   int unsigned Two;
};

emacs -Q results:

I couldn't see an easy way of fixing this (besides just adding all the 
combos to *-font-lock-extra-types).  Seems like there needs to be a 
c-primitive-type-postfix-kwds variable to do this right?

Thanks,
Chris

In GNU Emacs 28.2 (build 2, x86_64-w64-mingw32)
  of 2022-09-13 built on AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19044
System Description: Microsoft Windows 10 Home (v10.0.2009.19044.2251)

Configured using:
  'configure --with-modules --without-dbus --with-native-compilation
  --without-compress-install CFLAGS=-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
XPM ZLIB

Important settings:
   value of $LANG: ENU
   locale-coding-system: cp1252

Major mode: ELisp/l

Minor modes in effect:
   hexl-follow-ascii: t
   minibuffer-depth-indicate-mode: t
   icicle-mode: t
   which-function-mode: t
   shell-dirtrack-mode: t
   winner-mode: t
   global-eldoc-mode: t
   eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   buffer-read-only: t
   column-number-mode: t
   line-number-mode: t
   indent-tabs-mode: t

Load-path shadows:
~/emacs/lisp/json hides 
c:/apps/emacs/emacs-28.2/share/emacs/28.2/lisp/json
~/emacs/lisp/css-mode hides 
c:/apps/emacs/emacs-28.2/share/emacs/28.2/lisp/textmodes/css-mode

Features:
(shadow sort emacsbug make-mode js align goto-addr nroff-mode lpr
realgud-gdb realgud:gdb-track-mode realgud:gdb-init realgud-track-mode
realgud-backtrace-mode realgud:gdb-core realgud:run realgud-track
realgud-shortkey realgud-menu realgud-eval realgud-init realgud-file
esh-mode realgud-cmds realgud-core realgud-reset realgud-bp
realgud-bp-image-data realgud-lang realgud-send realgud-window
realgud-buffer-helper realgud-buffer-breakpoint realgud-buffer-backtrace
realgud-locals realgud-buffer-locals realgud-buffer-command
realgud-buffer-info realgud-regexp realgud-lochist realgud-loc
realgud-buffer-source realgud-key realgud-custom key realgud-follow
loc-changes org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-footnote org-src ob-comint org-pcomplete org-list org-faces
org-entities org-version ob-emacs-lisp ob-core ob-eval org-table
oc-basic bibtex ol org-keys oc org-compat org-macs org-loaddefs cal-menu
calendar cal-loaddefs realgud-fringe realgud-helper realgud-utils eshell
esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups
esh-util load-relative cl-print eieio-opt speedbar ezimage dframe
shortdoc help-fns nhexl-mode noutline outline pcase find-func autoload
radix-tree lisp-mnt mm-archive gnutls network-stream url-http url-gw nsm
url-cache url-auth ruler-mode hl-line mule-util hexl bat-mode mail-extr
meson-mode smie conf-mode find-file dabbrev calc-arith calccomp calc-bin
calc-alg calc-menu misearch multi-isearch add-log vc-bzr cap-words
superword subword face-remap etags-select etags fileloop generator xref
project mb-depth two-column bookmark icicles icicles-mode comp comp-cstr
cl-extra icicles-cmd2 icicles-cmd1 warnings icicles-mcmd doremi
icicles-fn icicles-var icicles-opt edmacro ffap kmacro cus-theme
thingatpt icicles-face hexrgb calc-vec calc-forms calc-misc calc-aent
calc-prog calc-ext calc calc-loaddefs rect calc-macs vcl-mode cc-langs
mel-mode prop-mode pfx-mode message rmc puny help-mode easy-mmode dired+
image-dired image-mode exif image-file image-converter dired-aux dired-x
dired dired-loaddefs rfc822 mml mml-sec epa epg rfc6068 epg-config
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader smtpmail sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils ibuffer
ibuffer-loaddefs caml-font 7z-arc-mode cperl-mode rx facemenu fakecygpty
matlab derived tempo which-func cus-edit pp wid-edit grep cus-load
cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs compile text-property-search vc vc-dispatcher imenu
browse-kill-ring view ediff ediff-merg ediff-mult ediff-wind ediff-diff
ediff-help ediff-init ediff-util checker-allout checker-outline hex-util
hmac-sha1 tramp tramp-loaddefs trampver tramp-integration files-x
tramp-compat shell pcomplete comint ansi-color parse-time iso8601
time-date format-spec web-mode advice tex-site server info winner ring
yaml-mode ispell finder-inf realgud-recursive-autoloads package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax 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 emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads w32notify
w32 lcms2 multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 2583460 283035)
  (symbols 48 48033 35)
  (strings 32 332543 29010)
  (string-bytes 1 11657043)
  (vectors 16 124331)
  (vector-slots 8 2675678 261302)
  (floats 8 559 942)
  (intervals 56 280393 2040)
  (buffers 992 101))