Skip to content

Commit

Permalink
WIP: Replace redundant append code with splice operator
Browse files Browse the repository at this point in the history
  • Loading branch information
gmlarumbe committed Aug 17, 2023
1 parent 57c76a7 commit 287f5dd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions test/verilog-ext-tests-hierarchy.el
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
;; `verilog-ext-tests-jump-parent-dir' and the instances.sv one
(cl-letf (((symbol-function 'verilog-ext-find-project-files)
(lambda (&optional follow-symlinks)
(append (verilog-ext-find-dir-files verilog-ext-tests-jump-parent-dir follow-symlinks)
`(,test-file))))
`(,@(verilog-ext-find-dir-files verilog-ext-tests-jump-parent-dir follow-symlinks)
,test-file)))
((symbol-function 'verilog-ext-hierarchy-display-twidget)
(lambda (hierarchy)
hierarchy))
Expand Down
4 changes: 2 additions & 2 deletions verilog-ext-eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ Override any previous configuration for `verilog-mode' and `verilog-ts-mode'."
(dolist (mode '(verilog-mode verilog-ts-mode))
(setq eglot-server-programs (assq-delete-all mode eglot-server-programs))
(if (listp cmd)
(push (append (list mode) cmd) eglot-server-programs)
(push (list mode cmd) eglot-server-programs)))
(push `(,@mode ,cmd) eglot-server-programs)
(push `(,mode ,cmd) eglot-server-programs)))
;; Additional settings depending on chosen server-id
(when (equal server-id 've-svlangserver)
(dolist (hook '(verilog-mode-hook verilog-ts-mode-hook))
Expand Down
4 changes: 2 additions & 2 deletions verilog-ext-tags.el
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ existing one with current location properties."
(puthash parent (list :items nil :locs nil) table)))
(setq parent-items (plist-get parent-value :items))
(unless (member tag parent-items)
(plist-put parent-value :items (append parent-items `(,tag)))
(plist-put parent-value :items `(,@parent-items ,tag))
(puthash parent parent-value table)))
table))

Expand Down Expand Up @@ -205,7 +205,7 @@ completion."
(setq inner-limit (verilog-ext-pos-at-forward-sexp)))
(let ((top-items-defs '(declarations tf structs classes)))
(when (string-match "\\<\\(module\\|interface\\)\\>" type)
(setq top-items-defs (append top-items-defs '(instances))))
(setq top-items-defs `(,@top-items-defs instances)))
(dolist (defs top-items-defs)
(verilog-ext-tags-table-push-definitions defs table file inner-start inner-limit tag)))))
(_ (error "Unsupported tag type")))))
Expand Down
2 changes: 1 addition & 1 deletion verilog-ext-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ If on a `verilog-ts-mode' buffer, run `indent-for-tab-command' with ARG."
(defun verilog-ext-company-keywords-add ()
"Add `verilog-keywords' to `company-keywords' backend."
(dolist (mode '(verilog-mode verilog-ts-mode))
(add-to-list 'company-keywords-alist (append `(,mode) verilog-keywords))))
(add-to-list 'company-keywords-alist `(,mode ,@verilog-keywords))))

(provide 'verilog-ext-utils)

Expand Down
4 changes: 2 additions & 2 deletions verilog-ext-workspace.el
Original file line number Diff line number Diff line change
Expand Up @@ -634,12 +634,12 @@ and will set the appropriate mode."
(string= cmd-bin "svlint")
(if (member "-1" cmd-args)
verilog-ext-workspace-compile-cmd
(mapconcat #'identity (append `(,cmd-bin) '("-1") cmd-args) " ")))
(mapconcat #'identity `(,cmd-bin "-1" ,@cmd-args) " ")))
;; For slang make sure that there is no colored output
((string= cmd-bin "slang")
(if (member "--color-diagnostics=false" cmd-args)
verilog-ext-workspace-compile-cmd
(mapconcat #'identity (append `(,cmd-bin) '("--color-diagnostics=false") cmd-args) " ")))
(mapconcat #'identity `(,cmd-bin "--color-diagnostics=false" ,@cmd-args) " ")))
;; For the rest use the provided command
(t
verilog-ext-workspace-compile-cmd)))
Expand Down

0 comments on commit 287f5dd

Please sign in to comment.