 
     table))
 
-(defgroup rust-mode nil "Support for Rust code.")
+(defgroup rust-mode nil
+  "Support for Rust code."
+  :link '(url-link "http://www.rust-lang.org/")
+  :group 'languages)
 
 (defcustom rust-indent-offset 4
-  "*Indent Rust code by this number of spaces."
+  "Indent Rust code by this number of spaces."
+  :type 'integer
   :group 'rust-mode)
 
 (defun rust-paren-level () (nth 0 (syntax-ppss)))

(define-derived-mode rust-mode rust-parent-mode "Rust"
  "Major mode for Rust code."
  :group 'rust-mode

  ;; Basic syntax
  (set-syntax-table rust-mode-syntax-table)

  ;; Indentation
  (set (make-local-variable 'indent-line-function)
       'rust-mode-indent-line)

  ;; Fonts
  (set (make-local-variable 'font-lock-defaults)
       '(rust-mode-font-lock-keywords nil nil nil nil))

  ;; Misc
  (set (make-local-variable 'comment-start) "// ")
  (set (make-local-variable 'comment-end)   "")
  (set (make-local-variable 'indent-tabs-mode) nil)

  ;; Allow paragraph fills for comments
  (set (make-local-variable 'comment-start-skip)
       "\\(?://[/!]*\\|/\\*[*!]?\\)[[:space:]]*")
  (set (make-local-variable 'paragraph-start)
       (concat "[[:space:]]*\\(?:" comment-start-skip "\\|\\*/?[[:space:]]*\\|\\)$"))
  (set (make-local-variable 'paragraph-separate) paragraph-start)
  (set (make-local-variable 'normal-auto-fill-function) 'rust-do-auto-fill)
  (set (make-local-variable 'fill-paragraph-function) 'rust-fill-paragraph)
  (set (make-local-variable 'fill-forward-paragraph-function) 'rust-fill-forward-paragraph)
  (set (make-local-variable 'adaptive-fill-function) 'rust-find-fill-prefix)
  (set (make-local-variable 'comment-multi-line) t)
  (set (make-local-variable 'comment-line-break-function) 'rust-comment-indent-new-line)
  (set (make-local-variable 'imenu-generic-expression) rust-imenu-generic-expression)
  (set (make-local-variable 'beginning-of-defun-function) 'rust-beginning-of-defun)
  (set (make-local-variable 'end-of-defun-function) 'rust-end-of-defun)
  )


;;;###autoload
(add-to-list 'auto-mode-alist '("\\.rs$" . rust-mode))

(defun rust-mode-reload ()
  (interactive)
  (unload-feature 'rust-mode)
  (require 'rust-mode)
  (rust-mode))

(provide 'rust-mode)

;; Issue #6887: Rather than inheriting the 'gnu compilation error
;; regexp (which is broken on a few edge cases), add our own 'rust

      (concat "^\\s-*\\(?:priv\\|pub\\)?\\s-*"
              (regexp-opt
               '("enum" "struct" "type" "mod" "use" "fn" "static" "impl"
                 "extern" "impl" "static" "trait"))))

(defun rust-beginning-of-defun (&optional arg)
  "Move backward to the beginning of the current defun.
