Skip to content

Commit

Permalink
Minor code fixes and doc function renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
gmlarumbe committed Jun 17, 2023
1 parent bc04321 commit 574aa4d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Enabling of `verilog-ext-mode` minor-mode creates the following keybindings:

* Features:
* <kbd>M-i</kbd> `verilog-ext-imenu-list`
* <kbd>C-c C-l</kbd> `verilog-ext-code-format`
* <kbd>C-c C-l</kbd> `verilog-ext-formatter-run`
* <kbd>C-c \<f5\></kbd> `verilog-ext-workspace-compile`
* <kbd>C-c C-p</kbd> `verilog-ext-preprocess`
* <kbd>C-c C-f</kbd> `verilog-ext-flycheck-mode`
Expand All @@ -159,8 +159,8 @@ Enabling of `verilog-ext-mode` minor-mode creates the following keybindings:
* <kbd>C-\<tab\></kbd> `verilog-ext-hs-toggle-hiding`

* Code beautifying
* <kbd>C-M-i</kbd> `verilog-ext-indent-block-at-point`
* <kbd>C-c C-b</kbd> `verilog-ext-module-at-point-beautify`
* <kbd>C-M-i</kbd> `verilog-ext-beautify-block-at-point-indent`
* <kbd>C-c C-b</kbd> `verilog-ext-beautify-module-at-point`

* Dwim navigation
* <kbd>C-M-a</kbd> `verilog-ext-nav-beg-of-defun-dwim`
Expand All @@ -178,9 +178,9 @@ Enabling of `verilog-ext-mode` minor-mode creates the following keybindings:
* <kbd>C-M-.</kbd> `verilog-ext-workspace-jump-to-parent-module`

* Port connections
* <kbd>C-c C-c c</kbd> `verilog-ext-clean-port-blanks`
* <kbd>C-c C-c t</kbd> `verilog-ext-toggle-connect-port`
* <kbd>C-c C-c r</kbd> `verilog-ext-connect-ports-recursively`
* <kbd>C-c C-c c</kbd> `verilog-ext-ports-clean-blanks`
* <kbd>C-c C-c t</kbd> `verilog-ext-ports-toggle-connect`
* <kbd>C-c C-c r</kbd> `verilog-ext-ports-connect-recursively`

* Syntax table override functions:
* <kbd>TAB</kbd> `verilog-ext-tab`
Expand Down Expand Up @@ -267,13 +267,13 @@ Indent and align parameters and ports of RTL instances.

Interactive functions:

* `verilog-ext-module-at-point-beautify`: <kbd>C-c C-b</kbd>
* `verilog-ext-beautify-module-at-point`: <kbd>C-c C-b</kbd>
* `verilog-ext-beautify-current-buffer`

Batch-mode functions:

* `verilog-ext-beautify-files`
* `verilog-ext-beautify-files-current-dir`
* `verilog-ext-beautify-dir-files`

## Navigation ##

Expand Down Expand Up @@ -399,9 +399,9 @@ Toggle connections of ports under instance at point

<img src="https://user-images.githubusercontent.com/51021955/220176192-d823ba19-099f-4484-abc7-8269fd92928b.gif" width=400 height=300>

* `verilog-ext-toggle-connect-port`: <kbd>C-c C-c t</kbd>
* `verilog-ext-connect-ports-recursively`: <kbd>C-c C-c r</kbd>
* `verilog-ext-clean-port-blanks`: <kbd>C-c C-c c</kbd>
* `verilog-ext-ports-toggle-connect`: <kbd>C-c C-c t</kbd>
* `verilog-ext-ports-connect-recursively`: <kbd>C-c C-c r</kbd>
* `verilog-ext-ports-clean-blanks`: <kbd>C-c C-c c</kbd>


