emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116878: Sync with upstream vhdl mode v3.35.1


From: Glenn Morris
Subject: [Emacs-diffs] trunk r116878: Sync with upstream vhdl mode v3.35.1
Date: Wed, 26 Mar 2014 03:58:33 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116878
revision-id: address@hidden
parent: address@hidden
author: Reto Zimmermann <address@hidden>
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Tue 2014-03-25 20:58:25 -0700
message:
  Sync with upstream vhdl mode v3.35.1
  
  * lisp/progmodes/vhdl-mode.el (vhdl-version, vhdl-time-stamp): Update.
  (vhdl-compiler-alist): Doc fix.
  (vhdl-goto-line): Remove.
  (vhdl-mode-abbrev-table-init): Add XEmacs compat.
  (vhdl-mode) <paragraph-start>: Fix value.
  (vhdl-fix-statement-region): Not `for' in wait-statement.
  (vhdl-beautify-region): Also (un)tabify.
  (vhdl-get-visible-signals):
  Scan declarative part of generate statements.
  (vhdl-template-record): Fix indentation for record type declaration.
  (vhdl-expand-abbrev, vhdl-expand-paren): FIXME.
  (vhdl-scan-directory-contents): Tweak.
  (vhdl-speedbar-find-file, vhdl-speedbar-port-copy)
  (vhdl-compose-components-package):
  Replace vhdl-goto-line with forward-line.
  (top-level): Tweak speedbar frame selection.
  (vhdl-generate-makefile-1): Support for compilers with no
  unit-to-file name mapping (create directory with dummy files).
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/vhdl-mode.el    
vhdlmode.el-20091113204419-o5vbwnq5f7feedwu-1258
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-03-26 03:18:47 +0000
+++ b/lisp/ChangeLog    2014-03-26 03:58:25 +0000
@@ -1,3 +1,25 @@
+2014-03-26  Reto Zimmermann  <address@hidden>
+
+       Sync with upstream vhdl mode v3.35.1.
+       * progmodes/vhdl-mode.el (vhdl-version, vhdl-time-stamp): Update.
+       (vhdl-compiler-alist): Doc fix.
+       (vhdl-goto-line): Remove.
+       (vhdl-mode-abbrev-table-init): Add XEmacs compat.
+       (vhdl-mode) <paragraph-start>: Fix value.
+       (vhdl-fix-statement-region): Not `for' in wait-statement.
+       (vhdl-beautify-region): Also (un)tabify.
+       (vhdl-get-visible-signals):
+       Scan declarative part of generate statements.
+       (vhdl-template-record): Fix indentation for record type declaration.
+       (vhdl-expand-abbrev, vhdl-expand-paren): FIXME.
+       (vhdl-scan-directory-contents): Tweak.
+       (vhdl-speedbar-find-file, vhdl-speedbar-port-copy)
+       (vhdl-compose-components-package):
+       Replace vhdl-goto-line with forward-line.
+       (top-level): Tweak speedbar frame selection.
+       (vhdl-generate-makefile-1): Support for compilers with no
+       unit-to-file name mapping (create directory with dummy files).
+
 2014-03-26  Wilson Snyder  <address@hidden>
 
        Sync with upstream verilog-mode revision 702457d.

=== modified file 'lisp/progmodes/vhdl-mode.el'
--- a/lisp/progmodes/vhdl-mode.el       2014-01-01 07:43:34 +0000
+++ b/lisp/progmodes/vhdl-mode.el       2014-03-26 03:58:25 +0000
@@ -13,10 +13,10 @@
 ;; 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.34.2"
+(defconst vhdl-version "3.35.1"
   "VHDL Mode version number.")
 
