emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/dockerfile-mode 902e4c2a5a 075/104: Add faces for image na


From: ELPA Syncer
Subject: [nongnu] elpa/dockerfile-mode 902e4c2a5a 075/104: Add faces for image name and alias
Date: Sat, 29 Jan 2022 07:58:35 -0500 (EST)

branch: elpa/dockerfile-mode
commit 902e4c2a5a80d8481bc08fd18a474c23ef2c1d3e
Author: Matus Goljer <matus.goljer@gmail.com>
Commit: Matus Goljer <matus.goljer@gmail.com>

    Add faces for image name and alias
---
 dockerfile-mode.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/dockerfile-mode.el b/dockerfile-mode.el
index f031ff20be..9c9933a8b2 100644
--- a/dockerfile-mode.el
+++ b/dockerfile-mode.el
@@ -55,6 +55,14 @@ Each element of the list will be passed as a separate
   :type '(repeat string)
   :group 'dockerfile)
 
+(defface dockerfile-image-name
+  '((t (:inherit (font-lock-type-face bold))))
+  "Face to highlight the base image name after FROM instruction.")
+
+(defface dockerfile-image-alias
+  '((t (:inherit (font-lock-constant-face bold))))
+  "Face to highlight the base image alias inf FROM ... AS <alias> construct.")
+
 (defvar dockerfile-font-lock-keywords
   `(,(cons (rx (or line-start "onbuild ")
                (group (or "from" "maintainer" "run" "cmd" "expose" "env" "arg"
@@ -62,6 +70,9 @@ Each element of the list will be passed as a separate
                           "label" "stopsignal" "shell" "healthcheck"))
                word-boundary)
            font-lock-keyword-face)
+    (,(rx "FROM " (group (+? nonl)) (or " " eol) (? "as " (group (1+ nonl))))
+     (1 'dockerfile-image-name)
+     (2 'dockerfile-image-alias nil t))
     ,@(sh-font-lock-keywords)
     ,@(sh-font-lock-keywords-2)
     ,@(sh-font-lock-keywords-1))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]