unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#55944: [PATCH] Fix dns-mode-font-lock-keywords
@ 2022-06-13 10:58 Lassi Kortela
  2022-06-13 14:33 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Lassi Kortela @ 2022-06-13 10:58 UTC (permalink / raw)
  To: 55944

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

Attached is a simple fix to the syntax highlighting of dns-mode.

For example, IN and SOA are reserved words. Instead of highlighting only 
the full words IN and SOA, dns-mode would highlight any word that has IN 
or SOA as a substring. This patch fixes the use of regexp-opt such that 
reserved words are only highlighted when they are full words.

[-- Attachment #2: dns-mode-font-lock-keywords.patch --]
[-- Type: text/plain, Size: 782 bytes --]

--- dns-mode.el.orig	2022-06-13 13:25:03.000000000 +0300
+++ dns-mode.el	2022-06-13 13:31:15.000000000 +0300
@@ -110,11 +110,11 @@
 			"26.1" 'set)
 
 (defcustom dns-mode-font-lock-keywords
-  `((,(concat "^\\$" (regexp-opt dns-mode-control-entities))
+  `((,(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))
+    (,(regexp-opt dns-mode-classes 'words) 0 ,dns-mode-class-face)
+    (,(regexp-opt dns-mode-types 'words) 0 ,dns-mode-type-face))
   "Font lock keywords used to highlight text in DNS master file mode."
   :version "26.1"
   :type 'sexp)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-13 14:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-13 10:58 bug#55944: [PATCH] Fix dns-mode-font-lock-keywords Lassi Kortela
2022-06-13 14:33 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).