# HG changeset patch # User Dan Nicolaescu # Date 1210254256 0 # Node ID e087ad93ebd155c8b599004879f4aaaa32806cd6 # Parent 81557120766355b33f35f455578fa8a64098bc0e (verilog-type-font-keywords): Add leda and 0in as pragma keywords. (verilog-pretty-expr): Support lining up assignments which include part selects. (verilog-mode): More portable check for the availability of hideshow support. (verilog-do-indent): Remove special indent for declarations inside a parenthetical list. The code is ill-advised, and doesn't work given the new user defined types. (verilog-set-auto-endcomments): Enhance function automatic endcomment to support functions that return user defined types. (verilog-mode): Add code to tell which-function-mode minor mode that Verilog supports this feature. diff -r 815571207663 -r e087ad93ebd1 lisp/ChangeLog --- a/lisp/ChangeLog Thu May 08 13:31:31 2008 +0000 +++ b/lisp/ChangeLog Thu May 08 13:44:16 2008 +0000 @@ -1,3 +1,19 @@ +2008-05-08 Michael McNamara + + * verilog-mode.el (verilog-type-font-keywords): Add leda and 0in + as pragma keywords. + (verilog-pretty-expr): Support lining up assignments which include + part selects. + (verilog-mode): More portable check for the availability of + hideshow support. + (verilog-do-indent): Remove special indent for declarations inside + a parenthetical list. The code is ill-advised, and doesn't work + given the new user defined types. + (verilog-set-auto-endcomments): Enhance function automatic + endcomment to support functions that return user defined types. + (verilog-mode): Add code to tell which-function-mode minor mode + that Verilog supports this feature. + 2008-05-08 Eli Zaretskii * epa-file.el: Require epa-hook. diff -r 815571207663 -r e087ad93ebd1 lisp/progmodes/verilog-mode.el --- a/lisp/progmodes/verilog-mode.el Thu May 08 13:31:31 2008 +0000 +++ b/lisp/progmodes/verilog-mode.el Thu May 08 13:44:16 2008 +0000 @@ -118,9 +118,9 @@ ;;; Code: ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "404" +(defconst verilog-mode-version "423" "Version of this Verilog mode.") -(defconst verilog-mode-release-date "2008-03-02-GNU" +(defconst verilog-mode-release-date "2008-05-07-GNU" "Release date of this Verilog mode.") (defconst verilog-mode-release-emacs t "If non-nil, this version of Verilog mode was released with Emacs itself.") @@ -1953,7 +1953,7 @@ (verilog-pragma-keywords (eval-when-compile (verilog-regexp-opt - '("surefire" "synopsys" "rtl_synthesis" "verilint" ) nil + '("surefire" "synopsys" "rtl_synthesis" "verilint" "leda" "0in") nil ))) (verilog-p1800-keywords @@ -2514,12 +2514,16 @@ ;; Tell imenu how to handle Verilog. (make-local-variable 'imenu-generic-expression) (setq imenu-generic-expression verilog-imenu-generic-expression) + ;; Tell which-func-modes that imenu knows about verilog + (when (boundp 'which-function-modes) + (add-to-list 'which-func-modes 'verilog-mode)) ;; hideshow support - (unless (assq 'verilog-mode hs-special-modes-alist) - (setq hs-special-modes-alist - (cons '(verilog-mode-mode "\\" "\\" nil - verilog-forward-sexp-function) - hs-special-modes-alist))) + (when (boundp 'hs-special-modes-alist) + (unless (assq 'verilog-mode hs-special-modes-alist) + (setq hs-special-modes-alist + (cons '(verilog-mode-mode "\\" "\\" nil + verilog-forward-sexp-function) + hs-special-modes-alist)))) ;; Stuff for autos (add-hook 'write-contents-hooks 'verilog-auto-save-check) ; already local @@ -3468,7 +3472,7 @@ (;- this is end{function,generate,task,module,primitive,table,generate} ;- which can not be nested. t - (let (string reg (width nil)) + (let (string reg (name-re nil)) (end-of-line) (if kill-existing-comment (save-match-data @@ -3478,7 +3482,8 @@ (cond ((match-end 5) ;; of verilog-end-block-ordered-re (setq reg "\\(\\\\)\\|\\(\\<\\(endfunction\\|task\\|\\(macro\\)?module\\|primitive\\)\\>\\)") - (setq width "\\(\\s-*\\(\\[[^]]*\\]\\)\\|\\(real\\(time\\)?\\)\\|\\(integer\\)\\|\\(time\\)\\)?")) + (setq name-re "\\w+\\s-*(") + ) ((match-end 6) ;; of verilog-end-block-ordered-re (setq reg "\\(\\\\)\\|\\(\\<\\(endtask\\|function\\|\\(macro\\)?module\\|primitive\\)\\>\\)")) ((match-end 7) ;; of verilog-end-block-ordered-re @@ -3509,9 +3514,9 @@ (setq b (progn (skip-chars-forward "^ \t") (verilog-forward-ws&directives) - (if (and width (looking-at width)) + (if (and name-re (verilog-re-search-forward name-re nil 'move)) (progn - (goto-char (match-end 0)) + (goto-char (match-beginning 0)) (verilog-forward-ws&directives))) (point)) e (progn @@ -4683,10 +4688,8 @@ (skip-chars-forward " \t") (current-column)))) (indent-line-to val) - (if (and (not (verilog-in-struct-region-p)) - (looking-at verilog-declaration-re)) - (verilog-indent-declaration ind)))) - + )) + (;-- Handle the ends (or (looking-at verilog-end-block-re ) @@ -4920,7 +4923,7 @@ (if (or (eq myre nil) (string-equal myre "")) (setq myre "\\(<\\|:\\)?=")) - (setq myre (concat "\\(^[^;#:<=>]*\\)\\(" myre "\\)")) + (setq myre (concat "\\(^[^;#<=>]*\\)\\(" myre "\\)")) (let ((rexp(concat "^\\s-*" verilog-complete-reg))) (beginning-of-line) (if (and (not (looking-at rexp )) @@ -7372,12 +7375,12 @@ func-returns) (setq func-returns (funcall function)) (when fontlocked (font-lock-mode t)) - ;; Cache for next time - (setq verilog-modi-cache-list + ;; Cache for next time + (setq verilog-modi-cache-list (cons (list (list modi function) - (buffer-modified-tick) - (visited-file-modtime) - func-returns) + (buffer-modified-tick) + (visited-file-modtime) + func-returns) verilog-modi-cache-list)) func-returns)))))) @@ -7842,10 +7845,10 @@ (goto-char (point-min)) (while (verilog-re-search-forward-quick "\\