aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-09-19 14:20:54 +0000
committerStefan Monnier2007-09-19 14:20:54 +0000
commitab8e678c8cb07f2ca0f6ebce5b672281b29c67e2 (patch)
treed804c1e42a3b251d145360809bd0a30befa7cc57
parentb608e3027e376f2e0db591250a33fc8f6b6b253b (diff)
downloademacs-ab8e678c8cb07f2ca0f6ebce5b672281b29c67e2.tar.gz
emacs-ab8e678c8cb07f2ca0f6ebce5b672281b29c67e2.zip
Remove spurious * in docstrings.
(snmp-rfc1155-types, snmp-rfc1213-types, snmp-rfc1902-types) (snmp-rfc1903-types, snmp-rfc1155-access, snmp-rfc1902-access) (snmp-rfc1212-status, snmp-rfc1902-status): Remove list wrappers now that completion accepts lists of strings. (snmp-mode-syntax-table): Move initialization into declaration. (snmp-mode-map): Likewise and remove \t binding. (snmp-common-mode): Set tab-always-indent according to snmp-t-a-i. (snmp-indent-line, snmp-mode-imenu-create-index): Remove unused var. (snmp-indent-command): Remove.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/net/snmp-mode.el121
2 files changed, 60 insertions, 72 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index adf080ddeab..d387dcac958 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,16 @@
12007-09-19 Stefan Monnier <monnier@iro.umontreal.ca> 12007-09-19 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * net/snmp-mode.el: Remove spurious * in docstrings.
4 (snmp-rfc1155-types, snmp-rfc1213-types, snmp-rfc1902-types)
5 (snmp-rfc1903-types, snmp-rfc1155-access, snmp-rfc1902-access)
6 (snmp-rfc1212-status, snmp-rfc1902-status): Remove list wrappers now
7 that completion accepts lists of strings.
8 (snmp-mode-syntax-table): Move initialization into declaration.
9 (snmp-mode-map): Likewise and remove \t binding.
10 (snmp-common-mode): Set tab-always-indent according to snmp-t-a-i.
11 (snmp-indent-line, snmp-mode-imenu-create-index): Remove unused var.
12 (snmp-indent-command): Remove.
13
3 * emacs-lisp/lisp-mode.el (lisp-mode-shared-map): Use the default TAB 14 * emacs-lisp/lisp-mode.el (lisp-mode-shared-map): Use the default TAB
4 binding, so tab-always-indent works right. 15 binding, so tab-always-indent works right.
5 16
diff --git a/lisp/net/snmp-mode.el b/lisp/net/snmp-mode.el
index bf438638794..0ce0b91c037 100644
--- a/lisp/net/snmp-mode.el
+++ b/lisp/net/snmp-mode.el
@@ -88,6 +88,8 @@
88;;; Code: 88;;; Code:
89 89
90(eval-when-compile 90(eval-when-compile
91 (require 'cl)
92 (require 'imenu) ; Need this stuff when compiling for imenu macros, etc.
91 (require 'tempo)) 93 (require 'tempo))
92 94
93;;;---------------------------------------------------------------------------- 95;;;----------------------------------------------------------------------------
@@ -102,42 +104,42 @@
102 :version "20.4") 104 :version "20.4")
103 105
104(defcustom snmp-special-indent t 106(defcustom snmp-special-indent t
105 "*If non-nil, use a simple heuristic to try to guess the right indentation. 107 "If non-nil, use a simple heuristic to try to guess the right indentation.
106If nil, then no special indentation is attempted." 108If nil, then no special indentation is attempted."
107 :type 'boolean 109 :type 'boolean
108 :group 'snmp) 110 :group 'snmp)
109 111
110(defcustom snmp-indent-level 4 112(defcustom snmp-indent-level 4
111 "*Indentation level for SNMP MIBs." 113 "Indentation level for SNMP MIBs."
112 :type 'integer 114 :type 'integer
113 :group 'snmp) 115 :group 'snmp)
114 116
115(defcustom snmp-tab-always-indent nil 117(defcustom snmp-tab-always-indent nil
116 "*Non-nil means TAB should always reindent the current line. 118 "Non-nil means TAB should always reindent the current line.
117A value of nil means reindent if point is within the initial line indentation; 119A value of nil means reindent if point is within the initial line indentation;
118otherwise insert a TAB." 120otherwise insert a TAB."
119 :type 'boolean 121 :type 'boolean
120 :group 'snmp) 122 :group 'snmp)
121 123
122(defcustom snmp-completion-ignore-case t 124(defcustom snmp-completion-ignore-case t
123 "*Non-nil means that case differences are ignored during completion. 125 "Non-nil means that case differences are ignored during completion.
124A value of nil means that case is significant. 126A value of nil means that case is significant.
125This is used during Tempo template completion." 127This is used during Tempo template completion."
126 :type 'boolean 128 :type 'boolean
127 :group 'snmp) 129 :group 'snmp)
128 130
129(defcustom snmp-common-mode-hook nil 131(defcustom snmp-common-mode-hook nil
130 "*Hook(s) evaluated when a buffer enters either SNMP or SNMPv2 mode." 132 "Hook(s) evaluated when a buffer enters either SNMP or SNMPv2 mode."
131 :type 'hook 133 :type 'hook
132 :group 'snmp) 134 :group 'snmp)
133 135
134(defcustom snmp-mode-hook nil 136(defcustom snmp-mode-hook nil
135 "*Hook(s) evaluated when a buffer enters SNMP mode." 137 "Hook(s) evaluated when a buffer enters SNMP mode."
136 :type 'hook 138 :type 'hook
137 :group 'snmp) 139 :group 'snmp)
138 140
139(defcustom snmpv2-mode-hook nil 141(defcustom snmpv2-mode-hook nil
140 "*Hook(s) evaluated when a buffer enters SNMPv2 mode." 142 "Hook(s) evaluated when a buffer enters SNMPv2 mode."
141 :type 'hook 143 :type 'hook
142 :group 'snmp) 144 :group 'snmp)
143 145
@@ -195,26 +197,26 @@ This is used during Tempo template completion."
195 "Predefined types for SYNTAX clauses.") 197 "Predefined types for SYNTAX clauses.")
196 198
197(defvar snmp-rfc1155-types 199(defvar snmp-rfc1155-types
198 '(("INTEGER") ("OCTET STRING") ("OBJECT IDENTIFIER") ("NULL") ("IpAddress") 200 '("INTEGER" "OCTET STRING" "OBJECT IDENTIFIER" "NULL" "IpAddress"
199 ("NetworkAddress") ("Counter") ("Gauge") ("TimeTicks") ("Opaque")) 201 "NetworkAddress" "Counter" "Gauge" "TimeTicks" "Opaque")
200 "Types from RFC 1155 v1 SMI.") 202 "Types from RFC 1155 v1 SMI.")
201 203
202(defvar snmp-rfc1213-types 204(defvar snmp-rfc1213-types
203 '(("DisplayString")) 205 '("DisplayString")
204 "Types from RFC 1213 MIB-II.") 206 "Types from RFC 1213 MIB-II.")
205 207
206(defvar snmp-rfc1902-types 208(defvar snmp-rfc1902-types
207 '(("INTEGER") ("OCTET STRING") ("OBJECT IDENTIFIER") ("Integer32") 209 '("INTEGER" "OCTET STRING" "OBJECT IDENTIFIER" "Integer32"
208 ("IpAddress") ("Counter32") ("Gauge32") ("Unsigned32") ("TimeTicks") 210 "IpAddress" "Counter32" "Gauge32" "Unsigned32" "TimeTicks"
209 ("Opaque") ("Counter64")) 211 "Opaque" "Counter64")
210 "Types from RFC 1902 v2 SMI.") 212 "Types from RFC 1902 v2 SMI.")
211 213
212(defvar snmp-rfc1903-types 214(defvar snmp-rfc1903-types
213 '(("DisplayString") ("PhysAddress") ("MacAddress") ("TruthValue") 215 '("DisplayString" "PhysAddress" "MacAddress" "TruthValue"
214 ("TestAndIncr") ("AutonomousType") ("InstancePointer") 216 "TestAndIncr" "AutonomousType" "InstancePointer"
215 ("VariablePointer") ("RowPointer") ("RowStatus") ("TimeStamp") 217 "VariablePointer" "RowPointer" "RowStatus" "TimeStamp"
216 ("TimeInterval") ("DateAndTime") ("StorageType") ("TDomain") 218 "TimeInterval" "DateAndTime" "StorageType" "TDomain"
217 ("TAddress")) 219 "TAddress")
218 "Types from RFC 1903 Textual Conventions.") 220 "Types from RFC 1903 Textual Conventions.")
219 221
220 222
@@ -222,12 +224,12 @@ This is used during Tempo template completion."
222 "Predefined values for ACCESS clauses.") 224 "Predefined values for ACCESS clauses.")
223 225
224(defvar snmp-rfc1155-access 226(defvar snmp-rfc1155-access
225 '(("read-only") ("read-write") ("write-only") ("not-accessible")) 227 '("read-only" "read-write" "write-only" "not-accessible")
226 "ACCESS values from RFC 1155 v1 SMI.") 228 "ACCESS values from RFC 1155 v1 SMI.")
227 229
228(defvar snmp-rfc1902-access 230(defvar snmp-rfc1902-access
229 '(("read-only") ("read-write") ("read-create") ("not-accessible") 231 '("read-only" "read-write" "read-create" "not-accessible"
230 ("accessible-for-notify")) 232 "accessible-for-notify")
231 "ACCESS values from RFC 1155 v1 SMI.") 233 "ACCESS values from RFC 1155 v1 SMI.")
232 234
233 235
@@ -235,11 +237,11 @@ This is used during Tempo template completion."
235 "Predefined values for STATUS clauses.") 237 "Predefined values for STATUS clauses.")
236 238
237(defvar snmp-rfc1212-status 239(defvar snmp-rfc1212-status
238 '(("mandatory") ("obsolete") ("deprecated")) 240 '("mandatory" "obsolete" "deprecated")
239 "STATUS values from RFC 1212 v1 SMI.") 241 "STATUS values from RFC 1212 v1 SMI.")
240 242
241(defvar snmp-rfc1902-status 243(defvar snmp-rfc1902-status
242 '(("current") ("obsolete") ("deprecated")) 244 '("current" "obsolete" "deprecated")
243 "STATUS values from RFC 1902 v2 SMI.") 245 "STATUS values from RFC 1902 v2 SMI.")
244 246
245 247
@@ -252,13 +254,6 @@ This is used during Tempo template completion."
252;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 254;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
253 255
254 256
255;; Need this stuff when compiling for imenu macros, etc.
256;;
257(eval-when-compile
258 (require 'cl)
259 (require 'imenu))
260
261
262;; Create abbrev table for SNMP MIB mode 257;; Create abbrev table for SNMP MIB mode
263;; 258;;
264(defvar snmp-mode-abbrev-table nil 259(defvar snmp-mode-abbrev-table nil
@@ -275,33 +270,30 @@ This is used during Tempo template completion."
275 270
276;; Set up our keymap 271;; Set up our keymap
277;; 272;;
278(defvar snmp-mode-map (make-sparse-keymap) 273(defvar snmp-mode-map
274 (let ((map (make-sparse-keymap)))
275 (define-key map "\177" 'backward-delete-char-untabify)
276 (define-key map "\C-c\C-i" 'tempo-complete-tag)
277 (define-key map "\C-c\C-f" 'tempo-forward-mark)
278 (define-key map "\C-c\C-b" 'tempo-backward-mark)
279 map)
279 "Keymap used in SNMP mode.") 280 "Keymap used in SNMP mode.")
280 281
281(define-key snmp-mode-map "\t" 'snmp-indent-command)
282(define-key snmp-mode-map "\177" 'backward-delete-char-untabify)
283
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)
287
288 282
289;; Set up our syntax table 283;; Set up our syntax table
290;; 284;;
291(defvar snmp-mode-syntax-table nil 285(defvar snmp-mode-syntax-table
286 (let ((st (make-syntax-table)))
287 (modify-syntax-entry ?\\ "\\" st)
288 (modify-syntax-entry ?- "_ 1234" st)
289 (modify-syntax-entry ?\n ">" st)
290 (modify-syntax-entry ?\^m ">" st)
291 (modify-syntax-entry ?_ "." st)
292 (modify-syntax-entry ?: "." st)
293 (modify-syntax-entry ?= "." st)
294 st)
292 "Syntax table used for buffers in SNMP mode.") 295 "Syntax table used for buffers in SNMP mode.")
293 296
294(if snmp-mode-syntax-table
295 ()
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))
304
305;; Set up the stuff that's common between snmp-mode and snmpv2-mode 297;; Set up the stuff that's common between snmp-mode and snmpv2-mode
306;; 298;;
307(defun snmp-common-mode (name mode abbrev font-keywords imenu-index tempo-tags) 299(defun snmp-common-mode (name mode abbrev font-keywords imenu-index tempo-tags)
@@ -335,10 +327,9 @@ This is used during Tempo template completion."
335 (setq parse-sexp-ignore-comments t) 327 (setq parse-sexp-ignore-comments t)
336 328
337 ;; Set up indentation 329 ;; Set up indentation
338 (make-local-variable 'indent-line-function) 330 (if snmp-special-indent
339 (setq indent-line-function (if snmp-special-indent 331 (set (make-local-variable 'indent-line-function) 'snmp-indent-line))
340 'snmp-indent-line 332 (set (make-local-variable 'tab-always-indent) snmp-tab-always-indent)
341 'indent-to-left-margin))
342 333
343 ;; Font Lock 334 ;; Font Lock
344 (make-local-variable 'font-lock-defaults) 335 (make-local-variable 'font-lock-defaults)
@@ -474,7 +465,7 @@ lines for the purposes of this function."
474 "Indent current line as SNMP MIB code." 465 "Indent current line as SNMP MIB code."
475 (let ((indent (snmp-calculate-indent)) 466 (let ((indent (snmp-calculate-indent))
476 (pos (- (point-max) (point))) 467 (pos (- (point-max) (point)))
477 shift-amt beg end) 468 shift-amt beg)
478 (beginning-of-line) 469 (beginning-of-line)
479 (setq beg (point)) 470 (setq beg (point))
480 (skip-chars-forward " \t") 471 (skip-chars-forward " \t")
@@ -488,20 +479,6 @@ lines for the purposes of this function."
488 (if (> (- (point-max) pos) (point)) 479 (if (> (- (point-max) pos) (point))
489 (goto-char (- (point-max) pos))))) 480 (goto-char (- (point-max) pos)))))
490 481
491(defun snmp-indent-command ()
492 "Indent current line as SNMP MIB code, or sometimes insert a TAB.
493If `snmp-tab-always-indent' is t, always reindent the current line when
494this command is run.
495If `snmp-tab-always-indent' is nil, reindent the current line if point is
496in the initial indentation. Otherwise, insert a TAB."
497 (interactive)
498 (if (and (not snmp-tab-always-indent)
499 (save-excursion
500 (skip-chars-backward " \t")
501 (not (bolp))))
502 (insert-tab)
503 (snmp-indent-line)))
504
505 482
506;;;---------------------------------------------------------------------------- 483;;;----------------------------------------------------------------------------
507;; 484;;
@@ -520,7 +497,7 @@ in the initial indentation. Otherwise, insert a TAB."
520 (index-table-alist '()) 497 (index-table-alist '())
521 (index-trap-alist '()) 498 (index-trap-alist '())
522 (case-fold-search nil) ; keywords must be uppercase 499 (case-fold-search nil) ; keywords must be uppercase
523 prev-pos token marker end) 500 prev-pos token end)
524 (goto-char (point-min)) 501 (goto-char (point-min))
525 (imenu-progress-message prev-pos 0) 502 (imenu-progress-message prev-pos 0)
526 ;; Search for a useful MIB item (that's not in a comment) 503 ;; Search for a useful MIB item (that's not in a comment)
@@ -529,7 +506,7 @@ in the initial indentation. Otherwise, insert a TAB."
529 (imenu-progress-message prev-pos) 506 (imenu-progress-message prev-pos)
530 (setq 507 (setq
531 end (match-end 0) 508 end (match-end 0)
532 token (cons (buffer-substring (match-beginning 1) (match-end 1)) 509 token (cons (match-string 1)
533 (set-marker (make-marker) (match-beginning 1)))) 510 (set-marker (make-marker) (match-beginning 1))))
534 (goto-char (match-beginning 2)) 511 (goto-char (match-beginning 2))
535 (cond ((looking-at "OBJECT-TYPE[ \t\n]+SYNTAX") 512 (cond ((looking-at "OBJECT-TYPE[ \t\n]+SYNTAX")
@@ -719,5 +696,5 @@ controls whether case is significant."
719 696
720(provide 'snmp-mode) 697(provide 'snmp-mode)
721 698
722;;; arch-tag: eb6cc0f9-1e47-4023-8625-bc9aae6c3527 699;; arch-tag: eb6cc0f9-1e47-4023-8625-bc9aae6c3527
723;;; snmp-mode.el ends here 700;;; snmp-mode.el ends here