diff options
| author | Miles Bader | 2008-01-30 07:57:28 +0000 |
|---|---|---|
| committer | Miles Bader | 2008-01-30 07:57:28 +0000 |
| commit | d235ca2ff8fab139ce797757fcb159d1e28fa7e0 (patch) | |
| tree | 96c5cd1a06a0d9dc26e8470c6eabfc032c0046f3 /lisp/progmodes | |
| parent | 3709a060f679dba14df71ae64a0035fa2b5b3106 (diff) | |
| parent | 02cbe062bee38a6705bafb1699d77e3c44cfafcf (diff) | |
| download | emacs-d235ca2ff8fab139ce797757fcb159d1e28fa7e0.tar.gz emacs-d235ca2ff8fab139ce797757fcb159d1e28fa7e0.zip | |
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-324
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/ada-mode.el | 7 | ||||
| -rw-r--r-- | lisp/progmodes/ada-xref.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-awk.el | 2 | ||||
| -rw-r--r-- | lisp/progmodes/cc-cmds.el | 6 | ||||
| -rw-r--r-- | lisp/progmodes/cc-defs.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 27 | ||||
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 8 | ||||
| -rw-r--r-- | lisp/progmodes/cc-styles.el | 15 | ||||
| -rw-r--r-- | lisp/progmodes/cc-vars.el | 58 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 3 | ||||
| -rw-r--r-- | lisp/progmodes/ebrowse.el | 24 | ||||
| -rw-r--r-- | lisp/progmodes/etags.el | 10 | ||||
| -rw-r--r-- | lisp/progmodes/f90.el | 6 | ||||
| -rw-r--r-- | lisp/progmodes/gdb-ui.el | 19 | ||||
| -rw-r--r-- | lisp/progmodes/hideif.el | 94 | ||||
| -rw-r--r-- | lisp/progmodes/pascal.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 13 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 1 | ||||
| -rw-r--r-- | lisp/progmodes/verilog-mode.el | 1062 | ||||
| -rw-r--r-- | lisp/progmodes/vhdl-mode.el | 2 |
20 files changed, 579 insertions, 788 deletions
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index 2c3acdda176..39e66b049c0 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el | |||
| @@ -930,7 +930,8 @@ are treated as numbers instead of gnatprep comments." | |||
| 930 | (buffer-undo-list t) | 930 | (buffer-undo-list t) |
| 931 | (inhibit-read-only t) | 931 | (inhibit-read-only t) |
| 932 | (inhibit-point-motion-hooks t) | 932 | (inhibit-point-motion-hooks t) |
| 933 | (inhibit-modification-hooks t)) | 933 | (inhibit-modification-hooks t) |
| 934 | buffer-file-name buffer-file-truename) | ||
| 934 | (remove-text-properties (point-min) (point-max) '(syntax-table nil)) | 935 | (remove-text-properties (point-min) (point-max) '(syntax-table nil)) |
| 935 | (goto-char (point-min)) | 936 | (goto-char (point-min)) |
| 936 | (while (re-search-forward | 937 | (while (re-search-forward |
| @@ -4954,11 +4955,11 @@ The paragraph is indented on the first line." | |||
| 4954 | ;; cursor at the correct position. | 4955 | ;; cursor at the correct position. |
| 4955 | ;; Standard Ada does not force any relation between unit names and file names, | 4956 | ;; Standard Ada does not force any relation between unit names and file names, |
| 4956 | ;; so some of these functions can only be a good approximation. However, they | 4957 | ;; so some of these functions can only be a good approximation. However, they |
| 4957 | ;; are also overriden in `ada-xref'.el when we know that the user is using | 4958 | ;; are also overridden in `ada-xref'.el when we know that the user is using |
| 4958 | ;; GNAT. | 4959 | ;; GNAT. |
| 4959 | ;; --------------------------------------------------- | 4960 | ;; --------------------------------------------------- |
| 4960 | 4961 | ||
| 4961 | ;; Overriden when we work with GNAT, to use gnatkrunch | 4962 | ;; Overridden when we work with GNAT, to use gnatkrunch |
| 4962 | (defun ada-make-filename-from-adaname (adaname) | 4963 | (defun ada-make-filename-from-adaname (adaname) |
| 4963 | "Determine the filename in which ADANAME is found. | 4964 | "Determine the filename in which ADANAME is found. |
| 4964 | This matches the GNAT default naming convention, except for | 4965 | This matches the GNAT default naming convention, except for |
diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el index f9b5c026a4e..c63850ee5be 100644 --- a/lisp/progmodes/ada-xref.el +++ b/lisp/progmodes/ada-xref.el | |||
| @@ -617,7 +617,7 @@ If NO-USER-QUESTION, don't prompt user for file. Call | |||
| 617 | 617 | ||
| 618 | (defun ada-convert-file-name (name) | 618 | (defun ada-convert-file-name (name) |
| 619 | "Convert from NAME to a name that can be used by the compilation commands. | 619 | "Convert from NAME to a name that can be used by the compilation commands. |
| 620 | This is overriden on VMS to convert from VMS filenames to Unix filenames." | 620 | This is overridden on VMS to convert from VMS filenames to Unix filenames." |
| 621 | name) | 621 | name) |
| 622 | ;; FIXME: use convert-standard-filename instead | 622 | ;; FIXME: use convert-standard-filename instead |
| 623 | 623 | ||
diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index d9a70558697..b361585422a 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el | |||
| @@ -478,7 +478,7 @@ | |||
| 478 | 478 | ||
| 479 | (defun c-awk-get-NL-prop-prev-line (&optional do-lim) | 479 | (defun c-awk-get-NL-prop-prev-line (&optional do-lim) |
| 480 | ;; Get the c-awk-NL-prop text-property from the previous line, calculating | 480 | ;; Get the c-awk-NL-prop text-property from the previous line, calculating |
| 481 | ;; it if necessary. Return nil if we're at BOB. | 481 | ;; it if necessary. Return nil if we're already at BOB. |
| 482 | ;; See c-awk-after-if-for-while-condition-p for a description of DO-LIM. | 482 | ;; See c-awk-after-if-for-while-condition-p for a description of DO-LIM. |
| 483 | ;; | 483 | ;; |
| 484 | ;; This function might do hidden buffer changes. | 484 | ;; This function might do hidden buffer changes. |
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 8d3facb08b6..1a2ee3f0ce5 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el | |||
| @@ -524,7 +524,11 @@ inside a literal or a macro, nothing special happens." | |||
| 524 | ;; This is the list of brace syntactic symbols that can hang. | 524 | ;; This is the list of brace syntactic symbols that can hang. |
| 525 | ;; If any new ones are added to c-offsets-alist, they should be | 525 | ;; If any new ones are added to c-offsets-alist, they should be |
| 526 | ;; added here as well. | 526 | ;; added here as well. |
| 527 | '(class-open class-close defun-open defun-close | 527 | ;; |
| 528 | ;; The order of this list is important; if SYNTAX has several | ||
| 529 | ;; elements, the element that "wins" is the earliest in SYMS. | ||
| 530 | '(arglist-cont-nonempty ; e.g. an array literal. | ||
| 531 | class-open class-close defun-open defun-close | ||
| 528 | inline-open inline-close | 532 | inline-open inline-close |
| 529 | brace-list-open brace-list-close | 533 | brace-list-open brace-list-close |
| 530 | brace-list-intro brace-entry-open | 534 | brace-list-intro brace-entry-open |
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 288aca687aa..2d4cc982714 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el | |||
| @@ -96,7 +96,7 @@ | |||
| 96 | 96 | ||
| 97 | ;;; Variables also used at compile time. | 97 | ;;; Variables also used at compile time. |
| 98 | 98 | ||
| 99 | (defconst c-version "5.31.4" | 99 | (defconst c-version "5.31.5" |
| 100 | "CC Mode version number.") | 100 | "CC Mode version number.") |
| 101 | 101 | ||
| 102 | (defconst c-version-sym (intern c-version)) | 102 | (defconst c-version-sym (intern c-version)) |
| @@ -425,6 +425,8 @@ The return value is the value of the last form in BODY." | |||
| 425 | (inhibit-read-only t) (inhibit-point-motion-hooks t) | 425 | (inhibit-read-only t) (inhibit-point-motion-hooks t) |
| 426 | before-change-functions after-change-functions | 426 | before-change-functions after-change-functions |
| 427 | deactivate-mark | 427 | deactivate-mark |
| 428 | buffer-file-name buffer-file-truename ; Prevent primitives checking | ||
| 429 | ; for file modification | ||
| 428 | ,@varlist) | 430 | ,@varlist) |
| 429 | (unwind-protect | 431 | (unwind-protect |
| 430 | (progn ,@body) | 432 | (progn ,@body) |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 7cac158166e..48bbcaf18cf 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -5094,7 +5094,8 @@ comment at the start of cc-engine.el for more info." | |||
| 5094 | ;; | 5094 | ;; |
| 5095 | ;; The point is left at the first token after the first complete | 5095 | ;; The point is left at the first token after the first complete |
| 5096 | ;; declarator, if there is one. The return value is a cons where | 5096 | ;; declarator, if there is one. The return value is a cons where |
| 5097 | ;; the car is the position of the first token in the declarator. | 5097 | ;; the car is the position of the first token in the declarator. (See |
| 5098 | ;; below for the cdr.) | ||
| 5098 | ;; Some examples: | 5099 | ;; Some examples: |
| 5099 | ;; | 5100 | ;; |
| 5100 | ;; void foo (int a, char *b) stuff ... | 5101 | ;; void foo (int a, char *b) stuff ... |
| @@ -5118,9 +5119,9 @@ comment at the start of cc-engine.el for more info." | |||
| 5118 | ;; Foo::Foo (int b) : Base (b) {} | 5119 | ;; Foo::Foo (int b) : Base (b) {} |
| 5119 | ;; car ^ ^ point | 5120 | ;; car ^ ^ point |
| 5120 | ;; | 5121 | ;; |
| 5121 | ;; The cdr of the return value is non-nil if a | 5122 | ;; The cdr of the return value is non-nil iff a `c-typedef-decl-kwds' |
| 5122 | ;; `c-typedef-decl-kwds' specifier is found in the declaration, | 5123 | ;; specifier (e.g. class, struct, enum, typedef) is found in the |
| 5123 | ;; i.e. the declared identifier(s) are types. | 5124 | ;; declaration, i.e. the declared identifier(s) are types. |
| 5124 | ;; | 5125 | ;; |
| 5125 | ;; If a cast is parsed: | 5126 | ;; If a cast is parsed: |
| 5126 | ;; | 5127 | ;; |
| @@ -5135,7 +5136,7 @@ comment at the start of cc-engine.el for more info." | |||
| 5135 | ;; the first token in (the visible part of) the buffer. | 5136 | ;; the first token in (the visible part of) the buffer. |
| 5136 | ;; | 5137 | ;; |
| 5137 | ;; CONTEXT is a symbol that describes the context at the point: | 5138 | ;; CONTEXT is a symbol that describes the context at the point: |
| 5138 | ;; 'decl In a comma-separatded declaration context (typically | 5139 | ;; 'decl In a comma-separated declaration context (typically |
| 5139 | ;; inside a function declaration arglist). | 5140 | ;; inside a function declaration arglist). |
| 5140 | ;; '<> In an angle bracket arglist. | 5141 | ;; '<> In an angle bracket arglist. |
| 5141 | ;; 'arglist Some other type of arglist. | 5142 | ;; 'arglist Some other type of arglist. |
| @@ -8032,12 +8033,15 @@ comment at the start of cc-engine.el for more info." | |||
| 8032 | 8033 | ||
| 8033 | ;; CASE 5A.5: ordinary defun open | 8034 | ;; CASE 5A.5: ordinary defun open |
| 8034 | (t | 8035 | (t |
| 8035 | (goto-char placeholder) | 8036 | (save-excursion |
| 8036 | (if (or containing-decl-open macro-start) | 8037 | (c-beginning-of-decl-1 lim) |
| 8037 | (c-add-syntax 'defun-open (c-point 'boi)) | 8038 | (while (looking-at c-specifier-key) |
| 8038 | ;; Bogus to use bol here, but it's the legacy. | 8039 | (goto-char (match-end 1)) |
| 8039 | (c-add-syntax 'defun-open (c-point 'bol))) | 8040 | (c-forward-syntactic-ws indent-point)) |
| 8040 | ))) | 8041 | (c-add-syntax 'defun-open (c-point 'boi)) |
| 8042 | ;; Bogus to use bol here, but it's the legacy. (Resolved, | ||
| 8043 | ;; 2007-11-09) | ||
| 8044 | )))) | ||
| 8041 | 8045 | ||
| 8042 | ;; CASE 5B: After a function header but before the body (or | 8046 | ;; CASE 5B: After a function header but before the body (or |
| 8043 | ;; the ending semicolon if there's no body). | 8047 | ;; the ending semicolon if there's no body). |
| @@ -8296,6 +8300,7 @@ comment at the start of cc-engine.el for more info." | |||
| 8296 | 8300 | ||
| 8297 | ;; CASE 5H: we could be looking at subsequent knr-argdecls | 8301 | ;; CASE 5H: we could be looking at subsequent knr-argdecls |
| 8298 | ((and c-recognize-knr-p | 8302 | ((and c-recognize-knr-p |
| 8303 | (not containing-sexp) ; can't be knr inside braces. | ||
| 8299 | (not (eq char-before-ip ?})) | 8304 | (not (eq char-before-ip ?})) |
| 8300 | (save-excursion | 8305 | (save-excursion |
| 8301 | (setq placeholder (cdr (c-beginning-of-decl-1 lim))) | 8306 | (setq placeholder (cdr (c-beginning-of-decl-1 lim))) |
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index ea527730620..54725c0fd88 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el | |||
| @@ -1771,11 +1771,13 @@ one of `c-type-list-kwds', `c-ref-list-kwds', | |||
| 1771 | (c-lang-defvar c-prefix-spec-kwds-re (c-lang-const c-prefix-spec-kwds-re)) | 1771 | (c-lang-defvar c-prefix-spec-kwds-re (c-lang-const c-prefix-spec-kwds-re)) |
| 1772 | 1772 | ||
| 1773 | (c-lang-defconst c-specifier-key | 1773 | (c-lang-defconst c-specifier-key |
| 1774 | ;; Adorned regexp of the keywords in `c-prefix-spec-kwds' that | 1774 | ;; Adorned regexp of the keywords in `c-prefix-spec-kwds' that aren't |
| 1775 | ;; aren't ambiguous with types or type prefixes. | 1775 | ;; ambiguous with types or type prefixes. These are the keywords (like |
| 1776 | ;; extern, namespace, but NOT template) that can modify a declaration. | ||
| 1776 | t (c-make-keywords-re t | 1777 | t (c-make-keywords-re t |
| 1777 | (set-difference (c-lang-const c-prefix-spec-kwds) | 1778 | (set-difference (c-lang-const c-prefix-spec-kwds) |
| 1778 | (c-lang-const c-type-start-kwds) | 1779 | (append (c-lang-const c-type-start-kwds) |
| 1780 | (c-lang-const c-<>-arglist-kwds)) | ||
| 1779 | :test 'string-equal))) | 1781 | :test 'string-equal))) |
| 1780 | (c-lang-defvar c-specifier-key (c-lang-const c-specifier-key)) | 1782 | (c-lang-defvar c-specifier-key (c-lang-const c-specifier-key)) |
| 1781 | 1783 | ||
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 41f1836c0a4..26596e42ae8 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el | |||
| @@ -58,7 +58,8 @@ | |||
| 58 | '(("gnu" | 58 | '(("gnu" |
| 59 | (c-basic-offset . 2) | 59 | (c-basic-offset . 2) |
| 60 | (c-comment-only-line-offset . (0 . 0)) | 60 | (c-comment-only-line-offset . (0 . 0)) |
| 61 | (c-hanging-braces-alist . ((substatement-open before after))) | 61 | (c-hanging-braces-alist . ((substatement-open before after) |
| 62 | (arglist-cont-nonempty))) | ||
| 62 | (c-offsets-alist . ((statement-block-intro . +) | 63 | (c-offsets-alist . ((statement-block-intro . +) |
| 63 | (knr-argdecl-intro . 5) | 64 | (knr-argdecl-intro . 5) |
| 64 | (substatement-open . +) | 65 | (substatement-open . +) |
| @@ -170,7 +171,8 @@ | |||
| 170 | (case-label . +) | 171 | (case-label . +) |
| 171 | (access-label . -) | 172 | (access-label . -) |
| 172 | (inclass . ++) | 173 | (inclass . ++) |
| 173 | (inline-open . 0)))) | 174 | (inline-open . 0) |
| 175 | (arglist-cont-nonempty)))) | ||
| 174 | 176 | ||
| 175 | ("linux" | 177 | ("linux" |
| 176 | (c-basic-offset . 8) | 178 | (c-basic-offset . 8) |
| @@ -178,7 +180,8 @@ | |||
| 178 | (c-hanging-braces-alist . ((brace-list-open) | 180 | (c-hanging-braces-alist . ((brace-list-open) |
| 179 | (brace-entry-open) | 181 | (brace-entry-open) |
| 180 | (substatement-open after) | 182 | (substatement-open after) |
| 181 | (block-close . c-snug-do-while))) | 183 | (block-close . c-snug-do-while) |
| 184 | (arglist-cont-nonempty))) | ||
| 182 | (c-cleanup-list . (brace-else-brace)) | 185 | (c-cleanup-list . (brace-else-brace)) |
| 183 | (c-offsets-alist . ((statement-block-intro . +) | 186 | (c-offsets-alist . ((statement-block-intro . +) |
| 184 | (knr-argdecl-intro . 0) | 187 | (knr-argdecl-intro . 0) |
| @@ -200,7 +203,8 @@ | |||
| 200 | (brace-list-close) | 203 | (brace-list-close) |
| 201 | (brace-entry-open) | 204 | (brace-entry-open) |
| 202 | (substatement-open after) | 205 | (substatement-open after) |
| 203 | (block-close . c-snug-do-while))) | 206 | (block-close . c-snug-do-while) |
| 207 | (arglist-cont-nonempty))) | ||
| 204 | (c-block-comment-prefix . "")) | 208 | (c-block-comment-prefix . "")) |
| 205 | 209 | ||
| 206 | ("java" | 210 | ("java" |
| @@ -230,7 +234,8 @@ | |||
| 230 | (c-hanging-braces-alist . ((defun-open after) | 234 | (c-hanging-braces-alist . ((defun-open after) |
| 231 | (defun-close . c-snug-1line-defun-close) | 235 | (defun-close . c-snug-1line-defun-close) |
| 232 | (substatement-open after) | 236 | (substatement-open after) |
| 233 | (block-close . c-snug-do-while))) | 237 | (block-close . c-snug-do-while) |
| 238 | (arglist-cont-nonempty))) | ||
| 234 | (c-hanging-semi&comma-criteria . nil) | 239 | (c-hanging-semi&comma-criteria . nil) |
| 235 | (c-cleanup-list . nil) ; You might want one-liner-defun here. | 240 | (c-cleanup-list . nil) ; You might want one-liner-defun here. |
| 236 | (c-offsets-alist . ((statement-block-intro . +) | 241 | (c-offsets-alist . ((statement-block-intro . +) |
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 25adb2be01b..8b7b9cd24ee 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el | |||
| @@ -73,8 +73,28 @@ Useful as last item in a `choice' widget." | |||
| 73 | :format "%t%n" | 73 | :format "%t%n" |
| 74 | :value 'other)) | 74 | :value 'other)) |
| 75 | 75 | ||
| 76 | ;; The next defun will supersede c-const-symbol. | ||
| 77 | (eval-and-compile | ||
| 78 | (defun c-constant-symbol (sym len) | ||
| 79 | "Create an uneditable symbol for customization buffers. | ||
| 80 | SYM is the name of the symbol, LEN the length of the field (in | ||
| 81 | characters) the symbol will be displayed in. LEN must be big | ||
| 82 | enough. | ||
| 83 | |||
| 84 | This returns a (const ....) structure, suitable for embedding | ||
| 85 | within a customization type." | ||
| 86 | (or (symbolp sym) (error "c-constant-symbol: %s is not a symbol" sym)) | ||
| 87 | (let* ((name (symbol-name sym)) | ||
| 88 | (l (length name)) | ||
| 89 | (disp (concat name ":" (make-string (- len l 1) ?\ )))) | ||
| 90 | `(const | ||
| 91 | :size ,len | ||
| 92 | :format ,disp | ||
| 93 | :value ,sym)))) | ||
| 94 | |||
| 76 | (define-widget 'c-const-symbol 'item | 95 | (define-widget 'c-const-symbol 'item |
| 77 | "An uneditable lisp symbol." | 96 | "An uneditable lisp symbol. This is obsolete - |
| 97 | use c-constant-symbol instead." | ||
| 78 | :value nil | 98 | :value nil |
| 79 | :tag "Symbol" | 99 | :tag "Symbol" |
| 80 | :format "%t: %v\n%d" | 100 | :format "%t: %v\n%d" |
| @@ -305,6 +325,7 @@ e.g. `c-special-indent-hook'." | |||
| 305 | :type 'boolean | 325 | :type 'boolean |
| 306 | :group 'c) | 326 | :group 'c) |
| 307 | (make-variable-buffer-local 'c-syntactic-indentation) | 327 | (make-variable-buffer-local 'c-syntactic-indentation) |
| 328 | (put 'c-syntactic-indentation 'safe-local-variable 'booleanp) | ||
| 308 | 329 | ||
| 309 | (defcustom c-syntactic-indentation-in-macros t | 330 | (defcustom c-syntactic-indentation-in-macros t |
| 310 | "*Enable syntactic analysis inside macros. | 331 | "*Enable syntactic analysis inside macros. |
| @@ -323,6 +344,7 @@ countered easily by surrounding the statements by a block \(or even | |||
| 323 | better with the \"do { ... } while \(0)\" trick)." | 344 | better with the \"do { ... } while \(0)\" trick)." |
| 324 | :type 'boolean | 345 | :type 'boolean |
| 325 | :group 'c) | 346 | :group 'c) |
| 347 | (put 'c-syntactic-indentation-in-macros 'safe-local-variable 'booleanp) | ||
| 326 | 348 | ||
| 327 | (defcustom-c-stylevar c-comment-only-line-offset 0 | 349 | (defcustom-c-stylevar c-comment-only-line-offset 0 |
| 328 | "*Extra offset for line which contains only the start of a comment. | 350 | "*Extra offset for line which contains only the start of a comment. |
| @@ -405,9 +427,7 @@ in that case, i.e. as if \\[c-indent-command] was used instead." | |||
| 405 | `(set ,@(mapcar | 427 | `(set ,@(mapcar |
| 406 | (lambda (elt) | 428 | (lambda (elt) |
| 407 | `(cons :format "%v" | 429 | `(cons :format "%v" |
| 408 | (c-const-symbol :format "%v: " | 430 | ,(c-constant-symbol elt 20) |
| 409 | :size 20 | ||
| 410 | :value ,elt) | ||
| 411 | (choice | 431 | (choice |
| 412 | :format "%[Choice%] %v" | 432 | :format "%[Choice%] %v" |
| 413 | :value (column . nil) | 433 | :value (column . nil) |
| @@ -709,7 +729,8 @@ involve auto-newline inserted newlines: | |||
| 709 | (module-open after) | 729 | (module-open after) |
| 710 | (composition-open after) | 730 | (composition-open after) |
| 711 | (inexpr-class-open after) | 731 | (inexpr-class-open after) |
| 712 | (inexpr-class-close before)) | 732 | (inexpr-class-close before) |
| 733 | (arglist-cont-nonempty)) | ||
| 713 | "*Controls the insertion of newlines before and after braces | 734 | "*Controls the insertion of newlines before and after braces |
| 714 | when the auto-newline feature is active. This variable contains an | 735 | when the auto-newline feature is active. This variable contains an |
| 715 | association list with elements of the following form: | 736 | association list with elements of the following form: |
| @@ -743,18 +764,15 @@ syntactic context for the brace line." | |||
| 743 | `(set ,@(mapcar | 764 | `(set ,@(mapcar |
| 744 | (lambda (elt) | 765 | (lambda (elt) |
| 745 | `(cons :format "%v" | 766 | `(cons :format "%v" |
| 746 | (c-const-symbol :format "%v: " | 767 | ,(c-constant-symbol elt 24) |
| 747 | :size 20 | ||
| 748 | :value ,elt) | ||
| 749 | (choice :format "%[Choice%] %v" | 768 | (choice :format "%[Choice%] %v" |
| 750 | :value (before after) | 769 | :value (before after) |
| 751 | (set :menu-tag "Before/after" | 770 | (set :menu-tag "Before/after" |
| 752 | :format "Newline %v brace\n" | 771 | :format "Newline %v brace\n" |
| 753 | (const :format "%v, " before) | 772 | (const :format "%v, " before) |
| 754 | (const :format "%v" after)) | 773 | (const :format "%v " after)) |
| 755 | (function :menu-tag "Function" | 774 | (function :menu-tag "Function" |
| 756 | :format "Run function: %v" | 775 | :format "Run function: %v")))) |
| 757 | :value c-)))) | ||
| 758 | '(defun-open defun-close | 776 | '(defun-open defun-close |
| 759 | class-open class-close | 777 | class-open class-close |
| 760 | inline-open inline-close | 778 | inline-open inline-close |
| @@ -766,7 +784,8 @@ syntactic context for the brace line." | |||
| 766 | namespace-open namespace-close | 784 | namespace-open namespace-close |
| 767 | module-open module-close | 785 | module-open module-close |
| 768 | composition-open composition-close | 786 | composition-open composition-close |
| 769 | inexpr-class-open inexpr-class-close))) | 787 | inexpr-class-open inexpr-class-close |
| 788 | arglist-cont-nonempty))) | ||
| 770 | :group 'c) | 789 | :group 'c) |
| 771 | 790 | ||
| 772 | (defcustom c-max-one-liner-length 80 | 791 | (defcustom c-max-one-liner-length 80 |
| @@ -790,11 +809,9 @@ currently not supported for this variable." | |||
| 790 | `(set ,@(mapcar | 809 | `(set ,@(mapcar |
| 791 | (lambda (elt) | 810 | (lambda (elt) |
| 792 | `(cons :format "%v" | 811 | `(cons :format "%v" |
| 793 | (c-const-symbol :format "%v: " | 812 | ,(c-constant-symbol elt 20) |
| 794 | :size 20 | 813 | (set :format "Newline %v colon\n" |
| 795 | :value ,elt) | 814 | (const :format "%v, " before) |
| 796 | (set :format "Newline %v brace\n" | ||
| 797 | (const :format "%v, " before) | ||
| 798 | (const :format "%v" after)))) | 815 | (const :format "%v" after)))) |
| 799 | '(case-label label access-label member-init-intro inher-intro))) | 816 | '(case-label label access-label member-init-intro inher-intro))) |
| 800 | :group 'c) | 817 | :group 'c) |
| @@ -1307,8 +1324,7 @@ Here is the current list of valid syntactic element symbols: | |||
| 1307 | (lambda (elt) | 1324 | (lambda (elt) |
| 1308 | `(cons :format "%v" | 1325 | `(cons :format "%v" |
| 1309 | :value ,elt | 1326 | :value ,elt |
| 1310 | (c-const-symbol :format "%v: " | 1327 | ,(c-constant-symbol (car elt) 25) |
| 1311 | :size 25) | ||
| 1312 | (sexp :format "%v" | 1328 | (sexp :format "%v" |
| 1313 | :validate | 1329 | :validate |
| 1314 | (lambda (widget) | 1330 | (lambda (widget) |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 772d35f94f0..f02a7756419 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -272,8 +272,9 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) | |||
| 272 | " in \\([^()\n ]+\\)(\\([0-9]+\\))$" 1 2) | 272 | " in \\([^()\n ]+\\)(\\([0-9]+\\))$" 1 2) |
| 273 | 273 | ||
| 274 | (msft | 274 | (msft |
| 275 | ;; AFAWK, The message may be a "warning", "error", or "fatal error". | ||
| 275 | "^\\([0-9]+>\\)?\\(\\(?:[a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \ | 276 | "^\\([0-9]+>\\)?\\(\\(?:[a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \ |
| 276 | : \\(?:error\\|warnin\\(g\\)\\) C[0-9]+:" 2 3 nil (4)) | 277 | : \\(?:warnin\\(g\\)\\|[a-z ]+\\) C[0-9]+:" 2 3 nil (4)) |
| 277 | 278 | ||
| 278 | (oracle | 279 | (oracle |
| 279 | "^\\(?:Semantic error\\|Error\\|PCC-[0-9]+:\\).* line \\([0-9]+\\)\ | 280 | "^\\(?:Semantic error\\|Error\\|PCC-[0-9]+:\\).* line \\([0-9]+\\)\ |
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index 6bd7e8c780c..eaeabe58aae 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el | |||
| @@ -1614,21 +1614,6 @@ and (b) in the directories named in `ebrowse-search-path'." | |||
| 1614 | file-name)) | 1614 | file-name)) |
| 1615 | 1615 | ||
| 1616 | 1616 | ||
| 1617 | (defun ebrowse-view-file-other-window (file) | ||
| 1618 | "View a file FILE in another window. | ||
| 1619 | This is a replacement for `view-file-other-window' which does not | ||
| 1620 | seem to work. It should be removed when `view.el' is fixed." | ||
| 1621 | (interactive) | ||
| 1622 | (let ((old-arrangement (current-window-configuration)) | ||
| 1623 | (had-a-buf (get-file-buffer file)) | ||
| 1624 | (buf-to-view (find-file-noselect file))) | ||
| 1625 | (switch-to-buffer-other-window buf-to-view) | ||
| 1626 | (view-mode-enter old-arrangement | ||
| 1627 | (and (not had-a-buf) | ||
| 1628 | (not (buffer-modified-p buf-to-view)) | ||
| 1629 | 'kill-buffer)))) | ||
| 1630 | |||
| 1631 | |||
| 1632 | (defun ebrowse-view-exit-fn (buffer) | 1617 | (defun ebrowse-view-exit-fn (buffer) |
| 1633 | "Function called when exiting View mode in BUFFER. | 1618 | "Function called when exiting View mode in BUFFER. |
| 1634 | Restore frame configuration active before viewing the file, | 1619 | Restore frame configuration active before viewing the file, |
| @@ -1649,10 +1634,9 @@ and possibly kill the viewed buffer." | |||
| 1649 | 1634 | ||
| 1650 | (defun ebrowse-view-file-other-frame (file) | 1635 | (defun ebrowse-view-file-other-frame (file) |
| 1651 | "View a file FILE in another frame. | 1636 | "View a file FILE in another frame. |
| 1652 | The new frame is deleted when it is no longer used." | 1637 | The new frame is deleted when you quit viewing the file in that frame." |
| 1653 | (interactive) | 1638 | (interactive) |
| 1654 | (let ((old-frame-configuration (current-frame-configuration)) | 1639 | (let ((old-frame-configuration (current-frame-configuration)) |
| 1655 | (old-arrangement (current-window-configuration)) | ||
| 1656 | (had-a-buf (get-file-buffer file)) | 1640 | (had-a-buf (get-file-buffer file)) |
| 1657 | (buf-to-view (find-file-noselect file))) | 1641 | (buf-to-view (find-file-noselect file))) |
| 1658 | (switch-to-buffer-other-frame buf-to-view) | 1642 | (switch-to-buffer-other-frame buf-to-view) |
| @@ -1663,8 +1647,8 @@ The new frame is deleted when it is no longer used." | |||
| 1663 | (and (not had-a-buf) | 1647 | (and (not had-a-buf) |
| 1664 | (not (buffer-modified-p buf-to-view)) | 1648 | (not (buffer-modified-p buf-to-view)) |
| 1665 | 'kill-buffer)) | 1649 | 'kill-buffer)) |
| 1666 | (view-mode-enter old-arrangement 'ebrowse-view-exit-fn))) | 1650 | (view-mode-enter (cons (selected-window) (cons (selected-window) t)) |
| 1667 | 1651 | 'ebrowse-view-exit-fn))) | |
| 1668 | 1652 | ||
| 1669 | (defun ebrowse-view/find-file-and-search-pattern | 1653 | (defun ebrowse-view/find-file-and-search-pattern |
| 1670 | (struc info file tags-file-name &optional view where) | 1654 | (struc info file tags-file-name &optional view where) |
| @@ -1699,7 +1683,7 @@ specifies where to find/view the result." | |||
| 1699 | (setq view-mode-hook nil)) | 1683 | (setq view-mode-hook nil)) |
| 1700 | (push 'ebrowse-find-pattern view-mode-hook) | 1684 | (push 'ebrowse-find-pattern view-mode-hook) |
| 1701 | (case where | 1685 | (case where |
| 1702 | (other-window (ebrowse-view-file-other-window file)) | 1686 | (other-window (view-file-other-window file)) |
| 1703 | (other-frame (ebrowse-view-file-other-frame file)) | 1687 | (other-frame (ebrowse-view-file-other-frame file)) |
| 1704 | (t (view-file file)))) | 1688 | (t (view-file file)))) |
| 1705 | (t | 1689 | (t |
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 21a5593c659..32aecdd8295 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -1815,13 +1815,19 @@ See documentation of variable `tags-file-name'." | |||
| 1815 | (tags-loop-continue (or file-list-form t)))) | 1815 | (tags-loop-continue (or file-list-form t)))) |
| 1816 | 1816 | ||
| 1817 | ;;;###autoload | 1817 | ;;;###autoload |
| 1818 | (defun tags-query-replace (from to &optional delimited file-list-form start end) | 1818 | (defun tags-query-replace (from to &optional delimited file-list-form) |
| 1819 | "Do `query-replace-regexp' of FROM with TO on all files listed in tags table. | 1819 | "Do `query-replace-regexp' of FROM with TO on all files listed in tags table. |
| 1820 | Third arg DELIMITED (prefix arg) means replace only word-delimited matches. | 1820 | Third arg DELIMITED (prefix arg) means replace only word-delimited matches. |
| 1821 | If you exit (\\[keyboard-quit], RET or q), you can resume the query replace | 1821 | If you exit (\\[keyboard-quit], RET or q), you can resume the query replace |
| 1822 | with the command \\[tags-loop-continue]. | 1822 | with the command \\[tags-loop-continue]. |
| 1823 | Fourth arg FILE-LIST-FORM non-nil means initialize the replacement loop. | ||
| 1824 | Fifth and sixth arguments START and END are accepted, for compatibility | ||
| 1825 | with `query-replace-regexp', and ignored. | ||
| 1823 | 1826 | ||
| 1824 | See documentation of variable `tags-file-name'." | 1827 | If FILE-LIST-FORM is non-nil, it is a form to evaluate to |
| 1828 | produce the list of files to search. | ||
| 1829 | |||
| 1830 | See also the documentation of the variable `tags-file-name'." | ||
| 1825 | (interactive (query-replace-read-args "Tags query replace (regexp)" t t)) | 1831 | (interactive (query-replace-read-args "Tags query replace (regexp)" t t)) |
| 1826 | (setq tags-loop-scan `(let ,(unless (equal from (downcase from)) | 1832 | (setq tags-loop-scan `(let ,(unless (equal from (downcase from)) |
| 1827 | '((case-fold-search nil))) | 1833 | '((case-fold-search nil))) |
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index df10b5ecd30..2c152d91512 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el | |||
| @@ -1681,7 +1681,7 @@ A block is a subroutine, if-endif, etc." | |||
| 1681 | (push-mark) | 1681 | (push-mark) |
| 1682 | (goto-char pos) | 1682 | (goto-char pos) |
| 1683 | (setq program (f90-beginning-of-subprogram)) | 1683 | (setq program (f90-beginning-of-subprogram)) |
| 1684 | (if (fboundp 'zmacs-activate-region) | 1684 | (if (featurep 'xemacs) |
| 1685 | (zmacs-activate-region) | 1685 | (zmacs-activate-region) |
| 1686 | (setq mark-active t | 1686 | (setq mark-active t |
| 1687 | deactivate-mark nil)) | 1687 | deactivate-mark nil)) |
| @@ -1866,7 +1866,7 @@ If run in the middle of a line, the line is not broken." | |||
| 1866 | (goto-char save-point) | 1866 | (goto-char save-point) |
| 1867 | (set-marker end-region-mark nil) | 1867 | (set-marker end-region-mark nil) |
| 1868 | (set-marker save-point nil) | 1868 | (set-marker save-point nil) |
| 1869 | (if (fboundp 'zmacs-deactivate-region) | 1869 | (if (featurep 'xemacs) |
| 1870 | (zmacs-deactivate-region) | 1870 | (zmacs-deactivate-region) |
| 1871 | (deactivate-mark)))) | 1871 | (deactivate-mark)))) |
| 1872 | 1872 | ||
| @@ -1976,7 +1976,7 @@ Like `join-line', but handles F90 syntax." | |||
| 1976 | f90-cache-position (point))) | 1976 | f90-cache-position (point))) |
| 1977 | (setq f90-cache-position nil) | 1977 | (setq f90-cache-position nil) |
| 1978 | (set-marker end-region-mark nil) | 1978 | (set-marker end-region-mark nil) |
| 1979 | (if (fboundp 'zmacs-deactivate-region) | 1979 | (if (featurep 'xemacs) |
| 1980 | (zmacs-deactivate-region) | 1980 | (zmacs-deactivate-region) |
| 1981 | (deactivate-mark)))) | 1981 | (deactivate-mark)))) |
| 1982 | 1982 | ||
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index eee68fb2b6f..3e29f9732b2 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -435,11 +435,11 @@ otherwise do not." | |||
| 435 | (output | 435 | (output |
| 436 | (with-output-to-string | 436 | (with-output-to-string |
| 437 | (with-current-buffer standard-output | 437 | (with-current-buffer standard-output |
| 438 | (call-process shell-file-name | 438 | (and file (file-exists-p file) |
| 439 | (if (file-exists-p file) file nil) | 439 | (call-process shell-file-name file |
| 440 | (list t nil) nil "-c" | 440 | (list t nil) nil "-c" |
| 441 | (concat gdb-cpp-define-alist-program " " | 441 | (concat gdb-cpp-define-alist-program " " |
| 442 | gdb-cpp-define-alist-flags))))) | 442 | gdb-cpp-define-alist-flags)))))) |
| 443 | (define-list (split-string output "\n" t)) (name)) | 443 | (define-list (split-string output "\n" t)) (name)) |
| 444 | (setq gdb-define-alist nil) | 444 | (setq gdb-define-alist nil) |
| 445 | (dolist (define define-list) | 445 | (dolist (define define-list) |
| @@ -1214,10 +1214,12 @@ This filter may simply queue input for a later time." | |||
| 1214 | 1214 | ||
| 1215 | (defun gdb-dequeue-input () | 1215 | (defun gdb-dequeue-input () |
| 1216 | (let ((queue gdb-input-queue)) | 1216 | (let ((queue gdb-input-queue)) |
| 1217 | (and queue | 1217 | (if queue |
| 1218 | (let ((last (car (last queue)))) | 1218 | (let ((last (car (last queue)))) |
| 1219 | (unless (nbutlast queue) (setq gdb-input-queue '())) | 1219 | (unless (nbutlast queue) (setq gdb-input-queue '())) |
| 1220 | last)))) | 1220 | last) |
| 1221 | ;; This should be nil here anyway but set it just to make sure. | ||
| 1222 | (setq gdb-pending-triggers nil)))) | ||
| 1221 | 1223 | ||
| 1222 | (defun gdb-send-item (item) | 1224 | (defun gdb-send-item (item) |
| 1223 | (setq gdb-flush-pending-output nil) | 1225 | (setq gdb-flush-pending-output nil) |
| @@ -3445,7 +3447,8 @@ BUFFER nil or omitted means use the current buffer." | |||
| 3445 | (let ((buffer (marker-buffer gud-overlay-arrow-position)) | 3447 | (let ((buffer (marker-buffer gud-overlay-arrow-position)) |
| 3446 | (position (marker-position gud-overlay-arrow-position))) | 3448 | (position (marker-position gud-overlay-arrow-position))) |
| 3447 | (when (and buffer | 3449 | (when (and buffer |
| 3448 | (string-equal (buffer-name buffer) | 3450 | (string-equal (file-name-nondirectory |
| 3451 | (buffer-file-name buffer)) | ||
| 3449 | (file-name-nondirectory (match-string 3)))) | 3452 | (file-name-nondirectory (match-string 3)))) |
| 3450 | (with-current-buffer buffer | 3453 | (with-current-buffer buffer |
| 3451 | (setq fringe-indicator-alist | 3454 | (setq fringe-indicator-alist |
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 126b5310ccc..83ffb5f7a0e 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; hideif.el --- hides selected code within ifdef | 1 | ;;; hideif.el --- hides selected code within ifdef |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1988, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 | 3 | ;; Copyright (C) 1988, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; 2008 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Daniel LaLiberte <liberte@holonexus.org> | 6 | ;; Author: Daniel LaLiberte <liberte@holonexus.org> |
| 7 | ;; Maintainer: FSF | 7 | ;; Maintainer: FSF |
| @@ -99,12 +99,6 @@ | |||
| 99 | ;; | 99 | ;; |
| 100 | ;; Written by Brian Marick, at Gould, Computer Systems Division, Urbana IL. | 100 | ;; Written by Brian Marick, at Gould, Computer Systems Division, Urbana IL. |
| 101 | ;; Extensively modified by Daniel LaLiberte (while at Gould). | 101 | ;; Extensively modified by Daniel LaLiberte (while at Gould). |
| 102 | ;; | ||
| 103 | ;; You may freely modify and distribute this, but keep a record | ||
| 104 | ;; of modifications and send comments to: | ||
| 105 | ;; liberte@a.cs.uiuc.edu or ihnp4!uiucdcs!liberte | ||
| 106 | ;; I will continue to upgrade hide-ifdef-mode | ||
| 107 | ;; with your contributions. | ||
| 108 | 102 | ||
| 109 | ;;; Code: | 103 | ;;; Code: |
| 110 | 104 | ||
| @@ -114,6 +108,33 @@ | |||
| 114 | "Hide selected code within `ifdef'." | 108 | "Hide selected code within `ifdef'." |
| 115 | :group 'c) | 109 | :group 'c) |
| 116 | 110 | ||
| 111 | (defcustom hide-ifdef-initially nil | ||
| 112 | "Non-nil means call `hide-ifdefs' when Hide-Ifdef mode is first activated." | ||
| 113 | :type 'boolean | ||
| 114 | :group 'hide-ifdef) | ||
| 115 | |||
| 116 | (defcustom hide-ifdef-read-only nil | ||
| 117 | "Set to non-nil if you want buffer to be read-only while hiding text." | ||
| 118 | :type 'boolean | ||
| 119 | :group 'hide-ifdef) | ||
| 120 | |||
| 121 | (defcustom hide-ifdef-lines nil | ||
| 122 | "Non-nil means hide the #ifX, #else, and #endif lines." | ||
| 123 | :type 'boolean | ||
| 124 | :group 'hide-ifdef) | ||
| 125 | |||
| 126 | (defcustom hide-ifdef-shadow nil | ||
| 127 | "Non-nil means shadow text instead of hiding it." | ||
| 128 | :type 'boolean | ||
| 129 | :group 'hide-ifdef | ||
| 130 | :version "23.1") | ||
| 131 | |||
| 132 | (defface hide-ifdef-shadow '((t (:inherit shadow))) | ||
| 133 | "Face for shadowing ifdef blocks." | ||
| 134 | :group 'hide-ifdef | ||
| 135 | :version "23.1") | ||
| 136 | |||
| 137 | |||
| 117 | (defvar hide-ifdef-mode-submap | 138 | (defvar hide-ifdef-mode-submap |
| 118 | ;; Set up the submap that goes after the prefix key. | 139 | ;; Set up the submap that goes after the prefix key. |
| 119 | (let ((map (make-sparse-keymap))) | 140 | (let ((map (make-sparse-keymap))) |
| @@ -128,6 +149,7 @@ | |||
| 128 | (define-key map "\C-s" 'show-ifdef-block) | 149 | (define-key map "\C-s" 'show-ifdef-block) |
| 129 | 150 | ||
| 130 | (define-key map "\C-q" 'hide-ifdef-toggle-read-only) | 151 | (define-key map "\C-q" 'hide-ifdef-toggle-read-only) |
| 152 | (define-key map "\C-w" 'hide-ifdef-toggle-shadowing) | ||
| 131 | (substitute-key-definition | 153 | (substitute-key-definition |
| 132 | 'toggle-read-only 'hide-ifdef-toggle-outside-read-only map) | 154 | 'toggle-read-only 'hide-ifdef-toggle-outside-read-only map) |
| 133 | map) | 155 | map) |
| @@ -155,7 +177,9 @@ | |||
| 155 | ["Use an alist" hide-ifdef-use-define-alist t] | 177 | ["Use an alist" hide-ifdef-use-define-alist t] |
| 156 | ["Undefine a variable" hide-ifdef-undef t] | 178 | ["Undefine a variable" hide-ifdef-undef t] |
| 157 | ["Toggle read only" hide-ifdef-toggle-read-only | 179 | ["Toggle read only" hide-ifdef-toggle-read-only |
| 158 | :style toggle :selected hide-ifdef-read-only])) | 180 | :style toggle :selected hide-ifdef-read-only] |
| 181 | ["Toggle shadowing" hide-ifdef-toggle-shadowing | ||
| 182 | :style toggle :selected hide-ifdef-shadow])) | ||
| 159 | 183 | ||
| 160 | (defvar hide-ifdef-hiding nil | 184 | (defvar hide-ifdef-hiding nil |
| 161 | "Non-nil when text may be hidden.") | 185 | "Non-nil when text may be hidden.") |
| @@ -256,9 +280,12 @@ how the hiding is done: | |||
| 256 | (end-of-line 2))) | 280 | (end-of-line 2))) |
| 257 | 281 | ||
| 258 | (defun hide-ifdef-region-internal (start end) | 282 | (defun hide-ifdef-region-internal (start end) |
| 259 | (remove-overlays start end 'invisible 'hide-ifdef) | 283 | (remove-overlays start end 'hide-ifdef t) |
| 260 | (let ((o (make-overlay start end))) | 284 | (let ((o (make-overlay start end))) |
| 261 | (overlay-put o 'invisible 'hide-ifdef))) | 285 | (overlay-put o 'hide-ifdef t) |
| 286 | (if hide-ifdef-shadow | ||
| 287 | (overlay-put o 'face 'hide-ifdef-shadow) | ||
| 288 | (overlay-put o 'invisible 'hide-ifdef)))) | ||
| 262 | 289 | ||
| 263 | (defun hide-ifdef-region (start end) | 290 | (defun hide-ifdef-region (start end) |
| 264 | "START is the start of a #if or #else form. END is the ending part. | 291 | "START is the start of a #if or #else form. END is the ending part. |
| @@ -270,7 +297,7 @@ Everything including these lines is made invisible." | |||
| 270 | 297 | ||
| 271 | (defun hif-show-ifdef-region (start end) | 298 | (defun hif-show-ifdef-region (start end) |
| 272 | "Everything between START and END is made visible." | 299 | "Everything between START and END is made visible." |
| 273 | (remove-overlays start end 'invisible 'hide-ifdef)) | 300 | (remove-overlays start end 'hide-ifdef t)) |
| 274 | 301 | ||
| 275 | 302 | ||
| 276 | ;;===%%SF%% evaluation (Start) === | 303 | ;;===%%SF%% evaluation (Start) === |
| @@ -740,11 +767,11 @@ Point is left unchanged." | |||
| 740 | 767 | ||
| 741 | (defun hif-hide-line (point) | 768 | (defun hif-hide-line (point) |
| 742 | "Hide the line containing point. Does nothing if `hide-ifdef-lines' is nil." | 769 | "Hide the line containing point. Does nothing if `hide-ifdef-lines' is nil." |
| 743 | (if hide-ifdef-lines | 770 | (when hide-ifdef-lines |
| 744 | (save-excursion | 771 | (save-excursion |
| 745 | (goto-char point) | 772 | (goto-char point) |
| 746 | (hide-ifdef-region-internal (line-beginning-position) | 773 | (hide-ifdef-region-internal |
| 747 | (progn (hif-end-of-line) (point)))))) | 774 | (line-beginning-position) (progn (hif-end-of-line) (point)))))) |
| 748 | 775 | ||
| 749 | 776 | ||
| 750 | ;;; Hif-Possibly-Hide | 777 | ;;; Hif-Possibly-Hide |
| @@ -827,24 +854,6 @@ It does not do the work that's pointless to redo on a recursive entry." | |||
| 827 | 854 | ||
| 828 | ;;===%%SF%% exports (Start) === | 855 | ;;===%%SF%% exports (Start) === |
| 829 | 856 | ||
| 830 | ;;;###autoload | ||
| 831 | (defcustom hide-ifdef-initially nil | ||
| 832 | "*Non-nil means call `hide-ifdefs' when Hide-Ifdef mode is first activated." | ||
| 833 | :type 'boolean | ||
| 834 | :group 'hide-ifdef) | ||
| 835 | |||
| 836 | ;;;###autoload | ||
| 837 | (defcustom hide-ifdef-read-only nil | ||
| 838 | "*Set to non-nil if you want buffer to be read-only while hiding text." | ||
| 839 | :type 'boolean | ||
| 840 | :group 'hide-ifdef) | ||
| 841 | |||
| 842 | ;;;###autoload | ||
| 843 | (defcustom hide-ifdef-lines nil | ||
| 844 | "*Non-nil means hide the #ifX, #else, and #endif lines." | ||
| 845 | :type 'boolean | ||
| 846 | :group 'hide-ifdef) | ||
| 847 | |||
| 848 | (defun hide-ifdef-toggle-read-only () | 857 | (defun hide-ifdef-toggle-read-only () |
| 849 | "Toggle `hide-ifdef-read-only'." | 858 | "Toggle `hide-ifdef-read-only'." |
| 850 | (interactive) | 859 | (interactive) |
| @@ -866,6 +875,21 @@ It does not do the work that's pointless to redo on a recursive entry." | |||
| 866 | hif-outside-read-only)) | 875 | hif-outside-read-only)) |
| 867 | (force-mode-line-update)) | 876 | (force-mode-line-update)) |
| 868 | 877 | ||
| 878 | (defun hide-ifdef-toggle-shadowing () | ||
| 879 | "Toggle shadowing." | ||
| 880 | (interactive) | ||
| 881 | (set (make-local-variable 'hide-ifdef-shadow) (not hide-ifdef-shadow)) | ||
| 882 | (message "Shadowing %s" (if hide-ifdef-shadow "ON" "OFF")) | ||
| 883 | (save-restriction | ||
| 884 | (widen) | ||
| 885 | (dolist (overlay (overlays-in (point-min) (point-max))) | ||
| 886 | (when (overlay-get overlay 'hide-ifdef) | ||
| 887 | (if hide-ifdef-shadow | ||
| 888 | (progn | ||
| 889 | (overlay-put overlay 'invisible nil) | ||
| 890 | (overlay-put overlay 'face 'hide-ifdef-shadow)) | ||
| 891 | (overlay-put overlay 'face nil) | ||
| 892 | (overlay-put overlay 'invisible 'hide-ifdef)))))) | ||
| 869 | 893 | ||
| 870 | (defun hide-ifdef-define (var) | 894 | (defun hide-ifdef-define (var) |
| 871 | "Define a VAR so that #ifdef VAR would be included." | 895 | "Define a VAR so that #ifdef VAR would be included." |
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el index 6dca919ba25..4c33b6b053c 100644 --- a/lisp/progmodes/pascal.el +++ b/lisp/progmodes/pascal.el | |||
| @@ -523,8 +523,8 @@ This puts the mark at the end, and point at the beginning." | |||
| 523 | (pascal-end-of-defun) | 523 | (pascal-end-of-defun) |
| 524 | (push-mark (point)) | 524 | (push-mark (point)) |
| 525 | (pascal-beg-of-defun) | 525 | (pascal-beg-of-defun) |
| 526 | (if (fboundp 'zmacs-activate-region) | 526 | (when (featurep 'xemacs) |
| 527 | (zmacs-activate-region))) | 527 | (zmacs-activate-region))) |
| 528 | 528 | ||
| 529 | (defun pascal-comment-area (start end) | 529 | (defun pascal-comment-area (start end) |
| 530 | "Put the region into a Pascal comment. | 530 | "Put the region into a Pascal comment. |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index bef282f5e98..39fe096309d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1889,7 +1889,8 @@ Uses `python-beginning-of-block', `python-end-of-block'." | |||
| 1889 | 1889 | ||
| 1890 | ;;;; Completion. | 1890 | ;;;; Completion. |
| 1891 | 1891 | ||
| 1892 | (defvar python-imports nil | 1892 | ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-01/msg00076.html |
| 1893 | (defvar python-imports "None" | ||
| 1893 | "String of top-level import statements updated by `python-find-imports'.") | 1894 | "String of top-level import statements updated by `python-find-imports'.") |
| 1894 | (make-variable-buffer-local 'python-imports) | 1895 | (make-variable-buffer-local 'python-imports) |
| 1895 | 1896 | ||
| @@ -2076,7 +2077,7 @@ The default contents correspond to the elements of `python-skeletons'." | |||
| 2076 | < ; Avoid wrong indentation after block opening. | 2077 | < ; Avoid wrong indentation after block opening. |
| 2077 | "elif " str ":" \n | 2078 | "elif " str ":" \n |
| 2078 | > _ \n nil) | 2079 | > _ \n nil) |
| 2079 | (python-else) | ^) | 2080 | '(python-else) | ^) |
| 2080 | 2081 | ||
| 2081 | (define-skeleton python-else | 2082 | (define-skeleton python-else |
| 2082 | "Auxiliary skeleton." | 2083 | "Auxiliary skeleton." |
| @@ -2090,24 +2091,24 @@ The default contents correspond to the elements of `python-skeletons'." | |||
| 2090 | "Condition: " | 2091 | "Condition: " |
| 2091 | "while " str ":" \n | 2092 | "while " str ":" \n |
| 2092 | > _ \n | 2093 | > _ \n |
| 2093 | (python-else) | ^) | 2094 | '(python-else) | ^) |
| 2094 | 2095 | ||
| 2095 | (def-python-skeleton for | 2096 | (def-python-skeleton for |
| 2096 | "Target, %s: " | 2097 | "Target, %s: " |
| 2097 | "for " str " in " (skeleton-read "Expression, %s: ") ":" \n | 2098 | "for " str " in " (skeleton-read "Expression, %s: ") ":" \n |
| 2098 | > _ \n | 2099 | > _ \n |
| 2099 | (python-else) | ^) | 2100 | '(python-else) | ^) |
| 2100 | 2101 | ||
| 2101 | (def-python-skeleton try/except | 2102 | (def-python-skeleton try/except |
| 2102 | nil | 2103 | nil |
| 2103 | "try:" \n | 2104 | "try:" \n |
| 2104 | > _ \n | 2105 | > _ \n |
| 2105 | ("Exception, %s: " | 2106 | ("Exception, %s: " |
| 2106 | < "except " str (python-target) ":" \n | 2107 | < "except " str '(python-target) ":" \n |
| 2107 | > _ \n nil) | 2108 | > _ \n nil) |
| 2108 | < "except:" \n | 2109 | < "except:" \n |
| 2109 | > _ \n | 2110 | > _ \n |
| 2110 | (python-else) | ^) | 2111 | '(python-else) | ^) |
| 2111 | 2112 | ||
| 2112 | (define-skeleton python-target | 2113 | (define-skeleton python-target |
| 2113 | "Auxiliary skeleton." | 2114 | "Auxiliary skeleton." |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 56b4b9b0f38..90b2fda36e2 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1186,6 +1186,7 @@ Can be set to a number, or to nil which means leave it as is." | |||
| 1186 | This value is used for the `+' and `-' symbols in an indentation variable." | 1186 | This value is used for the `+' and `-' symbols in an indentation variable." |
| 1187 | :type 'integer | 1187 | :type 'integer |
| 1188 | :group 'sh-indentation) | 1188 | :group 'sh-indentation) |
| 1189 | (put 'sh-basic-offset 'safe-local-variable 'integerp) | ||
| 1189 | 1190 | ||
| 1190 | (defcustom sh-indent-comment nil | 1191 | (defcustom sh-indent-comment nil |
| 1191 | "How a comment line is to be indented. | 1192 | "How a comment line is to be indented. |
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 54a3f0f6f80..c177ca1b184 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el | |||
| @@ -11,6 +11,12 @@ | |||
| 11 | ;; http://www.veripool.com | 11 | ;; http://www.veripool.com |
| 12 | ;; Keywords: languages | 12 | ;; Keywords: languages |
| 13 | 13 | ||
| 14 | ;; This code supports Emacs 21.1 and later | ||
| 15 | ;; And XEmacs 21.1 and later | ||
| 16 | ;; Please do not make changes that break Emacs 21. Thanks! | ||
| 17 | ;; | ||
| 18 | ;; | ||
| 19 | |||
| 14 | ;; This file is part of GNU Emacs. | 20 | ;; This file is part of GNU Emacs. |
| 15 | 21 | ||
| 16 | ;; GNU Emacs is free software; you can redistribute it and/or modify | 22 | ;; GNU Emacs is free software; you can redistribute it and/or modify |
| @@ -30,12 +36,12 @@ | |||
| 30 | 36 | ||
| 31 | ;;; Commentary: | 37 | ;;; Commentary: |
| 32 | 38 | ||
| 33 | ;; This mode borrows heavily from the Pascal-mode and the cc-mode of emacs | 39 | ;; This mode borrows heavily from the Pascal-mode and the cc-mode of Emacs |
| 34 | 40 | ||
| 35 | ;; USAGE | 41 | ;; USAGE |
| 36 | ;; ===== | 42 | ;; ===== |
| 37 | 43 | ||
| 38 | ;; A major mode for editing Verilog HDL source code. When you have | 44 | ;; A major mode for editing Verilog HDL source code. When you have |
| 39 | ;; entered Verilog mode, you may get more info by pressing C-h m. You | 45 | ;; entered Verilog mode, you may get more info by pressing C-h m. You |
| 40 | ;; may also get online help describing various functions by: C-h f | 46 | ;; may also get online help describing various functions by: C-h f |
| 41 | ;; <Name of function you want described> | 47 | ;; <Name of function you want described> |
| @@ -44,8 +50,8 @@ | |||
| 44 | ;; ======================= | 50 | ;; ======================= |
| 45 | 51 | ||
| 46 | ;; Verilog is a rapidly evolving language, and hence this mode is | 52 | ;; Verilog is a rapidly evolving language, and hence this mode is |
| 47 | ;; under continuous development. Hence this is beta code, and likely | 53 | ;; under continuous development. Hence this is beta code, and likely |
| 48 | ;; has bugs. Please report any and all bugs to me at mac@verilog.com. | 54 | ;; has bugs. Please report any and all bugs to me at mac@verilog.com. |
| 49 | ;; Please use verilog-submit-bug-report to submit a report; type C-c | 55 | ;; Please use verilog-submit-bug-report to submit a report; type C-c |
| 50 | ;; C-b to invoke this and as a result I will have a much easier time | 56 | ;; C-b to invoke this and as a result I will have a much easier time |
| 51 | ;; of reproducing the bug you find, and hence fixing it. | 57 | ;; of reproducing the bug you find, and hence fixing it. |
| @@ -55,7 +61,7 @@ | |||
| 55 | 61 | ||
| 56 | ;; An older version of this mode may be already installed as a part of | 62 | ;; An older version of this mode may be already installed as a part of |
| 57 | ;; your environment, and one method of updating would be to update | 63 | ;; your environment, and one method of updating would be to update |
| 58 | ;; your emacs environment. Sometimes this is difficult for local | 64 | ;; your Emacs environment. Sometimes this is difficult for local |
| 59 | ;; political/control reasons, and hence you can always install a | 65 | ;; political/control reasons, and hence you can always install a |
| 60 | ;; private copy (or even a shared copy) which overrides the system | 66 | ;; private copy (or even a shared copy) which overrides the system |
| 61 | ;; default. | 67 | ;; default. |
| @@ -74,7 +80,7 @@ | |||
| 74 | 80 | ||
| 75 | ;; If you want to customize Verilog mode to fit your needs better, | 81 | ;; If you want to customize Verilog mode to fit your needs better, |
| 76 | ;; you may add these lines (the values of the variables presented | 82 | ;; you may add these lines (the values of the variables presented |
| 77 | ;; here are the defaults). Note also that if you use an emacs that | 83 | ;; here are the defaults). Note also that if you use an Emacs that |
| 78 | ;; supports custom, it's probably better to use the custom menu to | 84 | ;; supports custom, it's probably better to use the custom menu to |
| 79 | ;; edit these. | 85 | ;; edit these. |
| 80 | ;; | 86 | ;; |
| @@ -102,15 +108,19 @@ | |||
| 102 | ;; | 108 | ;; |
| 103 | 109 | ||
| 104 | ;;; History: | 110 | ;;; History: |
| 105 | ;; | 111 | ;; |
| 106 | ;; | 112 | ;; See commit history at http://www.veripool.com/verilog-mode.html |
| 113 | ;; (This section is required to appease checkdoc.) | ||
| 114 | |||
| 107 | ;;; Code: | 115 | ;;; Code: |
| 108 | 116 | ||
| 109 | ;; This variable will always hold the version number of the mode | 117 | ;; This variable will always hold the version number of the mode |
| 110 | (defconst verilog-mode-version "377" | 118 | (defconst verilog-mode-version "383" |
| 111 | "Version of this verilog mode.") | ||
| 112 | (defconst verilog-mode-release-date "2007-12-07" | ||
| 113 | "Version of this verilog mode.") | 119 | "Version of this verilog mode.") |
| 120 | (defconst verilog-mode-release-date "2008-01-07-GNU" | ||
| 121 | "Release date of this verilog mode.") | ||
| 122 | (defconst verilog-mode-release-emacs t | ||
| 123 | "If non-nil, this version of verilog mode was released with Emacs itself.") | ||
| 114 | 124 | ||
| 115 | (defun verilog-version () | 125 | (defun verilog-version () |
| 116 | "Inform caller of the version of this file." | 126 | "Inform caller of the version of this file." |
| @@ -118,7 +128,10 @@ | |||
| 118 | (message "Using verilog-mode version %s" verilog-mode-version)) | 128 | (message "Using verilog-mode version %s" verilog-mode-version)) |
| 119 | 129 | ||
| 120 | ;; Insure we have certain packages, and deal with it if we don't | 130 | ;; Insure we have certain packages, and deal with it if we don't |
| 131 | ;; Be sure to note which Emacs flavor and version added each feature. | ||
| 121 | (eval-when-compile | 132 | (eval-when-compile |
| 133 | ;; The below were disabled when GNU Emacs 22 was released; | ||
| 134 | ;; perhaps some still need to be there to support Emacs 21. | ||
| 122 | (when (featurep 'xemacs) | 135 | (when (featurep 'xemacs) |
| 123 | (condition-case nil | 136 | (condition-case nil |
| 124 | (require 'easymenu) | 137 | (require 'easymenu) |
| @@ -181,8 +194,8 @@ STRING should be given if the last search was by `string-match' on STRING." | |||
| 181 | result) | 194 | result) |
| 182 | (buffer-substring-no-properties (match-beginning num) | 195 | (buffer-substring-no-properties (match-beginning num) |
| 183 | (match-end num) | 196 | (match-end num) |
| 184 | (current-buffer) | 197 | (current-buffer))))) |
| 185 | ))))) | 198 | ) |
| 186 | (error nil)) | 199 | (error nil)) |
| 187 | (if (and (featurep 'custom) (fboundp 'custom-declare-variable)) | 200 | (if (and (featurep 'custom) (fboundp 'custom-declare-variable)) |
| 188 | nil ;; We've got what we needed | 201 | nil ;; We've got what we needed |
| @@ -210,6 +223,8 @@ STRING should be given if the last search was by `string-match' on STRING." | |||
| 210 | ;; Provide a regular expression optimization routine, using regexp-opt | 223 | ;; Provide a regular expression optimization routine, using regexp-opt |
| 211 | ;; if provided by the user's elisp libraries | 224 | ;; if provided by the user's elisp libraries |
| 212 | (eval-and-compile | 225 | (eval-and-compile |
| 226 | ;; The below were disabled when GNU Emacs 22 was released; | ||
| 227 | ;; perhaps some still need to be there to support Emacs 21. | ||
| 213 | (if (featurep 'xemacs) | 228 | (if (featurep 'xemacs) |
| 214 | (if (fboundp 'regexp-opt) | 229 | (if (fboundp 'regexp-opt) |
| 215 | ;; regexp-opt is defined, does it take 3 or 2 arguments? | 230 | ;; regexp-opt is defined, does it take 3 or 2 arguments? |
| @@ -222,8 +237,7 @@ STRING should be given if the last search was by `string-match' on STRING." | |||
| 222 | (defun verilog-regexp-opt (a b) | 237 | (defun verilog-regexp-opt (a b) |
| 223 | "Deal with differing number of required arguments for `regexp-opt'. | 238 | "Deal with differing number of required arguments for `regexp-opt'. |
| 224 | Call 'regexp-opt' on A and B." | 239 | Call 'regexp-opt' on A and B." |
| 225 | (regexp-opt a b 't) | 240 | (regexp-opt a b 't)) |
| 226 | ) | ||
| 227 | (error nil)) | 241 | (error nil)) |
| 228 | ) | 242 | ) |
| 229 | ((eq args 2) ;; It takes 2 | 243 | ((eq args 2) ;; It takes 2 |
| @@ -261,6 +275,12 @@ STRING should be given if the last search was by `string-match' on STRING." | |||
| 261 | (if (fboundp 'customize-apropos) | 275 | (if (fboundp 'customize-apropos) |
| 262 | (customize-apropos "font-lock-*" 'faces))) | 276 | (customize-apropos "font-lock-*" 'faces))) |
| 263 | 277 | ||
| 278 | (defun verilog-booleanp (value) | ||
| 279 | "Return t if VALUE is boolean. | ||
| 280 | This implements GNU Emacs 22.1's `booleanp' function in earlier Emacs. | ||
| 281 | This function may be removed when Emacs 21 is no longer supported." | ||
| 282 | (or (equal value t) (equal value nil))) | ||
| 283 | |||
| 264 | (defgroup verilog-mode nil | 284 | (defgroup verilog-mode nil |
| 265 | "Facilitates easy editing of Verilog source text" | 285 | "Facilitates easy editing of Verilog source text" |
| 266 | :group 'languages) | 286 | :group 'languages) |
| @@ -290,6 +310,7 @@ you type \\[compile]. When the compile completes, \\[next-error] will take | |||
| 290 | you to the next lint error." | 310 | you to the next lint error." |
| 291 | :type 'string | 311 | :type 'string |
| 292 | :group 'verilog-mode-actions) | 312 | :group 'verilog-mode-actions) |
| 313 | ;; We don't mark it safe, as it's used as a shell command | ||
| 293 | 314 | ||
| 294 | (defcustom verilog-coverage | 315 | (defcustom verilog-coverage |
| 295 | "echo 'No verilog-coverage set, see \"M-x describe-variable verilog-coverage\"'" | 316 | "echo 'No verilog-coverage set, see \"M-x describe-variable verilog-coverage\"'" |
| @@ -299,6 +320,7 @@ you type \\[compile]. When the compile completes, \\[next-error] will take | |||
| 299 | you to the next lint error." | 320 | you to the next lint error." |
| 300 | :type 'string | 321 | :type 'string |
| 301 | :group 'verilog-mode-actions) | 322 | :group 'verilog-mode-actions) |
| 323 | ;; We don't mark it safe, as it's used as a shell command | ||
| 302 | 324 | ||
| 303 | (defcustom verilog-simulator | 325 | (defcustom verilog-simulator |
| 304 | "echo 'No verilog-simulator set, see \"M-x describe-variable verilog-simulator\"'" | 326 | "echo 'No verilog-simulator set, see \"M-x describe-variable verilog-simulator\"'" |
| @@ -308,6 +330,7 @@ you type \\[compile]. When the compile completes, \\[next-error] will take | |||
| 308 | you to the next lint error." | 330 | you to the next lint error." |
| 309 | :type 'string | 331 | :type 'string |
| 310 | :group 'verilog-mode-actions) | 332 | :group 'verilog-mode-actions) |
| 333 | ;; We don't mark it safe, as it's used as a shell command | ||
| 311 | 334 | ||
| 312 | (defcustom verilog-compiler | 335 | (defcustom verilog-compiler |
| 313 | "echo 'No verilog-compiler set, see \"M-x describe-variable verilog-compiler\"'" | 336 | "echo 'No verilog-compiler set, see \"M-x describe-variable verilog-compiler\"'" |
| @@ -317,6 +340,7 @@ you type \\[compile]. When the compile completes, \\[next-error] will take | |||
| 317 | you to the next lint error." | 340 | you to the next lint error." |
| 318 | :type 'string | 341 | :type 'string |
| 319 | :group 'verilog-mode-actions) | 342 | :group 'verilog-mode-actions) |
| 343 | ;; We don't mark it safe, as it's used as a shell command | ||
| 320 | 344 | ||
| 321 | (defvar verilog-tool 'verilog-linter | 345 | (defvar verilog-tool 'verilog-linter |
| 322 | "Which tool to use for building compiler-command. | 346 | "Which tool to use for building compiler-command. |
| @@ -336,11 +360,14 @@ Note: Activate the new setting in a Verilog buffer by re-fontifying it (menu | |||
| 336 | entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." | 360 | entry \"Fontify Buffer\"). XEmacs: turn off and on font locking." |
| 337 | :type 'boolean | 361 | :type 'boolean |
| 338 | :group 'verilog-mode-indent) | 362 | :group 'verilog-mode-indent) |
| 363 | ;; Note we don't use :safe, as that would break on Emacsen before 22.0. | ||
| 364 | (put 'verilog-highlight-translate-off 'safe-local-variable 'verilog-booleanp) | ||
| 339 | 365 | ||
| 340 | (defcustom verilog-indent-level 3 | 366 | (defcustom verilog-indent-level 3 |
| 341 | "*Indentation of Verilog statements with respect to containing block." | 367 | "*Indentation of Verilog statements with respect to containing block." |
| 342 | :group 'verilog-mode-indent | 368 | :group 'verilog-mode-indent |
| 343 | :type 'integer) | 369 | :type 'integer) |
| 370 | (put 'verilog-indent-level 'safe-local-variable 'integerp) | ||
| 344 | 371 | ||
| 345 | (defcustom verilog-indent-level-module 3 | 372 | (defcustom verilog-indent-level-module 3 |
| 346 | "*Indentation of Module level Verilog statements. (eg always, initial) | 373 | "*Indentation of Module level Verilog statements. (eg always, initial) |
| @@ -348,12 +375,14 @@ Set to 0 to get initial and always statements lined up on the left side of | |||
| 348 | your screen." | 375 | your screen." |
| 349 | :group 'verilog-mode-indent | 376 | :group 'verilog-mode-indent |
| 350 | :type 'integer) | 377 | :type 'integer) |
| 378 | (put 'verilog-indent-level-module 'safe-local-variable 'integerp) | ||
| 351 | 379 | ||
| 352 | (defcustom verilog-indent-level-declaration 3 | 380 | (defcustom verilog-indent-level-declaration 3 |
| 353 | "*Indentation of declarations with respect to containing block. | 381 | "*Indentation of declarations with respect to containing block. |
| 354 | Set to 0 to get them list right under containing block." | 382 | Set to 0 to get them list right under containing block." |
| 355 | :group 'verilog-mode-indent | 383 | :group 'verilog-mode-indent |
| 356 | :type 'integer) | 384 | :type 'integer) |
| 385 | (put 'verilog-indent-level-declaration 'safe-local-variable 'integerp) | ||
| 357 | 386 | ||
| 358 | (defcustom verilog-indent-declaration-macros nil | 387 | (defcustom verilog-indent-declaration-macros nil |
| 359 | "*How to treat macro expansions in a declaration. | 388 | "*How to treat macro expansions in a declaration. |
| @@ -367,6 +396,7 @@ If non nil, treat as: | |||
| 367 | output c;" | 396 | output c;" |
| 368 | :group 'verilog-mode-indent | 397 | :group 'verilog-mode-indent |
| 369 | :type 'boolean) | 398 | :type 'boolean) |
| 399 | (put 'verilog-indent-declaration-macros 'safe-local-variable 'verilog-booleanp) | ||
| 370 | 400 | ||
| 371 | (defcustom verilog-indent-lists t | 401 | (defcustom verilog-indent-lists t |
| 372 | "*How to treat indenting items in a list. | 402 | "*How to treat indenting items in a list. |
| @@ -379,62 +409,73 @@ If nil, treat as: | |||
| 379 | reset ) begin" | 409 | reset ) begin" |
| 380 | :group 'verilog-mode-indent | 410 | :group 'verilog-mode-indent |
| 381 | :type 'boolean) | 411 | :type 'boolean) |
| 412 | (put 'verilog-indent-lists 'safe-local-variable 'verilog-booleanp) | ||
| 382 | 413 | ||
| 383 | (defcustom verilog-indent-level-behavioral 3 | 414 | (defcustom verilog-indent-level-behavioral 3 |
| 384 | "*Absolute indentation of first begin in a task or function block. | 415 | "*Absolute indentation of first begin in a task or function block. |
| 385 | Set to 0 to get such code to start at the left side of the screen." | 416 | Set to 0 to get such code to start at the left side of the screen." |
| 386 | :group 'verilog-mode-indent | 417 | :group 'verilog-mode-indent |
| 387 | :type 'integer) | 418 | :type 'integer) |
| 419 | (put 'verilog-indent-level-behavioral 'safe-local-variable 'integerp) | ||
| 388 | 420 | ||
| 389 | (defcustom verilog-indent-level-directive 1 | 421 | (defcustom verilog-indent-level-directive 1 |
| 390 | "*Indentation to add to each level of `ifdef declarations. | 422 | "*Indentation to add to each level of `ifdef declarations. |
| 391 | Set to 0 to have all directives start at the left side of the screen." | 423 | Set to 0 to have all directives start at the left side of the screen." |
| 392 | :group 'verilog-mode-indent | 424 | :group 'verilog-mode-indent |
| 393 | :type 'integer) | 425 | :type 'integer) |
| 426 | (put 'verilog-indent-level-directive 'safe-local-variable 'integerp) | ||
| 394 | 427 | ||
| 395 | (defcustom verilog-cexp-indent 2 | 428 | (defcustom verilog-cexp-indent 2 |
| 396 | "*Indentation of Verilog statements split across lines." | 429 | "*Indentation of Verilog statements split across lines." |
| 397 | :group 'verilog-mode-indent | 430 | :group 'verilog-mode-indent |
| 398 | :type 'integer) | 431 | :type 'integer) |
| 432 | (put 'verilog-cexp-indent 'safe-local-variable 'integerp) | ||
| 399 | 433 | ||
| 400 | (defcustom verilog-case-indent 2 | 434 | (defcustom verilog-case-indent 2 |
| 401 | "*Indentation for case statements." | 435 | "*Indentation for case statements." |
| 402 | :group 'verilog-mode-indent | 436 | :group 'verilog-mode-indent |
| 403 | :type 'integer) | 437 | :type 'integer) |
| 438 | (put 'verilog-case-indent 'safe-local-variable 'integerp) | ||
| 404 | 439 | ||
| 405 | (defcustom verilog-auto-newline t | 440 | (defcustom verilog-auto-newline t |
| 406 | "*True means automatically newline after semicolons." | 441 | "*True means automatically newline after semicolons." |
| 407 | :group 'verilog-mode-indent | 442 | :group 'verilog-mode-indent |
| 408 | :type 'boolean) | 443 | :type 'boolean) |
| 444 | (put 'verilog-auto-newline 'safe-local-variable 'verilog-booleanp) | ||
| 409 | 445 | ||
| 410 | (defcustom verilog-auto-indent-on-newline t | 446 | (defcustom verilog-auto-indent-on-newline t |
| 411 | "*True means automatically indent line after newline." | 447 | "*True means automatically indent line after newline." |
| 412 | :group 'verilog-mode-indent | 448 | :group 'verilog-mode-indent |
| 413 | :type 'boolean) | 449 | :type 'boolean) |
| 450 | (put 'verilog-auto-indent-on-newline 'safe-local-variable 'verilog-booleanp) | ||
| 414 | 451 | ||
| 415 | (defcustom verilog-tab-always-indent t | 452 | (defcustom verilog-tab-always-indent t |
| 416 | "*True means TAB should always re-indent the current line. | 453 | "*True means TAB should always re-indent the current line. |
| 417 | Nil means TAB will only reindent when at the beginning of the line." | 454 | Nil means TAB will only reindent when at the beginning of the line." |
| 418 | :group 'verilog-mode-indent | 455 | :group 'verilog-mode-indent |
| 419 | :type 'boolean) | 456 | :type 'boolean) |
| 457 | (put 'verilog-tab-always-indent 'safe-local-variable 'verilog-booleanp) | ||
| 420 | 458 | ||
| 421 | (defcustom verilog-tab-to-comment nil | 459 | (defcustom verilog-tab-to-comment nil |
| 422 | "*True means TAB moves to the right hand column in preparation for a comment." | 460 | "*True means TAB moves to the right hand column in preparation for a comment." |
| 423 | :group 'verilog-mode-actions | 461 | :group 'verilog-mode-actions |
| 424 | :type 'boolean) | 462 | :type 'boolean) |
| 463 | (put 'verilog-tab-to-comment 'safe-local-variable 'verilog-booleanp) | ||
| 425 | 464 | ||
| 426 | (defcustom verilog-indent-begin-after-if t | 465 | (defcustom verilog-indent-begin-after-if t |
| 427 | "*If true, indent begin statements following if, else, while, for and repeat. | 466 | "*If true, indent begin statements following if, else, while, for and repeat. |
| 428 | Otherwise, line them up." | 467 | Otherwise, line them up." |
| 429 | :group 'verilog-mode-indent | 468 | :group 'verilog-mode-indent |
| 430 | :type 'boolean ) | 469 | :type 'boolean) |
| 470 | (put 'verilog-indent-begin-after-if 'safe-local-variable 'verilog-booleanp) | ||
| 431 | 471 | ||
| 432 | 472 | ||
| 433 | (defcustom verilog-align-ifelse nil | 473 | (defcustom verilog-align-ifelse nil |
| 434 | "*If true, align `else' under matching `if'. | 474 | "*If true, align `else' under matching `if'. |
| 435 | Otherwise else is lined up with first character on line holding matching if." | 475 | Otherwise else is lined up with first character on line holding matching if." |
| 436 | :group 'verilog-mode-indent | 476 | :group 'verilog-mode-indent |
| 437 | :type 'boolean ) | 477 | :type 'boolean) |
| 478 | (put 'verilog-align-ifelse 'safe-local-variable 'verilog-booleanp) | ||
| 438 | 479 | ||
| 439 | (defcustom verilog-minimum-comment-distance 10 | 480 | (defcustom verilog-minimum-comment-distance 10 |
| 440 | "*Minimum distance (in lines) between begin and end required before a comment. | 481 | "*Minimum distance (in lines) between begin and end required before a comment. |
| @@ -442,6 +483,7 @@ Setting this variable to zero results in every end acquiring a comment; the | |||
| 442 | default avoids too many redundant comments in tight quarters" | 483 | default avoids too many redundant comments in tight quarters" |
| 443 | :group 'verilog-mode-indent | 484 | :group 'verilog-mode-indent |
| 444 | :type 'integer) | 485 | :type 'integer) |
| 486 | (put 'verilog-minimum-comment-distance 'safe-local-variable 'integerp) | ||
| 445 | 487 | ||
| 446 | (defcustom verilog-auto-lineup '(declaration) | 488 | (defcustom verilog-auto-lineup '(declaration) |
| 447 | "*Algorithm for lining up statements on multiple lines. | 489 | "*Algorithm for lining up statements on multiple lines. |
| @@ -481,23 +523,26 @@ would become | |||
| 481 | ; | 523 | ; |
| 482 | 524 | ||
| 483 | :group 'verilog-mode-indent | 525 | :group 'verilog-mode-indent |
| 484 | :type 'list ) | 526 | :type 'list) |
| 527 | (put 'verilog-auto-lineup 'safe-local-variable 'listp) | ||
| 485 | 528 | ||
| 486 | (defcustom verilog-highlight-p1800-keywords nil | 529 | (defcustom verilog-highlight-p1800-keywords nil |
| 487 | "*If true highlight words newly reserved by IEEE-1800 in | 530 | "*True means highlight words newly reserved by IEEE-1800. |
| 488 | verilog-font-lock-p1800-face in order to gently suggest changing where | 531 | These will appear in `verilog-font-lock-p1800-face' in order to gently |
| 489 | these words are used as variables to something else. Nil means highlight | 532 | suggest changing where these words are used as variables to something else. |
| 490 | these words as appropriate for the SystemVerilog IEEE-1800 standard. Note | 533 | Nil means highlight these words as appropriate for the SystemVerilog |
| 491 | that changing this will require restarting emacs to see the effect as font | 534 | IEEE-1800 standard. Note that changing this will require restarting Emacs |
| 492 | color choices are cached by emacs" | 535 | to see the effect as font color choices are cached by Emacs" |
| 493 | :group 'verilog-mode-indent | 536 | :group 'verilog-mode-indent |
| 494 | :type 'boolean) | 537 | :type 'boolean) |
| 538 | (put 'verilog-highlight-p1800-keywords 'safe-local-variable 'verilog-booleanp) | ||
| 495 | 539 | ||
| 496 | (defcustom verilog-auto-endcomments t | 540 | (defcustom verilog-auto-endcomments t |
| 497 | "*True means insert a comment /* ... */ after 'end's. | 541 | "*True means insert a comment /* ... */ after 'end's. |
| 498 | The name of the function or case will be set between the braces." | 542 | The name of the function or case will be set between the braces." |
| 499 | :group 'verilog-mode-actions | 543 | :group 'verilog-mode-actions |
| 500 | :type 'boolean ) | 544 | :type 'boolean) |
| 545 | (put 'verilog-auto-endcomments 'safe-local-variable 'verilog-booleanp) | ||
| 501 | 546 | ||
| 502 | (defcustom verilog-auto-read-includes nil | 547 | (defcustom verilog-auto-read-includes nil |
| 503 | "*True means to automatically read includes before AUTOs. | 548 | "*True means to automatically read includes before AUTOs. |
| @@ -506,7 +551,8 @@ each AUTO expansion. This makes it easier to embed defines and includes, | |||
| 506 | but can result in very slow reading times if there are many or large | 551 | but can result in very slow reading times if there are many or large |
| 507 | include files." | 552 | include files." |
| 508 | :group 'verilog-mode-actions | 553 | :group 'verilog-mode-actions |
| 509 | :type 'boolean ) | 554 | :type 'boolean) |
| 555 | (put 'verilog-auto-read-includes 'safe-local-variable 'verilog-booleanp) | ||
| 510 | 556 | ||
| 511 | (defcustom verilog-auto-save-policy nil | 557 | (defcustom verilog-auto-save-policy nil |
| 512 | "*Non-nil indicates action to take when saving a Verilog buffer with AUTOs. | 558 | "*Non-nil indicates action to take when saving a Verilog buffer with AUTOs. |
| @@ -527,6 +573,7 @@ They will be expanded in the same way as if there was a AUTOINST in the | |||
| 527 | instantiation. See also `verilog-auto-star' and `verilog-auto-star-save'." | 573 | instantiation. See also `verilog-auto-star' and `verilog-auto-star-save'." |
| 528 | :group 'verilog-mode-actions | 574 | :group 'verilog-mode-actions |
| 529 | :type 'boolean) | 575 | :type 'boolean) |
| 576 | (put 'verilog-auto-star-expand 'safe-local-variable 'verilog-booleanp) | ||
| 530 | 577 | ||
| 531 | (defcustom verilog-auto-star-save nil | 578 | (defcustom verilog-auto-star-save nil |
| 532 | "*Non-nil indicates to save to disk SystemVerilog .* instance expansions. | 579 | "*Non-nil indicates to save to disk SystemVerilog .* instance expansions. |
| @@ -537,6 +584,7 @@ Instead of setting this, you may want to use /*AUTOINST*/, which will | |||
| 537 | always be saved." | 584 | always be saved." |
| 538 | :group 'verilog-mode-actions | 585 | :group 'verilog-mode-actions |
| 539 | :type 'boolean) | 586 | :type 'boolean) |
| 587 | (put 'verilog-auto-star-save 'safe-local-variable 'verilog-booleanp) | ||
| 540 | 588 | ||
| 541 | (defvar verilog-auto-update-tick nil | 589 | (defvar verilog-auto-update-tick nil |
| 542 | "Modification tick at which autos were last performed.") | 590 | "Modification tick at which autos were last performed.") |
| @@ -624,8 +672,7 @@ always be saved." | |||
| 624 | ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 bold t) | 672 | ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 bold t) |
| 625 | ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 2 bold t) | 673 | ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 2 bold t) |
| 626 | ) | 674 | ) |
| 627 | "*Keywords to also highlight in Verilog *compilation* buffers." | 675 | "*Keywords to also highlight in Verilog *compilation* buffers.") |
| 628 | ) | ||
| 629 | 676 | ||
| 630 | (defcustom verilog-library-flags '("") | 677 | (defcustom verilog-library-flags '("") |
| 631 | "*List of standard Verilog arguments to use for /*AUTOINST*/. | 678 | "*List of standard Verilog arguments to use for /*AUTOINST*/. |
| @@ -656,6 +703,7 @@ have problems, use \\[find-alternate-file] RET to have these take effect. | |||
| 656 | See also the variables mentioned above." | 703 | See also the variables mentioned above." |
| 657 | :group 'verilog-mode-auto | 704 | :group 'verilog-mode-auto |
| 658 | :type '(repeat string)) | 705 | :type '(repeat string)) |
| 706 | (put 'verilog-library-flags 'safe-local-variable 'listp) | ||
| 659 | 707 | ||
| 660 | (defcustom verilog-library-directories '(".") | 708 | (defcustom verilog-library-directories '(".") |
| 661 | "*List of directories when looking for files for /*AUTOINST*/. | 709 | "*List of directories when looking for files for /*AUTOINST*/. |
| @@ -678,9 +726,11 @@ See also `verilog-library-flags', `verilog-library-files' | |||
| 678 | and `verilog-library-extensions'." | 726 | and `verilog-library-extensions'." |
| 679 | :group 'verilog-mode-auto | 727 | :group 'verilog-mode-auto |
| 680 | :type '(repeat file)) | 728 | :type '(repeat file)) |
| 729 | (put 'verilog-library-directories 'safe-local-variable 'listp) | ||
| 681 | 730 | ||
| 682 | (defcustom verilog-library-files '() | 731 | (defcustom verilog-library-files '() |
| 683 | "*List of files to search for modules when looking for AUTOINST files. | 732 | "*List of files to search for modules. |
| 733 | AUTOINST will use this when it needs to resolve a module name. | ||
| 684 | This is a complete path, usually to a technology file with many standard | 734 | This is a complete path, usually to a technology file with many standard |
| 685 | cells defined in it. | 735 | cells defined in it. |
| 686 | 736 | ||
| @@ -698,12 +748,14 @@ have problems, use \\[find-alternate-file] RET to have these take effect. | |||
| 698 | See also `verilog-library-flags', `verilog-library-directories'." | 748 | See also `verilog-library-flags', `verilog-library-directories'." |
| 699 | :group 'verilog-mode-auto | 749 | :group 'verilog-mode-auto |
| 700 | :type '(repeat directory)) | 750 | :type '(repeat directory)) |
| 751 | (put 'verilog-library-files 'safe-local-variable 'listp) | ||
| 701 | 752 | ||
| 702 | (defcustom verilog-library-extensions '(".v") | 753 | (defcustom verilog-library-extensions '(".v") |
| 703 | "*List of extensions to use when looking for files for /*AUTOINST*/. | 754 | "*List of extensions to use when looking for files for /*AUTOINST*/. |
| 704 | See also `verilog-library-flags', `verilog-library-directories'." | 755 | See also `verilog-library-flags', `verilog-library-directories'." |
| 705 | :type '(repeat string) | 756 | :type '(repeat string) |
| 706 | :group 'verilog-mode-auto) | 757 | :group 'verilog-mode-auto) |
| 758 | (put 'verilog-library-extensions 'safe-local-variable 'listp) | ||
| 707 | 759 | ||
| 708 | (defcustom verilog-active-low-regexp nil | 760 | (defcustom verilog-active-low-regexp nil |
| 709 | "*If set, treat signals matching this regexp as active low. | 761 | "*If set, treat signals matching this regexp as active low. |
| @@ -711,21 +763,24 @@ This is used for AUTORESET and AUTOTIEOFF. For proper behavior, | |||
| 711 | you will probably also need `verilog-auto-reset-widths' set." | 763 | you will probably also need `verilog-auto-reset-widths' set." |
| 712 | :group 'verilog-mode-auto | 764 | :group 'verilog-mode-auto |
| 713 | :type 'string) | 765 | :type 'string) |
| 766 | (put 'verilog-active-low-regexp 'safe-local-variable 'stringp) | ||
| 714 | 767 | ||
| 715 | (defcustom verilog-auto-sense-include-inputs nil | 768 | (defcustom verilog-auto-sense-include-inputs nil |
| 716 | "*If true, AUTOSENSE should include all inputs. | 769 | "*If true, AUTOSENSE should include all inputs. |
| 717 | If nil, only inputs that are NOT output signals in the same block are | 770 | If nil, only inputs that are NOT output signals in the same block are |
| 718 | included." | 771 | included." |
| 719 | :type 'boolean | 772 | :group 'verilog-mode-auto |
| 720 | :group 'verilog-mode-auto) | 773 | :type 'boolean) |
| 774 | (put 'verilog-auto-sense-include-inputs 'safe-local-variable 'verilog-booleanp) | ||
| 721 | 775 | ||
| 722 | (defcustom verilog-auto-sense-defines-constant nil | 776 | (defcustom verilog-auto-sense-defines-constant nil |
| 723 | "*If true, AUTOSENSE should assume all defines represent constants. | 777 | "*If true, AUTOSENSE should assume all defines represent constants. |
| 724 | When true, the defines will not be included in sensitivity lists. To | 778 | When true, the defines will not be included in sensitivity lists. To |
| 725 | maintain compatibility with other sites, this should be set at the bottom | 779 | maintain compatibility with other sites, this should be set at the bottom |
| 726 | of each verilog file that requires it, rather than being set globally." | 780 | of each verilog file that requires it, rather than being set globally." |
| 727 | :type 'boolean | 781 | :group 'verilog-mode-auto |
| 728 | :group 'verilog-mode-auto) | 782 | :type 'boolean) |
| 783 | (put 'verilog-auto-sense-defines-constant 'safe-local-variable 'verilog-booleanp) | ||
| 729 | 784 | ||
| 730 | (defcustom verilog-auto-reset-widths t | 785 | (defcustom verilog-auto-reset-widths t |
| 731 | "*If true, AUTORESET should determine the width of signals. | 786 | "*If true, AUTORESET should determine the width of signals. |
| @@ -735,11 +790,13 @@ the constant zero. This may result in ugly code when parameters determine | |||
| 735 | the MSB or LSB of a signal inside a AUTORESET." | 790 | the MSB or LSB of a signal inside a AUTORESET." |
| 736 | :type 'boolean | 791 | :type 'boolean |
| 737 | :group 'verilog-mode-auto) | 792 | :group 'verilog-mode-auto) |
| 793 | (put 'verilog-auto-reset-widths 'safe-local-variable 'verilog-booleanp) | ||
| 738 | 794 | ||
| 739 | (defcustom verilog-assignment-delay "" | 795 | (defcustom verilog-assignment-delay "" |
| 740 | "*Text used for delays in delayed assignments. Add a trailing space if set." | 796 | "*Text used for delays in delayed assignments. Add a trailing space if set." |
| 741 | :type 'string | 797 | :group 'verilog-mode-auto |
| 742 | :group 'verilog-mode-auto) | 798 | :type 'string) |
| 799 | (put 'verilog-assignment-delay 'safe-local-variable 'stringp) | ||
| 743 | 800 | ||
| 744 | (defcustom verilog-auto-inst-vector t | 801 | (defcustom verilog-auto-inst-vector t |
| 745 | "*If true, when creating default ports with AUTOINST, use bus subscripts. | 802 | "*If true, when creating default ports with AUTOINST, use bus subscripts. |
| @@ -748,7 +805,8 @@ the module (AUTOWIRE signals always are subscripted, you must manually | |||
| 748 | declare the wire to have the subscripts removed.) Nil may speed up some | 805 | declare the wire to have the subscripts removed.) Nil may speed up some |
| 749 | simulators, but is less general and harder to read, so avoid." | 806 | simulators, but is less general and harder to read, so avoid." |
| 750 | :group 'verilog-mode-auto | 807 | :group 'verilog-mode-auto |
| 751 | :type 'boolean ) | 808 | :type 'boolean) |
| 809 | (put 'verilog-auto-inst-vector 'safe-local-variable 'verilog-booleanp) | ||
| 752 | 810 | ||
| 753 | (defcustom verilog-auto-inst-template-numbers nil | 811 | (defcustom verilog-auto-inst-template-numbers nil |
| 754 | "*If true, when creating templated ports with AUTOINST, add a comment. | 812 | "*If true, when creating templated ports with AUTOINST, add a comment. |
| @@ -756,7 +814,8 @@ The comment will add the line number of the template that was used for that | |||
| 756 | port declaration. Setting this aids in debugging, but nil is suggested for | 814 | port declaration. Setting this aids in debugging, but nil is suggested for |
| 757 | regular use to prevent large numbers of merge conflicts." | 815 | regular use to prevent large numbers of merge conflicts." |
| 758 | :group 'verilog-mode-auto | 816 | :group 'verilog-mode-auto |
| 759 | :type 'boolean ) | 817 | :type 'boolean) |
| 818 | (put 'verilog-auto-inst-template-numbers 'safe-local-variable 'verilog-booleanp) | ||
| 760 | 819 | ||
| 761 | (defvar verilog-auto-inst-column 40 | 820 | (defvar verilog-auto-inst-column 40 |
| 762 | "Column number for first part of auto-inst.") | 821 | "Column number for first part of auto-inst.") |
| @@ -765,31 +824,36 @@ regular use to prevent large numbers of merge conflicts." | |||
| 765 | "*If set, when creating AUTOINPUT list, ignore signals matching this regexp. | 824 | "*If set, when creating AUTOINPUT list, ignore signals matching this regexp. |
| 766 | See the \\[verilog-faq] for examples on using this." | 825 | See the \\[verilog-faq] for examples on using this." |
| 767 | :group 'verilog-mode-auto | 826 | :group 'verilog-mode-auto |
| 768 | :type 'string ) | 827 | :type 'string) |
| 828 | (put 'verilog-auto-input-ignore-regexp 'safe-local-variable 'stringp) | ||
| 769 | 829 | ||
| 770 | (defcustom verilog-auto-inout-ignore-regexp nil | 830 | (defcustom verilog-auto-inout-ignore-regexp nil |
| 771 | "*If set, when creating AUTOINOUT list, ignore signals matching this regexp. | 831 | "*If set, when creating AUTOINOUT list, ignore signals matching this regexp. |
| 772 | See the \\[verilog-faq] for examples on using this." | 832 | See the \\[verilog-faq] for examples on using this." |
| 773 | :group 'verilog-mode-auto | 833 | :group 'verilog-mode-auto |
| 774 | :type 'string ) | 834 | :type 'string) |
| 835 | (put 'verilog-auto-inout-ignore-regexp 'safe-local-variable 'stringp) | ||
| 775 | 836 | ||
| 776 | (defcustom verilog-auto-output-ignore-regexp nil | 837 | (defcustom verilog-auto-output-ignore-regexp nil |
| 777 | "*If set, when creating AUTOOUTPUT list, ignore signals matching this regexp. | 838 | "*If set, when creating AUTOOUTPUT list, ignore signals matching this regexp. |
| 778 | See the \\[verilog-faq] for examples on using this." | 839 | See the \\[verilog-faq] for examples on using this." |
| 779 | :group 'verilog-mode-auto | 840 | :group 'verilog-mode-auto |
| 780 | :type 'string ) | 841 | :type 'string) |
| 842 | (put 'verilog-auto-output-ignore-regexp 'safe-local-variable 'stringp) | ||
| 781 | 843 | ||
| 782 | (defcustom verilog-auto-unused-ignore-regexp nil | 844 | (defcustom verilog-auto-unused-ignore-regexp nil |
| 783 | "*If set, when creating AUTOUNUSED list, ignore signals matching this regexp. | 845 | "*If set, when creating AUTOUNUSED list, ignore signals matching this regexp. |
| 784 | See the \\[verilog-faq] for examples on using this." | 846 | See the \\[verilog-faq] for examples on using this." |
| 785 | :group 'verilog-mode-auto | 847 | :group 'verilog-mode-auto |
| 786 | :type 'string ) | 848 | :type 'string) |
| 849 | (put 'verilog-auto-unused-ignore-regexp 'safe-local-variable 'stringp) | ||
| 787 | 850 | ||
| 788 | (defcustom verilog-typedef-regexp nil | 851 | (defcustom verilog-typedef-regexp nil |
| 789 | "*If non-nil, regular expression that matches Verilog-2001 typedef names. | 852 | "*If non-nil, regular expression that matches Verilog-2001 typedef names. |
| 790 | For example, \"_t$\" matches typedefs named with _t, as in the C language." | 853 | For example, \"_t$\" matches typedefs named with _t, as in the C language." |
| 791 | :group 'verilog-mode-auto | 854 | :group 'verilog-mode-auto |
| 792 | :type 'string ) | 855 | :type 'string) |
| 856 | (put 'verilog-typedef-regexp 'safe-local-variable 'stringp) | ||
| 793 | 857 | ||
| 794 | (defcustom verilog-mode-hook 'verilog-set-compile-command | 858 | (defcustom verilog-mode-hook 'verilog-set-compile-command |
| 795 | "*Hook (List of functions) run after verilog mode is loaded." | 859 | "*Hook (List of functions) run after verilog mode is loaded." |
| @@ -798,33 +862,33 @@ For example, \"_t$\" matches typedefs named with _t, as in the C language." | |||
| 798 | 862 | ||
| 799 | (defcustom verilog-auto-hook nil | 863 | (defcustom verilog-auto-hook nil |
| 800 | "*Hook run after `verilog-mode' updates AUTOs." | 864 | "*Hook run after `verilog-mode' updates AUTOs." |
| 801 | :type 'hook | 865 | :group 'verilog-mode-auto |
| 802 | :group 'verilog-mode-auto) | 866 | :type 'hook) |
| 803 | 867 | ||
| 804 | (defcustom verilog-before-auto-hook nil | 868 | (defcustom verilog-before-auto-hook nil |
| 805 | "*Hook run before `verilog-mode' updates AUTOs." | 869 | "*Hook run before `verilog-mode' updates AUTOs." |
| 806 | :type 'hook | 870 | :group 'verilog-mode-auto |
| 807 | :group 'verilog-mode-auto) | 871 | :type 'hook) |
| 808 | 872 | ||
| 809 | (defcustom verilog-delete-auto-hook nil | 873 | (defcustom verilog-delete-auto-hook nil |
| 810 | "*Hook run after `verilog-mode' deletes AUTOs." | 874 | "*Hook run after `verilog-mode' deletes AUTOs." |
| 811 | :type 'hook | 875 | :group 'verilog-mode-auto |
| 812 | :group 'verilog-mode-auto) | 876 | :type 'hook) |
| 813 | 877 | ||
| 814 | (defcustom verilog-before-delete-auto-hook nil | 878 | (defcustom verilog-before-delete-auto-hook nil |
| 815 | "*Hook run before `verilog-mode' deletes AUTOs." | 879 | "*Hook run before `verilog-mode' deletes AUTOs." |
| 816 | :type 'hook | 880 | :group 'verilog-mode-auto |
| 817 | :group 'verilog-mode-auto) | 881 | :type 'hook) |
| 818 | 882 | ||
| 819 | (defcustom verilog-getopt-flags-hook nil | 883 | (defcustom verilog-getopt-flags-hook nil |
| 820 | "*Hook run after `verilog-getopt-flags' determines the Verilog option lists." | 884 | "*Hook run after `verilog-getopt-flags' determines the Verilog option lists." |
| 821 | :type 'hook | 885 | :group 'verilog-mode-auto |
| 822 | :group 'verilog-mode-auto) | 886 | :type 'hook) |
| 823 | 887 | ||
| 824 | (defcustom verilog-before-getopt-flags-hook nil | 888 | (defcustom verilog-before-getopt-flags-hook nil |
| 825 | "*Hook run before `verilog-getopt-flags' determines the Verilog option lists." | 889 | "*Hook run before `verilog-getopt-flags' determines the Verilog option lists." |
| 826 | :type 'hook | 890 | :group 'verilog-mode-auto |
| 827 | :group 'verilog-mode-auto) | 891 | :type 'hook) |
| 828 | 892 | ||
| 829 | (defvar verilog-imenu-generic-expression | 893 | (defvar verilog-imenu-generic-expression |
| 830 | '((nil "^\\s-*\\(\\(m\\(odule\\|acromodule\\)\\)\\|primitive\\)\\s-+\\([a-zA-Z0-9_.:]+\\)" 4) | 894 | '((nil "^\\s-*\\(\\(m\\(odule\\|acromodule\\)\\)\\|primitive\\)\\s-+\\([a-zA-Z0-9_.:]+\\)" 4) |
| @@ -843,13 +907,11 @@ format (e.g. 09/17/1997) is not supported.") | |||
| 843 | (defvar verilog-company nil | 907 | (defvar verilog-company nil |
| 844 | "*Default name of Company for verilog header. | 908 | "*Default name of Company for verilog header. |
| 845 | If set will become buffer local.") | 909 | If set will become buffer local.") |
| 846 | |||
| 847 | (make-variable-buffer-local 'verilog-company) | 910 | (make-variable-buffer-local 'verilog-company) |
| 848 | 911 | ||
| 849 | (defvar verilog-project nil | 912 | (defvar verilog-project nil |
| 850 | "*Default name of Project for verilog header. | 913 | "*Default name of Project for verilog header. |
| 851 | If set will become buffer local.") | 914 | If set will become buffer local.") |
| 852 | |||
| 853 | (make-variable-buffer-local 'verilog-project) | 915 | (make-variable-buffer-local 'verilog-project) |
| 854 | 916 | ||
| 855 | (defvar verilog-mode-map | 917 | (defvar verilog-mode-map |
| @@ -871,7 +933,6 @@ If set will become buffer local.") | |||
| 871 | (define-key map "\M-\r" `electric-verilog-terminate-and-indent) | 933 | (define-key map "\M-\r" `electric-verilog-terminate-and-indent) |
| 872 | (define-key map "\M-\t" 'verilog-complete-word) | 934 | (define-key map "\M-\t" 'verilog-complete-word) |
| 873 | (define-key map "\M-?" 'verilog-show-completions) | 935 | (define-key map "\M-?" 'verilog-show-completions) |
| 874 | (define-key map [(meta control h)] 'verilog-mark-defun) | ||
| 875 | (define-key map "\C-c\`" 'verilog-lint-off) | 936 | (define-key map "\C-c\`" 'verilog-lint-off) |
| 876 | (define-key map "\C-c\*" 'verilog-delete-auto-star-implicit) | 937 | (define-key map "\C-c\*" 'verilog-delete-auto-star-implicit) |
| 877 | (define-key map "\C-c\C-r" 'verilog-label-be) | 938 | (define-key map "\C-c\C-r" 'verilog-label-be) |
| @@ -881,8 +942,10 @@ If set will become buffer local.") | |||
| 881 | (define-key map "\M-*" 'verilog-star-comment) | 942 | (define-key map "\M-*" 'verilog-star-comment) |
| 882 | (define-key map "\C-c\C-c" 'verilog-comment-region) | 943 | (define-key map "\C-c\C-c" 'verilog-comment-region) |
| 883 | (define-key map "\C-c\C-u" 'verilog-uncomment-region) | 944 | (define-key map "\C-c\C-u" 'verilog-uncomment-region) |
| 884 | (define-key map "\M-\C-a" 'verilog-beg-of-defun) | 945 | (when (featurep 'xemacs) |
| 885 | (define-key map "\M-\C-e" 'verilog-end-of-defun) | 946 | (define-key map [(meta control h)] 'verilog-mark-defun) |
| 947 | (define-key map "\M-\C-a" 'verilog-beg-of-defun) | ||
| 948 | (define-key map "\M-\C-e" 'verilog-end-of-defun)) | ||
| 886 | (define-key map "\C-c\C-d" 'verilog-goto-defun) | 949 | (define-key map "\C-c\C-d" 'verilog-goto-defun) |
| 887 | (define-key map "\C-c\C-k" 'verilog-delete-auto) | 950 | (define-key map "\C-c\C-k" 'verilog-delete-auto) |
| 888 | (define-key map "\C-c\C-a" 'verilog-auto) | 951 | (define-key map "\C-c\C-a" 'verilog-auto) |
| @@ -895,7 +958,7 @@ If set will become buffer local.") | |||
| 895 | 958 | ||
| 896 | ;; menus | 959 | ;; menus |
| 897 | (defvar verilog-xemacs-menu | 960 | (defvar verilog-xemacs-menu |
| 898 | '("Verilog" | 961 | `("Verilog" |
| 899 | ("Choose Compilation Action" | 962 | ("Choose Compilation Action" |
| 900 | ["None" | 963 | ["None" |
| 901 | (progn | 964 | (progn |
| @@ -929,9 +992,15 @@ If set will become buffer local.") | |||
| 929 | :selected (equal verilog-tool `verilog-compiler)] | 992 | :selected (equal verilog-tool `verilog-compiler)] |
| 930 | ) | 993 | ) |
| 931 | ("Move" | 994 | ("Move" |
| 932 | ["Beginning of function" verilog-beg-of-defun t] | 995 | ,(if (featurep 'xemacs) |
| 933 | ["End of function" verilog-end-of-defun t] | 996 | (progn |
| 934 | ["Mark function" verilog-mark-defun t] | 997 | ["Beginning of function" verilog-beg-of-defun t] |
| 998 | ["End of function" verilog-end-of-defun t] | ||
| 999 | ["Mark function" verilog-mark-defun t]) | ||
| 1000 | ["Beginning of function" beginning-of-defun t] | ||
| 1001 | ["End of function" end-of-defun t] | ||
| 1002 | ["Mark function" mark-defun t]) | ||
| 1003 | |||
| 935 | ["Goto function/module" verilog-goto-defun t] | 1004 | ["Goto function/module" verilog-goto-defun t] |
| 936 | ["Move to beginning of block" electric-verilog-backward-sexp t] | 1005 | ["Move to beginning of block" electric-verilog-backward-sexp t] |
| 937 | ["Move to end of block" electric-verilog-forward-sexp t] | 1006 | ["Move to end of block" electric-verilog-forward-sexp t] |
| @@ -1025,8 +1094,7 @@ If set will become buffer local.") | |||
| 1025 | ["Casex" verilog-sk-casex t] | 1094 | ["Casex" verilog-sk-casex t] |
| 1026 | ["Casez" verilog-sk-casez t] | 1095 | ["Casez" verilog-sk-casez t] |
| 1027 | ) | 1096 | ) |
| 1028 | "Menu for statement templates in Verilog." | 1097 | "Menu for statement templates in Verilog.") |
| 1029 | ) | ||
| 1030 | 1098 | ||
| 1031 | (easy-menu-define verilog-menu verilog-mode-map "Menu for Verilog mode" | 1099 | (easy-menu-define verilog-menu verilog-mode-map "Menu for Verilog mode" |
| 1032 | verilog-xemacs-menu) | 1100 | verilog-xemacs-menu) |
| @@ -1072,8 +1140,7 @@ will break, as the o's continuously replace. xa -> x works ok though." | |||
| 1072 | (store-match-data '(nil nil)) | 1140 | (store-match-data '(nil nil)) |
| 1073 | (if BOUND | 1141 | (if BOUND |
| 1074 | (< (point) BOUND) | 1142 | (< (point) BOUND) |
| 1075 | t) | 1143 | t))))) |
| 1076 | )))) | ||
| 1077 | (match-end 0)) | 1144 | (match-end 0)) |
| 1078 | 1145 | ||
| 1079 | (defsubst verilog-re-search-backward (REGEXP BOUND NOERROR) | 1146 | (defsubst verilog-re-search-backward (REGEXP BOUND NOERROR) |
| @@ -1087,8 +1154,7 @@ will break, as the o's continuously replace. xa -> x works ok though." | |||
| 1087 | (store-match-data '(nil nil)) | 1154 | (store-match-data '(nil nil)) |
| 1088 | (if BOUND | 1155 | (if BOUND |
| 1089 | (> (point) BOUND) | 1156 | (> (point) BOUND) |
| 1090 | t) | 1157 | t))))) |
| 1091 | )))) | ||
| 1092 | (match-end 0)) | 1158 | (match-end 0)) |
| 1093 | 1159 | ||
| 1094 | (defsubst verilog-re-search-forward-quick (regexp bound noerror) | 1160 | (defsubst verilog-re-search-forward-quick (regexp bound noerror) |
| @@ -1130,6 +1196,8 @@ so there may be a large up front penalty for the first search." | |||
| 1130 | (save-excursion | 1196 | (save-excursion |
| 1131 | (nth 3 (parse-partial-sexp (verilog-get-beg-of-line) (point))))) | 1197 | (nth 3 (parse-partial-sexp (verilog-get-beg-of-line) (point))))) |
| 1132 | 1198 | ||
| 1199 | (defvar compile-command) | ||
| 1200 | |||
| 1133 | ;; compilation program | 1201 | ;; compilation program |
| 1134 | (defun verilog-set-compile-command () | 1202 | (defun verilog-set-compile-command () |
| 1135 | "Function to compute shell command to compile verilog. | 1203 | "Function to compute shell command to compile verilog. |
| @@ -1201,8 +1269,7 @@ find the errors." | |||
| 1201 | (setq compilation-error-regexp-alist | 1269 | (setq compilation-error-regexp-alist |
| 1202 | (default-value 'compilation-error-regexp-alist)) | 1270 | (default-value 'compilation-error-regexp-alist)) |
| 1203 | (set (make-local-variable 'compilation-error-regexp-alist) | 1271 | (set (make-local-variable 'compilation-error-regexp-alist) |
| 1204 | (default-value 'compilation-error-regexp-alist)) | 1272 | (default-value 'compilation-error-regexp-alist))))) |
| 1205 | ))) | ||
| 1206 | 1273 | ||
| 1207 | (add-hook 'compilation-mode-hook 'verilog-error-regexp-add) | 1274 | (add-hook 'compilation-mode-hook 'verilog-error-regexp-add) |
| 1208 | 1275 | ||
| @@ -1330,8 +1397,7 @@ find the errors." | |||
| 1330 | "endprogram" | 1397 | "endprogram" |
| 1331 | "endsequence" | 1398 | "endsequence" |
| 1332 | "endclocking" | 1399 | "endclocking" |
| 1333 | ) | 1400 | )))) |
| 1334 | ))) | ||
| 1335 | 1401 | ||
| 1336 | 1402 | ||
| 1337 | (defconst verilog-endcomment-reason-re | 1403 | (defconst verilog-endcomment-reason-re |
| @@ -1655,157 +1721,37 @@ find the errors." | |||
| 1655 | ) | 1721 | ) |
| 1656 | "List of Verilog keywords.") | 1722 | "List of Verilog keywords.") |
| 1657 | 1723 | ||
| 1658 | |||
| 1659 | (defconst verilog-emacs-features | ||
| 1660 | ;; Documentation at the bottom | ||
| 1661 | (let ((major (and (boundp 'emacs-major-version) | ||
| 1662 | emacs-major-version)) | ||
| 1663 | (minor (and (boundp 'emacs-minor-version) | ||
| 1664 | emacs-minor-version)) | ||
| 1665 | flavor comments flock-syntax) | ||
| 1666 | ;; figure out version numbers if not already discovered | ||
| 1667 | (and (or (not major) (not minor)) | ||
| 1668 | (string-match "\\([0-9]+\\).\\([0-9]+\\)" emacs-version) | ||
| 1669 | (setq major (string-to-number (substring emacs-version | ||
| 1670 | (match-beginning 1) | ||
| 1671 | (match-end 1))) | ||
| 1672 | minor (string-to-number (substring emacs-version | ||
| 1673 | (match-beginning 2) | ||
| 1674 | (match-end 2))))) | ||
| 1675 | (if (not (and major minor)) | ||
| 1676 | (error "Cannot figure out the major and minor version numbers")) | ||
| 1677 | ;; calculate the major version | ||
| 1678 | (cond | ||
| 1679 | ((= major 4) (setq major 'v18)) ;Epoch 4 | ||
| 1680 | ((= major 18) (setq major 'v18)) ;Emacs 18 | ||
| 1681 | ((= major 19) (setq major 'v19 ;Emacs 19 | ||
| 1682 | flavor (if (or (string-match "Lucid" emacs-version) | ||
| 1683 | (string-match "XEmacs" emacs-version)) | ||
| 1684 | 'XEmacs 'FSF))) | ||
| 1685 | ((> major 19) (setq major 'v20 | ||
| 1686 | flavor (if (or (string-match "Lucid" emacs-version) | ||
| 1687 | (string-match "XEmacs" emacs-version)) | ||
| 1688 | 'XEmacs 'FSF))) | ||
| 1689 | ;; I don't know | ||
| 1690 | (t (error "Cannot recognize major version number: %s" major))) | ||
| 1691 | ;; XEmacs 19 uses 8-bit modify-syntax-entry flags, as do all | ||
| 1692 | ;; patched Emacs 19, Emacs 18, Epoch 4's. Only Emacs 19 uses a | ||
| 1693 | ;; 1-bit flag. Let's be as smart as we can about figuring this | ||
| 1694 | ;; out. | ||
| 1695 | (if (or (eq major 'v20) (eq major 'v19)) | ||
| 1696 | (let ((table (copy-syntax-table))) | ||
| 1697 | (modify-syntax-entry ?a ". 12345678" table) | ||
| 1698 | (cond | ||
| 1699 | ;; XEmacs pre 20 and Emacs pre 19.30 use vectors for syntax tables. | ||
| 1700 | ((vectorp table) | ||
| 1701 | (if (= (logand (lsh (aref table ?a) -16) 255) 255) | ||
| 1702 | (setq comments '8-bit) | ||
| 1703 | (setq comments '1-bit))) | ||
| 1704 | ;; XEmacs 20 is known to be 8-bit | ||
| 1705 | ((eq flavor 'XEmacs) (setq comments '8-bit)) | ||
| 1706 | ;; Emacs 19.30 and beyond are known to be 1-bit | ||
| 1707 | ((eq flavor 'FSF) (setq comments '1-bit)) | ||
| 1708 | ;; Don't know what this is | ||
| 1709 | (t (error "Couldn't figure out syntax table format")) | ||
| 1710 | )) | ||
| 1711 | ;; Emacs 18 has no support for dual comments | ||
| 1712 | (setq comments 'no-dual-comments)) | ||
| 1713 | ;; determine whether to use old or new font lock syntax | ||
| 1714 | ;; We can assume 8-bit syntax table emacsen support new syntax, otherwise | ||
| 1715 | ;; look for version > 19.30 | ||
| 1716 | (setq flock-syntax | ||
| 1717 | (if (or (equal comments '8-bit) | ||
| 1718 | (equal major 'v20) | ||
| 1719 | (and (equal major 'v19) (> minor 30))) | ||
| 1720 | 'flock-syntax-after-1930 | ||
| 1721 | 'flock-syntax-before-1930)) | ||
| 1722 | ;; lets do some minimal sanity checking. | ||
| 1723 | (if (or | ||
| 1724 | ;; Emacs before 19.6 had bugs | ||
| 1725 | (and (eq major 'v19) (eq flavor 'XEmacs) (< minor 6)) | ||
| 1726 | ;; Emacs 19 before 19.21 has known bugs | ||
| 1727 | (and (eq major 'v19) (eq flavor 'FSF) (< minor 21)) | ||
| 1728 | ) | ||
| 1729 | (with-output-to-temp-buffer "*verilog-mode warnings*" | ||
| 1730 | (print (format | ||
| 1731 | "The version of Emacs that you are running, %s, | ||
| 1732 | has known bugs in its syntax parsing routines which will affect the | ||
| 1733 | performance of verilog-mode. You should strongly consider upgrading to the | ||
| 1734 | latest available version. verilog-mode may continue to work, after a | ||
| 1735 | fashion, but strange indentation errors could be encountered." | ||
| 1736 | emacs-version)))) | ||
| 1737 | ;; Emacs 18, with no patch is not too good | ||
| 1738 | (if (and (eq major 'v18) (eq comments 'no-dual-comments)) | ||
| 1739 | (with-output-to-temp-buffer "*verilog-mode warnings*" | ||
| 1740 | (print (format | ||
| 1741 | "The version of Emacs 18 you are running, %s, | ||
| 1742 | has known deficiencies in its ability to handle the dual verilog | ||
| 1743 | \(and C++) comments, (e.g. the // and /* */ comments). This will | ||
| 1744 | not be much of a problem for you if you only use the /* */ comments, | ||
| 1745 | but you really should strongly consider upgrading to one of the latest | ||
| 1746 | Emacs 19's. In Emacs 18, you may also experience performance degradations. | ||
| 1747 | Emacs 19 has some new built-in routines which will speed things up for you. | ||
| 1748 | Because of these inherent problems, verilog-mode is not supported | ||
| 1749 | on emacs-18." | ||
| 1750 | emacs-version)))) | ||
| 1751 | ;; Emacs 18 with the syntax patches are no longer supported | ||
| 1752 | (if (and (eq major 'v18) (not (eq comments 'no-dual-comments))) | ||
| 1753 | (with-output-to-temp-buffer "*verilog-mode warnings*" | ||
| 1754 | (print (format | ||
| 1755 | "You are running a syntax patched Emacs 18 variant. While this should | ||
| 1756 | work for you, you may want to consider upgrading to Emacs 19. | ||
| 1757 | The syntax patches are no longer supported either for verilog-mode.")))) | ||
| 1758 | (list major comments flock-syntax)) | ||
| 1759 | "A list of features extant in the Emacs you are using. | ||
| 1760 | There are many flavors of Emacs out there, each with different | ||
| 1761 | features supporting those needed by `verilog-mode'. Here's the current | ||
| 1762 | supported list, along with the values for this variable: | ||
| 1763 | |||
| 1764 | Vanilla Emacs 18/Epoch 4: (v18 no-dual-comments flock-syntax-before-1930) | ||
| 1765 | Emacs 18/Epoch 4 (patch2): (v18 8-bit flock-syntax-after-1930) | ||
| 1766 | XEmacs (formerly Lucid) 19: (v19 8-bit flock-syntax-after-1930) | ||
| 1767 | XEmacs 20: (v20 8-bit flock-syntax-after-1930) | ||
| 1768 | Emacs 19.1-19.30: (v19 8-bit flock-syntax-before-1930) | ||
| 1769 | Emacs 19.31-19.xx: (v19 8-bit flock-syntax-after-1930) | ||
| 1770 | Emacs20 : (v20 1-bit flock-syntax-after-1930).") | ||
| 1771 | |||
| 1772 | (defconst verilog-comment-start-regexp "//\\|/\\*" | 1724 | (defconst verilog-comment-start-regexp "//\\|/\\*" |
| 1773 | "Dual comment value for `comment-start-regexp'.") | 1725 | "Dual comment value for `comment-start-regexp'.") |
| 1774 | 1726 | ||
| 1775 | (defun verilog-populate-syntax-table (table) | 1727 | (defvar verilog-mode-syntax-table |
| 1776 | "Populate the syntax TABLE." | 1728 | (let ((table (make-syntax-table))) |
| 1777 | (modify-syntax-entry ?\\ "\\" table) | 1729 | ;; Populate the syntax TABLE. |
| 1778 | (modify-syntax-entry ?+ "." table) | 1730 | (modify-syntax-entry ?\\ "\\" table) |
| 1779 | (modify-syntax-entry ?- "." table) | 1731 | (modify-syntax-entry ?+ "." table) |
| 1780 | (modify-syntax-entry ?= "." table) | 1732 | (modify-syntax-entry ?- "." table) |
| 1781 | (modify-syntax-entry ?% "." table) | 1733 | (modify-syntax-entry ?= "." table) |
| 1782 | (modify-syntax-entry ?< "." table) | 1734 | (modify-syntax-entry ?% "." table) |
| 1783 | (modify-syntax-entry ?> "." table) | 1735 | (modify-syntax-entry ?< "." table) |
| 1784 | (modify-syntax-entry ?& "." table) | 1736 | (modify-syntax-entry ?> "." table) |
| 1785 | (modify-syntax-entry ?| "." table) | 1737 | (modify-syntax-entry ?& "." table) |
| 1786 | (modify-syntax-entry ?` "w" table) | 1738 | (modify-syntax-entry ?| "." table) |
| 1787 | (modify-syntax-entry ?_ "w" table) | 1739 | (modify-syntax-entry ?` "w" table) |
| 1788 | (modify-syntax-entry ?\' "." table) | 1740 | (modify-syntax-entry ?_ "w" table) |
| 1789 | ) | 1741 | (modify-syntax-entry ?\' "." table) |
| 1790 | 1742 | ||
| 1791 | (defun verilog-setup-dual-comments (table) | 1743 | ;; Set up TABLE to handle block and line style comments. |
| 1792 | "Set up TABLE to handle block and line style comments." | 1744 | (if (featurep 'xemacs) |
| 1793 | (cond | 1745 | (progn |
| 1794 | ((memq '8-bit verilog-emacs-features) | 1746 | ;; XEmacs (formerly Lucid) has the best implementation |
| 1795 | ;; XEmacs (formerly Lucid) has the best implementation | 1747 | (modify-syntax-entry ?/ ". 1456" table) |
| 1796 | (modify-syntax-entry ?/ ". 1456" table) | 1748 | (modify-syntax-entry ?* ". 23" table) |
| 1797 | (modify-syntax-entry ?* ". 23" table) | 1749 | (modify-syntax-entry ?\n "> b" table)) |
| 1798 | (modify-syntax-entry ?\n "> b" table) | 1750 | ;; Emacs 19 does things differently, but we can work with it |
| 1799 | ) | 1751 | (modify-syntax-entry ?/ ". 124b" table) |
| 1800 | ((memq '1-bit verilog-emacs-features) | 1752 | (modify-syntax-entry ?* ". 23" table) |
| 1801 | ;; Emacs 19 does things differently, but we can work with it | 1753 | (modify-syntax-entry ?\n "> b" table)) |
| 1802 | (modify-syntax-entry ?/ ". 124b" table) | 1754 | table) |
| 1803 | (modify-syntax-entry ?* ". 23" table) | ||
| 1804 | (modify-syntax-entry ?\n "> b" table) | ||
| 1805 | ) | ||
| 1806 | )) | ||
| 1807 | |||
| 1808 | (defvar verilog-mode-syntax-table nil | ||
| 1809 | "Syntax table used in `verilog-mode' buffers.") | 1755 | "Syntax table used in `verilog-mode' buffers.") |
| 1810 | 1756 | ||
| 1811 | (defvar verilog-font-lock-keywords nil | 1757 | (defvar verilog-font-lock-keywords nil |
| @@ -1961,8 +1907,7 @@ See also `verilog-font-lock-extra-types'.") | |||
| 1961 | 'font-lock-type-face)) | 1907 | 'font-lock-type-face)) |
| 1962 | ;; Fontify Verilog-AMS keywords | 1908 | ;; Fontify Verilog-AMS keywords |
| 1963 | (cons (concat "\\<\\(" verilog-ams-keywords "\\)\\>") | 1909 | (cons (concat "\\<\\(" verilog-ams-keywords "\\)\\>") |
| 1964 | 'verilog-font-lock-ams-face) | 1910 | 'verilog-font-lock-ams-face))) |
| 1965 | )) | ||
| 1966 | 1911 | ||
| 1967 | (setq verilog-font-lock-keywords-1 | 1912 | (setq verilog-font-lock-keywords-1 |
| 1968 | (append verilog-font-lock-keywords | 1913 | (append verilog-font-lock-keywords |
| @@ -1976,15 +1921,12 @@ See also `verilog-font-lock-extra-types'.") | |||
| 1976 | (list | 1921 | (list |
| 1977 | (concat "\\<function\\>\\s-+\\(integer\\|real\\(time\\)?\\|time\\)\\s-+\\(\\sw+\\)" ) | 1922 | (concat "\\<function\\>\\s-+\\(integer\\|real\\(time\\)?\\|time\\)\\s-+\\(\\sw+\\)" ) |
| 1978 | '(1 font-lock-keyword-face) | 1923 | '(1 font-lock-keyword-face) |
| 1979 | '(3 font-lock-reference-face prepend) | 1924 | '(3 font-lock-reference-face prepend)) |
| 1980 | ) | ||
| 1981 | '("\\<function\\>\\s-+\\(\\[[^]]+\\]\\)\\s-+\\(\\sw+\\)" | 1925 | '("\\<function\\>\\s-+\\(\\[[^]]+\\]\\)\\s-+\\(\\sw+\\)" |
| 1982 | (1 font-lock-keyword-face) | 1926 | (1 font-lock-keyword-face) |
| 1983 | (2 font-lock-reference-face append) | 1927 | (2 font-lock-reference-face append)) |
| 1984 | ) | ||
| 1985 | '("\\<function\\>\\s-+\\(\\sw+\\)" | 1928 | '("\\<function\\>\\s-+\\(\\sw+\\)" |
| 1986 | 1 'font-lock-reference-face append) | 1929 | 1 'font-lock-reference-face append)))) |
| 1987 | ))) | ||
| 1988 | 1930 | ||
| 1989 | (setq verilog-font-lock-keywords-2 | 1931 | (setq verilog-font-lock-keywords-2 |
| 1990 | (append verilog-font-lock-keywords-1 | 1932 | (append verilog-font-lock-keywords-1 |
| @@ -2002,7 +1944,6 @@ See also `verilog-font-lock-extra-types'.") | |||
| 2002 | 0 font-lock-type-face append) | 1944 | 0 font-lock-type-face append) |
| 2003 | ;; Fontify instantiation names | 1945 | ;; Fontify instantiation names |
| 2004 | '("\\([A-Za-z][A-Za-z0-9_]+\\)\\s-*(" 1 font-lock-function-name-face) | 1946 | '("\\([A-Za-z][A-Za-z0-9_]+\\)\\s-*(" 1 font-lock-function-name-face) |
| 2005 | |||
| 2006 | ))) | 1947 | ))) |
| 2007 | 1948 | ||
| 2008 | (setq verilog-font-lock-keywords-3 | 1949 | (setq verilog-font-lock-keywords-3 |
| @@ -2015,15 +1956,14 @@ See also `verilog-font-lock-extra-types'.") | |||
| 2015 | ))))) | 1956 | ))))) |
| 2016 | 1957 | ||
| 2017 | 1958 | ||
| 2018 | |||
| 2019 | (defun verilog-inside-comment-p () | 1959 | (defun verilog-inside-comment-p () |
| 2020 | "Check if point inside a nested comment." | 1960 | "Check if point inside a nested comment." |
| 2021 | (save-excursion | 1961 | (save-excursion |
| 2022 | (let ((st-point (point)) hitbeg) | 1962 | (let ((st-point (point)) hitbeg) |
| 2023 | (or (search-backward "//" (verilog-get-beg-of-line) t) | 1963 | (or (search-backward "//" (verilog-get-beg-of-line) t) |
| 2024 | (if (progn | 1964 | (if (progn |
| 2025 | ;; This is for tricky case //*, we keep searching if /* is | 1965 | ;; This is for tricky case //*, we keep searching if /* |
| 2026 | ;; proceeded by // on same line. | 1966 | ;; is proceeded by // on same line. |
| 2027 | (while | 1967 | (while |
| 2028 | (and (setq hitbeg (search-backward "/*" nil t)) | 1968 | (and (setq hitbeg (search-backward "/*" nil t)) |
| 2029 | (progn | 1969 | (progn |
| @@ -2048,14 +1988,14 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2048 | "Move backward over a sexp." | 1988 | "Move backward over a sexp." |
| 2049 | (interactive) | 1989 | (interactive) |
| 2050 | ;; before that see if we are in a comment | 1990 | ;; before that see if we are in a comment |
| 2051 | (verilog-backward-sexp) | 1991 | (verilog-backward-sexp)) |
| 2052 | ) | 1992 | |
| 2053 | (defun electric-verilog-forward-sexp () | 1993 | (defun electric-verilog-forward-sexp () |
| 2054 | "Move backward over a sexp." | 1994 | "Move backward over a sexp." |
| 2055 | (interactive) | 1995 | (interactive) |
| 2056 | ;; before that see if we are in a comment | 1996 | ;; before that see if we are in a comment |
| 2057 | (verilog-forward-sexp) | 1997 | (verilog-forward-sexp)) |
| 2058 | ) | 1998 | |
| 2059 | ;;;used by hs-minor-mode | 1999 | ;;;used by hs-minor-mode |
| 2060 | (defun verilog-forward-sexp-function (arg) | 2000 | (defun verilog-forward-sexp-function (arg) |
| 2061 | (if (< arg 0) | 2001 | (if (< arg 0) |
| @@ -2067,19 +2007,16 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2067 | (let ((reg) | 2007 | (let ((reg) |
| 2068 | (elsec 1) | 2008 | (elsec 1) |
| 2069 | (found nil) | 2009 | (found nil) |
| 2070 | (st (point)) | 2010 | (st (point))) |
| 2071 | ) | ||
| 2072 | (if (not (looking-at "\\<")) | 2011 | (if (not (looking-at "\\<")) |
| 2073 | (forward-word -1)) | 2012 | (forward-word -1)) |
| 2074 | (cond | 2013 | (cond |
| 2075 | ((verilog-skip-backward-comment-or-string) | 2014 | ((verilog-skip-backward-comment-or-string)) |
| 2076 | ) | ||
| 2077 | ((looking-at "\\<else\\>") | 2015 | ((looking-at "\\<else\\>") |
| 2078 | (setq reg (concat | 2016 | (setq reg (concat |
| 2079 | verilog-end-block-re | 2017 | verilog-end-block-re |
| 2080 | "\\|\\(\\<else\\>\\)" | 2018 | "\\|\\(\\<else\\>\\)" |
| 2081 | "\\|\\(\\<if\\>\\)" | 2019 | "\\|\\(\\<if\\>\\)")) |
| 2082 | )) | ||
| 2083 | (while (and (not found) | 2020 | (while (and (not found) |
| 2084 | (verilog-re-search-backward reg nil 'move)) | 2021 | (verilog-re-search-backward reg nil 'move)) |
| 2085 | (cond | 2022 | (cond |
| @@ -2094,11 +2031,7 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2094 | (setq elsec (1- elsec)) | 2031 | (setq elsec (1- elsec)) |
| 2095 | (if (= 0 elsec) | 2032 | (if (= 0 elsec) |
| 2096 | ;; Now previous line describes syntax | 2033 | ;; Now previous line describes syntax |
| 2097 | (setq found 't) | 2034 | (setq found 't)))))) |
| 2098 | )) | ||
| 2099 | ) | ||
| 2100 | ) | ||
| 2101 | ) | ||
| 2102 | ((looking-at verilog-end-block-re) | 2035 | ((looking-at verilog-end-block-re) |
| 2103 | (verilog-leap-to-head)) | 2036 | (verilog-leap-to-head)) |
| 2104 | ((looking-at "\\(endmodule\\>\\)\\|\\(\\<endprimitive\\>\\)\\|\\(\\<endclass\\>\\)\\|\\(\\<endprogram\\>\\)\\|\\(\\<endinterface\\>\\)\\|\\(\\<endpackage\\>\\)") | 2037 | ((looking-at "\\(endmodule\\>\\)\\|\\(\\<endprimitive\\>\\)\\|\\(\\<endclass\\>\\)\\|\\(\\<endprogram\\>\\)\\|\\(\\<endinterface\\>\\)\\|\\(\\<endpackage\\>\\)") |
| @@ -2120,9 +2053,7 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2120 | (backward-sexp 1)))) | 2053 | (backward-sexp 1)))) |
| 2121 | (t | 2054 | (t |
| 2122 | (goto-char st) | 2055 | (goto-char st) |
| 2123 | (backward-sexp)) | 2056 | (backward-sexp))))) |
| 2124 | ) ;; cond | ||
| 2125 | )) | ||
| 2126 | 2057 | ||
| 2127 | (defun verilog-forward-sexp () | 2058 | (defun verilog-forward-sexp () |
| 2128 | (let ((reg) | 2059 | (let ((reg) |
| @@ -2132,8 +2063,7 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2132 | (forward-word -1)) | 2063 | (forward-word -1)) |
| 2133 | (cond | 2064 | (cond |
| 2134 | ((verilog-skip-forward-comment-or-string) | 2065 | ((verilog-skip-forward-comment-or-string) |
| 2135 | (verilog-forward-syntactic-ws) | 2066 | (verilog-forward-syntactic-ws)) |
| 2136 | ) | ||
| 2137 | ((looking-at verilog-beg-block-re-ordered);; begin|case|fork|class|table|specify|function|task|generate|covergroup|property|sequence|clocking | 2067 | ((looking-at verilog-beg-block-re-ordered);; begin|case|fork|class|table|specify|function|task|generate|covergroup|property|sequence|clocking |
| 2138 | (cond | 2068 | (cond |
| 2139 | ((match-end 1) ; end | 2069 | ((match-end 1) ; end |
| @@ -2141,8 +2071,7 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2141 | (setq reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)" )) | 2071 | (setq reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)" )) |
| 2142 | ((match-end 2) ; endcase | 2072 | ((match-end 2) ; endcase |
| 2143 | ;; Search forward for matching case | 2073 | ;; Search forward for matching case |
| 2144 | (setq reg "\\(\\<randcase\\>\\|\\(\\<unique\\>\\s-+\\|\\<priority\\>\\s-+\\)?\\<case[xz]?\\>[^:]\\)\\|\\(\\<endcase\\>\\)" ) | 2074 | (setq reg "\\(\\<randcase\\>\\|\\(\\<unique\\>\\s-+\\|\\<priority\\>\\s-+\\)?\\<case[xz]?\\>[^:]\\)\\|\\(\\<endcase\\>\\)" )) |
| 2145 | ) | ||
| 2146 | ((match-end 3) ; join | 2075 | ((match-end 3) ; join |
| 2147 | ;; Search forward for matching fork | 2076 | ;; Search forward for matching fork |
| 2148 | (setq reg "\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" )) | 2077 | (setq reg "\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" )) |
| @@ -2173,12 +2102,10 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2173 | ((match-end 12) ; endsequence | 2102 | ((match-end 12) ; endsequence |
| 2174 | ;; Search forward for matching sequence | 2103 | ;; Search forward for matching sequence |
| 2175 | (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" ) | 2104 | (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" ) |
| 2176 | (setq md 3) ; 3 to get to endsequence in the reg above | 2105 | (setq md 3)) ; 3 to get to endsequence in the reg above |
| 2177 | ) | ||
| 2178 | ((match-end 13) ; endclocking | 2106 | ((match-end 13) ; endclocking |
| 2179 | ;; Search forward for matching clocking | 2107 | ;; Search forward for matching clocking |
| 2180 | (setq reg "\\(\\<clocking\\>\\)\\|\\(\\<endclocking\\>\\)" )) | 2108 | (setq reg "\\(\\<clocking\\>\\)\\|\\(\\<endclocking\\>\\)" ))) |
| 2181 | ) | ||
| 2182 | (if (forward-word 1) | 2109 | (if (forward-word 1) |
| 2183 | (catch 'skip | 2110 | (catch 'skip |
| 2184 | (let ((nest 1)) | 2111 | (let ((nest 1)) |
| @@ -2189,9 +2116,7 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2189 | (if (= 0 nest) ; we are out! | 2116 | (if (= 0 nest) ; we are out! |
| 2190 | (throw 'skip 1))) | 2117 | (throw 'skip 1))) |
| 2191 | ((match-end 1) ; the opener in reg, so we are deeper now | 2118 | ((match-end 1) ; the opener in reg, so we are deeper now |
| 2192 | (setq nest (1+ nest))))) | 2119 | (setq nest (1+ nest))))))))) |
| 2193 | ))) | ||
| 2194 | ) | ||
| 2195 | ((looking-at (concat | 2120 | ((looking-at (concat |
| 2196 | "\\(\\<\\(macro\\)?module\\>\\)\\|" | 2121 | "\\(\\<\\(macro\\)?module\\>\\)\\|" |
| 2197 | "\\(\\<primitive\\>\\)\\|" | 2122 | "\\(\\<primitive\\>\\)\\|" |
| @@ -2221,9 +2146,7 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2221 | (goto-char st) | 2146 | (goto-char st) |
| 2222 | (if (= (following-char) ?\) ) | 2147 | (if (= (following-char) ?\) ) |
| 2223 | (forward-char 1) | 2148 | (forward-char 1) |
| 2224 | (forward-sexp 1))) | 2149 | (forward-sexp 1)))))) |
| 2225 | ) ;; cond | ||
| 2226 | )) | ||
| 2227 | 2150 | ||
| 2228 | (defun verilog-declaration-beg () | 2151 | (defun verilog-declaration-beg () |
| 2229 | (verilog-re-search-backward verilog-declaration-re (bobp) t)) | 2152 | (verilog-re-search-backward verilog-declaration-re (bobp) t)) |
| @@ -2238,8 +2161,7 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2238 | (list | 2161 | (list |
| 2239 | ;; Fontify things in translate off regions | 2162 | ;; Fontify things in translate off regions |
| 2240 | '(verilog-match-translate-off | 2163 | '(verilog-match-translate-off |
| 2241 | (0 'verilog-font-lock-translate-off-face prepend)) | 2164 | (0 'verilog-font-lock-translate-off-face prepend)))))) |
| 2242 | )))) | ||
| 2243 | (put 'verilog-mode 'font-lock-defaults | 2165 | (put 'verilog-mode 'font-lock-defaults |
| 2244 | '((verilog-font-lock-keywords | 2166 | '((verilog-font-lock-keywords |
| 2245 | verilog-font-lock-keywords-1 | 2167 | verilog-font-lock-keywords-1 |
| @@ -2253,23 +2175,7 @@ Use filename, if current buffer being edited shorten to just buffer name." | |||
| 2253 | 2175 | ||
| 2254 | ;; initialize fontification for Verilog Mode | 2176 | ;; initialize fontification for Verilog Mode |
| 2255 | (verilog-font-lock-init) | 2177 | (verilog-font-lock-init) |
| 2256 | ;; start up message | 2178 | |
| 2257 | (defconst verilog-startup-message-lines | ||
| 2258 | '("Please use \\[verilog-submit-bug-report] to report bugs." | ||
| 2259 | "Visit http://www.verilog.com to check for updates" | ||
| 2260 | )) | ||
| 2261 | (defvar verilog-startup-message-displayed t) | ||
| 2262 | (defun verilog-display-startup-message () | ||
| 2263 | (if (not verilog-startup-message-displayed) | ||
| 2264 | (if (sit-for 5) | ||
| 2265 | (let ((lines verilog-startup-message-lines)) | ||
| 2266 | (message "verilog-mode version %s, released %s; type \\[describe-mode] for help" | ||
| 2267 | verilog-mode-version verilog-mode-release-date) | ||
| 2268 | (setq verilog-startup-message-displayed t) | ||
| 2269 | (while (and (sit-for 4) lines) | ||
| 2270 | (message (substitute-command-keys (car lines))) | ||
| 2271 | (setq lines (cdr lines))))) | ||
| 2272 | (message ""))) | ||
| 2273 | ;; | 2179 | ;; |
| 2274 | ;; | 2180 | ;; |
| 2275 | ;; Mode | 2181 | ;; Mode |
| @@ -2409,14 +2315,10 @@ Key bindings specific to `verilog-mode-map' are: | |||
| 2409 | (setq major-mode 'verilog-mode) | 2315 | (setq major-mode 'verilog-mode) |
| 2410 | (setq mode-name "Verilog") | 2316 | (setq mode-name "Verilog") |
| 2411 | (setq local-abbrev-table verilog-mode-abbrev-table) | 2317 | (setq local-abbrev-table verilog-mode-abbrev-table) |
| 2412 | (setq verilog-mode-syntax-table (make-syntax-table)) | 2318 | (set (make-local-variable 'beginning-of-defun-function) |
| 2413 | (verilog-populate-syntax-table verilog-mode-syntax-table) | ||
| 2414 | (set (make-local-variable 'beginning-of-defun-function) | ||
| 2415 | 'verilog-beg-of-defun) | 2319 | 'verilog-beg-of-defun) |
| 2416 | (set (make-local-variable 'end-of-defun-function) | 2320 | (set (make-local-variable 'end-of-defun-function) |
| 2417 | 'verilog-end-of-defun) | 2321 | 'verilog-end-of-defun) |
| 2418 | ;; add extra comment syntax | ||
| 2419 | (verilog-setup-dual-comments verilog-mode-syntax-table) | ||
| 2420 | (set-syntax-table verilog-mode-syntax-table) | 2322 | (set-syntax-table verilog-mode-syntax-table) |
| 2421 | (make-local-variable 'indent-line-function) | 2323 | (make-local-variable 'indent-line-function) |
| 2422 | (setq indent-line-function 'verilog-indent-line-relative) | 2324 | (setq indent-line-function 'verilog-indent-line-relative) |
| @@ -2444,8 +2346,8 @@ Key bindings specific to `verilog-mode-map' are: | |||
| 2444 | (not (assoc "Verilog" current-menubar))) | 2346 | (not (assoc "Verilog" current-menubar))) |
| 2445 | ;; (set-buffer-menubar (copy-sequence current-menubar)) | 2347 | ;; (set-buffer-menubar (copy-sequence current-menubar)) |
| 2446 | (add-submenu nil verilog-xemacs-menu) | 2348 | (add-submenu nil verilog-xemacs-menu) |
| 2447 | (add-submenu nil verilog-stmt-menu) | 2349 | (add-submenu nil verilog-stmt-menu))) |
| 2448 | )) | 2350 | |
| 2449 | ;; Stuff for GNU emacs | 2351 | ;; Stuff for GNU emacs |
| 2450 | (set (make-local-variable 'font-lock-defaults) | 2352 | (set (make-local-variable 'font-lock-defaults) |
| 2451 | '((verilog-font-lock-keywords verilog-font-lock-keywords-1 | 2353 | '((verilog-font-lock-keywords verilog-font-lock-keywords-1 |
| @@ -2472,8 +2374,6 @@ Key bindings specific to `verilog-mode-map' are: | |||
| 2472 | (cons '(verilog-mode-mode "\\<begin\\>" "\\<end\\>" nil | 2374 | (cons '(verilog-mode-mode "\\<begin\\>" "\\<end\\>" nil |
| 2473 | verilog-forward-sexp-function) | 2375 | verilog-forward-sexp-function) |
| 2474 | hs-special-modes-alist))) | 2376 | hs-special-modes-alist))) |
| 2475 | ;; Display version splash information. | ||
| 2476 | (verilog-display-startup-message) | ||
| 2477 | 2377 | ||
| 2478 | ;; Stuff for autos | 2378 | ;; Stuff for autos |
| 2479 | (add-hook 'write-contents-hooks 'verilog-auto-save-check) ; already local | 2379 | (add-hook 'write-contents-hooks 'verilog-auto-save-check) ; already local |
| @@ -2527,27 +2427,19 @@ With optional ARG, remove existing end of line comments." | |||
| 2527 | (progn | 2427 | (progn |
| 2528 | (end-of-line) | 2428 | (end-of-line) |
| 2529 | (delete-horizontal-space) | 2429 | (delete-horizontal-space) |
| 2530 | 't | 2430 | 't))) |
| 2531 | ) | ||
| 2532 | ) | ||
| 2533 | ) | ||
| 2534 | ;; see if we should line up assignments | 2431 | ;; see if we should line up assignments |
| 2535 | (progn | 2432 | (progn |
| 2536 | (if (or (memq 'all verilog-auto-lineup) | 2433 | (if (or (memq 'all verilog-auto-lineup) |
| 2537 | (memq 'assignments verilog-auto-lineup)) | 2434 | (memq 'assignments verilog-auto-lineup)) |
| 2538 | (verilog-pretty-expr) | 2435 | (verilog-pretty-expr)) |
| 2539 | ) | 2436 | (newline)) |
| 2540 | (newline) | 2437 | (forward-line 1)) |
| 2541 | ) | ||
| 2542 | (forward-line 1) | ||
| 2543 | ) | ||
| 2544 | ;; Indent next line | 2438 | ;; Indent next line |
| 2545 | (if verilog-auto-indent-on-newline | 2439 | (if verilog-auto-indent-on-newline |
| 2546 | (verilog-indent-line)) | 2440 | (verilog-indent-line))) |
| 2547 | ) | ||
| 2548 | (t | 2441 | (t |
| 2549 | (newline)) | 2442 | (newline))))) |
| 2550 | ))) | ||
| 2551 | 2443 | ||
| 2552 | (defun electric-verilog-terminate-and-indent () | 2444 | (defun electric-verilog-terminate-and-indent () |
| 2553 | "Insert a newline and indent for the next statement." | 2445 | "Insert a newline and indent for the next statement." |
| @@ -2565,8 +2457,7 @@ With optional ARG, remove existing end of line comments." | |||
| 2565 | (save-excursion | 2457 | (save-excursion |
| 2566 | (beginning-of-line) | 2458 | (beginning-of-line) |
| 2567 | (verilog-forward-ws&directives) | 2459 | (verilog-forward-ws&directives) |
| 2568 | (verilog-indent-line) | 2460 | (verilog-indent-line)) |
| 2569 | ) | ||
| 2570 | (if (and verilog-auto-newline | 2461 | (if (and verilog-auto-newline |
| 2571 | (not (verilog-parenthesis-depth))) | 2462 | (not (verilog-parenthesis-depth))) |
| 2572 | (electric-verilog-terminate-line)))) | 2463 | (electric-verilog-terminate-line)))) |
| @@ -2648,9 +2539,7 @@ With optional ARG, remove existing end of line comments." | |||
| 2648 | (re-search-forward comment-start-skip oldpnt 'move) | 2539 | (re-search-forward comment-start-skip oldpnt 'move) |
| 2649 | (goto-char (match-beginning 0)) | 2540 | (goto-char (match-beginning 0)) |
| 2650 | (skip-chars-backward " \t") | 2541 | (skip-chars-backward " \t") |
| 2651 | (kill-region (point) oldpnt) | 2542 | (kill-region (point) oldpnt)))))) |
| 2652 | )))) | ||
| 2653 | ) | ||
| 2654 | (progn (insert "\t")))) | 2543 | (progn (insert "\t")))) |
| 2655 | 2544 | ||
| 2656 | 2545 | ||
| @@ -2690,7 +2579,7 @@ To call this from the command line, see \\[verilog-batch-indent]." | |||
| 2690 | (insert " * ")) | 2579 | (insert " * ")) |
| 2691 | 2580 | ||
| 2692 | (defun verilog-insert-1 (fmt max) | 2581 | (defun verilog-insert-1 (fmt max) |
| 2693 | "Insert integers 0 to MAX-1 according to format string FMT. | 2582 | "Use format string FMT to insert integers 0 to MAX - 1. |
| 2694 | Inserts one integer per line, at the current column. Stops early | 2583 | Inserts one integer per line, at the current column. Stops early |
| 2695 | if it reaches the end of the buffer." | 2584 | if it reaches the end of the buffer." |
| 2696 | (let ((col (current-column)) | 2585 | (let ((col (current-column)) |
| @@ -2724,7 +2613,7 @@ located after the first 'a' gives: | |||
| 2724 | a = b a[ 7] = b | 2613 | a = b a[ 7] = b |
| 2725 | a = b a[ 8] = b" | 2614 | a = b a[ 8] = b" |
| 2726 | 2615 | ||
| 2727 | (interactive "NMAX? ") | 2616 | (interactive "NMAX: ") |
| 2728 | (verilog-insert-1 "[%3d]" max)) | 2617 | (verilog-insert-1 "[%3d]" max)) |
| 2729 | 2618 | ||
| 2730 | (defun verilog-generate-numbers (max) | 2619 | (defun verilog-generate-numbers (max) |
| @@ -2744,19 +2633,20 @@ following code fragment: | |||
| 2744 | buf buf buf buf007 | 2633 | buf buf buf buf007 |
| 2745 | buf buf buf buf008" | 2634 | buf buf buf buf008" |
| 2746 | 2635 | ||
| 2747 | (interactive "NMAX? ") | 2636 | (interactive "NMAX: ") |
| 2748 | (verilog-insert-1 "%3.3d" max)) | 2637 | (verilog-insert-1 "%3.3d" max)) |
| 2749 | 2638 | ||
| 2750 | (defun verilog-mark-defun () | 2639 | (defun verilog-mark-defun () |
| 2751 | "Mark the current verilog function (or procedure). | 2640 | "Mark the current verilog function (or procedure). |
| 2752 | This puts the mark at the end, and point at the beginning." | 2641 | This puts the mark at the end, and point at the beginning." |
| 2753 | (interactive) | 2642 | (interactive) |
| 2754 | (push-mark (point)) | 2643 | (when (featurep 'xemacs) |
| 2755 | (verilog-end-of-defun) | 2644 | (push-mark (point)) |
| 2756 | (push-mark (point)) | 2645 | (verilog-end-of-defun) |
| 2757 | (verilog-beg-of-defun) | 2646 | (push-mark (point)) |
| 2758 | (if (fboundp 'zmacs-activate-region) | 2647 | (verilog-beg-of-defun) |
| 2759 | (zmacs-activate-region))) | 2648 | (if (fboundp 'zmacs-activate-region) |
| 2649 | (zmacs-activate-region)))) | ||
| 2760 | 2650 | ||
| 2761 | (defun verilog-comment-region (start end) | 2651 | (defun verilog-comment-region (start end) |
| 2762 | ; checkdoc-params: (start end) | 2652 | ; checkdoc-params: (start end) |
| @@ -2792,8 +2682,7 @@ The commented area starts with `verilog-exclude-str-start', and ends with | |||
| 2792 | (save-excursion | 2682 | (save-excursion |
| 2793 | (let ((s+1 (1+ start))) | 2683 | (let ((s+1 (1+ start))) |
| 2794 | (while (re-search-backward "/\\*" s+1 t) | 2684 | (while (re-search-backward "/\\*" s+1 t) |
| 2795 | (replace-match "/-*" t t)))) | 2685 | (replace-match "/-*" t t)))))) |
| 2796 | )) | ||
| 2797 | 2686 | ||
| 2798 | (defun verilog-uncomment-region () | 2687 | (defun verilog-uncomment-region () |
| 2799 | "Uncomment a commented area; change deformed comments back to normal. | 2688 | "Uncomment a commented area; change deformed comments back to normal. |
| @@ -2869,8 +2758,7 @@ With ARG, first kill any existing labels." | |||
| 2869 | (point-marker))) | 2758 | (point-marker))) |
| 2870 | (e (progn | 2759 | (e (progn |
| 2871 | (verilog-end-of-defun) | 2760 | (verilog-end-of-defun) |
| 2872 | (point-marker))) | 2761 | (point-marker)))) |
| 2873 | ) | ||
| 2874 | (goto-char (marker-position b)) | 2762 | (goto-char (marker-position b)) |
| 2875 | (if (> (- e b) 200) | 2763 | (if (> (- e b) 200) |
| 2876 | (message "Relabeling module...")) | 2764 | (message "Relabeling module...")) |
| @@ -2885,18 +2773,15 @@ With ARG, first kill any existing labels." | |||
| 2885 | (let ((indent-str (verilog-indent-line))) | 2773 | (let ((indent-str (verilog-indent-line))) |
| 2886 | (verilog-set-auto-endcomments indent-str 't) | 2774 | (verilog-set-auto-endcomments indent-str 't) |
| 2887 | (end-of-line) | 2775 | (end-of-line) |
| 2888 | (delete-horizontal-space) | 2776 | (delete-horizontal-space)) |
| 2889 | ) | ||
| 2890 | (setq cnt (1+ cnt)) | 2777 | (setq cnt (1+ cnt)) |
| 2891 | (if (= 9 (% cnt 10)) | 2778 | (if (= 9 (% cnt 10)) |
| 2892 | (message "%d..." cnt)) | 2779 | (message "%d..." cnt))) |
| 2893 | ) | ||
| 2894 | (goto-char oldpos) | 2780 | (goto-char oldpos) |
| 2895 | (if (or | 2781 | (if (or |
| 2896 | (> (- e b) 200) | 2782 | (> (- e b) 200) |
| 2897 | (> cnt 20)) | 2783 | (> cnt 20)) |
| 2898 | (message "%d lines auto commented" cnt)) | 2784 | (message "%d lines auto commented" cnt)))) |
| 2899 | )) | ||
| 2900 | 2785 | ||
| 2901 | (defun verilog-beg-of-statement () | 2786 | (defun verilog-beg-of-statement () |
| 2902 | "Move backward to beginning of statement." | 2787 | "Move backward to beginning of statement." |
| @@ -2919,15 +2804,13 @@ With ARG, first kill any existing labels." | |||
| 2919 | (looking-at verilog-extended-complete-re) | 2804 | (looking-at verilog-extended-complete-re) |
| 2920 | (not (save-excursion | 2805 | (not (save-excursion |
| 2921 | (verilog-backward-token) | 2806 | (verilog-backward-token) |
| 2922 | (looking-at verilog-extended-complete-re))) | 2807 | (looking-at verilog-extended-complete-re)))) |
| 2923 | ) | ||
| 2924 | (looking-at verilog-basic-complete-re) | 2808 | (looking-at verilog-basic-complete-re) |
| 2925 | (save-excursion | 2809 | (save-excursion |
| 2926 | (verilog-backward-token) | 2810 | (verilog-backward-token) |
| 2927 | (or | 2811 | (or |
| 2928 | (looking-at verilog-end-block-re) | 2812 | (looking-at verilog-end-block-re) |
| 2929 | (looking-at verilog-preprocessor-re))) | 2813 | (looking-at verilog-preprocessor-re))))) |
| 2930 | )) | ||
| 2931 | (verilog-backward-syntactic-ws) | 2814 | (verilog-backward-syntactic-ws) |
| 2932 | (verilog-backward-token)) | 2815 | (verilog-backward-token)) |
| 2933 | ;; Now point is where the previous line ended. | 2816 | ;; Now point is where the previous line ended. |
| @@ -3011,9 +2894,9 @@ more specifically, point @ in the line foo : @ begin" | |||
| 3011 | (throw 'found 1)) | 2894 | (throw 'found 1)) |
| 3012 | (setq nest (1- nest))) | 2895 | (setq nest (1- nest))) |
| 3013 | (t | 2896 | (t |
| 3014 | (throw 'found (= nest 0))) | 2897 | (throw 'found (= nest 0))))))) |
| 3015 | )))) | ||
| 3016 | nil))) | 2898 | nil))) |
| 2899 | |||
| 3017 | (defun verilog-in-struct-region-p () | 2900 | (defun verilog-in-struct-region-p () |
| 3018 | "Return TRUE if in a struct region; | 2901 | "Return TRUE if in a struct region; |
| 3019 | more specifically, in a list after a struct|union keyword" | 2902 | more specifically, in a list after a struct|union keyword" |
| @@ -3024,20 +2907,14 @@ more specifically, in a list after a struct|union keyword" | |||
| 3024 | (if depth | 2907 | (if depth |
| 3025 | (progn (backward-up-list depth) | 2908 | (progn (backward-up-list depth) |
| 3026 | (verilog-beg-of-statement) | 2909 | (verilog-beg-of-statement) |
| 3027 | (looking-at "\\<typedef\\>?\\s-*\\<struct\\|union\\>") | 2910 | (looking-at "\\<typedef\\>?\\s-*\\<struct\\|union\\>")))))) |
| 3028 | ) | ||
| 3029 | ) | ||
| 3030 | ) | ||
| 3031 | ) | ||
| 3032 | ) | ||
| 3033 | 2911 | ||
| 3034 | (defun verilog-in-generate-region-p () | 2912 | (defun verilog-in-generate-region-p () |
| 3035 | "Return TRUE if in a generate region; | 2913 | "Return TRUE if in a generate region; |
| 3036 | more specifically, after a generate and before an endgenerate" | 2914 | more specifically, after a generate and before an endgenerate" |
| 3037 | (interactive) | 2915 | (interactive) |
| 3038 | (let ((lim (save-excursion (verilog-beg-of-defun) (point))) | 2916 | (let ((lim (save-excursion (verilog-beg-of-defun) (point))) |
| 3039 | (nest 1) | 2917 | (nest 1)) |
| 3040 | ) | ||
| 3041 | (save-excursion | 2918 | (save-excursion |
| 3042 | (while (and | 2919 | (while (and |
| 3043 | (/= nest 0) | 2920 | (/= nest 0) |
| @@ -3046,17 +2923,14 @@ more specifically, after a generate and before an endgenerate" | |||
| 3046 | ((match-end 1) ; generate | 2923 | ((match-end 1) ; generate |
| 3047 | (setq nest (1- nest))) | 2924 | (setq nest (1- nest))) |
| 3048 | ((match-end 2) ; endgenerate | 2925 | ((match-end 2) ; endgenerate |
| 3049 | (setq nest (1+ nest))) | 2926 | (setq nest (1+ nest))))))) |
| 3050 | )) | ||
| 3051 | )) | ||
| 3052 | (= nest 0) )) ; return nest | 2927 | (= nest 0) )) ; return nest |
| 3053 | 2928 | ||
| 3054 | (defun verilog-in-fork-region-p () | 2929 | (defun verilog-in-fork-region-p () |
| 3055 | "Return true if between a fork and join." | 2930 | "Return true if between a fork and join." |
| 3056 | (interactive) | 2931 | (interactive) |
| 3057 | (let ((lim (save-excursion (verilog-beg-of-defun) (point))) | 2932 | (let ((lim (save-excursion (verilog-beg-of-defun) (point))) |
| 3058 | (nest 1) | 2933 | (nest 1)) |
| 3059 | ) | ||
| 3060 | (save-excursion | 2934 | (save-excursion |
| 3061 | (while (and | 2935 | (while (and |
| 3062 | (/= nest 0) | 2936 | (/= nest 0) |
| @@ -3065,9 +2939,7 @@ more specifically, after a generate and before an endgenerate" | |||
| 3065 | ((match-end 1) ; fork | 2939 | ((match-end 1) ; fork |
| 3066 | (setq nest (1- nest))) | 2940 | (setq nest (1- nest))) |
| 3067 | ((match-end 2) ; join | 2941 | ((match-end 2) ; join |
| 3068 | (setq nest (1+ nest))) | 2942 | (setq nest (1+ nest))))))) |
| 3069 | )) | ||
| 3070 | )) | ||
| 3071 | (= nest 0) )) ; return nest | 2943 | (= nest 0) )) ; return nest |
| 3072 | 2944 | ||
| 3073 | (defun verilog-backward-case-item (lim) | 2945 | (defun verilog-backward-case-item (lim) |
| @@ -3099,8 +2971,7 @@ Limit search to point LIM." | |||
| 3099 | (setq colon (1- colon))) | 2971 | (setq colon (1- colon))) |
| 3100 | 2972 | ||
| 3101 | ((match-end 3) ;; : | 2973 | ((match-end 3) ;; : |
| 3102 | (setq colon (1+ colon))) | 2974 | (setq colon (1+ colon))))) |
| 3103 | )) | ||
| 3104 | ;; Skip back to beginning of case item | 2975 | ;; Skip back to beginning of case item |
| 3105 | (skip-chars-backward "\t ") | 2976 | (skip-chars-backward "\t ") |
| 3106 | (verilog-skip-backward-comment-or-string) | 2977 | (verilog-skip-backward-comment-or-string) |
| @@ -3123,10 +2994,8 @@ Limit search to point LIM." | |||
| 3123 | (t | 2994 | (t |
| 3124 | (goto-char (match-end 0)) | 2995 | (goto-char (match-end 0)) |
| 3125 | (verilog-forward-ws&directives) | 2996 | (verilog-forward-ws&directives) |
| 3126 | (point)) | 2997 | (point)))) |
| 3127 | )) | 2998 | (error "Malformed case item")))) |
| 3128 | (error "Malformed case item") | ||
| 3129 | ))) | ||
| 3130 | (setq str (buffer-substring b e)) | 2999 | (setq str (buffer-substring b e)) |
| 3131 | (if | 3000 | (if |
| 3132 | (setq e | 3001 | (setq e |
| @@ -3178,8 +3047,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3178 | (search-backward "//" (verilog-get-beg-of-line) t))))) | 3047 | (search-backward "//" (verilog-get-beg-of-line) t))))) |
| 3179 | (let ((nest 1) b e | 3048 | (let ((nest 1) b e |
| 3180 | m | 3049 | m |
| 3181 | (else (if (match-end 2) "!" " ")) | 3050 | (else (if (match-end 2) "!" " "))) |
| 3182 | ) | ||
| 3183 | (end-of-line) | 3051 | (end-of-line) |
| 3184 | (if kill-existing-comment | 3052 | (if kill-existing-comment |
| 3185 | (verilog-kill-existing-comment)) | 3053 | (verilog-kill-existing-comment)) |
| @@ -3199,8 +3067,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3199 | ((match-end 4) ; `ifdef | 3067 | ((match-end 4) ; `ifdef |
| 3200 | (setq nest (1- nest))) | 3068 | (setq nest (1- nest))) |
| 3201 | ((match-end 5) ; `ifndef | 3069 | ((match-end 5) ; `ifndef |
| 3202 | (setq nest (1- nest))) | 3070 | (setq nest (1- nest))))) |
| 3203 | )) | ||
| 3204 | (if (match-end 0) | 3071 | (if (match-end 0) |
| 3205 | (setq | 3072 | (setq |
| 3206 | m (buffer-substring | 3073 | m (buffer-substring |
| @@ -3212,15 +3079,13 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3212 | (point)) | 3079 | (point)) |
| 3213 | e (progn | 3080 | e (progn |
| 3214 | (skip-chars-forward "a-zA-Z0-9_") | 3081 | (skip-chars-forward "a-zA-Z0-9_") |
| 3215 | (point) | 3082 | (point))))) |
| 3216 | )))) | ||
| 3217 | (if b | 3083 | (if b |
| 3218 | (if (> (count-lines (point) b) verilog-minimum-comment-distance) | 3084 | (if (> (count-lines (point) b) verilog-minimum-comment-distance) |
| 3219 | (insert (concat " // " else m " " (buffer-substring b e)))) | 3085 | (insert (concat " // " else m " " (buffer-substring b e)))) |
| 3220 | (progn | 3086 | (progn |
| 3221 | (insert " // unmatched `else or `endif") | 3087 | (insert " // unmatched `else or `endif") |
| 3222 | (ding 't)) | 3088 | (ding 't))))) |
| 3223 | ))) | ||
| 3224 | 3089 | ||
| 3225 | (; Comment close case/class/function/task/module and named block | 3090 | (; Comment close case/class/function/task/module and named block |
| 3226 | (and (looking-at "\\<end") | 3091 | (and (looking-at "\\<end") |
| @@ -3269,8 +3134,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3269 | (err 't) | 3134 | (err 't) |
| 3270 | (here (point)) | 3135 | (here (point)) |
| 3271 | there | 3136 | there |
| 3272 | cntx | 3137 | cntx) |
| 3273 | ) | ||
| 3274 | (save-excursion | 3138 | (save-excursion |
| 3275 | (verilog-leap-to-head) | 3139 | (verilog-leap-to-head) |
| 3276 | (setq there (point)) | 3140 | (setq there (point)) |
| @@ -3282,12 +3146,10 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3282 | (verilog-kill-existing-comment)) | 3146 | (verilog-kill-existing-comment)) |
| 3283 | (delete-horizontal-space) | 3147 | (delete-horizontal-space) |
| 3284 | (insert str) | 3148 | (insert str) |
| 3285 | (ding 't) | 3149 | (ding 't)) |
| 3286 | ) | ||
| 3287 | (let ((lim | 3150 | (let ((lim |
| 3288 | (save-excursion (verilog-beg-of-defun) (point))) | 3151 | (save-excursion (verilog-beg-of-defun) (point))) |
| 3289 | (here (point)) | 3152 | (here (point))) |
| 3290 | ) | ||
| 3291 | (cond | 3153 | (cond |
| 3292 | (;-- handle named block differently | 3154 | (;-- handle named block differently |
| 3293 | (looking-at verilog-named-block-re) | 3155 | (looking-at verilog-named-block-re) |
| @@ -3336,8 +3198,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3336 | (;- else | 3198 | (;- else |
| 3337 | (match-end 4) | 3199 | (match-end 4) |
| 3338 | (let ((nest 0) | 3200 | (let ((nest 0) |
| 3339 | ( reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)") | 3201 | ( reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)")) |
| 3340 | ) | ||
| 3341 | (catch 'skip | 3202 | (catch 'skip |
| 3342 | (while (verilog-re-search-backward reg nil 'move) | 3203 | (while (verilog-re-search-backward reg nil 'move) |
| 3343 | (cond | 3204 | (cond |
| @@ -3353,16 +3214,13 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3353 | (setq err nil) | 3214 | (setq err nil) |
| 3354 | (setq str (verilog-get-expr)) | 3215 | (setq str (verilog-get-expr)) |
| 3355 | (setq str (concat " // else: !if" str )) | 3216 | (setq str (concat " // else: !if" str )) |
| 3356 | (throw 'skip 1)) | 3217 | (throw 'skip 1))))))))) |
| 3357 | ))) | ||
| 3358 | )))) | ||
| 3359 | 3218 | ||
| 3360 | (;- end else | 3219 | (;- end else |
| 3361 | (match-end 5) | 3220 | (match-end 5) |
| 3362 | (goto-char there) | 3221 | (goto-char there) |
| 3363 | (let ((nest 0) | 3222 | (let ((nest 0) |
| 3364 | ( reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)") | 3223 | (reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)\\|\\(\\<if\\>\\)")) |
| 3365 | ) | ||
| 3366 | (catch 'skip | 3224 | (catch 'skip |
| 3367 | (while (verilog-re-search-backward reg nil 'move) | 3225 | (while (verilog-re-search-backward reg nil 'move) |
| 3368 | (cond | 3226 | (cond |
| @@ -3378,9 +3236,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3378 | (setq err nil) | 3236 | (setq err nil) |
| 3379 | (setq str (verilog-get-expr)) | 3237 | (setq str (verilog-get-expr)) |
| 3380 | (setq str (concat " // else: !if" str )) | 3238 | (setq str (concat " // else: !if" str )) |
| 3381 | (throw 'skip 1)) | 3239 | (throw 'skip 1))))))))) |
| 3382 | ))) | ||
| 3383 | )))) | ||
| 3384 | 3240 | ||
| 3385 | (;- task/function/initial et cetera | 3241 | (;- task/function/initial et cetera |
| 3386 | t | 3242 | t |
| @@ -3392,8 +3248,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3392 | (setq str (concat " // " cntx str ))) | 3248 | (setq str (concat " // " cntx str ))) |
| 3393 | 3249 | ||
| 3394 | (;-- otherwise... | 3250 | (;-- otherwise... |
| 3395 | (setq str " // auto-endcomment confused ")) | 3251 | (setq str " // auto-endcomment confused ")))) |
| 3396 | )) | ||
| 3397 | 3252 | ||
| 3398 | ((and | 3253 | ((and |
| 3399 | (verilog-in-case-region-p) ;-- handle case item differently | 3254 | (verilog-in-case-region-p) ;-- handle case item differently |
| @@ -3431,9 +3286,8 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3431 | (match-end 11) ;; of verilog-end-block-ordered-re | 3286 | (match-end 11) ;; of verilog-end-block-ordered-re |
| 3432 | ;;(goto-char there) | 3287 | ;;(goto-char there) |
| 3433 | (let ((nest 0) | 3288 | (let ((nest 0) |
| 3434 | ( reg "\\<\\(class\\)\\|\\(endclass\\)\\|\\(package\\|primitive\\|\\(macro\\)?module\\)\\>") | 3289 | (reg "\\<\\(class\\)\\|\\(endclass\\)\\|\\(package\\|primitive\\|\\(macro\\)?module\\)\\>") |
| 3435 | string | 3290 | string) |
| 3436 | ) | ||
| 3437 | (save-excursion | 3291 | (save-excursion |
| 3438 | (catch 'skip | 3292 | (catch 'skip |
| 3439 | (while (verilog-re-search-backward reg nil 'move) | 3293 | (while (verilog-re-search-backward reg nil 'move) |
| @@ -3463,8 +3317,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3463 | (throw 'skip 1)))) | 3317 | (throw 'skip 1)))) |
| 3464 | )))) | 3318 | )))) |
| 3465 | (end-of-line) | 3319 | (end-of-line) |
| 3466 | (insert (concat " // " string ))) | 3320 | (insert (concat " // " string )))) |
| 3467 | ) | ||
| 3468 | 3321 | ||
| 3469 | (;- this is end{function,generate,task,module,primitive,table,generate} | 3322 | (;- this is end{function,generate,task,module,primitive,table,generate} |
| 3470 | ;- which can not be nested. | 3323 | ;- which can not be nested. |
| @@ -3479,8 +3332,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3479 | (cond | 3332 | (cond |
| 3480 | ((match-end 5) ;; of verilog-end-block-ordered-re | 3333 | ((match-end 5) ;; of verilog-end-block-ordered-re |
| 3481 | (setq reg "\\(\\<function\\>\\)\\|\\(\\<\\(endfunction\\|task\\|\\(macro\\)?module\\|primitive\\)\\>\\)") | 3334 | (setq reg "\\(\\<function\\>\\)\\|\\(\\<\\(endfunction\\|task\\|\\(macro\\)?module\\|primitive\\)\\>\\)") |
| 3482 | (setq width "\\(\\s-*\\(\\[[^]]*\\]\\)\\|\\(real\\(time\\)?\\)\\|\\(integer\\)\\|\\(time\\)\\)?") | 3335 | (setq width "\\(\\s-*\\(\\[[^]]*\\]\\)\\|\\(real\\(time\\)?\\)\\|\\(integer\\)\\|\\(time\\)\\)?")) |
| 3483 | ) | ||
| 3484 | ((match-end 6) ;; of verilog-end-block-ordered-re | 3336 | ((match-end 6) ;; of verilog-end-block-ordered-re |
| 3485 | (setq reg "\\(\\<task\\>\\)\\|\\(\\<\\(endtask\\|function\\|\\(macro\\)?module\\|primitive\\)\\>\\)")) | 3337 | (setq reg "\\(\\<task\\>\\)\\|\\(\\<\\(endtask\\|function\\|\\(macro\\)?module\\|primitive\\)\\>\\)")) |
| 3486 | ((match-end 7) ;; of verilog-end-block-ordered-re | 3338 | ((match-end 7) ;; of verilog-end-block-ordered-re |
| @@ -3502,8 +3354,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3502 | ((match-end 15) ;; of verilog-end-block-ordered-re | 3354 | ((match-end 15) ;; of verilog-end-block-ordered-re |
| 3503 | (setq reg "\\(\\<clocking\\>\\)\\|\\<endclocking\\>")) | 3355 | (setq reg "\\(\\<clocking\\>\\)\\|\\<endclocking\\>")) |
| 3504 | 3356 | ||
| 3505 | (t (error "Problem in verilog-set-auto-endcomments")) | 3357 | (t (error "Problem in verilog-set-auto-endcomments"))) |
| 3506 | ) | ||
| 3507 | (let (b e) | 3358 | (let (b e) |
| 3508 | (save-excursion | 3359 | (save-excursion |
| 3509 | (verilog-re-search-backward reg nil 'move) | 3360 | (verilog-re-search-backward reg nil 'move) |
| @@ -3515,8 +3366,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3515 | (if (and width (looking-at width)) | 3366 | (if (and width (looking-at width)) |
| 3516 | (progn | 3367 | (progn |
| 3517 | (goto-char (match-end 0)) | 3368 | (goto-char (match-end 0)) |
| 3518 | (verilog-forward-ws&directives) | 3369 | (verilog-forward-ws&directives))) |
| 3519 | )) | ||
| 3520 | (point)) | 3370 | (point)) |
| 3521 | e (progn | 3371 | e (progn |
| 3522 | (skip-chars-forward "a-zA-Z0-9_") | 3372 | (skip-chars-forward "a-zA-Z0-9_") |
| @@ -3577,8 +3427,7 @@ Insert `// NAME ' if this line ends a function, task, module, primitive or inter | |||
| 3577 | b) | 3427 | b) |
| 3578 | ('t | 3428 | ('t |
| 3579 | (skip-chars-forward "^: \t\n\f") | 3429 | (skip-chars-forward "^: \t\n\f") |
| 3580 | (point) | 3430 | (point))))) |
| 3581 | )))) | ||
| 3582 | (str (buffer-substring b e))) | 3431 | (str (buffer-substring b e))) |
| 3583 | (if (setq e (string-match "[ \t]*\\(\\(\n\\)\\|\\(//\\)\\|\\(/\\*\\)\\)" str)) | 3432 | (if (setq e (string-match "[ \t]*\\(\\(\n\\)\\|\\(//\\)\\|\\(/\\*\\)\\)" str)) |
| 3584 | (setq str (concat (substring str 0 e) "..."))) | 3433 | (setq str (concat (substring str 0 e) "..."))) |
| @@ -3601,8 +3450,8 @@ Useful for creating tri's and other expanded fields." | |||
| 3601 | (concat "\\(.*\\)" | 3450 | (concat "\\(.*\\)" |
| 3602 | (regexp-quote bra) | 3451 | (regexp-quote bra) |
| 3603 | "\\([0-9]*\\)\\(:[0-9]*\\|\\)\\(::[0-9---]*\\|\\)" | 3452 | "\\([0-9]*\\)\\(:[0-9]*\\|\\)\\(::[0-9---]*\\|\\)" |
| 3604 | (regexp-quote ket) | 3453 | (regexp-quote ket) |
| 3605 | "\\(.*\\)$") signal-string) | 3454 | "\\(.*\\)$") signal-string) |
| 3606 | (let* ((sig-head (match-string 1 signal-string)) | 3455 | (let* ((sig-head (match-string 1 signal-string)) |
| 3607 | (vec-start (string-to-number (match-string 2 signal-string))) | 3456 | (vec-start (string-to-number (match-string 2 signal-string))) |
| 3608 | (vec-end (if (= (match-beginning 3) (match-end 3)) | 3457 | (vec-end (if (= (match-beginning 3) (match-end 3)) |
| @@ -3765,8 +3614,7 @@ becomes: | |||
| 3765 | ))) | 3614 | ))) |
| 3766 | ((verilog-in-star-comment-p) | 3615 | ((verilog-in-star-comment-p) |
| 3767 | (re-search-backward "/\*") | 3616 | (re-search-backward "/\*") |
| 3768 | (insert (format " // surefire lint_off_line %6s" code )) | 3617 | (insert (format " // surefire lint_off_line %6s" code ))) |
| 3769 | ) | ||
| 3770 | (t | 3618 | (t |
| 3771 | (insert (format " // surefire lint_off_line %6s" code )) | 3619 | (insert (format " // surefire lint_off_line %6s" code )) |
| 3772 | ))))))))) | 3620 | ))))))))) |
| @@ -3823,11 +3671,11 @@ This lets programs calling batch mode to easily extract error messages." | |||
| 3823 | (setq default-major-mode `verilog-mode) | 3671 | (setq default-major-mode `verilog-mode) |
| 3824 | ;; Ditto files already read in | 3672 | ;; Ditto files already read in |
| 3825 | (mapc (lambda (buf) | 3673 | (mapc (lambda (buf) |
| 3826 | (when (buffer-file-name buf) | 3674 | (when (buffer-file-name buf) |
| 3827 | (save-excursion | 3675 | (save-excursion |
| 3828 | (set-buffer buf) | 3676 | (set-buffer buf) |
| 3829 | (verilog-mode)))) | 3677 | (verilog-mode)))) |
| 3830 | (buffer-list)) | 3678 | (buffer-list)) |
| 3831 | ;; Process the files | 3679 | ;; Process the files |
| 3832 | (mapcar '(lambda (buf) | 3680 | (mapcar '(lambda (buf) |
| 3833 | (when (buffer-file-name buf) | 3681 | (when (buffer-file-name buf) |
| @@ -3943,8 +3791,7 @@ type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)." | |||
| 3943 | (not (verilog-in-coverage)) | 3791 | (not (verilog-in-coverage)) |
| 3944 | (verilog-in-paren)) | 3792 | (verilog-in-paren)) |
| 3945 | (progn (setq par 1) | 3793 | (progn (setq par 1) |
| 3946 | (throw 'nesting 'block)) | 3794 | (throw 'nesting 'block))) |
| 3947 | ) | ||
| 3948 | 3795 | ||
| 3949 | ;; See if we are continuing a previous line | 3796 | ;; See if we are continuing a previous line |
| 3950 | (while t | 3797 | (while t |
| @@ -4026,8 +3873,7 @@ type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)." | |||
| 4026 | (setq reg "\\(\\<class\\>\\)\\|\\(\\<endclass\\>\\)" )) | 3873 | (setq reg "\\(\\<class\\>\\)\\|\\(\\<endclass\\>\\)" )) |
| 4027 | ((match-end 12) ; covergroup | 3874 | ((match-end 12) ; covergroup |
| 4028 | ;; Search back for matching covergroup | 3875 | ;; Search back for matching covergroup |
| 4029 | (setq reg "\\(\\<covergroup\\>\\)\\|\\(\\<endgroup\\>\\)" )) | 3876 | (setq reg "\\(\\<covergroup\\>\\)\\|\\(\\<endgroup\\>\\)" ))) |
| 4030 | ) | ||
| 4031 | (catch 'skip | 3877 | (catch 'skip |
| 4032 | (while (verilog-re-search-backward reg nil 'move) | 3878 | (while (verilog-re-search-backward reg nil 'move) |
| 4033 | (cond | 3879 | (cond |
| @@ -4037,11 +3883,8 @@ type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)." | |||
| 4037 | (throw 'skip 1))) | 3883 | (throw 'skip 1))) |
| 4038 | ((match-end 2) ; end | 3884 | ((match-end 2) ; end |
| 4039 | (setq nest (1+ nest))))) | 3885 | (setq nest (1+ nest))))) |
| 4040 | ) | 3886 | ))))))) |
| 4041 | )) | 3887 | (throw 'nesting (verilog-calc-1))) |
| 4042 | )))) | ||
| 4043 | (throw 'nesting (verilog-calc-1)) | ||
| 4044 | ) | ||
| 4045 | );; catch nesting | 3888 | );; catch nesting |
| 4046 | );; type | 3889 | );; type |
| 4047 | ) | 3890 | ) |
| @@ -4058,8 +3901,8 @@ type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)." | |||
| 4058 | ((eq type 'defun) | 3901 | ((eq type 'defun) |
| 4059 | (list type 0)) | 3902 | (list type 0)) |
| 4060 | (t | 3903 | (t |
| 4061 | (list type (verilog-current-indent-level))))) | 3904 | (list type (verilog-current-indent-level)))))))) |
| 4062 | ))) | 3905 | |
| 4063 | (defun verilog-wai () | 3906 | (defun verilog-wai () |
| 4064 | "Show matching nesting block for debugging." | 3907 | "Show matching nesting block for debugging." |
| 4065 | (interactive) | 3908 | (interactive) |
| @@ -4073,8 +3916,7 @@ type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)." | |||
| 4073 | (cond | 3916 | (cond |
| 4074 | ((equal (char-after) ?\{) | 3917 | ((equal (char-after) ?\{) |
| 4075 | (if (verilog-at-constraint-p) | 3918 | (if (verilog-at-constraint-p) |
| 4076 | (throw 'nesting 'block) | 3919 | (throw 'nesting 'block))) |
| 4077 | )) | ||
| 4078 | ((equal (char-after) ?\}) | 3920 | ((equal (char-after) ?\}) |
| 4079 | 3921 | ||
| 4080 | (let ((there (verilog-at-close-constraint-p))) | 3922 | (let ((there (verilog-at-close-constraint-p))) |
| @@ -4133,8 +3975,7 @@ type. Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)." | |||
| 4133 | For speed, the searcher looks at the last directive, not the indent | 3975 | For speed, the searcher looks at the last directive, not the indent |
| 4134 | of the appropriate enclosing block." | 3976 | of the appropriate enclosing block." |
| 4135 | (let ((base -1) ;; Indent of the line that determines our indentation | 3977 | (let ((base -1) ;; Indent of the line that determines our indentation |
| 4136 | (ind 0) ;; Relative offset caused by other directives (like `endif on same line as `else) | 3978 | (ind 0)) ;; Relative offset caused by other directives (like `endif on same line as `else) |
| 4137 | ) | ||
| 4138 | ;; Start at current location, scan back for another directive | 3979 | ;; Start at current location, scan back for another directive |
| 4139 | 3980 | ||
| 4140 | (save-excursion | 3981 | (save-excursion |
| @@ -4142,8 +3983,7 @@ of the appropriate enclosing block." | |||
| 4142 | (while (and (< base 0) | 3983 | (while (and (< base 0) |
| 4143 | (verilog-re-search-backward verilog-directive-re nil t)) | 3984 | (verilog-re-search-backward verilog-directive-re nil t)) |
| 4144 | (cond ((save-excursion (skip-chars-backward " \t") (bolp)) | 3985 | (cond ((save-excursion (skip-chars-backward " \t") (bolp)) |
| 4145 | (setq base (current-indentation)) | 3986 | (setq base (current-indentation)))) |
| 4146 | )) | ||
| 4147 | (cond ((and (looking-at verilog-directive-end) (< base 0)) ;; Only matters when not at BOL | 3987 | (cond ((and (looking-at verilog-directive-end) (< base 0)) ;; Only matters when not at BOL |
| 4148 | (setq ind (- ind verilog-indent-level-directive))) | 3988 | (setq ind (- ind verilog-indent-level-directive))) |
| 4149 | ((and (looking-at verilog-directive-middle) (>= base 0)) ;; Only matters when at BOL | 3989 | ((and (looking-at verilog-directive-middle) (>= base 0)) ;; Only matters when at BOL |
| @@ -4223,8 +4063,7 @@ from endcase to matching case, and so on." | |||
| 4223 | (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" )) | 4063 | (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" )) |
| 4224 | ((looking-at "\\<endclocking\\>") | 4064 | ((looking-at "\\<endclocking\\>") |
| 4225 | ;; 12: Search back for matching clocking | 4065 | ;; 12: Search back for matching clocking |
| 4226 | (setq reg "\\(\\<clocking\\)\\|\\(\\<endclocking\\>\\)" )) | 4066 | (setq reg "\\(\\<clocking\\)\\|\\(\\<endclocking\\>\\)" ))) |
| 4227 | ) | ||
| 4228 | (if reg | 4067 | (if reg |
| 4229 | (catch 'skip | 4068 | (catch 'skip |
| 4230 | (let (sreg) | 4069 | (let (sreg) |
| @@ -4268,9 +4107,7 @@ Set point to where line starts" | |||
| 4268 | (save-excursion | 4107 | (save-excursion |
| 4269 | (skip-chars-backward " \t") | 4108 | (skip-chars-backward " \t") |
| 4270 | (not (bolp)))) | 4109 | (not (bolp)))) |
| 4271 | (setq continued (verilog-backward-token)) | 4110 | (setq continued (verilog-backward-token))))) |
| 4272 | ) ;; while | ||
| 4273 | )) | ||
| 4274 | (setq continued nil)) | 4111 | (setq continued nil)) |
| 4275 | continued)) | 4112 | continued)) |
| 4276 | 4113 | ||
| @@ -4289,15 +4126,13 @@ Set point to where line starts" | |||
| 4289 | (= (preceding-char) ?\}) | 4126 | (= (preceding-char) ?\}) |
| 4290 | (progn | 4127 | (progn |
| 4291 | (backward-char) | 4128 | (backward-char) |
| 4292 | (verilog-at-close-constraint-p)) | 4129 | (verilog-at-close-constraint-p))) |
| 4293 | ) | ||
| 4294 | (;-- constraint foo { a = b } | 4130 | (;-- constraint foo { a = b } |
| 4295 | ; is a complete statement. *sigh* | 4131 | ; is a complete statement. *sigh* |
| 4296 | (= (preceding-char) ?\{) | 4132 | (= (preceding-char) ?\{) |
| 4297 | (progn | 4133 | (progn |
| 4298 | (backward-char) | 4134 | (backward-char) |
| 4299 | (not (verilog-at-constraint-p))) | 4135 | (not (verilog-at-constraint-p)))) |
| 4300 | ) | ||
| 4301 | (;-- Could be 'case (foo)' or 'always @(bar)' which is complete | 4136 | (;-- Could be 'case (foo)' or 'always @(bar)' which is complete |
| 4302 | ; also could be simply '@(foo)' | 4137 | ; also could be simply '@(foo)' |
| 4303 | ; or foo u1 #(a=8) | 4138 | ; or foo u1 #(a=8) |
| @@ -4322,10 +4157,8 @@ Set point to where line starts" | |||
| 4322 | (verilog-backward-token) | 4157 | (verilog-backward-token) |
| 4323 | (not (looking-at "\\<\\(always\\(_latch\\|_ff\\|_comb\\)?\\|initial\\|while\\)\\>")))) | 4158 | (not (looking-at "\\<\\(always\\(_latch\\|_ff\\|_comb\\)?\\|initial\\|while\\)\\>")))) |
| 4324 | ((= (preceding-char) ?\#) | 4159 | ((= (preceding-char) ?\#) |
| 4325 | (backward-char) | 4160 | (backward-char)) |
| 4326 | ) | 4161 | (t t))))))) |
| 4327 | (t t)) | ||
| 4328 | ))))) | ||
| 4329 | 4162 | ||
| 4330 | (;-- any of begin|initial|while are complete statements; 'begin : foo' is also complete | 4163 | (;-- any of begin|initial|while are complete statements; 'begin : foo' is also complete |
| 4331 | t | 4164 | t |
| @@ -4346,8 +4179,7 @@ Set point to where line starts" | |||
| 4346 | (backward-sexp) | 4179 | (backward-sexp) |
| 4347 | (if (looking-at verilog-nameable-item-re ) | 4180 | (if (looking-at verilog-nameable-item-re ) |
| 4348 | nil | 4181 | nil |
| 4349 | t) | 4182 | t)) |
| 4350 | ) | ||
| 4351 | ((= (preceding-char) ?\#) | 4183 | ((= (preceding-char) ?\#) |
| 4352 | (backward-char) | 4184 | (backward-char) |
| 4353 | t) | 4185 | t) |
| @@ -4357,8 +4189,7 @@ Set point to where line starts" | |||
| 4357 | 4189 | ||
| 4358 | (t | 4190 | (t |
| 4359 | (goto-char back) | 4191 | (goto-char back) |
| 4360 | t) | 4192 | t)))))))) |
| 4361 | ))))))) | ||
| 4362 | 4193 | ||
| 4363 | (defun verilog-backward-syntactic-ws (&optional bound) | 4194 | (defun verilog-backward-syntactic-ws (&optional bound) |
| 4364 | "Backward skip over syntactic whitespace for Emacs 19. | 4195 | "Backward skip over syntactic whitespace for Emacs 19. |
| @@ -4370,9 +4201,7 @@ Optional BOUND limits search." | |||
| 4370 | (narrow-to-region bound (point)) | 4201 | (narrow-to-region bound (point)) |
| 4371 | (while (/= here (point)) | 4202 | (while (/= here (point)) |
| 4372 | (setq here (point)) | 4203 | (setq here (point)) |
| 4373 | (verilog-skip-backward-comments) | 4204 | (verilog-skip-backward-comments)))))) |
| 4374 | ))) | ||
| 4375 | )) | ||
| 4376 | t) | 4205 | t) |
| 4377 | 4206 | ||
| 4378 | (defun verilog-forward-syntactic-ws (&optional bound) | 4207 | (defun verilog-forward-syntactic-ws (&optional bound) |
| @@ -4380,16 +4209,13 @@ Optional BOUND limits search." | |||
| 4380 | Optional BOUND limits search." | 4209 | Optional BOUND limits search." |
| 4381 | (save-restriction | 4210 | (save-restriction |
| 4382 | (let* ((bound (or bound (point-max))) | 4211 | (let* ((bound (or bound (point-max))) |
| 4383 | (here bound) | 4212 | (here bound)) |
| 4384 | ) | ||
| 4385 | (if (> bound (point)) | 4213 | (if (> bound (point)) |
| 4386 | (progn | 4214 | (progn |
| 4387 | (narrow-to-region (point) bound) | 4215 | (narrow-to-region (point) bound) |
| 4388 | (while (/= here (point)) | 4216 | (while (/= here (point)) |
| 4389 | (setq here (point)) | 4217 | (setq here (point)) |
| 4390 | (forward-comment (buffer-size)) | 4218 | (forward-comment (buffer-size)))))))) |
| 4391 | ))) | ||
| 4392 | ))) | ||
| 4393 | 4219 | ||
| 4394 | (defun verilog-backward-ws&directives (&optional bound) | 4220 | (defun verilog-backward-ws&directives (&optional bound) |
| 4395 | "Backward skip over syntactic whitespace and compiler directives for Emacs 19. | 4221 | "Backward skip over syntactic whitespace and compiler directives for Emacs 19. |
| @@ -4423,9 +4249,7 @@ Optional BOUND limits search." | |||
| 4423 | (point)) | 4249 | (point)) |
| 4424 | (t | 4250 | (t |
| 4425 | nil)))) | 4251 | nil)))) |
| 4426 | (if p (goto-char p)) | 4252 | (if p (goto-char p)))))))) |
| 4427 | ))) | ||
| 4428 | ))) | ||
| 4429 | 4253 | ||
| 4430 | (defun verilog-forward-ws&directives (&optional bound) | 4254 | (defun verilog-forward-ws&directives (&optional bound) |
| 4431 | "Forward skip over syntactic whitespace and compiler directives for Emacs 19. | 4255 | "Forward skip over syntactic whitespace and compiler directives for Emacs 19. |
| @@ -4433,8 +4257,7 @@ Optional BOUND limits search." | |||
| 4433 | (save-restriction | 4257 | (save-restriction |
| 4434 | (let* ((bound (or bound (point-max))) | 4258 | (let* ((bound (or bound (point-max))) |
| 4435 | (here bound) | 4259 | (here bound) |
| 4436 | jump | 4260 | jump) |
| 4437 | ) | ||
| 4438 | (if (> bound (point)) | 4261 | (if (> bound (point)) |
| 4439 | (progn | 4262 | (progn |
| 4440 | (let ((state | 4263 | (let ((state |
| @@ -4455,9 +4278,7 @@ Optional BOUND limits search." | |||
| 4455 | (if (looking-at verilog-directive-re-1) | 4278 | (if (looking-at verilog-directive-re-1) |
| 4456 | (setq jump t))) | 4279 | (setq jump t))) |
| 4457 | (if jump | 4280 | (if jump |
| 4458 | (beginning-of-line 2)) | 4281 | (beginning-of-line 2)))))))) |
| 4459 | ))) | ||
| 4460 | ))) | ||
| 4461 | 4282 | ||
| 4462 | (defun verilog-in-comment-p () | 4283 | (defun verilog-in-comment-p () |
| 4463 | "Return true if in a star or // comment." | 4284 | "Return true if in a star or // comment." |
| @@ -4537,14 +4358,11 @@ Optional BOUND limits search." | |||
| 4537 | (forward-list) | 4358 | (forward-list) |
| 4538 | (progn (backward-char 1) | 4359 | (progn (backward-char 1) |
| 4539 | (verilog-backward-ws&directives) | 4360 | (verilog-backward-ws&directives) |
| 4540 | (equal (char-before) ?\;)) | 4361 | (equal (char-before) ?\;)))) |
| 4541 | )) | ||
| 4542 | ;; maybe | 4362 | ;; maybe |
| 4543 | (verilog-re-search-backward "\\<constraint\\|coverpoint\\|cross\\>" nil 'move) | 4363 | (verilog-re-search-backward "\\<constraint\\|coverpoint\\|cross\\>" nil 'move) |
| 4544 | ;; not | 4364 | ;; not |
| 4545 | nil | 4365 | nil)) |
| 4546 | ) | ||
| 4547 | ) | ||
| 4548 | 4366 | ||
| 4549 | (defun verilog-parenthesis-depth () | 4367 | (defun verilog-parenthesis-depth () |
| 4550 | "Return non zero if in parenthetical-expression." | 4368 | "Return non zero if in parenthetical-expression." |
| @@ -4608,8 +4426,7 @@ Optional BOUND limits search." | |||
| 4608 | t) | 4426 | t) |
| 4609 | ((and (not (bobp)) | 4427 | ((and (not (bobp)) |
| 4610 | (= (char-before) ?\/) | 4428 | (= (char-before) ?\/) |
| 4611 | (= (char-before (1- (point))) ?\*) | 4429 | (= (char-before (1- (point))) ?\*)) |
| 4612 | ) | ||
| 4613 | (goto-char (- (point) 2)) | 4430 | (goto-char (- (point) 2)) |
| 4614 | t) | 4431 | t) |
| 4615 | (t | 4432 | (t |
| @@ -4650,8 +4467,8 @@ Only look at a few lines to determine indent level." | |||
| 4650 | (if (verilog-continued-line) | 4467 | (if (verilog-continued-line) |
| 4651 | (progn | 4468 | (progn |
| 4652 | (goto-char sp) | 4469 | (goto-char sp) |
| 4653 | (setq | 4470 | (setq indent-str |
| 4654 | indent-str (list 'statement (verilog-current-indent-level)))) | 4471 | (list 'statement (verilog-current-indent-level)))) |
| 4655 | (goto-char sp1) | 4472 | (goto-char sp1) |
| 4656 | (setq indent-str (list 'block (verilog-current-indent-level))))) | 4473 | (setq indent-str (list 'block (verilog-current-indent-level))))) |
| 4657 | (goto-char sp)) | 4474 | (goto-char sp)) |
| @@ -4701,16 +4518,13 @@ Only look at a few lines to determine indent level." | |||
| 4701 | (progn | 4518 | (progn |
| 4702 | (forward-char 1) | 4519 | (forward-char 1) |
| 4703 | (backward-up-list -1) | 4520 | (backward-up-list -1) |
| 4704 | (skip-chars-forward " \t"))) | 4521 | (skip-chars-forward " \t")))) |
| 4705 | ) | ||
| 4706 | (current-column)) | 4522 | (current-column)) |
| 4707 | (progn | 4523 | (progn |
| 4708 | (goto-char fst) | 4524 | (goto-char fst) |
| 4709 | (+ (current-column) verilog-cexp-indent)) | 4525 | (+ (current-column) verilog-cexp-indent)))))) |
| 4710 | )))) | ||
| 4711 | (goto-char here) | 4526 | (goto-char here) |
| 4712 | (indent-line-to val)) | 4527 | (indent-line-to val))) |
| 4713 | ) | ||
| 4714 | ((= (preceding-char) ?\) ) | 4528 | ((= (preceding-char) ?\) ) |
| 4715 | (goto-char here) | 4529 | (goto-char here) |
| 4716 | (let ((val (eval (cdr (assoc type verilog-indent-alist))))) | 4530 | (let ((val (eval (cdr (assoc type verilog-indent-alist))))) |
| @@ -4724,8 +4538,7 @@ Only look at a few lines to determine indent level." | |||
| 4724 | (setq val (current-column)) | 4538 | (setq val (current-column)) |
| 4725 | (setq val (eval (cdr (assoc type verilog-indent-alist))))) | 4539 | (setq val (eval (cdr (assoc type verilog-indent-alist))))) |
| 4726 | (goto-char here) | 4540 | (goto-char here) |
| 4727 | (indent-line-to val))) | 4541 | (indent-line-to val)))))) |
| 4728 | ))) | ||
| 4729 | 4542 | ||
| 4730 | (; handle inside parenthetical expressions | 4543 | (; handle inside parenthetical expressions |
| 4731 | (eq type 'cparenexp) | 4544 | (eq type 'cparenexp) |
| @@ -4737,8 +4550,7 @@ Only look at a few lines to determine indent level." | |||
| 4737 | (indent-line-to val) | 4550 | (indent-line-to val) |
| 4738 | (if (and (not (verilog-in-struct-region-p)) | 4551 | (if (and (not (verilog-in-struct-region-p)) |
| 4739 | (looking-at verilog-declaration-re)) | 4552 | (looking-at verilog-declaration-re)) |
| 4740 | (verilog-indent-declaration ind)) | 4553 | (verilog-indent-declaration ind)))) |
| 4741 | )) | ||
| 4742 | 4554 | ||
| 4743 | (;-- Handle the ends | 4555 | (;-- Handle the ends |
| 4744 | (or | 4556 | (or |
| @@ -4774,8 +4586,8 @@ Only look at a few lines to determine indent level." | |||
| 4774 | (;-- Everything else | 4586 | (;-- Everything else |
| 4775 | t | 4587 | t |
| 4776 | (let ((val (eval (cdr (assoc type verilog-indent-alist))))) | 4588 | (let ((val (eval (cdr (assoc type verilog-indent-alist))))) |
| 4777 | (indent-line-to val))) | 4589 | (indent-line-to val)))) |
| 4778 | ) | 4590 | |
| 4779 | (if (looking-at "[ \t]+$") | 4591 | (if (looking-at "[ \t]+$") |
| 4780 | (skip-chars-forward " \t")) | 4592 | (skip-chars-forward " \t")) |
| 4781 | indent-str ; Return indent data | 4593 | indent-str ; Return indent data |
| @@ -4823,8 +4635,7 @@ Do not count named blocks or case-statements." | |||
| 4823 | (t | 4635 | (t |
| 4824 | (save-excursion | 4636 | (save-excursion |
| 4825 | (re-search-backward "//" nil t) | 4637 | (re-search-backward "//" nil t) |
| 4826 | (current-column))) | 4638 | (current-column)))))) |
| 4827 | ))) | ||
| 4828 | (indent-line-to stcol) | 4639 | (indent-line-to stcol) |
| 4829 | stcol)) | 4640 | stcol)) |
| 4830 | 4641 | ||
| @@ -4843,8 +4654,7 @@ Do not count named blocks or case-statements." | |||
| 4843 | (t | 4654 | (t |
| 4844 | (save-excursion | 4655 | (save-excursion |
| 4845 | (re-search-backward "//" nil t) | 4656 | (re-search-backward "//" nil t) |
| 4846 | (current-column))) | 4657 | (current-column)))))) |
| 4847 | ))) | ||
| 4848 | (progn | 4658 | (progn |
| 4849 | (indent-to stcol) | 4659 | (indent-to stcol) |
| 4850 | (if (and star | 4660 | (if (and star |
| @@ -4912,8 +4722,7 @@ ARG is ignored, for `comment-indent-function' compatibility." | |||
| 4912 | (goto-char start) | 4722 | (goto-char start) |
| 4913 | (verilog-do-indent (verilog-calculate-indent)) | 4723 | (verilog-do-indent (verilog-calculate-indent)) |
| 4914 | (verilog-forward-ws&directives) | 4724 | (verilog-forward-ws&directives) |
| 4915 | (current-column))) | 4725 | (current-column)))) |
| 4916 | ) | ||
| 4917 | (goto-char end) | 4726 | (goto-char end) |
| 4918 | (goto-char start) | 4727 | (goto-char start) |
| 4919 | (if (> (- end start) 100) | 4728 | (if (> (- end start) 100) |
| @@ -4927,15 +4736,12 @@ ARG is ignored, for `comment-indent-function' compatibility." | |||
| 4927 | (verilog-forward-ws&directives) | 4736 | (verilog-forward-ws&directives) |
| 4928 | (indent-line-to base-ind) | 4737 | (indent-line-to base-ind) |
| 4929 | (verilog-forward-ws&directives) | 4738 | (verilog-forward-ws&directives) |
| 4930 | (verilog-re-search-forward "[ \t\n\f]" e 'move) | 4739 | (verilog-re-search-forward "[ \t\n\f]" e 'move)) |
| 4931 | ) | ||
| 4932 | (t | 4740 | (t |
| 4933 | (just-one-space) | 4741 | (just-one-space) |
| 4934 | (verilog-re-search-forward "[ \t\n\f]" e 'move) | 4742 | (verilog-re-search-forward "[ \t\n\f]" e 'move))) |
| 4935 | ) | 4743 | ;;(forward-line) |
| 4936 | ) | ||
| 4937 | ) | 4744 | ) |
| 4938 | ;;(forward-line)) | ||
| 4939 | ;; Now find biggest prefix | 4745 | ;; Now find biggest prefix |
| 4940 | (setq ind (verilog-get-lineup-indent start edpos)) | 4746 | (setq ind (verilog-get-lineup-indent start edpos)) |
| 4941 | ;; Now indent each line. | 4747 | ;; Now indent each line. |
| @@ -4960,21 +4766,19 @@ ARG is ignored, for `comment-indent-function' compatibility." | |||
| 4960 | (indent-to ind)) | 4766 | (indent-to ind)) |
| 4961 | (progn | 4767 | (progn |
| 4962 | (just-one-space) | 4768 | (just-one-space) |
| 4963 | (indent-to ind)) | 4769 | (indent-to ind))))) |
| 4964 | ))) | ||
| 4965 | ((verilog-continued-line-1 start) | 4770 | ((verilog-continued-line-1 start) |
| 4966 | (goto-char e) | 4771 | (goto-char e) |
| 4967 | (indent-line-to ind)) | 4772 | (indent-line-to ind)) |
| 4968 | (t ; Must be comment or white space | 4773 | (t ; Must be comment or white space |
| 4969 | (goto-char e) | 4774 | (goto-char e) |
| 4970 | (verilog-forward-ws&directives) | 4775 | (verilog-forward-ws&directives) |
| 4971 | (forward-line -1)) | 4776 | (forward-line -1))) |
| 4972 | ) | ||
| 4973 | (forward-line 1)) | 4777 | (forward-line 1)) |
| 4974 | (message ""))))) | 4778 | (message ""))))) |
| 4975 | 4779 | ||
| 4976 | (defun verilog-pretty-expr (&optional myre) | 4780 | (defun verilog-pretty-expr (&optional myre) |
| 4977 | "Line up expressions around point." | 4781 | "Line up expressions around point, or optional regexp MYRE." |
| 4978 | (interactive "sRegular Expression: ((<|:)?=) ") | 4782 | (interactive "sRegular Expression: ((<|:)?=) ") |
| 4979 | (save-excursion | 4783 | (save-excursion |
| 4980 | (if (or (eq myre nil) | 4784 | (if (or (eq myre nil) |
| @@ -4995,8 +4799,7 @@ ARG is ignored, for `comment-indent-function' compatibility." | |||
| 4995 | (beginning-of-line) | 4799 | (beginning-of-line) |
| 4996 | (while (and (not (looking-at (concat "^\\s-*" verilog-complete-reg))) | 4800 | (while (and (not (looking-at (concat "^\\s-*" verilog-complete-reg))) |
| 4997 | (looking-at myre) | 4801 | (looking-at myre) |
| 4998 | (not (bobp)) | 4802 | (not (bobp))) |
| 4999 | ) | ||
| 5000 | (setq e (point)) | 4803 | (setq e (point)) |
| 5001 | (verilog-backward-syntactic-ws) | 4804 | (verilog-backward-syntactic-ws) |
| 5002 | (beginning-of-line) | 4805 | (beginning-of-line) |
| @@ -5015,12 +4818,10 @@ ARG is ignored, for `comment-indent-function' compatibility." | |||
| 5015 | (end-of-line) | 4818 | (end-of-line) |
| 5016 | (setq e (point)) | 4819 | (setq e (point)) |
| 5017 | (verilog-forward-syntactic-ws) | 4820 | (verilog-forward-syntactic-ws) |
| 5018 | (beginning-of-line) | 4821 | (beginning-of-line)) |
| 5019 | ) | ||
| 5020 | e)) | 4822 | e)) |
| 5021 | (edpos (set-marker (make-marker) end)) | 4823 | (edpos (set-marker (make-marker) end)) |
| 5022 | (ind) | 4824 | (ind)) |
| 5023 | ) | ||
| 5024 | (goto-char start) | 4825 | (goto-char start) |
| 5025 | (verilog-do-indent (verilog-calculate-indent)) | 4826 | (verilog-do-indent (verilog-calculate-indent)) |
| 5026 | (if (> (- end start) 100) | 4827 | (if (> (- end start) 100) |
| @@ -5031,8 +4832,7 @@ ARG is ignored, for `comment-indent-function' compatibility." | |||
| 5031 | (beginning-of-line) | 4832 | (beginning-of-line) |
| 5032 | (verilog-just-one-space myre) | 4833 | (verilog-just-one-space myre) |
| 5033 | (end-of-line) | 4834 | (end-of-line) |
| 5034 | (verilog-forward-syntactic-ws) | 4835 | (verilog-forward-syntactic-ws)) |
| 5035 | ) | ||
| 5036 | 4836 | ||
| 5037 | ;; Now find biggest prefix | 4837 | ;; Now find biggest prefix |
| 5038 | (setq ind (verilog-get-lineup-indent-2 myre start edpos)) | 4838 | (setq ind (verilog-get-lineup-indent-2 myre start edpos)) |
| @@ -5049,20 +4849,16 @@ ARG is ignored, for `comment-indent-function' compatibility." | |||
| 5049 | (goto-char (match-end 1)) | 4849 | (goto-char (match-end 1)) |
| 5050 | (if (eq (char-after) ?=) | 4850 | (if (eq (char-after) ?=) |
| 5051 | (indent-to (1+ ind)) ; line up the = of the <= with surrounding = | 4851 | (indent-to (1+ ind)) ; line up the = of the <= with surrounding = |
| 5052 | (indent-to ind) | 4852 | (indent-to ind))) |
| 5053 | ) | ||
| 5054 | ) | ||
| 5055 | ((verilog-continued-line-1 start) | 4853 | ((verilog-continued-line-1 start) |
| 5056 | (goto-char e) | 4854 | (goto-char e) |
| 5057 | (indent-line-to ind)) | 4855 | (indent-line-to ind)) |
| 5058 | (t ; Must be comment or white space | 4856 | (t ; Must be comment or white space |
| 5059 | (goto-char e) | 4857 | (goto-char e) |
| 5060 | (verilog-forward-ws&directives) | 4858 | (verilog-forward-ws&directives) |
| 5061 | (forward-line -1)) | 4859 | (forward-line -1))) |
| 5062 | ) | ||
| 5063 | (forward-line 1)) | 4860 | (forward-line 1)) |
| 5064 | (message "") | 4861 | (message ""))))) |
| 5065 | )))) | ||
| 5066 | 4862 | ||
| 5067 | (defun verilog-just-one-space (myre) | 4863 | (defun verilog-just-one-space (myre) |
| 5068 | "Remove extra spaces around regular expression MYRE." | 4864 | "Remove extra spaces around regular expression MYRE." |
| @@ -5073,12 +4869,10 @@ ARG is ignored, for `comment-indent-function' compatibility." | |||
| 5073 | (p2 (match-end 2))) | 4869 | (p2 (match-end 2))) |
| 5074 | (progn | 4870 | (progn |
| 5075 | (goto-char p2) | 4871 | (goto-char p2) |
| 5076 | (if (looking-at "\\s-") (just-one-space) ) | 4872 | (if (looking-at "\\s-") (just-one-space)) |
| 5077 | (goto-char p1) | 4873 | (goto-char p1) |
| 5078 | (forward-char -1) | 4874 | (forward-char -1) |
| 5079 | (if (looking-at "\\s-") (just-one-space)) | 4875 | (if (looking-at "\\s-") (just-one-space))))) |
| 5080 | ) | ||
| 5081 | )) | ||
| 5082 | (message "")) | 4876 | (message "")) |
| 5083 | 4877 | ||
| 5084 | (defun verilog-indent-declaration (baseind) | 4878 | (defun verilog-indent-declaration (baseind) |
| @@ -5093,8 +4887,7 @@ BASEIND is the base indent to offset everything." | |||
| 5093 | (point))) | 4887 | (point))) |
| 5094 | (ind) | 4888 | (ind) |
| 5095 | (val) | 4889 | (val) |
| 5096 | (m1 (make-marker)) | 4890 | (m1 (make-marker))) |
| 5097 | ) | ||
| 5098 | (setq val | 4891 | (setq val |
| 5099 | (+ baseind (eval (cdr (assoc 'declaration verilog-indent-alist))))) | 4892 | (+ baseind (eval (cdr (assoc 'declaration verilog-indent-alist))))) |
| 5100 | (indent-line-to val) | 4893 | (indent-line-to val) |
| @@ -5125,13 +4918,11 @@ BASEIND is the base indent to offset everything." | |||
| 5125 | (just-one-space) | 4918 | (just-one-space) |
| 5126 | (goto-char (marker-position m1)) | 4919 | (goto-char (marker-position m1)) |
| 5127 | (just-one-space) | 4920 | (just-one-space) |
| 5128 | (indent-to ind) | 4921 | (indent-to ind)) |
| 5129 | ) | ||
| 5130 | (if (/= (current-column) ind) | 4922 | (if (/= (current-column) ind) |
| 5131 | (progn | 4923 | (progn |
| 5132 | (just-one-space) | 4924 | (just-one-space) |
| 5133 | (indent-to ind)) | 4925 | (indent-to ind))))) |
| 5134 | ))) | ||
| 5135 | (if (looking-at verilog-declaration-re-2-no-macro) | 4926 | (if (looking-at verilog-declaration-re-2-no-macro) |
| 5136 | (let ((p (match-end 0))) | 4927 | (let ((p (match-end 0))) |
| 5137 | (set-marker m1 p) | 4928 | (set-marker m1 p) |
| @@ -5362,11 +5153,8 @@ for matches of `str' and adding the occurrence tp `all' through point END." | |||
| 5362 | (if (or (null verilog-pred) | 5153 | (if (or (null verilog-pred) |
| 5363 | (funcall verilog-pred match)) | 5154 | (funcall verilog-pred match)) |
| 5364 | (setq verilog-all (cons match verilog-all))))) | 5155 | (setq verilog-all (cons match verilog-all))))) |
| 5365 | (forward-line 1) | 5156 | (forward-line 1))) |
| 5366 | ) | 5157 | verilog-all) |
| 5367 | ) | ||
| 5368 | verilog-all | ||
| 5369 | ) | ||
| 5370 | 5158 | ||
| 5371 | (defun verilog-type-completion () | 5159 | (defun verilog-type-completion () |
| 5372 | "Calculate all possible completions for types." | 5160 | "Calculate all possible completions for types." |
| @@ -5663,8 +5451,7 @@ If search fails, other files are checked based on | |||
| 5663 | (goto-char pt) | 5451 | (goto-char pt) |
| 5664 | (beginning-of-line)) | 5452 | (beginning-of-line)) |
| 5665 | pt) | 5453 | pt) |
| 5666 | (verilog-goto-defun-file label) | 5454 | (verilog-goto-defun-file label)))) |
| 5667 | ))) | ||
| 5668 | 5455 | ||
| 5669 | ;; Eliminate compile warning | 5456 | ;; Eliminate compile warning |
| 5670 | (eval-when-compile | 5457 | (eval-when-compile |
| @@ -5680,8 +5467,7 @@ If search fails, other files are checked based on | |||
| 5680 | (first 1) | 5467 | (first 1) |
| 5681 | (prevpos (point-min)) | 5468 | (prevpos (point-min)) |
| 5682 | (final-context-start (make-marker)) | 5469 | (final-context-start (make-marker)) |
| 5683 | (regexp "\\(module\\s-+\\w+\\s-*(\\)\\|\\(\\w+\\s-+\\w+\\s-*(\\)") | 5470 | (regexp "\\(module\\s-+\\w+\\s-*(\\)\\|\\(\\w+\\s-+\\w+\\s-*(\\)")) |
| 5684 | ) | ||
| 5685 | (with-output-to-temp-buffer "*Occur*" | 5471 | (with-output-to-temp-buffer "*Occur*" |
| 5686 | (save-excursion | 5472 | (save-excursion |
| 5687 | (message (format "Searching for %s ..." regexp)) | 5473 | (message (format "Searching for %s ..." regexp)) |
| @@ -5854,8 +5640,7 @@ Bound search by LIMIT. Adapted from | |||
| 5854 | (search-forward "<company>") | 5640 | (search-forward "<company>") |
| 5855 | (replace-match string t t) | 5641 | (replace-match string t t) |
| 5856 | (search-backward "<description>") | 5642 | (search-backward "<description>") |
| 5857 | (replace-match "" t t) | 5643 | (replace-match "" t t)))) |
| 5858 | ))) | ||
| 5859 | 5644 | ||
| 5860 | ;; verilog-header Uses the verilog-insert-date function | 5645 | ;; verilog-header Uses the verilog-insert-date function |
| 5861 | 5646 | ||
| @@ -5994,8 +5779,7 @@ Duplicate signals are also removed. For example A[2] and A[1] become A[2:1]." | |||
| 5994 | sv-type (verilog-sig-type sig) | 5779 | sv-type (verilog-sig-type sig) |
| 5995 | sv-multidim (verilog-sig-multidim sig) | 5780 | sv-multidim (verilog-sig-multidim sig) |
| 5996 | combo "" | 5781 | combo "" |
| 5997 | buswarn "" | 5782 | buswarn "")) |
| 5998 | )) | ||
| 5999 | ;; Extract bus details | 5783 | ;; Extract bus details |
| 6000 | (setq bus (verilog-sig-bits sig)) | 5784 | (setq bus (verilog-sig-bits sig)) |
| 6001 | (cond ((and bus | 5785 | (cond ((and bus |
| @@ -6043,16 +5827,15 @@ Duplicate signals are also removed. For example A[2] and A[1] become A[2:1]." | |||
| 6043 | (if sv-highbit | 5827 | (if sv-highbit |
| 6044 | (concat "[" (int-to-string sv-highbit) ":" | 5828 | (concat "[" (int-to-string sv-highbit) ":" |
| 6045 | (int-to-string sv-lowbit) "]"))) | 5829 | (int-to-string sv-lowbit) "]"))) |
| 6046 | (concat sv-comment combo buswarn) | 5830 | (concat sv-comment combo buswarn) |
| 6047 | sv-memory sv-enum sv-signed sv-type sv-multidim) | 5831 | sv-memory sv-enum sv-signed sv-type sv-multidim) |
| 6048 | out-list) | 5832 | out-list) |
| 6049 | sv-name nil))) | 5833 | sv-name nil)))) |
| 6050 | ) | ||
| 6051 | ;; | 5834 | ;; |
| 6052 | out-list)) | 5835 | out-list)) |
| 6053 | 5836 | ||
| 6054 | (defun verilog-sig-tieoff (sig &optional no-width) | 5837 | (defun verilog-sig-tieoff (sig &optional no-width) |
| 6055 | "Return tieoff expression for given SIGNAL, with appropriate width. | 5838 | "Return tieoff expression for given SIG, with appropriate width. |
| 6056 | Ignore width if optional NO-WIDTH is set." | 5839 | Ignore width if optional NO-WIDTH is set." |
| 6057 | (let* ((width (if no-width nil (verilog-sig-width sig)))) | 5840 | (let* ((width (if no-width nil (verilog-sig-width sig)))) |
| 6058 | (concat | 5841 | (concat |
| @@ -6189,8 +5972,7 @@ Return a array of [outputs inouts inputs wire reg assign const]." | |||
| 6189 | (forward-char 1) | 5972 | (forward-char 1) |
| 6190 | (when (< paren sig-paren) | 5973 | (when (< paren sig-paren) |
| 6191 | (setq expect-signal nil)) ; ) that ends variables inside v2k arg list | 5974 | (setq expect-signal nil)) ; ) that ends variables inside v2k arg list |
| 6192 | t) | 5975 | t)))) |
| 6193 | ))) | ||
| 6194 | ((looking-at "\\s-*\\(\\[[^]]+\\]\\)") | 5976 | ((looking-at "\\s-*\\(\\[[^]]+\\]\\)") |
| 6195 | (goto-char (match-end 0)) | 5977 | (goto-char (match-end 0)) |
| 6196 | (cond (newsig ; Memory, not just width. Patch last signal added's memory (nth 3) | 5978 | (cond (newsig ; Memory, not just width. Patch last signal added's memory (nth 3) |
| @@ -6272,12 +6054,15 @@ Return a array of [outputs inouts inputs wire reg assign const]." | |||
| 6272 | (nreverse sigs-reg) | 6054 | (nreverse sigs-reg) |
| 6273 | (nreverse sigs-assign) | 6055 | (nreverse sigs-assign) |
| 6274 | (nreverse sigs-const) | 6056 | (nreverse sigs-const) |
| 6275 | (nreverse sigs-gparam) | 6057 | (nreverse sigs-gparam))))) |
| 6276 | )))) | ||
| 6277 | 6058 | ||
| 6278 | (defvar sigs-in) ; Prevent compile warning | 6059 | (eval-when-compile |
| 6279 | (defvar sigs-inout) ; Prevent compile warning | 6060 | ;; Prevent compile warnings; these are let's, not globals |
| 6280 | (defvar sigs-out) ; Prevent compile warning | 6061 | ;; Do not remove the eval-when-compile |
| 6062 | ;; - we want a error when we are debugging this code if they are refed. | ||
| 6063 | (defvar sigs-in) | ||
| 6064 | (defvar sigs-inout) | ||
| 6065 | (defvar sigs-out)) | ||
| 6281 | 6066 | ||
| 6282 | 6067 | ||
| 6283 | (defsubst verilog-modi-get-decls (modi) | 6068 | (defsubst verilog-modi-get-decls (modi) |
| @@ -6524,10 +6309,16 @@ For example if declare A A (.B(SIG)) then B will be included in the list." | |||
| 6524 | (end-pt (point))) | 6309 | (end-pt (point))) |
| 6525 | (eval-region beg-pt end-pt nil))))) | 6310 | (eval-region beg-pt end-pt nil))))) |
| 6526 | 6311 | ||
| 6527 | ;; These are passed in a let, not global | 6312 | (eval-when-compile |
| 6528 | (defvar got-sig) | 6313 | ;; Prevent compile warnings; these are let's, not globals |
| 6529 | (defvar got-rvalue) | 6314 | ;; Do not remove the eval-when-compile |
| 6530 | (defvar uses-delayed) | 6315 | ;; - we want a error when we are debugging this code if they are refed. |
| 6316 | (defvar sigs-in) | ||
| 6317 | (defvar sigs-out) | ||
| 6318 | (defvar got-sig) | ||
| 6319 | (defvar got-rvalue) | ||
| 6320 | (defvar uses-delayed) | ||
| 6321 | (defvar vector-skip-list)) | ||
| 6531 | 6322 | ||
| 6532 | (defun verilog-read-always-signals-recurse | 6323 | (defun verilog-read-always-signals-recurse |
| 6533 | (exit-keywd rvalue ignore-next) | 6324 | (exit-keywd rvalue ignore-next) |
| @@ -6653,8 +6444,7 @@ IGNORE-NEXT is true to ignore next token, fake from inside case statement." | |||
| 6653 | (t | 6444 | (t |
| 6654 | (forward-char 1))) | 6445 | (forward-char 1))) |
| 6655 | ;; End of non-comment token | 6446 | ;; End of non-comment token |
| 6656 | (setq last-keywd keywd) | 6447 | (setq last-keywd keywd))) |
| 6657 | )) | ||
| 6658 | (skip-syntax-forward " ")) | 6448 | (skip-syntax-forward " ")) |
| 6659 | ;; Append the final pending signal | 6449 | ;; Append the final pending signal |
| 6660 | (when got-sig | 6450 | (when got-sig |
| @@ -6700,8 +6490,7 @@ IGNORE-NEXT is true to ignore next token, fake from inside case statement." | |||
| 6700 | (instant (match-string 2))) | 6490 | (instant (match-string 2))) |
| 6701 | (if (not (member module verilog-keywords)) | 6491 | (if (not (member module verilog-keywords)) |
| 6702 | (setq instants-list (cons (list module instant) instants-list))))) | 6492 | (setq instants-list (cons (list module instant) instants-list))))) |
| 6703 | (forward-line 1) | 6493 | (forward-line 1))) |
| 6704 | )) | ||
| 6705 | instants-list)) | 6494 | instants-list)) |
| 6706 | 6495 | ||
| 6707 | 6496 | ||
| @@ -6776,8 +6565,7 @@ list of ( (signal_name connection_name)... )" | |||
| 6776 | (t | 6565 | (t |
| 6777 | (error "%s: AUTO_TEMPLATE parsing error: %s" | 6566 | (error "%s: AUTO_TEMPLATE parsing error: %s" |
| 6778 | (verilog-point-text) | 6567 | (verilog-point-text) |
| 6779 | (progn (looking-at ".*$") (match-string 0)))) | 6568 | (progn (looking-at ".*$") (match-string 0)))))) |
| 6780 | )) | ||
| 6781 | ;; Return | 6569 | ;; Return |
| 6782 | (vector tpl-regexp | 6570 | (vector tpl-regexp |
| 6783 | (list tpl-sig-list tpl-wild-list))) | 6571 | (list tpl-sig-list tpl-wild-list))) |
| @@ -6799,8 +6587,7 @@ Optionally associate it with the specified enumeration ENUMNAME." | |||
| 6799 | (let ((enumvar (intern (concat "venum-" enumname)))) | 6587 | (let ((enumvar (intern (concat "venum-" enumname)))) |
| 6800 | ;;(message "Define %s=%s" defname defvalue) (sleep-for 1) | 6588 | ;;(message "Define %s=%s" defname defvalue) (sleep-for 1) |
| 6801 | (make-variable-buffer-local enumvar) | 6589 | (make-variable-buffer-local enumvar) |
| 6802 | (add-to-list enumvar defname))) | 6590 | (add-to-list enumvar defname))))) |
| 6803 | )) | ||
| 6804 | 6591 | ||
| 6805 | (defun verilog-read-defines (&optional filename recurse subcall) | 6592 | (defun verilog-read-defines (&optional filename recurse subcall) |
| 6806 | "Read `defines and parameters for the current file, or optional FILENAME. | 6593 | "Read `defines and parameters for the current file, or optional FILENAME. |
| @@ -6884,8 +6671,7 @@ warning message, you need to add to your .emacs file: | |||
| 6884 | (while (looking-at "\\s-*,?\\s-*\\([a-zA-Z0-9_$]+\\)\\s-*=\\s-*\\([^;,]*\\),?\\s-*") | 6671 | (while (looking-at "\\s-*,?\\s-*\\([a-zA-Z0-9_$]+\\)\\s-*=\\s-*\\([^;,]*\\),?\\s-*") |
| 6885 | (verilog-set-define (match-string-no-properties 1) (match-string-no-properties 2) origbuf enumname) | 6672 | (verilog-set-define (match-string-no-properties 1) (match-string-no-properties 2) origbuf enumname) |
| 6886 | (goto-char (match-end 0)) | 6673 | (goto-char (match-end 0)) |
| 6887 | (forward-comment 999)))) | 6674 | (forward-comment 999))))))) |
| 6888 | ))) | ||
| 6889 | 6675 | ||
| 6890 | (defun verilog-read-includes () | 6676 | (defun verilog-read-includes () |
| 6891 | "Read `includes for the current file. | 6677 | "Read `includes for the current file. |
| @@ -6950,8 +6736,7 @@ Some macros and such are also found and included. For dinotrace.el" | |||
| 6950 | (or (member keywd verilog-keywords) | 6736 | (or (member keywd verilog-keywords) |
| 6951 | (member keywd sigs-all) | 6737 | (member keywd sigs-all) |
| 6952 | (setq sigs-all (cons keywd sigs-all)))) | 6738 | (setq sigs-all (cons keywd sigs-all)))) |
| 6953 | (t (forward-char 1))) | 6739 | (t (forward-char 1)))) |
| 6954 | ) | ||
| 6955 | ;; Return list | 6740 | ;; Return list |
| 6956 | sigs-all))) | 6741 | sigs-all))) |
| 6957 | 6742 | ||
| @@ -7019,10 +6804,7 @@ Some macros and such are also found and included. For dinotrace.el" | |||
| 7019 | ((string-match "^[^-+]" arg) | 6804 | ((string-match "^[^-+]" arg) |
| 7020 | (verilog-add-list-unique `verilog-library-files arg)) | 6805 | (verilog-add-list-unique `verilog-library-files arg)) |
| 7021 | ;; Default - ignore; no warning | 6806 | ;; Default - ignore; no warning |
| 7022 | ) | 6807 | )))) |
| 7023 | ) | ||
| 7024 | ) | ||
| 7025 | ) | ||
| 7026 | ;;(verilog-getopt (list "+libext+.a+.b" "+incdir+foodir" "+define+a+aval" "-f" "otherf" "-v" "library" "-y" "dir")) | 6808 | ;;(verilog-getopt (list "+libext+.a+.b" "+incdir+foodir" "+define+a+aval" "-f" "otherf" "-v" "library" "-y" "dir")) |
| 7027 | 6809 | ||
| 7028 | (defun verilog-getopt-file (filename) | 6810 | (defun verilog-getopt-file (filename) |
| @@ -7096,8 +6878,7 @@ Allows version control to check out the file if need be." | |||
| 7096 | "Return true if SYMBOL is number-like." | 6878 | "Return true if SYMBOL is number-like." |
| 7097 | (or (string-match "^[0-9 \t:]+$" symbol) | 6879 | (or (string-match "^[0-9 \t:]+$" symbol) |
| 7098 | (string-match "^[---]*[0-9]+$" symbol) | 6880 | (string-match "^[---]*[0-9]+$" symbol) |
| 7099 | (string-match "^[0-9 \t]+'s?[hdxbo][0-9a-fA-F_xz? \t]*$" symbol) | 6881 | (string-match "^[0-9 \t]+'s?[hdxbo][0-9a-fA-F_xz? \t]*$" symbol))) |
| 7100 | )) | ||
| 7101 | 6882 | ||
| 7102 | (defun verilog-symbol-detick (symbol wing-it) | 6883 | (defun verilog-symbol-detick (symbol wing-it) |
| 7103 | "Return a expanded SYMBOL name without any defines. | 6884 | "Return a expanded SYMBOL name without any defines. |
| @@ -7185,13 +6966,11 @@ Or, just the existing dirnames themselves if there are no wildcards." | |||
| 7185 | (setq dirfile (expand-file-name (concat (car dirfiles) rest)) | 6966 | (setq dirfile (expand-file-name (concat (car dirfiles) rest)) |
| 7186 | dirfiles (cdr dirfiles)) | 6967 | dirfiles (cdr dirfiles)) |
| 7187 | (if (file-directory-p dirfile) | 6968 | (if (file-directory-p dirfile) |
| 7188 | (setq dirlist (cons dirfile dirlist)))) | 6969 | (setq dirlist (cons dirfile dirlist))))) |
| 7189 | ) | ||
| 7190 | ;; Defaults | 6970 | ;; Defaults |
| 7191 | (t | 6971 | (t |
| 7192 | (if (file-directory-p dirname) | 6972 | (if (file-directory-p dirname) |
| 7193 | (setq dirlist (cons dirname dirlist)))) | 6973 | (setq dirlist (cons dirname dirlist)))))) |
| 7194 | )) | ||
| 7195 | dirlist)) | 6974 | dirlist)) |
| 7196 | ;;(verilog-expand-dirnames (list "." ".." "nonexist" "../*" "/home/wsnyder/*/v")) | 6975 | ;;(verilog-expand-dirnames (list "." ".." "nonexist" "../*" "/home/wsnyder/*/v")) |
| 7197 | 6976 | ||
| @@ -7295,13 +7074,11 @@ Return modi if successful, else print message unless IGNORE-ERROR is true." | |||
| 7295 | "") | 7074 | "") |
| 7296 | "\n Check the verilog-library-directories variable." | 7075 | "\n Check the verilog-library-directories variable." |
| 7297 | "\n I looked in (if not listed, doesn't exist):\n\t" | 7076 | "\n I looked in (if not listed, doesn't exist):\n\t" |
| 7298 | (mapconcat 'concat orig-filenames "\n\t"))))) | 7077 | (mapconcat 'concat orig-filenames "\n\t")))))) |
| 7299 | ) | ||
| 7300 | (setq verilog-modi-lookup-last-mod module | 7078 | (setq verilog-modi-lookup-last-mod module |
| 7301 | verilog-modi-lookup-last-current current | 7079 | verilog-modi-lookup-last-current current |
| 7302 | verilog-modi-lookup-last-tick (buffer-modified-tick))))) | 7080 | verilog-modi-lookup-last-tick (buffer-modified-tick))))) |
| 7303 | verilog-modi-lookup-last-modi | 7081 | verilog-modi-lookup-last-modi)) |
| 7304 | )) | ||
| 7305 | 7082 | ||
| 7306 | (defsubst verilog-modi-name (modi) | 7083 | (defsubst verilog-modi-name (modi) |
| 7307 | (aref modi 0)) | 7084 | (aref modi 0)) |
| @@ -7370,8 +7147,7 @@ Cache the output of function so next call may have faster access." | |||
| 7370 | (buffer-modified-tick) | 7147 | (buffer-modified-tick) |
| 7371 | (visited-file-modtime) | 7148 | (visited-file-modtime) |
| 7372 | func-returns) | 7149 | func-returns) |
| 7373 | verilog-modi-cache-list))) | 7150 | verilog-modi-cache-list))))) |
| 7374 | )) | ||
| 7375 | ;; | 7151 | ;; |
| 7376 | func-returns)) | 7152 | func-returns)) |
| 7377 | 7153 | ||
| @@ -7483,7 +7259,7 @@ and invalidating the cache." | |||
| 7483 | (funcall func)))) | 7259 | (funcall func)))) |
| 7484 | 7260 | ||
| 7485 | (defun verilog-insert-one-definition (sig type indent-pt) | 7261 | (defun verilog-insert-one-definition (sig type indent-pt) |
| 7486 | "Print out a definition for SIGNAL of the given TYPE, | 7262 | "Print out a definition for SIG of the given TYPE, |
| 7487 | with appropriate INDENT-PT indentation." | 7263 | with appropriate INDENT-PT indentation." |
| 7488 | (indent-to indent-pt) | 7264 | (indent-to indent-pt) |
| 7489 | (insert type) | 7265 | (insert type) |
| @@ -7594,9 +7370,8 @@ This repairs those mis-inserted by a AUTOARG." | |||
| 7594 | (string-to-number (match-string 2 range-exp))))))) | 7370 | (string-to-number (match-string 2 range-exp))))))) |
| 7595 | ((string-match "^\\(.*\\)\\s *:\\s *\\(.*\\)\\s *$" range-exp) | 7371 | ((string-match "^\\(.*\\)\\s *:\\s *\\(.*\\)\\s *$" range-exp) |
| 7596 | (concat "(1+(" (match-string 1 range-exp) ")" | 7372 | (concat "(1+(" (match-string 1 range-exp) ")" |
| 7597 | (if (equal "0" (match-string 2 range-exp)) | 7373 | (if (equal "0" (match-string 2 range-exp)) |
| 7598 | ;; Don't bother with -(0) | 7374 | "" ;; Don't bother with -(0) |
| 7599 | "" | ||
| 7600 | (concat "-(" (match-string 2 range-exp) ")")) | 7375 | (concat "-(" (match-string 2 range-exp) ")")) |
| 7601 | ")")) | 7376 | ")")) |
| 7602 | (t nil))))) | 7377 | (t nil))))) |
| @@ -7621,8 +7396,7 @@ This repairs those mis-inserted by a AUTOARG." | |||
| 7621 | ;; End exists | 7396 | ;; End exists |
| 7622 | (end-of-line) | 7397 | (end-of-line) |
| 7623 | (delete-region pt (point)) | 7398 | (delete-region pt (point)) |
| 7624 | (forward-line 1)) | 7399 | (forward-line 1)))) |
| 7625 | )) | ||
| 7626 | 7400 | ||
| 7627 | (defun verilog-forward-close-paren () | 7401 | (defun verilog-forward-close-paren () |
| 7628 | "Find the close parenthesis that match the current point, | 7402 | "Find the close parenthesis that match the current point, |
| @@ -7897,8 +7671,7 @@ Typing \\[verilog-inject-auto] will make this into: | |||
| 7897 | (when (yes-or-no-p "AUTO statements not recomputed, do it now? ") | 7671 | (when (yes-or-no-p "AUTO statements not recomputed, do it now? ") |
| 7898 | (verilog-auto)) | 7672 | (verilog-auto)) |
| 7899 | ;; Don't ask again if didn't update | 7673 | ;; Don't ask again if didn't update |
| 7900 | (set (make-local-variable 'verilog-auto-update-tick) (buffer-modified-tick)) | 7674 | (set (make-local-variable 'verilog-auto-update-tick) (buffer-modified-tick)))) |
| 7901 | )) | ||
| 7902 | (when (not verilog-auto-star-save) | 7675 | (when (not verilog-auto-star-save) |
| 7903 | (verilog-delete-auto-star-implicit)) | 7676 | (verilog-delete-auto-star-implicit)) |
| 7904 | nil) ;; Always return nil -- we don't write the file ourselves | 7677 | nil) ;; Always return nil -- we don't write the file ourselves |
| @@ -8008,13 +7781,11 @@ Avoid declaring ports manually, as it makes code harder to maintain." | |||
| 8008 | (verilog-repair-close-comma) | 7781 | (verilog-repair-close-comma) |
| 8009 | (unless (eq (char-before) ?/ ) | 7782 | (unless (eq (char-before) ?/ ) |
| 8010 | (insert "\n")) | 7783 | (insert "\n")) |
| 8011 | (indent-to verilog-indent-level-declaration) | 7784 | (indent-to verilog-indent-level-declaration)))) |
| 8012 | ))) | ||
| 8013 | 7785 | ||
| 8014 | (defun verilog-auto-inst-port-map (port-st) | 7786 | (defun verilog-auto-inst-port-map (port-st) |
| 8015 | nil) | 7787 | nil) |
| 8016 | 7788 | ||
| 8017 | (defvar vector-skip-list nil) ; Prevent compile warning | ||
| 8018 | (defvar vl-cell-type nil "See `verilog-auto-inst'.") ; Prevent compile warning | 7789 | (defvar vl-cell-type nil "See `verilog-auto-inst'.") ; Prevent compile warning |
| 8019 | (defvar vl-cell-name nil "See `verilog-auto-inst'.") ; Prevent compile warning | 7790 | (defvar vl-cell-name nil "See `verilog-auto-inst'.") ; Prevent compile warning |
| 8020 | (defvar vl-name nil "See `verilog-auto-inst'.") ; Prevent compile warning | 7791 | (defvar vl-name nil "See `verilog-auto-inst'.") ; Prevent compile warning |
| @@ -8025,7 +7796,8 @@ Avoid declaring ports manually, as it makes code harder to maintain." | |||
| 8025 | "Print out a instantiation connection for this PORT-ST. | 7796 | "Print out a instantiation connection for this PORT-ST. |
| 8026 | Insert to INDENT-PT, use template TPL-LIST. | 7797 | Insert to INDENT-PT, use template TPL-LIST. |
| 8027 | @ are instantiation numbers, replaced with TPL-NUM. | 7798 | @ are instantiation numbers, replaced with TPL-NUM. |
| 8028 | @\"(expression @)\" are evaluated, with @ as a variable." | 7799 | @\"(expression @)\" are evaluated, with @ as a variable. |
| 7800 | If FOR-STAR add comment it is a .* expansion." | ||
| 8029 | (let* ((port (verilog-sig-name port-st)) | 7801 | (let* ((port (verilog-sig-name port-st)) |
| 8030 | (tpl-ass (or (assoc port (car tpl-list)) | 7802 | (tpl-ass (or (assoc port (car tpl-list)) |
| 8031 | (verilog-auto-inst-port-map port-st))) | 7803 | (verilog-auto-inst-port-map port-st))) |
| @@ -8072,13 +7844,11 @@ Insert to INDENT-PT, use template TPL-LIST. | |||
| 8072 | (prin1 (eval (car (read-from-string expr))) | 7844 | (prin1 (eval (car (read-from-string expr))) |
| 8073 | (lambda (ch) ()))))) | 7845 | (lambda (ch) ()))))) |
| 8074 | (if (numberp value) (setq value (number-to-string value))) | 7846 | (if (numberp value) (setq value (number-to-string value))) |
| 8075 | value | 7847 | value)) |
| 8076 | )) | ||
| 8077 | (substring tpl-net (match-end 0)))))) | 7848 | (substring tpl-net (match-end 0)))))) |
| 8078 | ;; Replace @ and [] magic variables in final output | 7849 | ;; Replace @ and [] magic variables in final output |
| 8079 | (setq tpl-net (verilog-string-replace-matches "@" tpl-num nil nil tpl-net)) | 7850 | (setq tpl-net (verilog-string-replace-matches "@" tpl-num nil nil tpl-net)) |
| 8080 | (setq tpl-net (verilog-string-replace-matches "\\[\\]" vl-bits nil nil tpl-net)) | 7851 | (setq tpl-net (verilog-string-replace-matches "\\[\\]" vl-bits nil nil tpl-net))) |
| 8081 | ) | ||
| 8082 | (indent-to indent-pt) | 7852 | (indent-to indent-pt) |
| 8083 | (insert "." port) | 7853 | (insert "." port) |
| 8084 | (indent-to verilog-auto-inst-column) | 7854 | (indent-to verilog-auto-inst-column) |
| @@ -8462,9 +8232,7 @@ Lisp Templates: | |||
| 8462 | (if (search-forward ")" nil t) ;; From user, moved up a line | 8232 | (if (search-forward ")" nil t) ;; From user, moved up a line |
| 8463 | (delete-backward-char 1)) | 8233 | (delete-backward-char 1)) |
| 8464 | (if (search-forward ";" nil t) ;; Don't error if user had syntax error and forgot it | 8234 | (if (search-forward ";" nil t) ;; Don't error if user had syntax error and forgot it |
| 8465 | (delete-backward-char 1)) | 8235 | (delete-backward-char 1))))))))) |
| 8466 | ))) | ||
| 8467 | )))) | ||
| 8468 | 8236 | ||
| 8469 | (defun verilog-auto-inst-param () | 8237 | (defun verilog-auto-inst-param () |
| 8470 | "Expand AUTOINSTPARAM statements, as part of \\[verilog-auto]. | 8238 | "Expand AUTOINSTPARAM statements, as part of \\[verilog-auto]. |
| @@ -8566,9 +8334,7 @@ Templates: | |||
| 8566 | (search-forward "\n") ;; Added by inst-port | 8334 | (search-forward "\n") ;; Added by inst-port |
| 8567 | (delete-backward-char 1) | 8335 | (delete-backward-char 1) |
| 8568 | (if (search-forward ")" nil t) ;; From user, moved up a line | 8336 | (if (search-forward ")" nil t) ;; From user, moved up a line |
| 8569 | (delete-backward-char 1)) | 8337 | (delete-backward-char 1))))))))) |
| 8570 | ))) | ||
| 8571 | )))) | ||
| 8572 | 8338 | ||
| 8573 | (defun verilog-auto-reg () | 8339 | (defun verilog-auto-reg () |
| 8574 | "Expand AUTOREG statements, as part of \\[verilog-auto]. | 8340 | "Expand AUTOREG statements, as part of \\[verilog-auto]. |
| @@ -8612,15 +8378,13 @@ Typing \\[verilog-auto] will make this into: | |||
| 8612 | (verilog-modi-get-consts modi) | 8378 | (verilog-modi-get-consts modi) |
| 8613 | (verilog-modi-get-gparams modi) | 8379 | (verilog-modi-get-gparams modi) |
| 8614 | (verilog-modi-get-sub-outputs modi) | 8380 | (verilog-modi-get-sub-outputs modi) |
| 8615 | (verilog-modi-get-sub-inouts modi) | 8381 | (verilog-modi-get-sub-inouts modi))))) |
| 8616 | )))) | ||
| 8617 | (forward-line 1) | 8382 | (forward-line 1) |
| 8618 | (when sig-list | 8383 | (when sig-list |
| 8619 | (verilog-insert-indent "// Beginning of automatic regs (for this module's undeclared outputs)\n") | 8384 | (verilog-insert-indent "// Beginning of automatic regs (for this module's undeclared outputs)\n") |
| 8620 | (verilog-insert-definition sig-list "reg" indent-pt nil) | 8385 | (verilog-insert-definition sig-list "reg" indent-pt nil) |
| 8621 | (verilog-modi-cache-add-regs modi sig-list) | 8386 | (verilog-modi-cache-add-regs modi sig-list) |
| 8622 | (verilog-insert-indent "// End of automatics\n")) | 8387 | (verilog-insert-indent "// End of automatics\n"))))) |
| 8623 | ))) | ||
| 8624 | 8388 | ||
| 8625 | (defun verilog-auto-reg-input () | 8389 | (defun verilog-auto-reg-input () |
| 8626 | "Expand AUTOREGINPUT statements, as part of \\[verilog-auto]. | 8390 | "Expand AUTOREGINPUT statements, as part of \\[verilog-auto]. |
| @@ -8665,15 +8429,13 @@ Typing \\[verilog-auto] will make this into: | |||
| 8665 | (verilog-signals-not-in | 8429 | (verilog-signals-not-in |
| 8666 | (append (verilog-modi-get-sub-inputs modi) | 8430 | (append (verilog-modi-get-sub-inputs modi) |
| 8667 | (verilog-modi-get-sub-inouts modi)) | 8431 | (verilog-modi-get-sub-inouts modi)) |
| 8668 | (verilog-modi-get-signals modi) | 8432 | (verilog-modi-get-signals modi))))) |
| 8669 | )))) | ||
| 8670 | (forward-line 1) | 8433 | (forward-line 1) |
| 8671 | (when sig-list | 8434 | (when sig-list |
| 8672 | (verilog-insert-indent "// Beginning of automatic reg inputs (for undeclared instantiated-module inputs)\n") | 8435 | (verilog-insert-indent "// Beginning of automatic reg inputs (for undeclared instantiated-module inputs)\n") |
| 8673 | (verilog-insert-definition sig-list "reg" indent-pt nil) | 8436 | (verilog-insert-definition sig-list "reg" indent-pt nil) |
| 8674 | (verilog-modi-cache-add-regs modi sig-list) | 8437 | (verilog-modi-cache-add-regs modi sig-list) |
| 8675 | (verilog-insert-indent "// End of automatics\n")) | 8438 | (verilog-insert-indent "// End of automatics\n"))))) |
| 8676 | ))) | ||
| 8677 | 8439 | ||
| 8678 | (defun verilog-auto-wire () | 8440 | (defun verilog-auto-wire () |
| 8679 | "Expand AUTOWIRE statements, as part of \\[verilog-auto]. | 8441 | "Expand AUTOWIRE statements, as part of \\[verilog-auto]. |
| @@ -8726,8 +8488,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 8726 | (verilog-signals-not-in | 8488 | (verilog-signals-not-in |
| 8727 | (append (verilog-modi-get-sub-outputs modi) | 8489 | (append (verilog-modi-get-sub-outputs modi) |
| 8728 | (verilog-modi-get-sub-inouts modi)) | 8490 | (verilog-modi-get-sub-inouts modi)) |
| 8729 | (verilog-modi-get-signals modi) | 8491 | (verilog-modi-get-signals modi))))) |
| 8730 | )))) | ||
| 8731 | (forward-line 1) | 8492 | (forward-line 1) |
| 8732 | (when sig-list | 8493 | (when sig-list |
| 8733 | (verilog-insert-indent "// Beginning of automatic wires (for undeclared instantiated-module outputs)\n") | 8494 | (verilog-insert-indent "// Beginning of automatic wires (for undeclared instantiated-module outputs)\n") |
| @@ -8739,8 +8500,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 8739 | (setq pnt (point)) | 8500 | (setq pnt (point)) |
| 8740 | (verilog-pretty-declarations) | 8501 | (verilog-pretty-declarations) |
| 8741 | (goto-char pnt) | 8502 | (goto-char pnt) |
| 8742 | (verilog-pretty-expr "//"))) | 8503 | (verilog-pretty-expr "//")))))) |
| 8743 | ))) | ||
| 8744 | 8504 | ||
| 8745 | (defun verilog-auto-output () | 8505 | (defun verilog-auto-output () |
| 8746 | "Expand AUTOOUTPUT statements, as part of \\[verilog-auto]. | 8506 | "Expand AUTOOUTPUT statements, as part of \\[verilog-auto]. |
| @@ -8793,8 +8553,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 8793 | (append (verilog-modi-get-outputs modi) | 8553 | (append (verilog-modi-get-outputs modi) |
| 8794 | (verilog-modi-get-inouts modi) | 8554 | (verilog-modi-get-inouts modi) |
| 8795 | (verilog-modi-get-sub-inputs modi) | 8555 | (verilog-modi-get-sub-inputs modi) |
| 8796 | (verilog-modi-get-sub-inouts modi) | 8556 | (verilog-modi-get-sub-inouts modi))))) |
| 8797 | )))) | ||
| 8798 | (setq sig-list (verilog-signals-not-matching-regexp | 8557 | (setq sig-list (verilog-signals-not-matching-regexp |
| 8799 | sig-list verilog-auto-output-ignore-regexp)) | 8558 | sig-list verilog-auto-output-ignore-regexp)) |
| 8800 | (forward-line 1) | 8559 | (forward-line 1) |
| @@ -8804,8 +8563,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 8804 | (verilog-insert-definition sig-list "output" indent-pt v2k) | 8563 | (verilog-insert-definition sig-list "output" indent-pt v2k) |
| 8805 | (verilog-modi-cache-add-outputs modi sig-list) | 8564 | (verilog-modi-cache-add-outputs modi sig-list) |
| 8806 | (verilog-insert-indent "// End of automatics\n")) | 8565 | (verilog-insert-indent "// End of automatics\n")) |
| 8807 | (when v2k (verilog-repair-close-comma)) | 8566 | (when v2k (verilog-repair-close-comma))))) |
| 8808 | ))) | ||
| 8809 | 8567 | ||
| 8810 | (defun verilog-auto-output-every () | 8568 | (defun verilog-auto-output-every () |
| 8811 | "Expand AUTOOUTPUTEVERY statements, as part of \\[verilog-auto]. | 8569 | "Expand AUTOOUTPUTEVERY statements, as part of \\[verilog-auto]. |
| @@ -8847,8 +8605,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 8847 | (sig-list (verilog-signals-combine-bus | 8605 | (sig-list (verilog-signals-combine-bus |
| 8848 | (verilog-signals-not-in | 8606 | (verilog-signals-not-in |
| 8849 | (verilog-modi-get-signals modi) | 8607 | (verilog-modi-get-signals modi) |
| 8850 | (verilog-modi-get-ports modi) | 8608 | (verilog-modi-get-ports modi))))) |
| 8851 | )))) | ||
| 8852 | (forward-line 1) | 8609 | (forward-line 1) |
| 8853 | (when v2k (verilog-repair-open-comma)) | 8610 | (when v2k (verilog-repair-open-comma)) |
| 8854 | (when sig-list | 8611 | (when sig-list |
| @@ -8856,8 +8613,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 8856 | (verilog-insert-definition sig-list "output" indent-pt v2k) | 8613 | (verilog-insert-definition sig-list "output" indent-pt v2k) |
| 8857 | (verilog-modi-cache-add-outputs modi sig-list) | 8614 | (verilog-modi-cache-add-outputs modi sig-list) |
| 8858 | (verilog-insert-indent "// End of automatics\n")) | 8615 | (verilog-insert-indent "// End of automatics\n")) |
| 8859 | (when v2k (verilog-repair-close-comma)) | 8616 | (when v2k (verilog-repair-close-comma))))) |
| 8860 | ))) | ||
| 8861 | 8617 | ||
| 8862 | (defun verilog-auto-input () | 8618 | (defun verilog-auto-input () |
| 8863 | "Expand AUTOINPUT statements, as part of \\[verilog-auto]. | 8619 | "Expand AUTOINPUT statements, as part of \\[verilog-auto]. |
| @@ -8913,8 +8669,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 8913 | (verilog-modi-get-consts modi) | 8669 | (verilog-modi-get-consts modi) |
| 8914 | (verilog-modi-get-gparams modi) | 8670 | (verilog-modi-get-gparams modi) |
| 8915 | (verilog-modi-get-sub-outputs modi) | 8671 | (verilog-modi-get-sub-outputs modi) |
| 8916 | (verilog-modi-get-sub-inouts modi) | 8672 | (verilog-modi-get-sub-inouts modi))))) |
| 8917 | )))) | ||
| 8918 | (setq sig-list (verilog-signals-not-matching-regexp | 8673 | (setq sig-list (verilog-signals-not-matching-regexp |
| 8919 | sig-list verilog-auto-input-ignore-regexp)) | 8674 | sig-list verilog-auto-input-ignore-regexp)) |
| 8920 | (forward-line 1) | 8675 | (forward-line 1) |
| @@ -8924,8 +8679,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 8924 | (verilog-insert-definition sig-list "input" indent-pt v2k) | 8679 | (verilog-insert-definition sig-list "input" indent-pt v2k) |
| 8925 | (verilog-modi-cache-add-inputs modi sig-list) | 8680 | (verilog-modi-cache-add-inputs modi sig-list) |
| 8926 | (verilog-insert-indent "// End of automatics\n")) | 8681 | (verilog-insert-indent "// End of automatics\n")) |
| 8927 | (when v2k (verilog-repair-close-comma)) | 8682 | (when v2k (verilog-repair-close-comma))))) |
| 8928 | ))) | ||
| 8929 | 8683 | ||
| 8930 | (defun verilog-auto-inout () | 8684 | (defun verilog-auto-inout () |
| 8931 | "Expand AUTOINOUT statements, as part of \\[verilog-auto]. | 8685 | "Expand AUTOINOUT statements, as part of \\[verilog-auto]. |
| @@ -8978,8 +8732,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 8978 | (verilog-modi-get-inouts modi) | 8732 | (verilog-modi-get-inouts modi) |
| 8979 | (verilog-modi-get-inputs modi) | 8733 | (verilog-modi-get-inputs modi) |
| 8980 | (verilog-modi-get-sub-inputs modi) | 8734 | (verilog-modi-get-sub-inputs modi) |
| 8981 | (verilog-modi-get-sub-outputs modi) | 8735 | (verilog-modi-get-sub-outputs modi))))) |
| 8982 | )))) | ||
| 8983 | (setq sig-list (verilog-signals-not-matching-regexp | 8736 | (setq sig-list (verilog-signals-not-matching-regexp |
| 8984 | sig-list verilog-auto-inout-ignore-regexp)) | 8737 | sig-list verilog-auto-inout-ignore-regexp)) |
| 8985 | (forward-line 1) | 8738 | (forward-line 1) |
| @@ -8989,8 +8742,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 8989 | (verilog-insert-definition sig-list "inout" indent-pt v2k) | 8742 | (verilog-insert-definition sig-list "inout" indent-pt v2k) |
| 8990 | (verilog-modi-cache-add-inouts modi sig-list) | 8743 | (verilog-modi-cache-add-inouts modi sig-list) |
| 8991 | (verilog-insert-indent "// End of automatics\n")) | 8744 | (verilog-insert-indent "// End of automatics\n")) |
| 8992 | (when v2k (verilog-repair-close-comma)) | 8745 | (when v2k (verilog-repair-close-comma))))) |
| 8993 | ))) | ||
| 8994 | 8746 | ||
| 8995 | (defun verilog-auto-inout-module () | 8747 | (defun verilog-auto-inout-module () |
| 8996 | "Expand AUTOINOUTMODULE statements, as part of \\[verilog-auto]. | 8748 | "Expand AUTOINOUTMODULE statements, as part of \\[verilog-auto]. |
| @@ -9062,8 +8814,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 9062 | (verilog-modi-cache-add-outputs modi sig-list-o) | 8814 | (verilog-modi-cache-add-outputs modi sig-list-o) |
| 9063 | (verilog-modi-cache-add-inouts modi sig-list-io) | 8815 | (verilog-modi-cache-add-inouts modi sig-list-io) |
| 9064 | (verilog-insert-indent "// End of automatics\n")) | 8816 | (verilog-insert-indent "// End of automatics\n")) |
| 9065 | (when v2k (verilog-repair-close-comma)) | 8817 | (when v2k (verilog-repair-close-comma))))))) |
| 9066 | ))))) | ||
| 9067 | 8818 | ||
| 9068 | (defun verilog-auto-sense-sigs (modi presense-sigs) | 8819 | (defun verilog-auto-sense-sigs (modi presense-sigs) |
| 9069 | "Return list of signals for current AUTOSENSE block." | 8820 | "Return list of signals for current AUTOSENSE block." |
| @@ -9164,8 +8915,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 9164 | (not-first (insert " or "))) | 8915 | (not-first (insert " or "))) |
| 9165 | (insert (verilog-sig-name (car sig-list))) | 8916 | (insert (verilog-sig-name (car sig-list))) |
| 9166 | (setq sig-list (cdr sig-list) | 8917 | (setq sig-list (cdr sig-list) |
| 9167 | not-first t)) | 8918 | not-first t))))) |
| 9168 | ))) | ||
| 9169 | 8919 | ||
| 9170 | (defun verilog-auto-reset () | 8920 | (defun verilog-auto-reset () |
| 9171 | "Expand AUTORESET statements, as part of \\[verilog-auto]. | 8921 | "Expand AUTORESET statements, as part of \\[verilog-auto]. |
| @@ -9260,8 +9010,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 9260 | ";\n") | 9010 | ";\n") |
| 9261 | (indent-to indent-pt) | 9011 | (indent-to indent-pt) |
| 9262 | (setq sig-list (cdr sig-list)))) | 9012 | (setq sig-list (cdr sig-list)))) |
| 9263 | (insert "// End of automatics")) | 9013 | (insert "// End of automatics"))))) |
| 9264 | ))) | ||
| 9265 | 9014 | ||
| 9266 | (defun verilog-auto-tieoff () | 9015 | (defun verilog-auto-tieoff () |
| 9267 | "Expand AUTOTIEOFF statements, as part of \\[verilog-auto]. | 9016 | "Expand AUTOTIEOFF statements, as part of \\[verilog-auto]. |
| @@ -9316,8 +9065,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 9316 | (verilog-modi-get-consts modi) | 9065 | (verilog-modi-get-consts modi) |
| 9317 | (verilog-modi-get-gparams modi) | 9066 | (verilog-modi-get-gparams modi) |
| 9318 | (verilog-modi-get-sub-outputs modi) | 9067 | (verilog-modi-get-sub-outputs modi) |
| 9319 | (verilog-modi-get-sub-inouts modi) | 9068 | (verilog-modi-get-sub-inouts modi))))) |
| 9320 | )))) | ||
| 9321 | (when sig-list | 9069 | (when sig-list |
| 9322 | (forward-line 1) | 9070 | (forward-line 1) |
| 9323 | (verilog-insert-indent "// Beginning of automatic tieoffs (for this module's unterminated outputs)\n") | 9071 | (verilog-insert-indent "// Beginning of automatic tieoffs (for this module's unterminated outputs)\n") |
| @@ -9330,8 +9078,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 9330 | (insert "= " (verilog-sig-tieoff sig) | 9078 | (insert "= " (verilog-sig-tieoff sig) |
| 9331 | ";\n") | 9079 | ";\n") |
| 9332 | (setq sig-list (cdr sig-list)))) | 9080 | (setq sig-list (cdr sig-list)))) |
| 9333 | (verilog-insert-indent "// End of automatics\n") | 9081 | (verilog-insert-indent "// End of automatics\n"))))) |
| 9334 | )))) | ||
| 9335 | 9082 | ||
| 9336 | (defun verilog-auto-unused () | 9083 | (defun verilog-auto-unused () |
| 9337 | "Expand AUTOUNUSED statements, as part of \\[verilog-auto]. | 9084 | "Expand AUTOUNUSED statements, as part of \\[verilog-auto]. |
| @@ -9395,8 +9142,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 9395 | (append (verilog-modi-get-inputs modi) | 9142 | (append (verilog-modi-get-inputs modi) |
| 9396 | (verilog-modi-get-inouts modi)) | 9143 | (verilog-modi-get-inouts modi)) |
| 9397 | (append (verilog-modi-get-sub-inputs modi) | 9144 | (append (verilog-modi-get-sub-inputs modi) |
| 9398 | (verilog-modi-get-sub-inouts modi) | 9145 | (verilog-modi-get-sub-inouts modi))))) |
| 9399 | )))) | ||
| 9400 | (setq sig-list (verilog-signals-not-matching-regexp | 9146 | (setq sig-list (verilog-signals-not-matching-regexp |
| 9401 | sig-list verilog-auto-unused-ignore-regexp)) | 9147 | sig-list verilog-auto-unused-ignore-regexp)) |
| 9402 | (when sig-list | 9148 | (when sig-list |
| @@ -9408,8 +9154,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 9408 | (indent-to indent-pt) | 9154 | (indent-to indent-pt) |
| 9409 | (insert (verilog-sig-name sig) ",\n") | 9155 | (insert (verilog-sig-name sig) ",\n") |
| 9410 | (setq sig-list (cdr sig-list)))) | 9156 | (setq sig-list (cdr sig-list)))) |
| 9411 | (verilog-insert-indent "// End of automatics\n") | 9157 | (verilog-insert-indent "// End of automatics\n"))))) |
| 9412 | )))) | ||
| 9413 | 9158 | ||
| 9414 | (defun verilog-enum-ascii (signm elim-regexp) | 9159 | (defun verilog-enum-ascii (signm elim-regexp) |
| 9415 | "Convert a enum name SIGNM to a ascii string for insertion. | 9160 | "Convert a enum name SIGNM to a ascii string for insertion. |
| @@ -9543,8 +9288,7 @@ Typing \\[verilog-auto] will make this into: | |||
| 9543 | (verilog-insert-indent "endcase\n") | 9288 | (verilog-insert-indent "endcase\n") |
| 9544 | (setq indent-pt (- indent-pt verilog-indent-level)) | 9289 | (setq indent-pt (- indent-pt verilog-indent-level)) |
| 9545 | (verilog-insert-indent "end\n" | 9290 | (verilog-insert-indent "end\n" |
| 9546 | "// End of automatics\n") | 9291 | "// End of automatics\n")))) |
| 9547 | ))) | ||
| 9548 | 9292 | ||
| 9549 | (defun verilog-auto-templated-rel () | 9293 | (defun verilog-auto-templated-rel () |
| 9550 | "Replace Templated relative line numbers with absolute line numbers. | 9294 | "Replace Templated relative line numbers with absolute line numbers. |
| @@ -9694,8 +9438,7 @@ Wilson Snyder (wsnyder@wsnyder.org), and/or see http://www.veripool.com." | |||
| 9694 | ;; Must be after all inputs outputs are generated | 9438 | ;; Must be after all inputs outputs are generated |
| 9695 | (verilog-auto-search-do "/*AUTOARG*/" 'verilog-auto-arg) | 9439 | (verilog-auto-search-do "/*AUTOARG*/" 'verilog-auto-arg) |
| 9696 | ;; Fix line numbers (comments only) | 9440 | ;; Fix line numbers (comments only) |
| 9697 | (verilog-auto-templated-rel) | 9441 | (verilog-auto-templated-rel)) |
| 9698 | ) | ||
| 9699 | ;; | 9442 | ;; |
| 9700 | (run-hooks 'verilog-auto-hook) | 9443 | (run-hooks 'verilog-auto-hook) |
| 9701 | ;; | 9444 | ;; |
| @@ -9709,14 +9452,13 @@ Wilson Snyder (wsnyder@wsnyder.org), and/or see http://www.veripool.com." | |||
| 9709 | ;; Unwind forms | 9452 | ;; Unwind forms |
| 9710 | (progn | 9453 | (progn |
| 9711 | ;; Restore font-lock | 9454 | ;; Restore font-lock |
| 9712 | (when fontlocked (font-lock-mode t))) | 9455 | (when fontlocked (font-lock-mode t)))))) |
| 9713 | ))) | ||
| 9714 | 9456 | ||
| 9715 | 9457 | ||
| 9716 | ;; | 9458 | ;; |
| 9717 | ;; Skeleton based code insertion | 9459 | ;; Skeleton based code insertion |
| 9718 | ;; | 9460 | ;; |
| 9719 | (defvar verilog-template-map | 9461 | (defvar verilog-template-map |
| 9720 | (let ((map (make-sparse-keymap))) | 9462 | (let ((map (make-sparse-keymap))) |
| 9721 | (define-key map "a" 'verilog-sk-always) | 9463 | (define-key map "a" 'verilog-sk-always) |
| 9722 | (define-key map "b" 'verilog-sk-begin) | 9464 | (define-key map "b" 'verilog-sk-begin) |
| @@ -9985,16 +9727,14 @@ and the case items." | |||
| 9985 | (defun verilog-sk-define-signal () | 9727 | (defun verilog-sk-define-signal () |
| 9986 | "Insert a definition of signal under point at top of module." | 9728 | "Insert a definition of signal under point at top of module." |
| 9987 | (interactive "*") | 9729 | (interactive "*") |
| 9988 | (let* ( | 9730 | (let* ((sig-re "[a-zA-Z0-9_]*") |
| 9989 | (sig-re "[a-zA-Z0-9_]*") | ||
| 9990 | (v1 (buffer-substring | 9731 | (v1 (buffer-substring |
| 9991 | (save-excursion | 9732 | (save-excursion |
| 9992 | (skip-chars-backward sig-re) | 9733 | (skip-chars-backward sig-re) |
| 9993 | (point)) | 9734 | (point)) |
| 9994 | (save-excursion | 9735 | (save-excursion |
| 9995 | (skip-chars-forward sig-re) | 9736 | (skip-chars-forward sig-re) |
| 9996 | (point)))) | 9737 | (point))))) |
| 9997 | ) | ||
| 9998 | (if (not (member v1 verilog-keywords)) | 9738 | (if (not (member v1 verilog-keywords)) |
| 9999 | (save-excursion | 9739 | (save-excursion |
| 10000 | (setq verilog-sk-signal v1) | 9740 | (setq verilog-sk-signal v1) |
| @@ -10003,10 +9743,7 @@ and the case items." | |||
| 10003 | (verilog-forward-syntactic-ws) | 9743 | (verilog-forward-syntactic-ws) |
| 10004 | (verilog-sk-def-reg) | 9744 | (verilog-sk-def-reg) |
| 10005 | (message "signal at point is %s" v1)) | 9745 | (message "signal at point is %s" v1)) |
| 10006 | (message "object at point (%s) is a keyword" v1)) | 9746 | (message "object at point (%s) is a keyword" v1)))) |
| 10007 | ) | ||
| 10008 | ) | ||
| 10009 | |||
| 10010 | 9747 | ||
| 10011 | (define-skeleton verilog-sk-wire | 9748 | (define-skeleton verilog-sk-wire |
| 10012 | "Insert a wire definition." | 9749 | "Insert a wire definition." |
| @@ -10109,7 +9846,7 @@ and the case items." | |||
| 10109 | "^`include\\s-+\"\\([^\n\"]*\\)\"" | 9846 | "^`include\\s-+\"\\([^\n\"]*\\)\"" |
| 10110 | "Regexp that matches the include file.") | 9847 | "Regexp that matches the include file.") |
| 10111 | 9848 | ||
| 10112 | (defvar verilog-mode-mouse-map | 9849 | (defvar verilog-mode-mouse-map |
| 10113 | (let ((map (make-sparse-keymap))) ; as described in info pages, make a map | 9850 | (let ((map (make-sparse-keymap))) ; as described in info pages, make a map |
| 10114 | (set-keymap-parent map verilog-mode-map) | 9851 | (set-keymap-parent map verilog-mode-map) |
| 10115 | ;; mouse button bindings | 9852 | ;; mouse button bindings |
| @@ -10189,8 +9926,7 @@ Files are checked based on `verilog-library-directories'." | |||
| 10189 | (progn | 9926 | (progn |
| 10190 | (message | 9927 | (message |
| 10191 | "File '%s' isn't readable, use shift-mouse2 to paste in this field" | 9928 | "File '%s' isn't readable, use shift-mouse2 to paste in this field" |
| 10192 | (match-string 1)))) | 9929 | (match-string 1))))))) |
| 10193 | ))) | ||
| 10194 | 9930 | ||
| 10195 | ;; ffap isn't useable for verilog mode. It uses library paths. | 9931 | ;; ffap isn't useable for verilog mode. It uses library paths. |
| 10196 | ;; so define this function to do more or less the same as ffap | 9932 | ;; so define this function to do more or less the same as ffap |
| @@ -10208,8 +9944,7 @@ Files are checked based on `verilog-library-directories'." | |||
| 10208 | (file-readable-p (car (verilog-library-filenames | 9944 | (file-readable-p (car (verilog-library-filenames |
| 10209 | (match-string 1) (buffer-file-name))))) | 9945 | (match-string 1) (buffer-file-name))))) |
| 10210 | (find-file (car (verilog-library-filenames | 9946 | (find-file (car (verilog-library-filenames |
| 10211 | (match-string 1) (buffer-file-name)))))) | 9947 | (match-string 1) (buffer-file-name)))))))) |
| 10212 | )) | ||
| 10213 | 9948 | ||
| 10214 | 9949 | ||
| 10215 | ;; | 9950 | ;; |
| @@ -10230,6 +9965,7 @@ Files are checked based on `verilog-library-directories'." | |||
| 10230 | (princ "\n"))) | 9965 | (princ "\n"))) |
| 10231 | 9966 | ||
| 10232 | (autoload 'reporter-submit-bug-report "reporter") | 9967 | (autoload 'reporter-submit-bug-report "reporter") |
| 9968 | (defvar reporter-prompt-for-summary-p) | ||
| 10233 | 9969 | ||
| 10234 | (defun verilog-submit-bug-report () | 9970 | (defun verilog-submit-bug-report () |
| 10235 | "Submit via mail a bug report on verilog-mode.el." | 9971 | "Submit via mail a bug report on verilog-mode.el." |
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 98818ea8354..72fda808053 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el | |||
| @@ -2047,7 +2047,7 @@ your style, only those that are different from the default.") | |||
| 2047 | (defun vhdl-keep-region-active () | 2047 | (defun vhdl-keep-region-active () |
| 2048 | "Do whatever is necessary to keep the region active in XEmacs. | 2048 | "Do whatever is necessary to keep the region active in XEmacs. |
| 2049 | Ignore byte-compiler warnings you might see." | 2049 | Ignore byte-compiler warnings you might see." |
| 2050 | (and (boundp 'zmacs-region-stays) | 2050 | (and (featurep 'xemacs) |
| 2051 | (setq zmacs-region-stays t))) | 2051 | (setq zmacs-region-stays t))) |
| 2052 | 2052 | ||
| 2053 | ;; `wildcard-to-regexp' is included only in XEmacs 21 | 2053 | ;; `wildcard-to-regexp' is included only in XEmacs 21 |