changeset 23465:be6981601edf

(vhdl-add-index-menu): reverse order in imenu-generic-expression. (vhdl-template-assert, vhdl-block, vhdl-configuration-spec) (vhdl-elsif, vhdl-generate, vhdl-if, vhdl-map) (vhdl-selected-signal-assignment, vhdl-use, vhdl-while-loop) (vhdl-get-port, vhdl-get-generic): Replace (undo 0) by (undo). (vhdl-when): Fix indentation problem. (vhdl-outer-space): Add "_" to syntax table for expand-abbrev. (vhdl-get-port, vhdl-get-generic): Bug fix in template. (vhdl-hooked-abbrev): Bug fix in hooked abbrev.
author Richard M. Stallman <rms@gnu.org>
date Wed, 14 Oct 1998 19:55:35 +0000
parents 7fb0a3c74e1d
children fa40617f5902
files lisp/progmodes/vhdl-mode.el
diffstat 1 files changed, 28 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/vhdl-mode.el	Wed Oct 14 18:18:52 1998 +0000
+++ b/lisp/progmodes/vhdl-mode.el	Wed Oct 14 19:55:35 1998 +0000
@@ -1219,7 +1219,7 @@
 
 (defun vhdl-add-index-menu ()
   (make-local-variable 'imenu-generic-expression)
-  (setq imenu-generic-expression vhdl-imenu-generic-expression)
+  (setq imenu-generic-expression (nreverse vhdl-imenu-generic-expression))
   (imenu-add-to-menubar "Index"))
 
 ;; ############################################################################
@@ -3955,7 +3955,7 @@
   (vhdl-insert-keyword "ASSERT ")
   (if vhdl-conditions-in-parenthesis (insert "("))
   (if (equal (vhdl-field "condition (negated)") "")
-      (progn (undo 0) (insert " "))
+      (progn (undo) (insert " "))
     (if vhdl-conditions-in-parenthesis (insert ")"))
     (vhdl-insert-keyword " REPORT \"")
     (vhdl-field "string-expression" "\" ")
@@ -3991,7 +3991,7 @@
   (let* ((margin (current-column))
 	 (name (vhdl-field "label")))
     (if (equal name "")
-	(progn (undo 0) (insert " "))
+	(progn (undo) (insert " "))
       (end-of-line)
       (insert "(")
       (if (equal (vhdl-field "[guard expression]") "")
@@ -4132,7 +4132,7 @@
   (let ((margin (current-column)))
     (vhdl-insert-keyword "FOR ")
     (if (equal (vhdl-field "(component names | ALL)" " : ") "")
-	(progn (undo 0) (insert " "))
+	(progn (undo) (insert " "))
       (vhdl-field "component type" "\n")
       (indent-to (+ margin vhdl-basic-offset))
       (vhdl-insert-keyword "USE ENTITY ")
@@ -4261,7 +4261,7 @@
     (vhdl-insert-keyword "ELSIF ")
     (if vhdl-conditions-in-parenthesis (insert "("))
     (if (equal (vhdl-field "condition") "")
-	(progn (undo 0) (insert " "))
+	(progn (undo) (insert " "))
       (if vhdl-conditions-in-parenthesis (insert ")"))
       (vhdl-indent-line)
       (setq margin (current-indentation))
@@ -4385,7 +4385,7 @@
 	(label (vhdl-field "label"))
 	(string))
     (if (equal label "")
-	(progn (undo 0) (insert " "))
+	(progn (undo) (insert " "))
       (insert " : ")
       (setq string (vhdl-field "(FOR | IF)"))
       (insert " ")
@@ -4482,7 +4482,7 @@
     (vhdl-insert-keyword "IF ")
     (if vhdl-conditions-in-parenthesis (insert "("))
     (if (equal (vhdl-field "condition") "")
-	(progn (undo 0) (insert " "))
+	(progn (undo) (insert " "))
       (if vhdl-conditions-in-parenthesis (insert ")"))
       (vhdl-insert-keyword " THEN\n\n")
       (indent-to margin)
@@ -4535,7 +4535,7 @@
   (interactive)
   (vhdl-insert-keyword "MAP (")
   (if (equal (vhdl-field "[association list]") "")
-      (progn (undo 0) (insert " "))
+      (progn (undo) (insert " "))
     (insert ")")
     ))
 
@@ -4718,7 +4718,7 @@
       (goto-char position))
     (vhdl-insert-keyword "WITH ")
     (if (equal (vhdl-field "selector expression") "")
-	(progn (undo 0) (insert " "))
+	(progn (undo) (insert " "))
       (end-of-line)
       (insert "\n")
       (indent-to (+ margin vhdl-basic-offset))
@@ -4806,7 +4806,7 @@
   (vhdl-insert-keyword "USE ..ALL;")
   (backward-char 6)
   (if (equal (vhdl-field "library name") "")
-      (progn (undo 0) (insert " "))
+      (progn (undo) (insert " "))
     (forward-char 1)
     (vhdl-field "package name")
     (end-of-line)
@@ -4855,7 +4855,8 @@
   (interactive)
   (let ((position (point))
 	(margin))
-    (if (and (re-search-forward "\\<end\\>" nil t)
+    (if (and (= (current-column) (current-indentation))
+	     (re-search-forward "\\<end\\>" nil t)
 	     (looking-at "\\s-*\\<case\\>"))
 	(progn
 	  (setq margin (current-indentation))
@@ -4880,7 +4881,7 @@
     (end-of-line)
     (if vhdl-conditions-in-parenthesis (insert "("))
     (if (equal (vhdl-field "condition") "")
-	(progn (undo 0) (insert " "))
+	(progn (undo 2))
       (if vhdl-conditions-in-parenthesis (insert ")"))
       (vhdl-insert-keyword " LOOP\n\n")
       (indent-to margin)
@@ -5106,7 +5107,12 @@
   (interactive "p")
   (if (or (and (>= (preceding-char) ?a) (<= (preceding-char) ?z))
 	  (and (>= (preceding-char) ?A) (<= (preceding-char) ?Z)))
-      (expand-abbrev))
+      (progn
+	(modify-syntax-entry ?_ "w" vhdl-mode-syntax-table)
+	(expand-abbrev)
+	(if (not vhdl-underscore-is-part-of-word)
+	    (modify-syntax-entry ?_ "_" vhdl-mode-syntax-table))
+	))
   (if (not (vhdl-in-comment-p))
       (self-insert-command count)
     (if (< (current-column) end-comment-column)
@@ -5236,7 +5242,7 @@
 	      (progn (vhdl-kill-entire-line) (forward-line -1)
 		     (if (not vhdl-argument-list-indent)
 			 (progn (vhdl-kill-entire-line) (forward-line -1))))
-	    (progn (undo 0) (insert " "))
+	    (progn (undo) (insert " "))
 	    nil )
 	(insert " : ")
 	(progn
@@ -5254,7 +5260,8 @@
 	      (setq vhdl-ports (vhdl-field "[names]" " : ")))
 	    (goto-char semicolon-pos)
 	    (if (not vhdl-argument-list-indent)
-		(progn (insert "\n") (indent-to margin)))
+		(progn (delete-char 1) (end-of-line) (insert "\n")
+		       (indent-to margin) (insert ";") (backward-char 1)))
 	    (insert ")")
 	    (forward-char 1)
 	    (if (= (following-char) ? )
@@ -5285,7 +5292,7 @@
 	      (progn (vhdl-kill-entire-line) (end-of-line -0)
 		     (if (not vhdl-argument-list-indent)
 			 (progn (vhdl-kill-entire-line) (end-of-line -0))))
-	    (progn (undo 0) (insert " "))
+	    (progn (undo) (insert " "))
 	    nil )
 	(insert " : ")
 	(progn
@@ -5308,7 +5315,8 @@
 		(setq vhdl-generic (vhdl-field "[name]" " : "))))
 	    (goto-char semicolon-pos)
 	    (if (not vhdl-argument-list-indent)
-		(progn (insert "\n") (indent-to margin)))
+		(progn (delete-char 1) (end-of-line) (insert "\n")
+		       (indent-to margin) (insert ";") (backward-char 1)))
 	    (insert ")")
 	    (forward-char 1)
 	    (if (= (following-char) ? )
@@ -5473,7 +5481,9 @@
 but not if inside a comment or quote)"
   (if (or (vhdl-in-comment-p)
 	  (vhdl-in-string-p)
-	  (save-excursion (forward-word -1) (looking-at "end")))
+	  (save-excursion (forward-word -1)
+			  (and (looking-at "\\<end\\>")
+			       (not (looking-at "\\<end;")))))
       (progn
 	(insert " ")
 	(unexpand-abbrev)