(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.
This commit is contained in:
parent
7218b1d448
commit
1c20c5890a
1 changed files with 28 additions and 18 deletions
|
@ -1219,7 +1219,7 @@ The format is suitable for use with `easy-menu-define'."
|
||||||
|
|
||||||
(defun vhdl-add-index-menu ()
|
(defun vhdl-add-index-menu ()
|
||||||
(make-local-variable 'imenu-generic-expression)
|
(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"))
|
(imenu-add-to-menubar "Index"))
|
||||||
|
|
||||||
;; ############################################################################
|
;; ############################################################################
|
||||||
|
@ -3955,7 +3955,7 @@ the token in MATCH."
|
||||||
(vhdl-insert-keyword "ASSERT ")
|
(vhdl-insert-keyword "ASSERT ")
|
||||||
(if vhdl-conditions-in-parenthesis (insert "("))
|
(if vhdl-conditions-in-parenthesis (insert "("))
|
||||||
(if (equal (vhdl-field "condition (negated)") "")
|
(if (equal (vhdl-field "condition (negated)") "")
|
||||||
(progn (undo 0) (insert " "))
|
(progn (undo) (insert " "))
|
||||||
(if vhdl-conditions-in-parenthesis (insert ")"))
|
(if vhdl-conditions-in-parenthesis (insert ")"))
|
||||||
(vhdl-insert-keyword " REPORT \"")
|
(vhdl-insert-keyword " REPORT \"")
|
||||||
(vhdl-field "string-expression" "\" ")
|
(vhdl-field "string-expression" "\" ")
|
||||||
|
@ -3991,7 +3991,7 @@ the token in MATCH."
|
||||||
(let* ((margin (current-column))
|
(let* ((margin (current-column))
|
||||||
(name (vhdl-field "label")))
|
(name (vhdl-field "label")))
|
||||||
(if (equal name "")
|
(if (equal name "")
|
||||||
(progn (undo 0) (insert " "))
|
(progn (undo) (insert " "))
|
||||||
(end-of-line)
|
(end-of-line)
|
||||||
(insert "(")
|
(insert "(")
|
||||||
(if (equal (vhdl-field "[guard expression]") "")
|
(if (equal (vhdl-field "[guard expression]") "")
|
||||||
|
@ -4132,7 +4132,7 @@ a configuration declaration if not within a design unit."
|
||||||
(let ((margin (current-column)))
|
(let ((margin (current-column)))
|
||||||
(vhdl-insert-keyword "FOR ")
|
(vhdl-insert-keyword "FOR ")
|
||||||
(if (equal (vhdl-field "(component names | ALL)" " : ") "")
|
(if (equal (vhdl-field "(component names | ALL)" " : ") "")
|
||||||
(progn (undo 0) (insert " "))
|
(progn (undo) (insert " "))
|
||||||
(vhdl-field "component type" "\n")
|
(vhdl-field "component type" "\n")
|
||||||
(indent-to (+ margin vhdl-basic-offset))
|
(indent-to (+ margin vhdl-basic-offset))
|
||||||
(vhdl-insert-keyword "USE ENTITY ")
|
(vhdl-insert-keyword "USE ENTITY ")
|
||||||
|
@ -4261,7 +4261,7 @@ a configuration declaration if not within a design unit."
|
||||||
(vhdl-insert-keyword "ELSIF ")
|
(vhdl-insert-keyword "ELSIF ")
|
||||||
(if vhdl-conditions-in-parenthesis (insert "("))
|
(if vhdl-conditions-in-parenthesis (insert "("))
|
||||||
(if (equal (vhdl-field "condition") "")
|
(if (equal (vhdl-field "condition") "")
|
||||||
(progn (undo 0) (insert " "))
|
(progn (undo) (insert " "))
|
||||||
(if vhdl-conditions-in-parenthesis (insert ")"))
|
(if vhdl-conditions-in-parenthesis (insert ")"))
|
||||||
(vhdl-indent-line)
|
(vhdl-indent-line)
|
||||||
(setq margin (current-indentation))
|
(setq margin (current-indentation))
|
||||||
|
@ -4385,7 +4385,7 @@ declaration, a for loop otherwise."
|
||||||
(label (vhdl-field "label"))
|
(label (vhdl-field "label"))
|
||||||
(string))
|
(string))
|
||||||
(if (equal label "")
|
(if (equal label "")
|
||||||
(progn (undo 0) (insert " "))
|
(progn (undo) (insert " "))
|
||||||
(insert " : ")
|
(insert " : ")
|
||||||
(setq string (vhdl-field "(FOR | IF)"))
|
(setq string (vhdl-field "(FOR | IF)"))
|
||||||
(insert " ")
|
(insert " ")
|
||||||
|
@ -4482,7 +4482,7 @@ declaration, a for loop otherwise."
|
||||||
(vhdl-insert-keyword "IF ")
|
(vhdl-insert-keyword "IF ")
|
||||||
(if vhdl-conditions-in-parenthesis (insert "("))
|
(if vhdl-conditions-in-parenthesis (insert "("))
|
||||||
(if (equal (vhdl-field "condition") "")
|
(if (equal (vhdl-field "condition") "")
|
||||||
(progn (undo 0) (insert " "))
|
(progn (undo) (insert " "))
|
||||||
(if vhdl-conditions-in-parenthesis (insert ")"))
|
(if vhdl-conditions-in-parenthesis (insert ")"))
|
||||||
(vhdl-insert-keyword " THEN\n\n")
|
(vhdl-insert-keyword " THEN\n\n")
|
||||||
(indent-to margin)
|
(indent-to margin)
|
||||||
|
@ -4535,7 +4535,7 @@ declaration, a for loop otherwise."
|
||||||
(interactive)
|
(interactive)
|
||||||
(vhdl-insert-keyword "MAP (")
|
(vhdl-insert-keyword "MAP (")
|
||||||
(if (equal (vhdl-field "[association list]") "")
|
(if (equal (vhdl-field "[association list]") "")
|
||||||
(progn (undo 0) (insert " "))
|
(progn (undo) (insert " "))
|
||||||
(insert ")")
|
(insert ")")
|
||||||
))
|
))
|
||||||
|
|
||||||
|
@ -4718,7 +4718,7 @@ declaration, a for loop otherwise."
|
||||||
(goto-char position))
|
(goto-char position))
|
||||||
(vhdl-insert-keyword "WITH ")
|
(vhdl-insert-keyword "WITH ")
|
||||||
(if (equal (vhdl-field "selector expression") "")
|
(if (equal (vhdl-field "selector expression") "")
|
||||||
(progn (undo 0) (insert " "))
|
(progn (undo) (insert " "))
|
||||||
(end-of-line)
|
(end-of-line)
|
||||||
(insert "\n")
|
(insert "\n")
|
||||||
(indent-to (+ margin vhdl-basic-offset))
|
(indent-to (+ margin vhdl-basic-offset))
|
||||||
|
@ -4806,7 +4806,7 @@ declaration, a for loop otherwise."
|
||||||
(vhdl-insert-keyword "USE ..ALL;")
|
(vhdl-insert-keyword "USE ..ALL;")
|
||||||
(backward-char 6)
|
(backward-char 6)
|
||||||
(if (equal (vhdl-field "library name") "")
|
(if (equal (vhdl-field "library name") "")
|
||||||
(progn (undo 0) (insert " "))
|
(progn (undo) (insert " "))
|
||||||
(forward-char 1)
|
(forward-char 1)
|
||||||
(vhdl-field "package name")
|
(vhdl-field "package name")
|
||||||
(end-of-line)
|
(end-of-line)
|
||||||
|
@ -4855,7 +4855,8 @@ declaration, a for loop otherwise."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((position (point))
|
(let ((position (point))
|
||||||
(margin))
|
(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\\>"))
|
(looking-at "\\s-*\\<case\\>"))
|
||||||
(progn
|
(progn
|
||||||
(setq margin (current-indentation))
|
(setq margin (current-indentation))
|
||||||
|
@ -4880,7 +4881,7 @@ declaration, a for loop otherwise."
|
||||||
(end-of-line)
|
(end-of-line)
|
||||||
(if vhdl-conditions-in-parenthesis (insert "("))
|
(if vhdl-conditions-in-parenthesis (insert "("))
|
||||||
(if (equal (vhdl-field "condition") "")
|
(if (equal (vhdl-field "condition") "")
|
||||||
(progn (undo 0) (insert " "))
|
(progn (undo 2))
|
||||||
(if vhdl-conditions-in-parenthesis (insert ")"))
|
(if vhdl-conditions-in-parenthesis (insert ")"))
|
||||||
(vhdl-insert-keyword " LOOP\n\n")
|
(vhdl-insert-keyword " LOOP\n\n")
|
||||||
(indent-to margin)
|
(indent-to margin)
|
||||||
|
@ -5106,7 +5107,12 @@ if in comment and past end-comment-column."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
(if (or (and (>= (preceding-char) ?a) (<= (preceding-char) ?z))
|
(if (or (and (>= (preceding-char) ?a) (<= (preceding-char) ?z))
|
||||||
(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))
|
(if (not (vhdl-in-comment-p))
|
||||||
(self-insert-command count)
|
(self-insert-command count)
|
||||||
(if (< (current-column) end-comment-column)
|
(if (< (current-column) end-comment-column)
|
||||||
|
@ -5236,7 +5242,7 @@ Point is left between them."
|
||||||
(progn (vhdl-kill-entire-line) (forward-line -1)
|
(progn (vhdl-kill-entire-line) (forward-line -1)
|
||||||
(if (not vhdl-argument-list-indent)
|
(if (not vhdl-argument-list-indent)
|
||||||
(progn (vhdl-kill-entire-line) (forward-line -1))))
|
(progn (vhdl-kill-entire-line) (forward-line -1))))
|
||||||
(progn (undo 0) (insert " "))
|
(progn (undo) (insert " "))
|
||||||
nil )
|
nil )
|
||||||
(insert " : ")
|
(insert " : ")
|
||||||
(progn
|
(progn
|
||||||
|
@ -5254,7 +5260,8 @@ Point is left between them."
|
||||||
(setq vhdl-ports (vhdl-field "[names]" " : ")))
|
(setq vhdl-ports (vhdl-field "[names]" " : ")))
|
||||||
(goto-char semicolon-pos)
|
(goto-char semicolon-pos)
|
||||||
(if (not vhdl-argument-list-indent)
|
(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 ")")
|
(insert ")")
|
||||||
(forward-char 1)
|
(forward-char 1)
|
||||||
(if (= (following-char) ? )
|
(if (= (following-char) ? )
|
||||||
|
@ -5285,7 +5292,7 @@ Point is left between them."
|
||||||
(progn (vhdl-kill-entire-line) (end-of-line -0)
|
(progn (vhdl-kill-entire-line) (end-of-line -0)
|
||||||
(if (not vhdl-argument-list-indent)
|
(if (not vhdl-argument-list-indent)
|
||||||
(progn (vhdl-kill-entire-line) (end-of-line -0))))
|
(progn (vhdl-kill-entire-line) (end-of-line -0))))
|
||||||
(progn (undo 0) (insert " "))
|
(progn (undo) (insert " "))
|
||||||
nil )
|
nil )
|
||||||
(insert " : ")
|
(insert " : ")
|
||||||
(progn
|
(progn
|
||||||
|
@ -5308,7 +5315,8 @@ Point is left between them."
|
||||||
(setq vhdl-generic (vhdl-field "[name]" " : "))))
|
(setq vhdl-generic (vhdl-field "[name]" " : "))))
|
||||||
(goto-char semicolon-pos)
|
(goto-char semicolon-pos)
|
||||||
(if (not vhdl-argument-list-indent)
|
(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 ")")
|
(insert ")")
|
||||||
(forward-char 1)
|
(forward-char 1)
|
||||||
(if (= (following-char) ? )
|
(if (= (following-char) ? )
|
||||||
|
@ -5473,7 +5481,9 @@ else indent line in proper way for current major mode
|
||||||
but not if inside a comment or quote)"
|
but not if inside a comment or quote)"
|
||||||
(if (or (vhdl-in-comment-p)
|
(if (or (vhdl-in-comment-p)
|
||||||
(vhdl-in-string-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
|
(progn
|
||||||
(insert " ")
|
(insert " ")
|
||||||
(unexpand-abbrev)
|
(unexpand-abbrev)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue