From 7f18416acdc2b12efe5e0a6c5e63d93322374949 Mon Sep 17 00:00:00 2001 From: Joel Grunbaum <joelgrun@gmail.com> Date: Tue, 26 Dec 2023 09:50:51 +0000 Subject: [PATCH] Added some features and updated config --- init.el | 3 +++ config.org | 32 +++++++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/config.org b/config.org index 4354593..8d8f8e0 100644 --- a/config.org +++ b/config.org @@ -503,6 +503,8 @@ (use-package undo-tree :diminish undo-tree-mode :config + (setq-default undo-tree-auto-save-history t) + (add-to-list 'undo-tree-incompatible-major-modes 'archive-mode) (global-undo-tree-mode)) #+END_SRC @@ -551,7 +553,9 @@ ** Line numbers Everyone needs line numbers when programming. #+BEGIN_SRC emacs-lisp - (add-hook 'prog-mode-hook 'linum-mode) + (if (version<= "26.0.50" emacs-version) + (add-hook 'prog-mode-hook 'display-line-numbers-mode) + (add-hook 'prog-mode-hook 'linum-mode)) #+END_SRC ** Garbage collection @@ -799,7 +803,8 @@ (setq read-process-output-max (* 1024 1024)) (setq lsp-completion-provider :capf) (setq lsp-keep-workspace-alive 'nil) - (add-to-list 'exec-path "~/.cargo/bin")) + (add-to-list 'exec-path "~/.cargo/bin") + (add-to-list 'exec-path "~/.local/bin")) (use-package lsp-ui :commands lsp-ui-mode) @@ -1212,6 +1217,27 @@ verilog-indent-level-directive 4 verilog-indent-level-module 4)) #+END_SRC +**** FPGA +#+BEGIN_SRC emacs-lisp + (use-package fpga + :init + (setq fpga-feature-list '(xilinx))) +#+END_SRC +**** Run and test +Run the open buffer and display the output in a new buffer. +#+BEGIN_SRC emacs-lisp + (defun run-verilator () + (interactive) + (save-buffer) + (if (not (eq (shell-command (concat "verilator --binary -j 0 " (buffer-file-name)) "*verilator output*") 0)) + (display-buffer "*verilator output*" 'display-buffer-reuse-window) + (shell-command (concat (file-name-directory (buffer-file-name)) + '"obj_dir/V" + (file-name-nondirectory (file-name-sans-extension (buffer-file-name)))) + "*test output*") + (display-buffer "*test output*" 'display-buffer-reuse-window)) + t) + (define-key verilog-mode-map (kbd "C-c c") 'run-verilator) #+END_SRC *** MATLAB Mode for editing MATLAB m-files. @@ -1300,7 +1326,7 @@ Pull the latest org mode from the repository, rather than the org which comes with emacs. #+BEGIN_SRC emacs-lisp (use-package org - :ensure org-contrib) + :pin gnu) #+END_SRC ** Small tweaks diff --git a/init.el b/init.el index c2b78e1..f911bd8 100644 --- a/init.el +++ b/init.el @@ -13,6 +13,7 @@ (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) +(setq package-install-upgrade-built-in t) (eval-when-compile (require 'use-package)) @@ -25,6 +26,8 @@ :config (setq auto-package-update-delete-old-versions t) (setq auto-package-update-hide-results t) + (setq auto-package-update-interval 7) + (setq auto-package-update-at-time "03:00") (auto-package-update-maybe)) ;; diminish -- Gitblit v1.9.3