]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix fontification of network files in `awk-mode`
authorStefan Kangas <stefankangas@gmail.com>
Sun, 7 Jul 2024 02:31:01 +0000 (04:31 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 7 Jul 2024 13:17:01 +0000 (15:17 +0200)
* lisp/progmodes/cc-awk.el (awk-font-lock-keywords): Fix fontification
of special network file names such as "/inet4/tcp/0/localhost/daytime".
See Info node '(gawk) TCP/IP Networking'.

(cherry picked from commit 17807a3144045305334c85b248ff6cdd93681ab6)

lisp/progmodes/cc-awk.el

index 937a965d4ed699259fd01b6f2a648184f5b3cdcc..e377c4831fc9c553596cacccfdc7fbd8253e3635 100644 (file)
@@ -1011,9 +1011,11 @@ std\\(err\\|in\\|out\\)\\|user\\)\\)\\>\
      ;; Do the same (almost) with
      ;; (regexp-opt '("/inet/tcp/lport/rhost/rport" "/inet/udp/lport/rhost/rport"
      ;;                 "/inet/raw/lport/rhost/rport") 'words)
+     ;; , replacing "inet" with "inet[46]?"
+     ;; , replacing "lport", "rhost", and "rport" with "[[:alnum:]]+".
      ;; This cannot be combined with the above pattern, because the match number
      ;; for the (optional) closing \" would then exceed 9.
-     '("\\(\"/inet/\\(\\(raw\\|\\(tc\\|ud\\)p\\)/lport/rhost/rport\\)\\)\\>\
+     '("\\(\"/inet[46]?/\\(\\(raw\\|\\(tc\\|ud\\)p\\)/[[:alnum:]]+/[[:alnum:]]+/[[:alnum:]]+\\)\\)\\>\
 \\(\\(\"\\)\\|\\([^\"/\n\r][^\"\n\r]*\\)?$\\)"
        (1 font-lock-variable-name-face t)
        (6 font-lock-variable-name-face t t))