]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/vhdl-mode.el
American English spelling fix.
[gnu-emacs] / lisp / progmodes / vhdl-mode.el
index 60d30eb8a6d854daec8f12af45bf988a2e5f5f2d..2ff6f8f1315f8fd19adf88a8c471bac37decd180 100644 (file)
@@ -1,7 +1,8 @@
 ;;; vhdl-mode.el --- major mode for editing VHDL code
 
 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-;;   2001, 2002, 2003, 2004, 2005, 2006, 2007  Free Software Foundation, Inc.
+;;   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;;   Free Software Foundation, Inc.
 
 ;; Authors:     Reto Zimmermann <reto@gnu.org>
 ;;              Rodney J. Whitby <software.vhdl-mode@rwhitby.net>
@@ -9,6 +10,11 @@
 ;; Keywords:    languages vhdl
 ;; WWW:         http://www.iis.ee.ethz.ch/~zimmi/emacs/vhdl-mode.html
 
+;; Yoni Rabkin <yoni@rabkins.net> contacted the maintainer of this
+;; file on 18/3/2008, and the maintainer agreed that when a bug is
+;; filed in the Emacs bug reporting system against this file, a copy
+;; of the bug report be sent to the maintainer's email address.
+
 (defconst vhdl-version "3.33.6"
   "VHDL Mode version number.")
 
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,9 +34,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Commentary:
 
 ;;; Code:
 
-;; XEmacs handling
-(defconst vhdl-xemacs (string-match "XEmacs" emacs-version)
-  "Non-nil if XEmacs is used.")
 ;; Emacs 21+ handling
