Spelling fixes.
[bpt/emacs.git] / lisp / cedet / srecode / srt-mode.el
index e10c163..0a99b78 100644 (file)
@@ -1,6 +1,6 @@
 ;;; srecode/srt-mode.el --- Major mode for writing screcode macros
 
-;; Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007-2011 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -183,27 +183,20 @@ we can tell font lock about them.")
   "Keymap used in srecode mode.")
 
 ;;;###autoload
-(defun srecode-template-mode ()
+(define-derived-mode srecode-template-mode fundamental-mode "SRecorder"
   "Major-mode for writing SRecode macros."
-  (interactive)
-  (kill-all-local-variables)
-  (setq major-mode 'srecode-template-mode
-        mode-name "SRecoder"
-       comment-start ";;"
+  (setq comment-start ";;"
        comment-end "")
   (set (make-local-variable 'parse-sexp-ignore-comments) t)
   (set (make-local-variable 'comment-start-skip)
        "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
-  (set-syntax-table srecode-template-mode-syntax-table)
-  (use-local-map srecode-template-mode-map)
   (set (make-local-variable 'font-lock-defaults)
        '(srecode-font-lock-keywords
          nil  ;; perform string/comment fontification
          nil  ;; keywords are case sensitive.
          ;; This puts _ & - as a word constituant,
          ;; simplifying our keywords significantly
-         ((?_ . "w") (?- . "w"))))
-  (run-hooks 'srecode-template-mode-hook))
+         ((?_ . "w") (?- . "w")))))
 
 ;;;###autoload
 (defalias 'srt-mode 'srecode-template-mode)
@@ -320,7 +313,7 @@ how many occur."
            (beginning-of-line)
            (while (re-search-forward es start t 2))
            (if (re-search-forward es start t)
-               ;; If there is a single, the the answer is yes.
+               ;; If there is a single, the answer is yes.
                t
              ;; If there wasn't another, then the answer is no.
              nil)
@@ -375,7 +368,7 @@ Moves out one named section."
 (define-mode-local-override semantic-beginning-of-context
   srecode-template-mode (&optional point)
   "Move to the beginning of the current context.
-Moves the the beginning of one named section."
+Moves to the beginning of one named section."
   (if (semantic-up-context point)
       t
     (let ((es (regexp-quote (srecode-template-get-escape-start)))
@@ -386,8 +379,8 @@ Moves the the beginning of one named section."
 
 (define-mode-local-override semantic-end-of-context
   srecode-template-mode (&optional point)
-  "Move to the beginning of the current context.
-Moves the the beginning of one named section."
+  "Move to the end of the current context.
+Moves to the end of one named section."
   (let ((name (srecode-up-context-get-name point))
        (tag (semantic-current-tag))
        (es  (regexp-quote (srecode-template-get-escape-start))))
@@ -490,7 +483,7 @@ section or ? for an ask variable."
 
        (if (> start (point))
            ;; If our starting point is after the found point, that
-           ;; means we are not inside the macro.  Retur nil.
+           ;; means we are not inside the macro.  Return nil.
            nil
          ;; We are inside the macro, extract the text so far.
          (let* ((macroend (match-beginning 0))
@@ -629,8 +622,7 @@ section or ? for an ask variable."
 (define-mode-local-override semantic-analyze-possible-completions
   srecode-template-mode (context)
   "Return a list of possible completions based on NONTEXT."
-  (save-excursion
-    (set-buffer (oref context buffer))
+  (with-current-buffer (oref context buffer)
     (let* ((prefix (car (last (oref context :prefix))))
           (prefixstr (cond ((stringp prefix)
                             prefix)
@@ -748,5 +740,4 @@ When optional BUFFER is provided, search that buffer."
 ;; generated-autoload-load-name: "srecode/srt-mode"
 ;; End:
 
-;; arch-tag: 9c613c25-d885-417a-8f0d-1824b26b22a5
 ;;; srecode/srt-mode.el ends here