aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilson Snyder2014-06-01 23:45:11 -0700
committerGlenn Morris2014-06-01 23:45:11 -0700
commit9e158ac805afeab4346fbf34ddb642b4cfbb3c98 (patch)
tree843c450b15a47f26f893e9621e4f41b00d594951
parentf34897e34def565eb6e07461549ab2ba2e275e95 (diff)
downloademacs-9e158ac805afeab4346fbf34ddb642b4cfbb3c98.tar.gz
emacs-9e158ac805afeab4346fbf34ddb642b4cfbb3c98.zip
Sync with upstream verilog-mode revision 3cd8144
* lisp/progmodes/verilog-mode.el (verilog-mode-version): Bump. (verilog-auto-arg-format): New option, to support newlines in AUTOARG. (verilog-type-font-keywords): Add nor. (verilog-batch-execute-func): Force reading of Local Variables. Fix printing "no changes to be saved" with verilog-batch. (verilog-auto-arg-ports): Doc fix. Add verilog-auto-arg-format to support newlines in AUTOARG. (verilog-auto-arg): Doc fix.
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/progmodes/verilog-mode.el84
2 files changed, 68 insertions, 28 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 40c2ae9eb17..f6999abd68c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
12014-06-02 Wilson Snyder <wsnyder@wsnyder.org>
2
3 Sync with upstream verilog-mode revision 3cd8144.
4 * progmodes/verilog-mode.el (verilog-mode-version): Bump.
5 (verilog-auto-arg-format): New option, to support newlines in AUTOARG.
6 (verilog-type-font-keywords): Add nor.
7 (verilog-batch-execute-func): Force reading of Local Variables.
8 Fix printing "no changes to be saved" with verilog-batch.
9 (verilog-auto-arg-ports): Doc fix.
10 Add verilog-auto-arg-format to support newlines in AUTOARG.
11 (verilog-auto-arg): Doc fix.
12
12014-06-02 Glenn Morris <rgm@gnu.org> 132014-06-02 Glenn Morris <rgm@gnu.org>
2 14
3 * emulation/crisp.el, emulation/tpu-edt.el, emulation/tpu-extras.el: 15 * emulation/crisp.el, emulation/tpu-edt.el, emulation/tpu-extras.el:
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 5b643e370c2..b649959bae3 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -123,7 +123,7 @@
123;;; Code: 123;;; Code:
124 124
125;; This variable will always hold the version number of the mode 125;; This variable will always hold the version number of the mode
126(defconst verilog-mode-version "2014-03-15-702457d-vpo" 126(defconst verilog-mode-version "2014-05-31-3cd8144-vpo"
127 "Version of this Verilog mode.") 127 "Version of this Verilog mode.")
128(defconst verilog-mode-release-emacs t 128(defconst verilog-mode-release-emacs t
129 "If non-nil, this version of Verilog mode was released with Emacs itself.") 129 "If non-nil, this version of Verilog mode was released with Emacs itself.")
@@ -1020,6 +1020,20 @@ SystemVerilog designs."
1020 :type 'string) 1020 :type 'string)
1021(put 'verilog-assignment-delay 'safe-local-variable 'stringp) 1021(put 'verilog-assignment-delay 'safe-local-variable 'stringp)
1022 1022
1023(defcustom verilog-auto-arg-format 'packed
1024 "Formatting to use for AUTOARG signal names.
1025If 'packed', then as many inputs and outputs that fit within
1026`fill-column' will be put onto one line.
1027
1028If 'single', then a single input or output will be put onto each
1029line."
1030 :version "24.5"
1031 :type '(radio (const :tag "Line up Assignments and Declarations" packed)
1032 (const :tag "Line up Assignment statements" single))
1033 :group 'verilog-mode-auto)
1034(put 'verilog-auto-arg-format 'safe-local-variable
1035 '(lambda (x) (memq x '(packed single))))
1036
1023(defcustom verilog-auto-arg-sort nil 1037(defcustom verilog-auto-arg-sort nil
1024 "Non-nil means AUTOARG signal names will be sorted, not in declaration order. 1038 "Non-nil means AUTOARG signal names will be sorted, not in declaration order.
1025Declaration order is advantageous with order based instantiations 1039Declaration order is advantageous with order based instantiations
@@ -2907,7 +2921,7 @@ See also `verilog-font-lock-extra-types'.")
2907 '( 2921 '(
2908 "and" "bit" "buf" "bufif0" "bufif1" "cmos" "defparam" 2922 "and" "bit" "buf" "bufif0" "bufif1" "cmos" "defparam"
2909 "event" "genvar" "inout" "input" "integer" "localparam" 2923 "event" "genvar" "inout" "input" "integer" "localparam"
2910 "logic" "mailbox" "nand" "nmos" "not" "notif0" "notif1" "or" 2924 "logic" "mailbox" "nand" "nmos" "nor" "not" "notif0" "notif1" "or"
2911 "output" "parameter" "pmos" "pull0" "pull1" "pulldown" "pullup" 2925 "output" "parameter" "pmos" "pull0" "pull1" "pulldown" "pullup"
2912 "rcmos" "real" "realtime" "reg" "rnmos" "rpmos" "rtran" 2926 "rcmos" "real" "realtime" "reg" "rnmos" "rpmos" "rtran"
2913 "rtranif0" "rtranif1" "semaphore" "signed" "struct" "supply" 2927 "rtranif0" "rtranif1" "semaphore" "signed" "struct" "supply"
@@ -5144,23 +5158,29 @@ Save the result unless optional NO-SAVE is t."
5144 ;; Make sure any sub-files we read get proper mode 5158 ;; Make sure any sub-files we read get proper mode
5145 (setq-default major-mode 'verilog-mode) 5159 (setq-default major-mode 'verilog-mode)
5146 ;; Ditto files already read in 5160 ;; Ditto files already read in
5147 (mapc (lambda (buf) 5161 ;; Remember buffer list, so don't later pickup any verilog-getopt files
5148 (when (buffer-file-name buf) 5162 (let ((orig-buffer-list (buffer-list)))
5149 (with-current-buffer buf 5163 (mapc (lambda (buf)
5150 (verilog-mode))))
5151 (buffer-list))
5152 ;; Process the files
5153 (mapcar (lambda (buf)
5154 (when (buffer-file-name buf) 5164 (when (buffer-file-name buf)
5155 (save-excursion 5165 (with-current-buffer buf
5156 (if (not (file-exists-p (buffer-file-name buf))) 5166 (verilog-mode)
5157 (error 5167 (verilog-auto-reeval-locals)
5158 (concat "File not found: " (buffer-file-name buf)))) 5168 (verilog-getopt-flags))))
5159 (message (concat "Processing " (buffer-file-name buf))) 5169 orig-buffer-list)
5160 (set-buffer buf) 5170 ;; Process the files
5161 (funcall funref) 5171 (mapcar (lambda (buf)
5162 (unless no-save (save-buffer))))) 5172 (when (buffer-file-name buf)
5163 (buffer-list)))) 5173 (save-excursion
5174 (if (not (file-exists-p (buffer-file-name buf)))
5175 (error
5176 (concat "File not found: " (buffer-file-name buf))))
5177 (message (concat "Processing " (buffer-file-name buf)))
5178 (set-buffer buf)
5179 (funcall funref)
5180 (when (and (not no-save)
5181 (buffer-modified-p)) ;; Avoid "no changes to be saved"
5182 (save-buffer)))))
5183 orig-buffer-list))))
5164 5184
5165(defun verilog-batch-auto () 5185(defun verilog-batch-auto ()
5166 "For use with --batch, perform automatic expansions as a stand-alone tool. 5186 "For use with --batch, perform automatic expansions as a stand-alone tool.
@@ -9639,7 +9659,7 @@ Return modi if successful, else print message unless IGNORE-ERROR is true."
9639 allow-cache 9659 allow-cache
9640 (setq modi (gethash module verilog-modi-lookup-cache)) 9660 (setq modi (gethash module verilog-modi-lookup-cache))
9641 (equal verilog-modi-lookup-last-current current) 9661 (equal verilog-modi-lookup-last-current current)
9642 ;; Iff hit is in current buffer, then tick must match 9662 ;; If hit is in current buffer, then tick must match
9643 (or (equal verilog-modi-lookup-last-tick (buffer-chars-modified-tick)) 9663 (or (equal verilog-modi-lookup-last-tick (buffer-chars-modified-tick))
9644 (not (equal current (verilog-modi-file-or-buffer modi))))) 9664 (not (equal current (verilog-modi-file-or-buffer modi)))))
9645 ;;(message "verilog-modi-lookup: HIT %S" modi) 9665 ;;(message "verilog-modi-lookup: HIT %S" modi)
@@ -10617,7 +10637,7 @@ If FORCE, always reread it."
10617;; 10637;;
10618 10638
10619(defun verilog-auto-arg-ports (sigs message indent-pt) 10639(defun verilog-auto-arg-ports (sigs message indent-pt)
10620 "Print a list of ports for an AUTOINST. 10640 "Print a list of ports for AUTOARG.
10621Takes SIGS list, adds MESSAGE to front and inserts each at INDENT-PT." 10641Takes SIGS list, adds MESSAGE to front and inserts each at INDENT-PT."
10622 (when sigs 10642 (when sigs
10623 (when verilog-auto-arg-sort 10643 (when verilog-auto-arg-sort
@@ -10629,13 +10649,19 @@ Takes SIGS list, adds MESSAGE to front and inserts each at INDENT-PT."
10629 (let ((space "")) 10649 (let ((space ""))
10630 (indent-to indent-pt) 10650 (indent-to indent-pt)
10631 (while sigs 10651 (while sigs
10632 (cond ((> (+ 2 (current-column) (length (verilog-sig-name (car sigs)))) fill-column) 10652 (cond ((equal verilog-auto-arg-format 'single)
10653 (indent-to indent-pt)
10654 (setq space "\n"))
10655 ;; verilog-auto-arg-format 'packed
10656 ((> (+ 2 (current-column) (length (verilog-sig-name (car sigs)))) fill-column)
10633 (insert "\n") 10657 (insert "\n")
10634 (indent-to indent-pt)) 10658 (indent-to indent-pt)
10635 (t (insert space))) 10659 (setq space " "))
10660 (t
10661 (insert space)
10662 (setq space " ")))
10636 (insert (verilog-sig-name (car sigs)) ",") 10663 (insert (verilog-sig-name (car sigs)) ",")
10637 (setq sigs (cdr sigs) 10664 (setq sigs (cdr sigs))))))
10638 space " ")))))
10639 10665
10640(defun verilog-auto-arg () 10666(defun verilog-auto-arg ()
10641 "Expand AUTOARG statements. 10667 "Expand AUTOARG statements.
@@ -10670,9 +10696,11 @@ Typing \\[verilog-auto] will make this into:
10670 output o; 10696 output o;
10671 endmodule 10697 endmodule
10672 10698
10673The argument declarations may be printed in declaration order to best suit 10699The argument declarations may be printed in declaration order to
10674order based instantiations, or alphabetically, based on the 10700best suit order based instantiations, or alphabetically, based on
10675`verilog-auto-arg-sort' variable. 10701the `verilog-auto-arg-sort' variable.
10702
10703Formatting is controlled with `verilog-auto-arg-format' variable.
10676 10704
10677Any ports declared between the ( and /*AUTOARG*/ are presumed to be 10705Any ports declared between the ( and /*AUTOARG*/ are presumed to be
10678predeclared and are not redeclared by AUTOARG. AUTOARG will make a 10706predeclared and are not redeclared by AUTOARG. AUTOARG will make a