diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-04-12 11:45:33 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-04-12 11:45:33 +0200 |
commit | 72db25ef54f3d8e3b9827eeaa6df2eab2711cdff (patch) | |
tree | 479d3506dbf24b91d71acbaa82ba519a17009aa4 /lisp/progmodes/verilog-mode.el | |
parent | f2ab4cec7a762e8fe641cde00e6b299a92301cac (diff) | |
download | emacs-72db25ef54f3d8e3b9827eeaa6df2eab2711cdff.tar.gz emacs-72db25ef54f3d8e3b9827eeaa6df2eab2711cdff.tar.bz2 emacs-72db25ef54f3d8e3b9827eeaa6df2eab2711cdff.zip |
Adjust verilog-mode to changes in the completion framework
* lisp/progmodes/verilog-mode.el (verilog-func-completion): Don't
bug out on `C-M-i' (which expects no point movement) (bug#47652).
(verilog-declaration-end): There may be no semicolons; don't bug out.
Diffstat (limited to 'lisp/progmodes/verilog-mode.el')
-rw-r--r-- | lisp/progmodes/verilog-mode.el | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index a7f72950b10..5f8f723f80e 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -3607,7 +3607,7 @@ inserted using a single call to `verilog-insert'." ;; More searching (defun verilog-declaration-end () - (search-forward ";")) + (search-forward ";" nil t)) (defun verilog-single-declaration-end (limit) "Returns pos where current (single) declaration statement ends. @@ -7555,25 +7555,25 @@ will be completed at runtime and should not be added to this list.") TYPE is `module', `tf' for task or function, or t if unknown." (if (string= verilog-str "") (setq verilog-str "[a-zA-Z_]")) - (let ((verilog-str (concat (cond - ((eq type 'module) "\\<\\(module\\|connectmodule\\)\\s +") - ((eq type 'tf) "\\<\\(task\\|function\\)\\s +") - (t "\\<\\(task\\|function\\|module\\|connectmodule\\)\\s +")) - "\\<\\(" verilog-str "[a-zA-Z0-9_.]*\\)\\>")) + (let ((verilog-str + (concat (cond + ((eq type 'module) "\\<\\(module\\|connectmodule\\)\\s +") + ((eq type 'tf) "\\<\\(task\\|function\\)\\s +") + (t "\\<\\(task\\|function\\|module\\|connectmodule\\)\\s +")) + "\\<\\(" verilog-str "[a-zA-Z0-9_.]*\\)\\>")) match) - (if (not (looking-at verilog-defun-re)) - (verilog-re-search-backward verilog-defun-re nil t)) - (forward-char 1) + (save-excursion + (if (not (looking-at verilog-defun-re)) + (verilog-re-search-backward verilog-defun-re nil t)) + (forward-char 1) - ;; Search through all reachable functions - (goto-char (point-min)) - (while (verilog-re-search-forward verilog-str (point-max) t) - (progn (setq match (buffer-substring (match-beginning 2) - (match-end 2))) - (setq verilog-all (cons match verilog-all)))) - (if (match-beginning 0) - (goto-char (match-beginning 0))))) + ;; Search through all reachable functions + (goto-char (point-min)) + (while (verilog-re-search-forward verilog-str (point-max) t) + (setq match (buffer-substring (match-beginning 2) + (match-end 2))) + (setq verilog-all (cons match verilog-all)))))) (defun verilog-get-completion-decl (end) "Macro for searching through current declaration (var, type or const) |