• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/net/

Lines Matching defs:snmp

0 ;;; snmp-mode.el --- SNMP & SNMPv2 MIB major mode
39 ;; list `snmp-tempo-tags' (or `snmpv2-tempo-tags'): this list is
40 ;; automatically installed when snmp-mode (or snmpv2-mode) is entered.
83 ;; (add-hook 'snmp-common-mode-hook 'turn-on-font-lock)
99 (defgroup snmp nil
104 (defcustom snmp-special-indent t
108 :group 'snmp)
110 (defcustom snmp-indent-level 4
113 :group 'snmp)
115 (defcustom snmp-tab-always-indent nil
120 :group 'snmp)
122 (defcustom snmp-completion-ignore-case t
127 :group 'snmp)
129 (defcustom snmp-common-mode-hook nil
132 :group 'snmp)
134 (defcustom snmp-mode-hook nil
137 :group 'snmp)
142 :group 'snmp)
144 (defvar snmp-tempo-tags nil
157 (defvar snmp-font-lock-keywords-1
170 (defvar snmp-font-lock-keywords-2
174 snmp-font-lock-keywords-1)
177 (defvar snmp-font-lock-keywords-3
183 snmp-font-lock-keywords-2)
186 (defvar snmp-font-lock-keywords snmp-font-lock-keywords-1
194 (defvar snmp-mode-syntax-list nil
197 (defvar snmp-rfc1155-types
202 (defvar snmp-rfc1213-types
206 (defvar snmp-rfc1902-types
212 (defvar snmp-rfc1903-types
221 (defvar snmp-mode-access-list nil
224 (defvar snmp-rfc1155-access
228 (defvar snmp-rfc1902-access
234 (defvar snmp-mode-status-list nil
237 (defvar snmp-rfc1212-status
241 (defvar snmp-rfc1902-status
264 (defvar snmp-mode-abbrev-table nil
266 (define-abbrev-table 'snmp-mode-abbrev-table ())
278 (defvar snmp-mode-map (make-sparse-keymap)
281 (define-key snmp-mode-map "\t" 'snmp-indent-command)
282 (define-key snmp-mode-map "\177" 'backward-delete-char-untabify)
284 (define-key snmp-mode-map "\C-c\C-i" 'tempo-complete-tag)
285 (define-key snmp-mode-map "\C-c\C-f" 'tempo-forward-mark)
286 (define-key snmp-mode-map "\C-c\C-b" 'tempo-backward-mark)
291 (defvar snmp-mode-syntax-table nil
294 (if snmp-mode-syntax-table
296 (setq snmp-mode-syntax-table (make-syntax-table))
297 (modify-syntax-entry ?\\ "\\" snmp-mode-syntax-table)
298 (modify-syntax-entry ?- "_ 1234" snmp-mode-syntax-table)
299 (modify-syntax-entry ?\n ">" snmp-mode-syntax-table)
300 (modify-syntax-entry ?\^m ">" snmp-mode-syntax-table)
301 (modify-syntax-entry ?_ "." snmp-mode-syntax-table)
302 (modify-syntax-entry ?: "." snmp-mode-syntax-table)
303 (modify-syntax-entry ?= "." snmp-mode-syntax-table))
305 ;; Set up the stuff that's common between snmp-mode and snmpv2-mode
307 (defun snmp-common-mode (name mode abbrev font-keywords imenu-index tempo-tags)
315 (use-local-map snmp-mode-map)
316 (set-syntax-table snmp-mode-syntax-table)
339 (setq indent-line-function (if snmp-special-indent
340 'snmp-indent-line
366 (defun snmp-mode ()
372 \\{snmp-mode-map}
373 Turning on snmp-mode runs the hooks in `snmp-common-mode-hook', then
374 `snmp-mode-hook'."
377 (snmp-common-mode "SNMP" 'snmp-mode
378 snmp-mode-abbrev-table
379 '(snmp-font-lock-keywords
380 snmp-font-lock-keywords-1
381 snmp-font-lock-keywords-2
382 snmp-font-lock-keywords-3)
383 'snmp-mode-imenu-create-index
384 'snmp-tempo-tags)
387 (make-local-variable 'snmp-mode-syntax-list)
388 (setq snmp-mode-syntax-list (append snmp-rfc1155-types
389 snmp-rfc1213-types
390 snmp-mode-syntax-list))
391 (make-local-variable 'snmp-mode-access-list)
392 (setq snmp-mode-access-list snmp-rfc1155-access)
393 (make-local-variable 'snmp-mode-status-list)
394 (setq snmp-mode-status-list snmp-rfc1212-status)
397 (run-mode-hooks 'snmp-common-mode-hook 'snmp-mode-hook))
407 \\{snmp-mode-map}
408 Turning on snmp-mode runs the hooks in `snmp-common-mode-hook',
412 (snmp-common-mode "SNMPv2" 'snmpv2-mode
414 '(snmp-font-lock-keywords
415 snmp-font-lock-keywords-1
416 snmp-font-lock-keywords-2
417 snmp-font-lock-keywords-3)
418 'snmp-mode-imenu-create-index
422 (make-local-variable 'snmp-mode-syntax-list)
423 (setq snmp-mode-syntax-list (append snmp-rfc1902-types
424 snmp-rfc1903-types
425 snmp-mode-syntax-list))
426 (make-local-variable 'snmp-mode-access-list)
427 (setq snmp-mode-access-list snmp-rfc1902-access)
428 (make-local-variable 'snmp-mode-status-list)
429 (setq snmp-mode-status-list snmp-rfc1902-status)
432 (run-mode-hooks 'snmp-common-mode-hook 'snmpv2-mode-hook))
441 (defvar snmp-macro-open
446 (defvar snmp-macro-close
449 (defun snmp-calculate-indent ()
453 open\" string, add `snmp-indent-level' to it. If it was a \"macro close\"
454 string, subtract `snmp-indent-level'. Otherwise, use the same indentation
465 (cond ((looking-at snmp-macro-open)
466 snmp-indent-level)
468 ((looking-at snmp-macro-close)
469 (- snmp-indent-level))
473 (defun snmp-indent-line ()
475 (let ((indent (snmp-calculate-indent))
491 (defun snmp-indent-command ()
493 If `snmp-tab-always-indent' is t, always reindent the current line when
495 If `snmp-tab-always-indent' is nil, reindent the current line if point is
498 (if (and (not snmp-tab-always-indent)
503 (snmp-indent-line)))
512 (defvar snmp-clause-regexp
516 (defun snmp-mode-imenu-create-index ()
528 (while (re-search-forward snmp-clause-regexp nil t)
574 (defun snmp-completing-read (prompt table &optional pred require init hist)
576 Like `completing-read', but the variable `snmp-completion-ignore-case'
578 (let ((completion-ignore-case snmp-completion-ignore-case))
583 (tempo-define-template "snmp-object-type"
587 (snmp-completing-read "Syntax: " snmp-mode-syntax-list nil nil)
591 (snmp-completing-read "Access: " snmp-mode-access-list nil t)
595 (snmp-completing-read "Status: " snmp-mode-status-list nil t)
605 'snmp-tempo-tags)
609 (tempo-define-template "snmp-table-type"
639 'snmp-tempo-tags)
648 (snmp-completing-read "Syntax: " snmp-mode-syntax-list nil nil)
652 (snmp-completing-read "Max Access: " snmp-mode-access-list nil t)
656 (snmp-completing-read "Status: " snmp-mode-status-list nil t)
708 (snmp-completing-read "Status: " snmp-mode-status-list nil t)
713 (snmp-completing-read "Syntax: " snmp-mode-syntax-list nil nil)
720 (provide 'snmp-mode)
723 ;;; snmp-mode.el ends here