]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/vera-mode.el
Add bug-gnu-emacs to some specialized bug report addresses
[gnu-emacs] / lisp / progmodes / vera-mode.el
index 525ce460bc82db4720d3e433867537295d5b0723..7b59faca2617e7b8039ed989d1fbdbce1aa0d2cb 100644 (file)
@@ -1,7 +1,6 @@
-;;; vera-mode.el --- major mode for editing Vera files.
+;;; vera-mode.el --- major mode for editing Vera files
 
-;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-;;   2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2013 Free Software Foundation, Inc.
 
 ;; Author:      Reto Zimmermann <reto@gnu.org>
 ;; Maintainer:  Reto Zimmermann <reto@gnu.org>
   :group 'languages)
 
 (defcustom vera-basic-offset 2
-  "*Amount of basic offset used for indentation."
+  "Amount of basic offset used for indentation."
   :type 'integer
   :group 'vera)
 
 (defcustom vera-underscore-is-part-of-word nil
-  "*Non-nil means consider the underscore character `_' as part of word.
+  "Non-nil means consider the underscore character `_' as part of word.
 An identifier containing underscores is then treated as a single word in
 select and move operations.  All parts of an identifier separated by underscore
 are treated as single words otherwise."
@@ -104,7 +103,7 @@ are treated as single words otherwise."
   :group 'vera)
 
 (defcustom vera-intelligent-tab t
-  "*Non-nil means `TAB' does indentation, word completion and tab insertion.
+  "Non-nil means `TAB' does indentation, word completion and tab insertion.
 That is, if preceding character is part of a word then complete word,
 else if not at beginning of line then insert tab,
 else if last command was a `TAB' or `RET' then dedent one step,
@@ -253,7 +252,7 @@ If nil, TAB always indents current line."
 ;;;###autoload (add-to-list 'auto-mode-alist (cons (purecopy "\\.vr[hi]?\\'")  'vera-mode))
 
 ;;;###autoload
-(defun vera-mode ()
+(define-derived-mode vera-mode prog-mode "Vera"
   "Major mode for editing Vera code.
 
 Usage:
@@ -301,13 +300,6 @@ Key bindings:
 -------------
 
 \\{vera-mode-map}"
-  (interactive)
-  (kill-all-local-variables)
-  (setq major-mode 'vera-mode)
-  (setq mode-name "Vera")
-  ;; set maps and tables
-  (use-local-map vera-mode-map)
-  (set-syntax-table vera-mode-syntax-table)
   ;; set local variables
   (require 'cc-cmds)
   (set (make-local-variable 'comment-start) "//")
@@ -318,7 +310,6 @@ Key bindings:
   (set (make-local-variable 'comment-indent-function) 'c-comment-indent)
   (set (make-local-variable 'paragraph-start) "^$")
   (set (make-local-variable 'paragraph-separate) paragraph-start)
-  (set (make-local-variable 'require-final-newline) t)
   (set (make-local-variable 'indent-tabs-mode) nil)
   (set (make-local-variable 'indent-line-function) 'vera-indent-line)
   (set (make-local-variable 'parse-sexp-ignore-comments) t)
@@ -328,9 +319,7 @@ Key bindings:
   ;; add menu (XEmacs)
   (easy-menu-add vera-mode-menu)
   ;; miscellaneous
-  (message "Vera Mode %s.  Type C-c C-h for documentation." vera-version)
-  ;; run hooks
-  (run-hooks 'vera-mode-hook))
+  (message "Vera Mode %s.  Type C-c C-h for documentation." vera-version))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -438,7 +427,7 @@ Key bindings:
     "icompare" "insert" "inst_get_at_least" "inst_get_auto_bin_max"
     "inst_get_collect" "inst_get_cov_weight" "inst_get_coverage_goal"
     "inst_getcross_bin_max" "inst_query" "inst_set_at_least"
-    "inst_set_auto_bin_max" "inst_set_bin_activiation" "inst_set_collect"
+    "inst_set_auto_bin_max" "inst_set_bin_activation" "inst_set_collect"
     "inst_set_cov_weight" "inst_set_coverage_goal" "inst_set_cross_bin_max"
     "itoa"
     "last" "last_index" "len" "load"
@@ -449,7 +438,7 @@ Key bindings:
     "push_front" "putc"
     "query" "query_str"
     "rand_mode" "randomize" "reserve" "reverse" "rsort"
-    "search" "set_at_least" "set_auto_bin_max" "set_bin_activiation"
+    "search" "set_at_least" "set_auto_bin_max" "set_bin_activation"
     "set_cov_weight" "set_coverage_goal" "set_cross_bin_max" "set_name" "size"
     "sort" "substr" "sum"
     "thismatch" "tolower" "toupper"
@@ -598,12 +587,6 @@ Key bindings:
 ;;; Font locking
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-;; XEmacs compatibility
-(when (featurep 'xemacs)
-  (require 'font-lock)
-  (copy-face 'font-lock-reference-face 'font-lock-constant-face)
-  (copy-face 'font-lock-preprocessor-face 'font-lock-builtin-face))
-
 (defun vera-font-lock-match-item (limit)
   "Match, and move over, any declaration item after point.
 Adapted from `font-lock-match-c-style-declaration-item-and-skip-to-next'."
@@ -681,23 +664,23 @@ Adapted from `font-lock-match-c-style-declaration-item-and-skip-to-next'."
   "Face name to use for interface names.")
 
 (defface vera-font-lock-number
-  '((((class color) (background light)) (:foreground "Gold4"))
-    (((class color) (background dark)) (:foreground "BurlyWood1"))
-    (t (:italic t :bold t)))
+  '((((class color) (background light)) :foreground "Gold4")
+    (((class color) (background dark))  :foreground "BurlyWood1")
+    (t :slant italic :weight bold))
   "Font lock mode face used to highlight @ definitions."
   :group 'font-lock-highlighting-faces)
 
 (defface vera-font-lock-function
-  '((((class color) (background light)) (:foreground "DarkCyan"))
-    (((class color) (background dark)) (:foreground "Orchid1"))
-    (t (:italic t :bold t)))
+  '((((class color) (background light)) :foreground "DarkCyan")
+    (((class color) (background dark))  :foreground "Orchid1")
+    (t :slant italic :weight bold))
   "Font lock mode face used to highlight predefined functions and tasks."
   :group 'font-lock-highlighting-faces)
 
 (defface vera-font-lock-interface
-  '((((class color) (background light)) (:foreground "Grey40"))
-    (((class color) (background dark)) (:foreground "Grey80"))
-    (t (:italic t :bold t)))
+  '((((class color) (background light)) :foreground "Grey40")
+    (((class color) (background dark))  :foreground "Grey80")
+    (t :slant italic :weight bold))
   "Font lock mode face used to highlight interface names."
   :group 'font-lock-highlighting-faces)
 
@@ -770,7 +753,7 @@ the offset is simply returned."
              relpos 0)
       (setq offset (vera-evaluate-offset offset langelem symbol)))
     (+ (if (and relpos
-               (< relpos (save-excursion (beginning-of-line) (point))))
+               (< relpos (line-beginning-position)))
           (save-excursion
             (goto-char relpos)
             (current-column))
@@ -1087,7 +1070,7 @@ try to increase performance by using this macro."
   (save-excursion
     (beginning-of-line)
     (let ((indent-point (point))
-         syntax state placeholder pos)
+         syntax state placeholder)
       ;; determine syntax state
       (setq state (parse-partial-sexp (point-min) (point)))
       (cond
@@ -1250,7 +1233,7 @@ Calls `indent-region' for whole buffer."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; electrifications
 
-(defun vera-electric-tab (&optional prefix-arg)
+(defun vera-electric-tab (&optional prefix)
   "Do what I mean (indent, expand, tab, change indent, etc..).
 If preceding character is part of a word or a paren then `hippie-expand',
 else if right of non whitespace on line then `tab-to-tab-stop',
@@ -1270,7 +1253,7 @@ If `vera-intelligent-tab' is nil, always indent line."
                      (or (and (boundp 'hippie-expand-only-buffers)
                               hippie-expand-only-buffers)
                          '(vera-mode))))
-                (vera-expand-abbrev prefix-arg)))
+                (vera-expand-abbrev prefix)))
              ((> (current-column) (current-indentation))
               (tab-to-tab-stop))
              ((and (or (eq last-command 'vera-electric-tab)
@@ -1412,7 +1395,7 @@ If `vera-intelligent-tab' is nil, always indent line."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Comments
 
-(defun vera-comment-uncomment-region (beg end &optional arg)
+(defun vera-comment-uncomment-region (beg end &optional _arg)
   "Comment region if not commented, uncomment region if already commented."
   (interactive "r\nP")
   (goto-char beg)
@@ -1440,7 +1423,8 @@ If `vera-intelligent-tab' is nil, always indent line."
 ;;; Bug reports
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(defconst vera-mode-help-address "Reto Zimmermann <reto@gnu.org>"
+(defconst vera-mode-help-address
+  "Reto Zimmermann <reto@gnu.org>, bug-gnu-emacs@gnu.org"
   "Address for Vera Mode bug reports.")
 
 ;; get reporter-submit-bug-report when byte-compiling
@@ -1482,5 +1466,4 @@ If `vera-intelligent-tab' is nil, always indent line."
 
 (provide 'vera-mode)
 
-;; arch-tag: 22eae722-7ac5-47ac-a713-c4db1cf623a9
 ;;; vera-mode.el ends here