# HG changeset patch # User Richard M. Stallman # Date 908394935 0 # Node ID be6981601edf6ce7a87deb0d547f9b63b79f7323 # Parent 7fb0a3c74e1d45254abe1e1e385c8a4b5806e0cb (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. diff -r 7fb0a3c74e1d -r be6981601edf lisp/progmodes/vhdl-mode.el --- 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 "\\" nil t) + (if (and (= (current-column) (current-indentation)) + (re-search-forward "\\" nil t) (looking-at "\\s-*\\")) (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 "\\") + (not (looking-at "\\