## Misc ##
Expand Down
12 changes: 6 additions & 6 deletions verilog-ext-beautify.el
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@
(setq current-module (car current-ids))
(save-excursion
(goto-char (match-beginning 0))
(beginning-of-line)
(goto-char (line-beginning-position))
(setq beg (point))
(goto-char (match-end 0))
(end-of-line)
(goto-char (line-end-position))
(setq end (point)))
(verilog-ext-indent-region beg end)
(message "Indented %s" current-module)))
Expand Down Expand Up @@ -136,10 +136,10 @@ FILES is a list of strings containing the filepaths."
(error "File %s does not exist! Aborting!" file)))
(save-window-excursion
(dolist (file files)
(find-file file)
(verilog-mode)
(verilog-ext-beautify-current-buffer)
(write-file file))))
(with-temp-file file
(insert-file-contents file)
(verilog-mode)
(verilog-ext-beautify-current-buffer)))))

(defun verilog-ext-beautify-dir-files (dir)
"Beautify Verilog files on DIR."
Expand Down
2 changes: 1 addition & 1 deletion verilog-ext-font-lock.el
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ Bound search by LIMIT."
(while (and (not found)
(verilog-re-search-forward decl-typedef-re limit t))
(when (save-excursion
(beginning-of-line)
(goto-char (line-beginning-position))
(looking-at decl-typedef-re))
(setq found t)))
(when found
Expand Down
4 changes: 2 additions & 2 deletions verilog-ext-hierarchy.el
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ Move through headings and point at the beginning of the tag."
(declare (indent 0) (debug t))
`(defun ,verilog-ext-func ()
(interactive)
(beginning-of-line) ; Required for `outline-hide-sublevels'
(goto-char (line-beginning-position)) ; Required for `outline-hide-sublevels'
(call-interactively ,outshine-func)
(skip-chars-forward (car (car outshine-promotion-headings)))))

Expand Down Expand Up @@ -414,7 +414,7 @@ Expects HIERARCHY to be a indented string."
(goto-char (point-min))
(re-search-forward "// \\* ")
(when (re-search-forward "// \\* " nil t)
(beginning-of-line)
(goto-char (line-beginning-position))
(open-line 3)
(forward-line 2)
(insert "// * Not found module references")
Expand Down
2 changes: 1 addition & 1 deletion verilog-ext-ports.el
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ of current port instead of toggling."
(re (concat "\\(?1:^\\s-*\\)\\.\\(?2:" verilog-identifier-re "\\)\\(?3:\\s-*\\)\\(?4:(\\s-*\\(?5:" verilog-identifier-re "\\)*\\s-*)\\)?"))
port-found port conn sig)
(save-excursion
(beginning-of-line)
(goto-char (line-beginning-position))
(if (looking-at re)
(progn
(setq port-found t)
Expand Down
8 changes: 4 additions & 4 deletions verilog-ext-template.el
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ Syntactic sugar for `verilog-ext-template-inst-auto-from-file'."
(verilog-ext-replace-string "/*AUTOINSTPARAM*/" "" beg end)
;; Remove ' // Parameters ' string
(forward-line 1)
(beginning-of-line)
(goto-char (line-beginning-position))
(kill-line 1))))

(defun verilog-ext-template-inst-auto-from-file (file &optional template inst-template)
Expand Down Expand Up @@ -657,15 +657,15 @@ endmodule // tb_<module_name>
(point) (verilog-pos-at-end-of-statement)))
(save-excursion
(while (re-search-forward "/\\*AUTO.*\*\/" nil t)
(beginning-of-line)
(goto-char (line-beginning-position))
(kill-line 1)))
(save-excursion
(while (search-forward "// Beginning of automatic" nil t)
(beginning-of-line)
(goto-char (line-beginning-position))
(kill-line 1)))
(save-excursion
(while (search-forward "// End of automatics" nil t)
(beginning-of-line)
(goto-char (line-beginning-position))
(kill-line 1)))
(search-forward "// TODO")
(write-file outfile)))
Expand Down

0 comments on commit 574aa4d

Please sign in to comment.