;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:25:16 2007 ;;; from file /home/cyd/emacs/lisp/textmodes/dns-mode.el ;;; in Emacs version 22.0.99 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`dns-mode.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (custom-declare-group 'dns-mode nil "DNS master file mode configuration." :group 'data) #@41 List of strings with known DNS classes. (defconst dns-mode-classes '("IN" "CS" "CH" "HS") (#$ . 661)) #@39 List of strings with known DNS types. (defconst dns-mode-types '("A" "NS" "MD" "MF" "CNAME" "SOA" "MB" "MG" "MR" "NULL" "WKS" "PTR" "HINFO" "MINFO" "MX" "TXT" "RP" "AFSDB" "X25" "ISDN" "RT" "NSAP" "NSAP" "SIG" "KEY" "PX" "GPOS" "AAAA" "LOC" "NXT" "EID" "NIMLOC" "SRV" "ATMA" "NAPTR" "KX" "CERT" "A6" "DNAME" "SINK" "OPT" "APL" "DS" "SSHFP" "RRSIG" "NSEC" "DNSKEY" "UINFO" "UID" "GID" "UNSPEC" "TKEY" "TSIG" "IXFR" "AXFR" "MAILB" "MAILA") (#$ . 769)) #@55 Name of face used for control entities, e.g. $ORIGIN. (defvar dns-mode-control-entity-face 'font-lock-keyword-face (#$ . 1225)) #@65 Name of face used for non-standard control entities, e.g. $FOO. (defvar dns-mode-bad-control-entity-face 'font-lock-warning-face (#$ . 1359)) #@45 Name of face used for DNS types, e.g., SOA. (defvar dns-mode-type-face 'font-lock-type-face (#$ . 1507)) #@46 Name of face used for DNS classes, e.g., IN. (defvar dns-mode-class-face 'font-lock-constant-face (#$ . 1618)) #@68 Font lock keywords used to highlight text in DNS master file mode. (custom-declare-variable 'dns-mode-font-lock-keywords '`(("^$ORIGIN" 0 ,dns-mode-control-entity-face) ("^$INCLUDE" 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)) '(#$ . 1735) :type 'sexp :group 'dns-mode) #@326 Whether to increment the SOA serial number automatically. If this variable is t, the serial number is incremented upon each save of the file. If it is `ask', Emacs asks for confirmation whether it should increment the serial upon saving. If nil, serials must be incremented manually with \[dns-mode-soa-increment-serial]. (custom-declare-variable 'dns-mode-soa-auto-increment-serial 't '(#$ . 2165) :type '(choice (const :tag "Always" t) (const :tag "Ask" ask) (const :tag "Never" nil)) :group 'dns-mode) #@49 Syntax table in use in DNS master file buffers. (defvar dns-mode-syntax-table (byte-code "\301 \302\303\304#\210\302\305\306#\210)\207" [table make-syntax-table modify-syntax-entry 59 "< " 10 "> "] 4) (#$ . 2679)) #@34 Keymap for DNS master file mode. (defvar dns-mode-map (byte-code "\301 \302\303\304#\210)\207" [map make-sparse-keymap define-key "" dns-mode-soa-increment-serial] 4) (#$ . 2907)) #@39 Menubar used in DNS master file mode. (defvar dns-mode-menu nil (#$ . 3098)) #@11 DNS Menu. (defvar dns-mode-menu nil (#$ . 3181)) (byte-code "\303\304\305\306$\210\307\310N\204\311\307\310\312#\210\313\300!\204\311\300\314\315#\210\300 B\316\300!\204/\317\300\320 \"\210\313\321!\204;\311\321\314\315#\210\321 B\316\321!\204K\317\321\322 \"\210\311\302\314\315#\210\302 B\316\302!\204e\317\302\323\302\324\"\210\n\"\210\311\315\325\326#\207" [dns-mode-map current-load-list dns-mode-abbrev-table easy-menu-do-define dns-mode-menu "DNS Menu." ("DNS" ["Increment SOA serial" dns-mode-soa-increment-serial t]) dns-mode-hook variable-documentation put "Hook run when entering DNS mode.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" boundp definition-name dns-mode default-boundp set-default make-sparse-keymap dns-mode-syntax-table make-syntax-table define-abbrev-table nil derived-mode-parent text-mode] 5) #@382 Major mode for viewing and editing DNS master files. This mode is inherited from text mode. It add syntax highlighting, and some commands for handling DNS master files. Its keymap inherits from `text-mode' and it has the same variables for customizing indentation. It has its own abbrev table and its own syntax table. Turning on DNS mode runs `dns-mode-hook'. \{dns-mode-map} (defalias 'dns-mode #[nil "\306\300!\210\307\310 \210\311\312\310\313N\203\314\311\313\310\313N#\210\315 !\204'\316 \317 \"\210\320\f!\211\2036 \321 =\203<\322\f\323 \"\210)\324 !\210\325\f!\210'(\306\326!\210\327\306\330!\210\331\306\332!\210\333\306\334!\210\335\336\337\340\341\307$\210\342) \"\210)\343\344!\203}\344\345!\207\346\345!\207" [delay-mode-hooks major-mode mode-name dns-mode-map dns-mode-syntax-table parent make-local-variable t text-mode dns-mode "DNS" mode-class put keymap-parent set-keymap-parent current-local-map char-table-parent standard-syntax-table set-char-table-parent syntax-table use-local-map set-syntax-table comment-start ";" comment-end "" comment-start-skip ";+ *" font-lock-defaults (dns-mode-font-lock-keywords nil nil ((95 . "w"))) add-hook before-save-hook dns-mode-soa-maybe-increment-serial nil easy-menu-add fboundp run-mode-hooks dns-mode-hook run-hooks dns-mode-abbrev-table local-abbrev-table dns-mode-menu] 6 (#$ . 4105) nil]) #@51 Locate SOA record and increment the serial field. (defalias 'dns-mode-soa-increment-serial #[nil "\212eb\210\306\307\310\311#\204\312\313!\210\306\314\310\311#\203q\315\316!\315\317!\320 !\321\322!\211 P\f\231\203H\323\324 \"\325 \310\211\211\316%\210\326\327 #)\202m\f\230\203j\323\211\330 G\" \nT#\325 \310\211\211\316%\210\326\327 #)\202m\312\331!-\202\306\306\332\310\311#\203\236\315\316!\321\333! \231\204\215\312\331!\202\232\325 \310\211\211\316%\210\326\327 #*\202\306\306\334\310\311#\203\303\315\316!\323\335\320!T\"\325 \310\211\211\316%\210\326\327 #*\202\306\312\336!)\207" [serial counterstr counter now nowandoldserial new re-search-forward "^\\(\\(\\([^ ]+[ ]+\\)?[^ ]+[ ]+\\)?[^ ]+[ ]+\\)?SOA" nil t error "Cannot locate SOA record" "\\<\\(\\(198\\|199\\|20[0-9]\\)[0-9]\\(0[0-9]\\|10\\|11\\|12\\)\\([012][0-9]\\|30\\|31\\)\\([0-9]\\{1,3\\}\\)\\)\\>" match-string 1 5 string-to-number format-time-string "%Y%m%d" format "%s00" replace-match message "Replaced old serial %s with %s" "%%s%%0%dd" "Current SOA serial is in the future" "\\<\\([0-9]\\{9,10\\}\\)\\>" "%s" "\\<\\([0-9]+\\)\\>" "%d" "Cannot locate serial number in SOA record"] 7 (#$ . 5488) nil]) #@80 Increment SOA serial if needed. This function is run from `before-save-hook'. (defalias 'dns-mode-soa-maybe-increment-serial #[nil "\301 \205\205\302=\204\303\304!\205\305 \210\306\207" [dns-mode-soa-auto-increment-serial buffer-modified-p t y-or-n-p "Increment SOA serial? " dns-mode-soa-increment-serial nil] 2 (#$ . 6709)]) (provide 'dns-mode)