diff options
| author | Wilson Snyder | 2016-03-22 20:46:40 -0400 |
|---|---|---|
| committer | Wilson Snyder | 2016-03-22 20:46:40 -0400 |
| commit | 500a781bc5d3d7cc2f671a950816ba4035a9d58c (patch) | |
| tree | 54f1f1594d95f610296409f9eaafd92fdda9e3a0 | |
| parent | ddd9111a90f59abedd5065bfb7ac53454f816780 (diff) | |
| download | emacs-500a781bc5d3d7cc2f671a950816ba4035a9d58c.tar.gz emacs-500a781bc5d3d7cc2f671a950816ba4035a9d58c.zip | |
Sync with verilog-mode development tree.
* lisp/progmodes/verilog-mode.el (verilog-imenu-generic-expression,
verilog-speedbar-initialize): Automatically add verilog-mode
extensions when in speedbar mode, bug1045, bug1046. Reported by
David Shleifman.
(verilog-mode-map): Move `verilog-star-comment' from M-* to C-c/ to
avoid conflict with `pop-tag-mark'. Reported by Ian Perryman.
(verilog-read-always-signals-recurse): Fix :: notation for
auto-reset signals. Reported by Andrew Jones.
(verilog-font-lock-grouping-keywords-face): Fix highlighting of
grouping keywords, bug1002. Reported by Paul Sargent.
(verilog-save-font-no-change-functions): Commentary and fix
pre-Emacs 21 behavior.
| -rw-r--r-- | lisp/progmodes/verilog-mode.el | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 28ae3500ca8..fd2e96af48b 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el | |||
| @@ -123,7 +123,7 @@ | |||
| 123 | ;; | 123 | ;; |
| 124 | 124 | ||
| 125 | ;; This variable will always hold the version number of the mode | 125 | ;; This variable will always hold the version number of the mode |
| 126 | (defconst verilog-mode-version "2015-11-21-8112ca0-vpo-GNU" | 126 | (defconst verilog-mode-version "2016-03-22-7547e76-vpo-GNU" |
| 127 | "Version of this Verilog mode.") | 127 | "Version of this Verilog mode.") |
| 128 | (defconst verilog-mode-release-emacs t | 128 | (defconst verilog-mode-release-emacs t |
| 129 | "If non-nil, this version of Verilog mode was released with Emacs itself.") | 129 | "If non-nil, this version of Verilog mode was released with Emacs itself.") |
| @@ -349,6 +349,11 @@ wherever possible, since it is slow." | |||
| 349 | (condition-case nil | 349 | (condition-case nil |
| 350 | (unless (fboundp 'prog-mode) | 350 | (unless (fboundp 'prog-mode) |
| 351 | (define-derived-mode prog-mode fundamental-mode "Prog")) | 351 | (define-derived-mode prog-mode fundamental-mode "Prog")) |
| 352 | (error nil)) | ||
| 353 | ;; Added in Emacs 25.1 | ||
| 354 | (condition-case nil | ||
| 355 | (unless (fboundp 'forward-word-strictly) | ||
| 356 | (defalias 'forward-word-strictly 'forward-word)) | ||
| 352 | (error nil))) | 357 | (error nil))) |
| 353 | 358 | ||
| 354 | (eval-when-compile | 359 | (eval-when-compile |
| @@ -1321,8 +1326,13 @@ See also `verilog-case-fold'." | |||
| 1321 | :type 'hook) | 1326 | :type 'hook) |
| 1322 | 1327 | ||
| 1323 | (defvar verilog-imenu-generic-expression | 1328 | (defvar verilog-imenu-generic-expression |
| 1324 | '((nil "^\\s-*\\(\\(m\\(odule\\|acromodule\\)\\)\\|primitive\\)\\s-+\\([a-zA-Z0-9_.:]+\\)" 4) | 1329 | '((nil "^\\s-*\\(?:m\\(?:odule\\|acromodule\\)\\|p\\(?:rimitive\\|rogram\\|ackage\\)\\)\\s-+\\([a-zA-Z0-9_.:]+\\)" 1) |
| 1325 | ("*Vars*" "^\\s-*\\(reg\\|wire\\)\\s-+\\(\\|\\[[^]]+\\]\\s-+\\)\\([A-Za-z0-9_]+\\)" 3)) | 1330 | ("*Variables*" "^\\s-*\\(reg\\|wire\\|logic\\)\\s-+\\(\\|\\[[^]]+\\]\\s-+\\)\\([A-Za-z0-9_]+\\)" 3) |
| 1331 | ("*Classes*" "^\\s-*\\(?:\\(?:virtual\\|interface\\)\\s-+\\)?class\\s-+\\([A-Za-z_][A-Za-z0-9_]+\\)" 1) | ||
| 1332 | ("*Tasks*" "^\\s-*\\(?:\\(?:static\\|pure\\|virtual\\|local\\|protected\\)\\s-+\\)*task\\s-+\\(?:\\(?:static\\|automatic\\)\\s-+\\)?\\([A-Za-z_][A-Za-z0-9_:]+\\)" 1) | ||
| 1333 | ("*Functions*" "^\\s-*\\(?:\\(?:static\\|pure\\|virtual\\|local\\|protected\\)\\s-+\\)*function\\s-+\\(?:\\(?:static\\|automatic\\)\\s-+\\)?\\(?:\\w+\\s-+\\)?\\([A-Za-z_][A-Za-z0-9_:]+\\)" 1) | ||
| 1334 | ("*Interfaces*" "^\\s-*interface\\s-+\\([a-zA-Z_0-9]+\\)" 1) | ||
| 1335 | ("*Types*" "^\\s-*typedef\\s-+.*\\s-+\\([a-zA-Z_0-9]+\\)\\s-*;" 1)) | ||
| 1326 | "Imenu expression for Verilog mode. See `imenu-generic-expression'.") | 1336 | "Imenu expression for Verilog mode. See `imenu-generic-expression'.") |
| 1327 | 1337 | ||
| 1328 | ;; | 1338 | ;; |
| @@ -1374,7 +1384,7 @@ If set will become buffer local.") | |||
| 1374 | (define-key map "\C-c\C-i" 'verilog-pretty-declarations) | 1384 | (define-key map "\C-c\C-i" 'verilog-pretty-declarations) |
| 1375 | (define-key map "\C-c=" 'verilog-pretty-expr) | 1385 | (define-key map "\C-c=" 'verilog-pretty-expr) |
| 1376 | (define-key map "\C-c\C-b" 'verilog-submit-bug-report) | 1386 | (define-key map "\C-c\C-b" 'verilog-submit-bug-report) |
| 1377 | (define-key map "\M-*" 'verilog-star-comment) | 1387 | (define-key map "\C-c/" 'verilog-star-comment) |
| 1378 | (define-key map "\C-c\C-c" 'verilog-comment-region) | 1388 | (define-key map "\C-c\C-c" 'verilog-comment-region) |
| 1379 | (define-key map "\C-c\C-u" 'verilog-uncomment-region) | 1389 | (define-key map "\C-c\C-u" 'verilog-uncomment-region) |
| 1380 | (when (featurep 'xemacs) | 1390 | (when (featurep 'xemacs) |
| @@ -3026,7 +3036,7 @@ See also `verilog-font-lock-extra-types'.") | |||
| 3026 | "Font lock mode face used to highlight AMS keywords." | 3036 | "Font lock mode face used to highlight AMS keywords." |
| 3027 | :group 'font-lock-highlighting-faces) | 3037 | :group 'font-lock-highlighting-faces) |
| 3028 | 3038 | ||
| 3029 | (defvar verilog-font-grouping-keywords-face | 3039 | (defvar verilog-font-lock-grouping-keywords-face |
| 3030 | 'verilog-font-lock-grouping-keywords-face | 3040 | 'verilog-font-lock-grouping-keywords-face |
| 3031 | "Font to use for Verilog Grouping Keywords (such as begin..end).") | 3041 | "Font to use for Verilog Grouping Keywords (such as begin..end).") |
| 3032 | (defface verilog-font-lock-grouping-keywords-face | 3042 | (defface verilog-font-lock-grouping-keywords-face |
| @@ -3870,6 +3880,25 @@ Key bindings specific to `verilog-mode-map' are: | |||
| 3870 | (add-hook 'write-contents-hooks 'verilog-auto-save-check nil 'local) | 3880 | (add-hook 'write-contents-hooks 'verilog-auto-save-check nil 'local) |
| 3871 | ;; verilog-mode-hook call added by define-derived-mode | 3881 | ;; verilog-mode-hook call added by define-derived-mode |
| 3872 | ) | 3882 | ) |
| 3883 | |||
| 3884 | ;;; Integration with the speedbar | ||
| 3885 | ;; | ||
| 3886 | |||
| 3887 | (declare-function speedbar-add-supported-extension "speedbar" (extension)) | ||
| 3888 | |||
| 3889 | (defun verilog-speedbar-initialize () | ||
| 3890 | "Initialize speedbar to understand `verilog-mode'." | ||
| 3891 | ;; Set Verilog file extensions (extracted from `auto-mode-alist') | ||
| 3892 | (let ((mode-alist auto-mode-alist)) | ||
| 3893 | (while mode-alist | ||
| 3894 | (when (eq (cdar mode-alist) 'verilog-mode) | ||
| 3895 | (speedbar-add-supported-extension (caar mode-alist))) | ||
| 3896 | (setq mode-alist (cdr mode-alist))))) | ||
| 3897 | |||
| 3898 | ;; If the speedbar is loaded, execute initialization instructions right away, | ||
| 3899 | ;; otherwise add the initialization instructions to the speedbar loader. | ||
| 3900 | (eval-after-load "speedbar" '(verilog-speedbar-initialize)) | ||
| 3901 | |||
| 3873 | 3902 | ||
| 3874 | ;;; Electric functions: | 3903 | ;;; Electric functions: |
| 3875 | ;; | 3904 | ;; |
| @@ -9016,7 +9045,8 @@ IGNORE-NEXT is true to ignore next token, fake from inside case statement." | |||
| 9016 | ;;(if dbg (setq dbg (concat dbg (format "\tif-check-else-other %s\n" keywd)))) | 9045 | ;;(if dbg (setq dbg (concat dbg (format "\tif-check-else-other %s\n" keywd)))) |
| 9017 | (setq gotend t)) | 9046 | (setq gotend t)) |
| 9018 | ;; Final statement? | 9047 | ;; Final statement? |
| 9019 | ((and exit-keywd (equal keywd exit-keywd)) | 9048 | ((and exit-keywd (and (equal keywd exit-keywd) |
| 9049 | (not (looking-at "::")))) | ||
| 9020 | (setq gotend t) | 9050 | (setq gotend t) |
| 9021 | (forward-char (length keywd))) | 9051 | (forward-char (length keywd))) |
| 9022 | ;; Standard tokens... | 9052 | ;; Standard tokens... |
| @@ -9032,7 +9062,9 @@ IGNORE-NEXT is true to ignore next token, fake from inside case statement." | |||
| 9032 | (goto-char (match-end 0)) | 9062 | (goto-char (match-end 0)) |
| 9033 | (forward-char 1))) | 9063 | (forward-char 1))) |
| 9034 | ((equal keywd ":") ; Case statement, begin/end label, x?y:z | 9064 | ((equal keywd ":") ; Case statement, begin/end label, x?y:z |
| 9035 | (cond ((equal "endcase" exit-keywd) ; case x: y=z; statement next | 9065 | (cond ((looking-at "::") |
| 9066 | (forward-char 1)) ; Another forward-char below | ||
| 9067 | ((equal "endcase" exit-keywd) ; case x: y=z; statement next | ||
| 9036 | (setq ignore-next nil rvalue nil)) | 9068 | (setq ignore-next nil rvalue nil)) |
| 9037 | ((equal "?" exit-keywd) ; x?y:z rvalue | 9069 | ((equal "?" exit-keywd) ; x?y:z rvalue |
| 9038 | ) ; NOP | 9070 | ) ; NOP |
| @@ -9127,7 +9159,7 @@ IGNORE-NEXT is true to ignore next token, fake from inside case statement." | |||
| 9127 | (verilog-read-always-signals-recurse nil nil nil) | 9159 | (verilog-read-always-signals-recurse nil nil nil) |
| 9128 | (setq sigs-out-i (append sigs-out-i sigs-out-unk) | 9160 | (setq sigs-out-i (append sigs-out-i sigs-out-unk) |
| 9129 | sigs-out-unk nil) | 9161 | sigs-out-unk nil) |
| 9130 | ;;(if dbg (with-current-buffer (get-buffer-create "*vl-dbg*")) (delete-region (point-min) (point-max)) (insert dbg) (setq dbg "")) | 9162 | ;;(if dbg (with-current-buffer (get-buffer-create "*vl-dbg*") (delete-region (point-min) (point-max)) (insert dbg) (setq dbg ""))) |
| 9131 | ;; Return what was found | 9163 | ;; Return what was found |
| 9132 | (verilog-alw-new sigs-out-d sigs-out-i sigs-temp sigs-in)))) | 9164 | (verilog-alw-new sigs-out-d sigs-out-i sigs-temp sigs-in)))) |
| 9133 | 9165 | ||