-(defconst vhdl-time-stamp "2012-11-21"
+(defconst vhdl-time-stamp "2014-03-11"
   "VHDL Mode time stamp for last update.")
 
 ;; This file is part of GNU Emacs.
@@ -72,12 +72,12 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Emacs Versions
 
-;; this updated version was only tested on: GNU Emacs 20.4
+;; this updated version was only tested on: GNU Emacs 24.1
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Installation
 
-;; Prerequisites:  GNU Emacs 20.X/21.X/22.X/23.X, XEmacs 20.X/21.X.
+;; Prerequisites:  GNU Emacs 20/21/22/23/24, XEmacs 20/21.
 
 ;; Put `vhdl-mode.el' into the `site-lisp' directory of your Emacs installation
 ;; or into an arbitrary directory that is added to the load path by the
@@ -392,7 +392,8 @@
 Unit-to-file name mapping: mapping of library unit names to names of files
                      generated by the compiler (used for Makefile generation)
   To string        : string a name is mapped to (\"\\1\" inserts the unit name,
-                     \"\\2\" inserts the entity name for architectures)
+                     \"\\2\" inserts the entity name for architectures,
+                     \"\\3\" inserts the library name)
   Case adjustment  : adjust case of inserted unit names
 
 \(*) The regular expression must match the error message starting from the
@@ -1069,7 +1070,7 @@
   "Customizations for sequential processes."
   :group 'vhdl-template)
 
-(defcustom  vhdl-reset-kind 'async
+(defcustom vhdl-reset-kind 'async
   "Specifies which kind of reset to use in sequential processes."
   :type '(choice (const :tag "None" none)
                 (const :tag "Synchronous" sync)
@@ -2256,7 +2257,6 @@
   "Wait until idle, then run FUNCTION."
   (if (fboundp 'start-itimer)
       (start-itimer "vhdl-mode" function secs repeat t)
-;    (run-with-idle-timer secs repeat function)))
     ;; explicitly activate timer (necessary when Emacs is already idle)
     (aset (run-with-idle-timer secs repeat function) 0 nil)))
 
@@ -2596,11 +2596,6 @@
     (set-buffer (marker-buffer marker)))
   (goto-char marker))
 
