summaryrefslogtreecommitdiff
path: root/lisp/textmodes/dns-mode.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2017-05-05 21:44:09 -0400
committerGlenn Morris <rgm@gnu.org>2017-05-05 21:44:09 -0400
commita95fefd1e699ba683331f2813d0956f4142ba986 (patch)
treeb02fd901463e4b8a5a1a2241e3f6d8c1c9518e42 /lisp/textmodes/dns-mode.el
parent2b91f3d1eac402128c753e0780c50488a4f9cacb (diff)
downloademacs-a95fefd1e699ba683331f2813d0956f4142ba986.tar.gz
Decruftify dns-mode.el a little bit
* lisp/textmodes/dns-mode.el (dns-mode-control-entities): New constant. (dns-mode-control-entity, dns-mode-bad-control-entity) (dns-mode-type, dns-mode-class): New faces. (dns-mode-control-entity-face, dns-mode-bad-control-entity-face) (dns-mode-type-face, dns-mode-class): Make these variables use the new faces, and mark as obsolete. (dns-mode-font-lock-keywords): Use dns-mode-control-entities.
Diffstat (limited to 'lisp/textmodes/dns-mode.el')
-rw-r--r--lisp/textmodes/dns-mode.el50
1 files changed, 42 insertions, 8 deletions
diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el
index 01f509d9136..cc8bad6337b 100644
--- a/lisp/textmodes/dns-mode.el
+++ b/lisp/textmodes/dns-mode.el
@@ -48,6 +48,9 @@
"DNS master file mode configuration."
:group 'data)
+(defconst dns-mode-control-entities '("INCLUDE" "ORIGIN" "TTL")
+ "Lists of strings with known DNS control entities.")
+
(defconst dns-mode-classes '("IN" "CS" "CH" "HS")
"List of strings with known DNS classes.")
@@ -62,28 +65,59 @@
"MAILA" "TLSA" "NSEC3")
"List of strings with known DNS types.")
-;; Font lock.
+(defface dns-mode-control-entity '((t :inherit font-lock-keyword-face))
+ "Face used for DNS control entities, e.g. $ORIGIN."
+ :version "26.1"
+ :group 'dns-mode)
+
+(defface dns-mode-bad-control-entity '((t :inherit font-lock-warning-face))
+ "Face used for non-standard DNS control entities, e.g. $FOO."
+ :version "26.1"
+ :group 'dns-mode)
+
+(defface dns-mode-type '((t :inherit font-lock-type-face))
+ "Face used for DNS types, e.g., SOA."
+ :version "26.1"
+ :group 'dns-mode)
+
+(defface dns-mode-class '((t :inherit font-lock-constant-face))
+ "Face used for DNS classes, e.g., IN."
+ :version "26.1"
+ :group 'dns-mode)
-(defvar dns-mode-control-entity-face 'font-lock-keyword-face
+(defvar dns-mode-control-entity-face ''dns-mode-control-entity
"Name of face used for control entities, e.g. $ORIGIN.")
+(make-obsolete-variable 'dns-mode-control-entity-face
+ "customize the face `dns-mode-control-entity' instead."
+ "26.1" 'set)
-(defvar dns-mode-bad-control-entity-face 'font-lock-warning-face
+(defvar dns-mode-bad-control-entity-face ''dns-mode-bad-control-entity
"Name of face used for non-standard control entities, e.g. $FOO.")
+(make-obsolete-variable
+ 'dns-mode-bad-control-entity-face
+ "customize the face `dns-mode-bad-control-entity' instead."
+ "26.1" 'set)
-(defvar dns-mode-type-face 'font-lock-type-face
+(defvar dns-mode-type-face ''dns-mode-type
"Name of face used for DNS types, e.g., SOA.")
+(make-obsolete-variable 'dns-mode-type-face
+ "customize the face `dns-mode-type' instead."
+ "26.1" 'set)
-(defvar dns-mode-class-face 'font-lock-constant-face
+(defvar dns-mode-class-face ''dns-mode-class
"Name of face used for DNS classes, e.g., IN.")
+(make-obsolete-variable 'dns-mode-class
+ "customize the face `dns-mode-class' instead."
+ "26.1" 'set)
(defcustom dns-mode-font-lock-keywords
- `(("^$ORIGIN" 0 ,dns-mode-control-entity-face)
- ("^$INCLUDE" 0 ,dns-mode-control-entity-face)
- ("^$TTL" 0 ,dns-mode-control-entity-face)
+ `((,(concat "^$" (regexp-opt dns-mode-control-entities))
+ 0 ,dns-mode-control-entity-face)
("^$[a-z0-9A-Z]+" 0 ,dns-mode-bad-control-entity-face)
(,(regexp-opt dns-mode-classes) 0 ,dns-mode-class-face)
(,(regexp-opt dns-mode-types) 0 ,dns-mode-type-face))
"Font lock keywords used to highlight text in DNS master file mode."
+ :version "26.1"
:type 'sexp
:group 'dns-mode)