-(defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not vhdl-xemacs))
+(defconst vhdl-emacs-21 (and (<= 21 emacs-major-version) (not (featurep 'xemacs)))
   "Non-nil if GNU Emacs 21, 22, ... is used.")
-(defconst vhdl-emacs-22 (and (<= 22 emacs-major-version) (not vhdl-xemacs))
+(defconst vhdl-emacs-22 (and (<= 22 emacs-major-version) (not (featurep 'xemacs)))
   "Non-nil if GNU Emacs 22, ... is used.")
 
 (defvar compilation-file-regexp-alist)
@@ -1844,13 +1845,13 @@ NOTE: Activate the new setting in a VHDL buffer by using the menu entry
 
 ;; add related general customizations
 (custom-add-to-group 'vhdl-related 'hideshow 'custom-group)
-(if vhdl-xemacs
+(if (featurep 'xemacs)
     (custom-add-to-group 'vhdl-related 'paren-mode 'custom-variable)
   (custom-add-to-group 'vhdl-related 'paren-showing 'custom-group))
 (custom-add-to-group 'vhdl-related 'ps-print 'custom-group)
 (custom-add-to-group 'vhdl-related 'speedbar 'custom-group)
 (custom-add-to-group 'vhdl-related 'line-number-mode 'custom-variable)
-(unless vhdl-xemacs
+(unless (featurep 'xemacs)
   (custom-add-to-group 'vhdl-related 'transient-mark-mode 'custom-variable))
 (custom-add-to-group 'vhdl-related 'user-full-name 'custom-variable)
 (custom-add-to-group 'vhdl-related 'mail-host-address 'custom-variable)
@@ -2050,7 +2051,7 @@ your style, only those that are different from the default.")
 (defun vhdl-keep-region-active ()
   "Do whatever is necessary to keep the region active in XEmacs.
 Ignore byte-compiler warnings you might see."
-  (and (boundp 'zmacs-region-stays)
+  (and (featurep 'xemacs)
        (setq zmacs-region-stays t)))
 
 ;; `wildcard-to-regexp' is included only in XEmacs 21
@@ -2093,7 +2094,7 @@ Ignore byte-compiler warnings you might see."
       newstr)))
 
 ;; `itimer.el': idle timer bug fix in version 1.09 (XEmacs 21.1.9)
-(when (and vhdl-xemacs (string< itimer-version "1.09")
+(when (and (featurep 'xemacs) (string< itimer-version "1.09")
           (not noninteractive))
   (load "itimer")
   (when (string< itimer-version "1.09")
@@ -2486,7 +2487,7 @@ conversion."
 (defun vhdl-show-messages ()
   "Get *Messages* buffer to show recent messages."
   (interactive)
-  (display-buffer (if vhdl-xemacs " *Message-Log*" "*Messages*")))
+  (display-buffer (if (featurep 'xemacs) " *Message-Log*" "*Messages*")))
 
 (defun vhdl-use-direct-instantiation ()
   "Return whether direct instantiation is used."
@@ -2686,7 +2687,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
   (define-key vhdl-mode-map "\M-\C-u"     'vhdl-backward-up-list)
   (define-key vhdl-mode-map "\M-\C-a"     'vhdl-backward-same-indent)
   (define-key vhdl-mode-map "\M-\C-e"     'vhdl-forward-same-indent)
-  (unless vhdl-xemacs ; would override `M-backspace' in XEmacs
+  (unless (featurep 'xemacs) ; would override `M-backspace' in XEmacs
     (define-key vhdl-mode-map "\M-\C-h"           'vhdl-mark-defun))
   (define-key vhdl-mode-map "\M-\C-q"     'vhdl-indent-sexp)
   (define-key vhdl-mode-map "\M-^"        'vhdl-delete-indentation)
@@ -2713,7 +2714,7 @@ STRING are replaced by `-' and substrings are converted to lower case."
   (define-key vhdl-mode-map "\C-c\C-p\C-i" 'vhdl-port-paste-instance)
   (define-key vhdl-mode-map "\C-c\C-p\C-s" 'vhdl-port-paste-signals)
   (define-key vhdl-mode-map "\C-c\C-p\M-c" 'vhdl-port-paste-constants)
-  (if vhdl-xemacs ; `... C-g' not allowed in XEmacs
+  (if (featurep 'xemacs) ; `... C-g' not allowed in XEmacs
       (define-key vhdl-mode-map "\C-c\C-p\M-g" 'vhdl-port-paste-generic-map)
     (define-key vhdl-mode-map "\C-c\C-p\C-g" 'vhdl-port-paste-generic-map))
   (define-key vhdl-mode-map "\C-c\C-p\C-z" 'vhdl-port-paste-initializations)
@@ -2726,12 +2727,12 @@ STRING are replaced by `-' and substrings are converted to lower case."
   (define-key vhdl-mode-map "\C-c\C-s\C-b" 'vhdl-subprog-paste-body)
   (define-key vhdl-mode-map "\C-c\C-s\C-c" 'vhdl-subprog-paste-call)
   (define-key vhdl-mode-map "\C-c\C-s\C-f" 'vhdl-subprog-flatten)
-  (define-key vhdl-mode-map "\C-c\C-c\C-n" 'vhdl-compose-new-component)
-  (define-key vhdl-mode-map "\C-c\C-c\C-p" 'vhdl-compose-place-component)
-  (define-key vhdl-mode-map "\C-c\C-c\C-w" 'vhdl-compose-wire-components)
-  (define-key vhdl-mode-map "\C-c\C-c\C-f" 'vhdl-compose-configuration)
-  (define-key vhdl-mode-map "\C-c\C-c\C-k" 'vhdl-compose-components-package)
-  (define-key vhdl-mode-map "\C-cc"       'vhdl-comment-uncomment-region)
+  (define-key vhdl-mode-map "\C-c\C-m\C-n" 'vhdl-compose-new-component)
+  (define-key vhdl-mode-map "\C-c\C-m\C-p" 'vhdl-compose-place-component)
+  (define-key vhdl-mode-map "\C-c\C-m\C-w" 'vhdl-compose-wire-components)
+  (define-key vhdl-mode-map "\C-c\C-m\C-f" 'vhdl-compose-configuration)
+  (define-key vhdl-mode-map "\C-c\C-m\C-k" 'vhdl-compose-components-package)
+  (define-key vhdl-mode-map "\C-c\C-c"    'vhdl-comment-uncomment-region)
   (define-key vhdl-mode-map "\C-c-"       'vhdl-comment-append-inline)
   (define-key vhdl-mode-map "\C-c\M--"    'vhdl-comment-display-line)
   (define-key vhdl-mode-map "\C-c\C-i\C-l" 'indent-according-to-mode)
@@ -2770,8 +2771,8 @@ STRING are replaced by `-' and substrings are converted to lower case."
   (define-key vhdl-mode-map "\C-c\C-b"    'vhdl-beautify-buffer)
   (define-key vhdl-mode-map "\C-c\C-u\C-s" 'vhdl-update-sensitivity-list-process)
   (define-key vhdl-mode-map "\C-c\C-u\M-s" 'vhdl-update-sensitivity-list-buffer)
-  (define-key vhdl-mode-map "\C-cf"       'vhdl-fontify-buffer)
-  (define-key vhdl-mode-map "\C-cs"       'vhdl-statistics-buffer)
+  (define-key vhdl-mode-map "\C-c\C-i\C-f" 'vhdl-fontify-buffer)
+  (define-key vhdl-mode-map "\C-c\C-i\C-s" 'vhdl-statistics-buffer)
   (define-key vhdl-mode-map "\C-c\M-m"    'vhdl-show-messages)
   (define-key vhdl-mode-map "\C-c\C-h"    'vhdl-doc-mode)
   (define-key vhdl-mode-map "\C-c\C-v"    'vhdl-version)
@@ -5395,7 +5396,7 @@ negative, skip forward otherwise."
       (skip-chars-forward " \t\n"))))
 
 ;; XEmacs hack: work around buggy `forward-comment' in XEmacs 21.4+
-(unless (and vhdl-xemacs (string< "21.2" emacs-version))
+(unless (and (featurep 'xemacs) (string< "21.2" emacs-version))
   (defalias 'vhdl-forward-comment 'forward-comment))
 
 ;; This is the best we can do in Win-Emacs.
@@ -9098,8 +9099,9 @@ otherwise."
         (progn (delete-region (point) (progn (end-of-line) (point)))
                (vhdl-template-insert-date))
        (unless noerror
-        (error (concat "ERROR:  Modification date prefix string \""
-                       vhdl-modify-date-prefix-string "\" not found")))))))
+        (error "ERROR:  Modification date prefix string \"%s\" not found"
+                       vhdl-modify-date-prefix-string))))))
+
 
 (defun vhdl-template-modify-noerror ()
   "Call `vhdl-template-modify' with NOERROR non-nil."
@@ -10435,7 +10437,7 @@ with double-quotes is to be inserted.  DEFAULT specifies a default string."
   "Query a decision from the user."
   (let ((start (point)))
     (when string (vhdl-insert-keyword (concat string " ")))
-    (message prompt)
+    (message "%s" (or prompt ""))
     (let ((char (read-char)))
       (delete-region start (point))
       (if (and optional (eq char ?\r))
@@ -13013,7 +13015,7 @@ This does background highlighting of translate-off regions.")
 
 (defun vhdl-ps-print-init ()
   "Initialize postscript printing."
-  (if vhdl-xemacs
+  (if (featurep 'xemacs)
       (when (boundp 'ps-print-color-p)
        (vhdl-ps-print-settings))
     (make-local-variable 'ps-print-hook)
@@ -14064,10 +14066,10 @@ if required."
          (save-excursion (beginning-of-line) (looking-at "[0-9]+:"))]
         ["Rescan Directory" vhdl-speedbar-rescan-hierarchy
          :active (save-excursion (beginning-of-line) (looking-at "[0-9]+:"))
-         ,(if vhdl-xemacs :active :visible) (not vhdl-speedbar-show-projects)]
+         ,(if (featurep 'xemacs) :active :visible) (not vhdl-speedbar-show-projects)]
         ["Rescan Project" vhdl-speedbar-rescan-hierarchy
          :active (save-excursion (beginning-of-line) (looking-at "[0-9]+:"))
-         ,(if vhdl-xemacs :active :visible) vhdl-speedbar-show-projects]
+         ,(if (featurep 'xemacs) :active :visible) vhdl-speedbar-show-projects]
         ["Save Caches" vhdl-save-caches vhdl-updated-project-list])))
     ;; hook-ups
     (speedbar-add-expansion-list
@@ -15172,7 +15174,7 @@ is already shown in a buffer."
        (goto-line (cdr token))
        (recenter))
       (vhdl-speedbar-update-current-unit t t)
-      (speedbar-set-timer speedbar-update-speed)
+      (speedbar-set-timer dframe-update-speed)
       (speedbar-maybee-jump-to-attached-frame))))
 
 (defun vhdl-speedbar-port-copy ()
@@ -16189,7 +16191,7 @@ no project is defined."
                    (assoc (car sublist) regexp-alist))
          (setq regexp-alist (cons (list (nth 0 sublist)
                                         (if (= 0 (nth 1 sublist))
-                                            (if vhdl-xemacs 9 nil)
+                                            (if (featurep 'xemacs) 9 nil)
                                           (nth 1 sublist))
                                         (nth 2 sublist) (nth 3 sublist))
                                   regexp-alist)))
@@ -16989,7 +16991,7 @@ to visually support naming conventions.")
 (defun vhdl-doc-variable (variable)
   "Display VARIABLE's documentation in *Help* buffer."
   (interactive)
-  (unless vhdl-xemacs
+  (unless (featurep 'xemacs)
     (help-setup-xref (list #'vhdl-doc-variable variable) (interactive-p)))
   (with-output-to-temp-buffer
       (if (fboundp 'help-buffer) (help-buffer) "*Help*")
@@ -17001,7 +17003,7 @@ to visually support naming conventions.")
 (defun vhdl-doc-mode ()
   "Display VHDL Mode documentation in *Help* buffer."
   (interactive)
-  (unless vhdl-xemacs
+  (unless (featurep 'xemacs)
     (help-setup-xref (list #'vhdl-doc-mode) (interactive-p)))
   (with-output-to-temp-buffer
       (if (fboundp 'help-buffer) (help-buffer) "*Help*")