-(defun vhdl-goto-line (line)
-  "Use this instead of calling user level function `goto-line'."
-  (goto-char (point-min))
-  (forward-line (1- line)))
-
 (defun vhdl-menu-split (list title)
   "Split menu LIST into several submenus, if number of
 elements > `vhdl-menu-max-size'."
@@ -2975,7 +2970,7 @@
 (make-variable-buffer-local 'vhdl-syntactic-context)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Abbrev ook bindings
+;; Abbrev hook bindings
 
 (defvar vhdl-mode-abbrev-table nil
   "Abbrev table to use in `vhdl-mode' buffers.")
@@ -2985,8 +2980,10 @@
   (define-abbrev-table 'vhdl-mode-abbrev-table
     (append
      (when (memq 'vhdl vhdl-electric-keywords)
-       ;; VHDL'93 keywords
-       (mapcar (lambda (x) (list (car x) "" (cdr x) 0 'system))
+       ;; VHDL'02 keywords
+       (mapcar (if (featurep 'xemacs)
+                  (lambda (x) (list (car x) "" (cdr x) 0))
+                (lambda (x) (list (car x) "" (cdr x) 0 'system)))
                '(
                  ("--"           . vhdl-template-display-comment-hook)
                  ("abs"                  . vhdl-template-default-hook)
@@ -3102,7 +3099,9 @@
                  )))
      ;; VHDL-AMS keywords
      (when (and (memq 'vhdl vhdl-electric-keywords) (vhdl-standard-p 'ams))
-       (mapcar (lambda (x) (list (car x) "" (cdr x) 0 'system))
+       (mapcar (if (featurep 'xemacs)
+                  (lambda (x) (list (car x) "" (cdr x) 0))
+                (lambda (x) (list (car x) "" (cdr x) 0 'system)))
                '(
                  ("across"     . vhdl-template-default-hook)
                  ("break"      . vhdl-template-break-hook)
@@ -4822,7 +4821,7 @@
 
   ;; set local variables
   (set (make-local-variable 'paragraph-start)
-       "\\s-*\\(--+\\s-*$\\|[^ -]\\|$\\)")
+       "\\s-*\\(--+\\s-*$\\|$\\)")
   (set (make-local-variable 'paragraph-separate) paragraph-start)
   (set (make-local-variable 'paragraph-ignore-fill-prefix) t)
   (set (make-local-variable 'parse-sexp-ignore-comments) t)
@@ -4860,9 +4859,7 @@
     (set (make-local-variable 'font-lock-support-mode) 'lazy-lock-mode)
     (set (make-local-variable 'lazy-lock-defer-contextually) nil)
     (set (make-local-variable 'lazy-lock-defer-on-the-fly) t)
-;    (set (make-local-variable 'lazy-lock-defer-time) 0.1)
     (set (make-local-variable 'lazy-lock-defer-on-scrolling) t))
-;  (turn-on-font-lock)
 
   ;; variables for source file compilation
   (when vhdl-compile-use-local-error-regexp
@@ -7566,7 +7563,6 @@
       (setq end (point-marker))
       (goto-char begin)
       (setq bol (setq begin (progn (beginning-of-line) (point))))
-;      (untabify bol end)
       (when indent
        (indent-region bol end nil))))
   (let ((copy (copy-alist alignment-list)))
@@ -7962,7 +7958,6 @@
               (and (looking-at "\\s-+") (re-search-forward "\\s-+" end t)
                    (progn (replace-match " " nil nil) t))
               (and (looking-at "-") (re-search-forward "-" end t))
-;             (re-search-forward "[^ \t-]+" end t))))
               (re-search-forward "[^ \t\"-]+" end t))))
   (unless no-message (message "Fixing up whitespace...done")))
 
@@ -8080,7 +8075,7 @@
        (while (re-search-forward "\\<\\(for\\|if\\)\\>" end t)
         (goto-char (match-end 1))
         (setq point (point-marker))
-        ;; exception: in literal or preceded by `end' or label
+        ;; exception: in literal or preceded by `end', `wait' or label
         (when (and (not (save-excursion (goto-char (match-beginning 1))
                                         (vhdl-in-literal)))
                    (save-excursion
@@ -8089,7 +8084,7 @@
                        (and (re-search-forward "^\\s-*\\([^ \t\n].*\\)"
                                                (match-beginning 1) t)
                             (not (string-match
-                                  
"\\(\\<end\\>\\|\\<wait\\>\\|\\w+\\s-*:\\)\\s-*$"
+                                  "\\(\\<end\\>\\|\\<wait 
.*\\|\\w+\\s-*:\\)\\s-*$"
                                   (match-string 1)))))))
           (goto-char (match-beginning 1))
           (insert "\n")
@@ -8138,10 +8133,12 @@
   (when (nth 0 vhdl-beautify-options) (vhdl-fixup-whitespace-region beg end t))
   (when (nth 1 vhdl-beautify-options) (vhdl-fix-statement-region beg end))
   (when (nth 2 vhdl-beautify-options) (vhdl-indent-region beg end))
-  (let ((vhdl-align-groups t))
-    (when (nth 3 vhdl-beautify-options) (vhdl-align-region beg end)))
+  (when (nth 3 vhdl-beautify-options)
+    (let ((vhdl-align-groups t)) (vhdl-align-region beg end)))
   (when (nth 4 vhdl-beautify-options) (vhdl-fix-case-region beg end))
-  (when (nth 0 vhdl-beautify-options) (vhdl-remove-trailing-spaces-region beg 
end)))
+  (when (nth 0 vhdl-beautify-options)
+    (vhdl-remove-trailing-spaces-region beg end)
+    (if vhdl-indent-tabs-mode (tabify beg end) (untabify beg end))))
 
 (defun vhdl-beautify-buffer ()
   "Beautify buffer by applying indentation, whitespace fixup, alignment, and
@@ -8447,11 +8444,11 @@
             (setq beg (point))))))
      ;; search for signals declared in surrounding block declarative parts
      (save-excursion
-       (while (and (progn (while (and (setq beg (re-search-backward 
"^\\s-*\\(\\w+\\s-*:\\s-*block\\|\\(end\\)\\s-+block\\)\\>" nil t))
-                                     (match-string 2))
-                           (goto-char (match-end 2))
+       (while (and (progn (while (and (setq beg (re-search-backward 
"^\\s-*\\(\\w+\\s-*:\\s-*\\(block\\|\\(for\\|if\\).*\\<generate\\>\\)\\|\\(end\\)\\s-+block\\)\\>"
 nil t))
+                                     (match-string 4))
+                           (goto-char (match-end 4))
                            (vhdl-backward-sexp)
-                           (re-search-backward "^\\s-*\\w+\\s-*:\\s-*block\\>" 
nil t))
+                           (re-search-backward 
"^\\s-*\\w+\\s-*:\\s-*\\(block\\|generate\\)\\>" nil t))
                          beg)
                   (setq end (re-search-forward "^\\s-*begin\\>" nil t)))
         ;; scan for all declared signal names
@@ -8966,8 +8963,6 @@
   (interactive)
   (when (vhdl-template-field "target signal")
     (insert " <= ")
-;    (if (not (equal (vhdl-template-field "[GUARDED] [TRANSPORT]") ""))
-;       (insert " "))
     (let ((margin (current-column))
          (start (point))
          position)
@@ -9903,7 +9898,7 @@
 (defun vhdl-template-record (kind &optional name secondary)
   "Insert a record type declaration."
   (interactive)
-  (let ((margin (current-column))
+  (let ((margin (current-indentation))
        (start (point))
        (first t))
     (vhdl-insert-keyword "RECORD\n")
@@ -9965,7 +9960,6 @@
       (insert "\n")
       (indent-to (+ margin vhdl-basic-offset))
       (vhdl-template-field "target signal" " <= ")
-;      (vhdl-template-field "[GUARDED] [TRANSPORT]")
       (insert "\n")
       (indent-to (+ margin vhdl-basic-offset))
       (vhdl-template-field "waveform")
@@ -10635,14 +10629,7 @@
       (if (not (or (and string (progn (insert string) t))
                   (vhdl-template-field "[comment]" nil t)))
          (delete-region position (point))
-       (while (= (preceding-char) ?\ ) (delete-char -1))
-       ;; (when (> (current-column) end-comment-column)
-       ;;   (setq position (point-marker))
-       ;;   (re-search-backward "-- ")
-       ;;   (insert "\n")
-       ;;   (indent-to comment-column)
-       ;;   (goto-char position))
-       ))))
+       (while (= (preceding-char) ?\ ) (delete-char -1))))))
 
 (defun vhdl-comment-block ()
   "Insert comment for code block."
@@ -10882,8 +10869,6 @@
 (defun vhdl-template-generate-body (margin label)
   "Insert body for generate template."
   (vhdl-insert-keyword " GENERATE")
-;   (if (not (vhdl-standard-p '87))
-;       (vhdl-template-begin-end "GENERATE" label margin)
   (insert "\n\n")
   (indent-to margin)
   (vhdl-insert-keyword "END GENERATE ")
@@ -11670,7 +11655,6 @@
                                                  comment group-comment))))
              ;; parse group comment and spacing
              (setq group-comment (vhdl-parse-group-comment))))
-;        (vhdl-parse-string "end\\>")
          ;; parse context clause
          (setq context-clause (vhdl-scan-context-clause))
 ;        ;; add surrounding package to context clause
@@ -12622,7 +12606,6 @@
   (while (and he-expand-list
              (or (not (stringp (car he-expand-list)))
                  (he-string-member (car he-expand-list) he-tried-table t)))
-;                (equal (car he-expand-list) he-search-string)))
     (unless (stringp (car he-expand-list))
       (setq vhdl-expand-upper-case (car he-expand-list)))
     (setq he-expand-list (cdr he-expand-list)))
@@ -12652,15 +12635,17 @@
  (defalias 'he-list-beg 'vhdl-he-list-beg))
 
 ;; function for expanding abbrevs and dabbrevs
-(defalias 'vhdl-expand-abbrev (make-hippie-expand-function
-                              '(try-expand-dabbrev
-                                try-expand-dabbrev-all-buffers
-                                vhdl-try-expand-abbrev)))
+(defun vhdl-expand-abbrev (arg))
+(fset 'vhdl-expand-abbrev (make-hippie-expand-function
+                          '(try-expand-dabbrev
+                            try-expand-dabbrev-all-buffers
+                            vhdl-try-expand-abbrev)))
 
 ;; function for expanding parenthesis
-(defalias 'vhdl-expand-paren (make-hippie-expand-function
-                             '(try-expand-list
-                               try-expand-list-all-buffers)))
+(defun vhdl-expand-paren (arg))
+(fset 'vhdl-expand-paren (make-hippie-expand-function
+                         '(try-expand-list
+                           try-expand-list-all-buffers)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Line handling functions
@@ -13275,7 +13260,6 @@
                    (skip-syntax-backward " ")
                    (skip-syntax-backward "w_")
                    (skip-syntax-backward " ")))
-;                (skip-chars-backward "^-(\n\";")
           (goto-char (match-end 1)) (1 font-lock-variable-name-face)))
 
    ;; highlight formal parameters in component instantiations and subprogram
@@ -13676,8 +13660,6 @@
                                          non-final)
   "Scan contents of VHDL files in directory or file pattern NAME."
   (string-match "\\(.*[/\\]\\)\\(.*\\)" name)
-;   (unless (file-directory-p (match-string 1 name))
-;     (message "No such directory: \"%s\"" (match-string 1 name)))
   (let* ((dir-name (match-string 1 name))
         (file-pattern (match-string 2 name))
         (is-directory (= 0 (length file-pattern)))
@@ -13907,7 +13889,10 @@
                                         
"\\(\\(for\\|if\\)\\>[^;:]+\\<generate\\>\\|block\\>\\)\\)\\|"
                                         "\\(^[ \t]*end[ 
\t\n\r\f]+\\(generate\\|block\\)\\>\\)") end-of-unit t)
                                (or (not limit-hier-inst-no)
-                                   (<= (setq inst-no (1+ inst-no))
+                                   (<= (if (or (match-string 14)
+                                               (match-string 16))
+                                           inst-no
+                                         (setq inst-no (1+ inst-no)))
                                        limit-hier-inst-no)))
                      (cond
                       ;; block/generate beginning found
@@ -14276,9 +14261,6 @@
       (setq level (1+ level)))
     (when (member ent-key ent-hier)
       (error "ERROR:  Instantiation loop detected, component instantiates 
itself: \"%s\"" ent-key))
-    ;; check configured architecture (already checked during scanning)
-;     (unless (or (null conf-inst-alist) (assoc arch-key (nth 3 ent-entry)))
-;       (vhdl-warning-when-idle "Configuration for non-existing architecture 
used: \"%s\"" conf-key))
     ;; process all instances
     (while inst-alist
       (setq inst-entry (car inst-alist)
@@ -14528,7 +14510,6 @@
 (defun vhdl-speedbar-initialize ()
   "Initialize speedbar."
   ;; general settings
-;  (set (make-local-variable 'speedbar-tag-hierarchy-method) nil)
   ;; VHDL file extensions (extracted from `auto-mode-alist')
   (let ((mode-alist auto-mode-alist))
     (while mode-alist
@@ -14626,11 +14607,7 @@
          (append
           '(("vhdl directory" vhdl-speedbar-update-current-unit)
             ("vhdl project" vhdl-speedbar-update-current-project
-             vhdl-speedbar-update-current-unit)
-;           ("files" (lambda () (setq speedbar-ignored-path-regexp
-;                                     (speedbar-extension-list-to-regex
-;                                      speedbar-ignored-path-expressions))))
-            )
+             vhdl-speedbar-update-current-unit))
           speedbar-stealthy-function-list))
     (when (eq vhdl-speedbar-display-mode 'directory)
       (setq speedbar-initial-expansion-list-name "vhdl directory"))
@@ -14724,10 +14701,7 @@
               (concat "^\\([0-9]+:\\s-*<\\)[+]>\\s-+" (caar project-alist) 
"$") nil t)
          (goto-char (match-end 1))
          (speedbar-do-function-pointer)))
-      (setq project-alist (cdr project-alist))))
-;   (vhdl-speedbar-update-current-project)
-;   (vhdl-speedbar-update-current-unit nil t)
-  )
+      (setq project-alist (cdr project-alist)))))
 
 (defun vhdl-speedbar-insert-project-hierarchy (project indent &optional rescan)
   "Insert hierarchy of PROJECT.  Rescan directories if RESCAN is non-nil,
@@ -15747,7 +15721,8 @@
     (let ((buffer (get-file-buffer (car token))))
       (speedbar-find-file-in-frame (car token))
       (when (or vhdl-speedbar-jump-to-unit buffer)
-       (vhdl-goto-line (cdr token))
+       (goto-char (point-min))
+       (forward-line (1- (cdr token)))
        (recenter))
       (vhdl-speedbar-update-current-unit t t)
       (speedbar-set-timer dframe-update-speed)
@@ -15765,7 +15740,8 @@
              (let ((token (get-text-property
                            (match-beginning 3) 'speedbar-token)))
                (vhdl-visit-file (car token) t
-                                (progn (vhdl-goto-line (cdr token))
+                                (progn (goto-char (point-min))
+                                       (forward-line (1- (cdr token)))
                                        (end-of-line)
                                        (if is-entity
                                            (vhdl-port-copy)
@@ -15946,15 +15922,14 @@
 
 ;; add speedbar
 (when (fboundp 'speedbar)
-  (condition-case ()
-      (when (and vhdl-speedbar-auto-open
-                (not (and (boundp 'speedbar-frame)
-                          (frame-live-p speedbar-frame))))
-       (speedbar-frame-mode 1)
-       (if (fboundp 'speedbar-select-attached-frame)
-           (speedbar-select-attached-frame)
-         (select-frame speedbar-attached-frame)))
-    (error (vhdl-warning-when-idle "ERROR:  An error occurred while opening 
speedbar"))))
+  (let ((current-frame (selected-frame)))
+    (condition-case ()
+       (when (and vhdl-speedbar-auto-open
+                  (not (and (boundp 'speedbar-frame)
+                            (frame-live-p speedbar-frame))))
+         (speedbar-frame-mode 1))
+      (error (vhdl-warning-when-idle "ERROR:  An error occurred while opening 
speedbar")))
+    (select-frame current-frame)))
 
 ;; initialize speedbar
 (if (not (boundp 'speedbar-frame))
@@ -16519,7 +16494,8 @@
     ;; insert component declarations
     (while ent-alist
       (vhdl-visit-file (nth 2 (car ent-alist)) nil
-                      (progn (vhdl-goto-line (nth 3 (car ent-alist)))
+                      (progn (goto-char (point-min))
+                             (forward-line (1- (nth 3 (car ent-alist))))
                              (end-of-line)
                              (vhdl-port-copy)))
       (goto-char component-pos)
@@ -17000,12 +16976,16 @@
         (ent-alist (aget vhdl-entity-alist (or project directory) t))
         (conf-alist (aget vhdl-config-alist (or project directory) t))
         (pack-alist (aget vhdl-package-alist (or project directory) t))
-        (regexp-list (nth 12 (aget vhdl-compiler-alist vhdl-compiler)))
-        (ent-regexp (cons "\\(.*\\)" (nth 0 regexp-list)))
-        (arch-regexp (cons "\\(.*\\) \\(.*\\)" (nth 1 regexp-list)))
-        (conf-regexp (cons "\\(.*\\)" (nth 2 regexp-list)))
-        (pack-regexp (cons "\\(.*\\)" (nth 3 regexp-list)))
-        (pack-body-regexp (cons "\\(.*\\)" (nth 4 regexp-list)))
+        (regexp-list (or (nth 12 (aget vhdl-compiler-alist vhdl-compiler))
+                         '("\\1.vhd" "\\2_\\1.vhd" "\\1.vhd"
+                           "\\1.vhd" "\\1_body.vhd" identity)))
+        (mapping-exist
+         (if (nth 12 (aget vhdl-compiler-alist vhdl-compiler)) t nil))
+        (ent-regexp (cons "\\(.*\\) \\(.*\\) \\(.*\\)" (nth 0 regexp-list)))
+        (arch-regexp (cons "\\(.*\\) \\(.*\\) \\(.*\\)" (nth 1 regexp-list)))
+        (conf-regexp (cons "\\(.*\\) \\(.*\\) \\(.*\\)" (nth 2 regexp-list)))
+        (pack-regexp (cons "\\(.*\\) \\(.*\\) \\(.*\\)" (nth 3 regexp-list)))
+        (pack-body-regexp (cons "\\(.*\\) \\(.*\\) \\(.*\\)" (nth 4 
regexp-list)))
         (adjust-case (nth 5 regexp-list))
         (work-library (downcase (vhdl-work-library)))
         (compile-directory (expand-file-name (vhdl-compile-directory)
@@ -17022,9 +17002,10 @@
     ;; check prerequisites
     (unless (file-exists-p compile-directory)
       (make-directory compile-directory t))
-    (unless regexp-list
-      (error "Please contact the VHDL Mode maintainer for support of \"%s\""
-            vhdl-compiler))
+    (unless mapping-exist
+      (vhdl-warning
+       (format "No unit-to-file name mapping found for compiler \"%s\".\n  
Directory of dummy files is created instead (to be used as dependencies).\n  
Please contact the VHDL Mode maintainer for full support of \"%s\""
+              vhdl-compiler vhdl-compiler) t))
     (message "Generating makefile \"%s\"..." makefile-name)
     ;; rules for all entities
     (setq tmp-list ent-alist)
@@ -17044,7 +17025,9 @@
              second-list nil
              subcomp-list nil)
        (setq tmp-key (vhdl-replace-string
-                      ent-regexp (funcall adjust-case ent-key)))
+                      ent-regexp
+                      (funcall adjust-case
+                               (concat ent-key "  " work-library))))
        (push (cons ent-key tmp-key) unit-list)
        ;; rule target for this entity
        (push ent-key target-list)
@@ -17070,7 +17053,9 @@
                depend-list (nth 1 rule))
          (setq tmp-key (vhdl-replace-string
                         arch-regexp
-                        (funcall adjust-case (concat arch-key " " ent-key))))
+                        (funcall adjust-case
+                                 (concat arch-key " " ent-key " "
+                                         work-library))))
          (setq unit-list
                (cons (cons ent-arch-key tmp-key) unit-list))
          (push ent-arch-key second-list)
@@ -17117,7 +17102,9 @@
            depend-list (nth 1 rule)
            subcomp-list (list ent-key))
       (setq tmp-key (vhdl-replace-string
-                    conf-regexp (funcall adjust-case conf-key)))
+                    conf-regexp
+                    (funcall adjust-case
+                             (concat conf-key "  " work-library))))
       (push (cons conf-key tmp-key) unit-list)
       ;; rule target for this configuration
       (push conf-key target-list)
@@ -17131,14 +17118,11 @@
       (while inst-alist
        (setq inst-entry (car inst-alist))
        (setq inst-ent-key (nth 2 inst-entry)
-;             comp-arch-key (nth 2 inst-entry))
              inst-conf-key (nth 4 inst-entry))
        (when (equal (downcase (nth 5 inst-entry)) work-library)
          (when inst-ent-key
            (setq depend-list (cons inst-ent-key depend-list)
                  subcomp-list (cons inst-ent-key subcomp-list)))
-;          (when comp-arch-key
-;            (push (concat comp-ent-key "-" comp-arch-key) depend-list))
          (when inst-conf-key
            (setq depend-list (cons inst-conf-key depend-list)
                  subcomp-list (cons inst-conf-key subcomp-list))))
@@ -17163,7 +17147,9 @@
              rule (aget rule-alist pack-file-name)
              target-list (nth 0 rule) depend-list (nth 1 rule))
        (setq tmp-key (vhdl-replace-string
-                      pack-regexp (funcall adjust-case pack-key)))
+                      pack-regexp
+                      (funcall adjust-case
+                               (concat pack-key "  " work-library))))
        (push (cons pack-key tmp-key) unit-list)
        ;; rule target for this package
        (push pack-key target-list)
@@ -17184,7 +17170,9 @@
                target-list (nth 0 rule)
                depend-list (nth 1 rule))
          (setq tmp-key (vhdl-replace-string
-                        pack-body-regexp (funcall adjust-case pack-key)))
+                        pack-body-regexp
+                        (funcall adjust-case
+                                 (concat pack-key "  " work-library))))
          (setq unit-list
                (cons (cons pack-body-key tmp-key) unit-list))
          ;; rule target for this package's body
@@ -17259,12 +17247,16 @@
                compile-directory))))
       (insert "\n\n# Define library paths\n"
              "\nLIBRARY-" work-library " = " library-directory "\n")
+      (unless mapping-exist
+       (insert "LIBRARY-" work-library "-make = " "$(LIBRARY-" work-library
+               ")/make" "\n"))
       ;; insert variable definitions for all library unit files
       (insert "\n\n# Define library unit files\n")
       (setq tmp-list unit-list)
       (while unit-list
        (insert "\nUNIT-" work-library "-" (caar unit-list)
-               " = \\\n\t$(LIBRARY-" work-library ")/" (cdar unit-list))
+               " = \\\n\t$(LIBRARY-" work-library
+               (if mapping-exist "" "-make") ")/" (cdar unit-list))
        (setq unit-list (cdr unit-list)))
       ;; insert variable definition for list of all library unit files
       (insert "\n\n\n# Define list of all library unit files\n"
@@ -17287,13 +17279,20 @@
       ;; insert `make library' rule
       (insert "\n\n# Rule for creating library directory\n"
              "\n" (nth 2 vhdl-makefile-default-targets) " :"
-             " \\\n\t\t$(LIBRARY-" work-library ")\n"
+             " \\\n\t\t$(LIBRARY-" work-library ")"
+             (if mapping-exist ""
+               (concat " \\\n\t\t$(LIBRARY-" work-library "-make)\n"))
+             "\n"
              "\n$(LIBRARY-" work-library ") :"
              "\n\t"
              (vhdl-replace-string
               (cons "\\(.*\\)\n\\(.*\\)" (nth 5 compiler))
               (concat "$(LIBRARY-" work-library ")\n" (vhdl-work-library)))
              "\n")
+      (unless mapping-exist
+       (insert "\n$(LIBRARY-" work-library "-make) :"
+               "\n\t"
+               "mkdir -p $(LIBRARY-" work-library "-make)\n"))
       ;; insert '.PHONY' declaration
       (insert "\n\n.PHONY : "
              (nth 0 vhdl-makefile-default-targets) " "
@@ -17358,13 +17357,15 @@
                    (nth 0 rule)
                    (if (equal vhdl-compile-post-command "") ""
                      " $(POST-COMPILE)") "\n")
+         (insert "\n"))
+       (unless (and options mapping-exist)
          (setq tmp-list target-list)
          (while target-list
-           (insert "address@hidden $(UNIT-" work-library "-" (car target-list) 
")"
-                   (if (cdr target-list) " \\" "\n"))
+           (insert "address@hidden $(UNIT-" work-library "-" (car target-list) 
")\n")
            (setq target-list (cdr target-list)))
          (setq target-list tmp-list))
        (setq rule-alist (cdr rule-alist)))
+
       (insert "\n\n### " makefile-name " ends here\n")
       ;; run Makefile generation hook
       (run-hooks 'vhdl-makefile-generation-hook)
@@ -17374,7 +17375,8 @@
          (progn (save-buffer)
                 (kill-buffer (current-buffer))
                 (set-buffer orig-buffer)
-                (add-to-history 'file-name-history makefile-path-name))
+                (when (fboundp 'add-to-history)
+                  (add-to-history 'file-name-history makefile-path-name)))
        (vhdl-warning-when-idle
         (format "File not writable: \"%s\""
                 (abbreviate-file-name makefile-path-name)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]