Compare commits
10 Commits
46141609ac
...
503d0b38b0
Author | SHA1 | Date |
---|---|---|
John Turner | 503d0b38b0 | 11 months ago |
John Turner | 7ff7d65700 | 11 months ago |
John Turner | 86fee35bc4 | 11 months ago |
John Turner | aab807be63 | 11 months ago |
John Turner | 0f331b9321 | 1 year ago |
John Turner | 72c0d999b6 | 1 year ago |
John Turner | 6045d40d78 | 1 year ago |
John Turner | 105399f2a5 | 1 year ago |
John Turner | 13d49b4920 | 1 year ago |
John Turner | 9e755851c6 | 1 year ago |
@ -0,0 +1,37 @@
|
||||
;;; flycheck-nasm-mode.el --- flycheck checker for NASM -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2024 John Turner
|
||||
|
||||
;; Author: John Turner jturner.usa@gmail.com
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'flycheck)
|
||||
|
||||
(flycheck-def-option-var flycheck-nasm-format "elf64" nasm
|
||||
"NASM executable format."
|
||||
:type 'string)
|
||||
|
||||
(flycheck-define-checker nasm
|
||||
"Flycheck checker for NASM."
|
||||
:command ("nasm" "-o" "/dev/null" (option "-f" flycheck-nasm-format) source)
|
||||
:error-patterns ((error line-start (file-name) ":" line ":" space "error:" space (message) line-end)
|
||||
(warning line-start (file-name) ":" line ":" space "warning:" space (message) line-end))
|
||||
:modes (asm-mode nasm-mode))
|
||||
|
||||
(provide 'flycheck-nasm)
|
||||
;;; flycheck-nasm-mode.el ends here
|
@ -0,0 +1,76 @@
|
||||
;;; fmt.el --- -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2023 John Turner
|
||||
|
||||
;; Author: John Turner <notroot@gentoo-pc>
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
(defgroup fmt nil
|
||||
"Format buffers using external programs such as rustfmt.")
|
||||
|
||||
(defcustom fmt-executable nil
|
||||
"Formatter executable to use for formatting a buffer."
|
||||
:local t
|
||||
:type '(string)
|
||||
:group 'fmt)
|
||||
|
||||
(defcustom fmt-args nil
|
||||
"Args to use when running fmt-executable."
|
||||
:local t
|
||||
:type '(repeat string)
|
||||
:group 'fmt)
|
||||
|
||||
(defun fmt--init-output-buffer (name)
|
||||
(with-current-buffer (get-buffer-create name)
|
||||
(erase-buffer)
|
||||
(current-buffer)))
|
||||
|
||||
(defun fmt--wait-for-processes (processes)
|
||||
(cl-loop for process in processes
|
||||
do (cl-loop while (accept-process-output process))))
|
||||
|
||||
(defun fmt-process-current-buffer ()
|
||||
(let* ((stdout-buffer (fmt--init-output-buffer "*fmt stdout*"))
|
||||
(stderr-buffer (fmt--init-output-buffer "*fmt stderr*"))
|
||||
(stderr (make-pipe-process
|
||||
:name (format "%s stderr" fmt-executable)
|
||||
:buffer stderr-buffer
|
||||
:sentinel 'ignore
|
||||
:noquery t))
|
||||
(process (make-process
|
||||
:name fmt-executable
|
||||
:buffer stdout-buffer
|
||||
:command (cons fmt-executable fmt-args)
|
||||
:sentinel 'ignore
|
||||
:noquery t
|
||||
:connection-type 'pipe
|
||||
:stderr stderr)))
|
||||
(process-send-region process (point-min) (point-max))
|
||||
(process-send-eof process)
|
||||
(cons process stderr)))
|
||||
|
||||
(defun fmt-current-buffer ()
|
||||
(interactive)
|
||||
(pcase-let ((`(,process . ,stderr) (fmt-process-current-buffer)))
|
||||
(fmt--wait-for-processes (list process stderr))
|
||||
(if (zerop (process-exit-status process))
|
||||
(replace-buffer-contents (process-buffer process))
|
||||
(message "%s failed with exit status %s. See %s for output."
|
||||
fmt-executable
|
||||
(process-exit-status process)
|
||||
(process-buffer stderr)))))
|
||||
|
||||
(provide 'fmt)
|
||||
;;; fmt.el ends here
|
@ -0,0 +1,4 @@
|
||||
(use-package dired
|
||||
:custom
|
||||
(dired-listing-switches "-ahl --group-directories-first")
|
||||
(dired-kill-when-opening-new-dired-buffer t))
|
@ -1,3 +1,9 @@
|
||||
(use-package flycheck
|
||||
:hook
|
||||
(flycheck-error-list-mode . visual-line-mode))
|
||||
(flycheck-error-list-mode . visual-line-mode)
|
||||
:custom
|
||||
(flycheck-python-mypy-cache-dir (file-name-concat (getenv "HOME") ".cache" "mypy"))
|
||||
:config
|
||||
(when (require 'best-side-window nil t)
|
||||
(add-to-list 'display-buffer-alist '((major-mode . flycheck-error-list-mode)
|
||||
best-side-window-display-buffer-in-best-side-window))))
|
||||
|
@ -0,0 +1,3 @@
|
||||
(use-package image-dired
|
||||
:custom
|
||||
(image-dired-dir (file-name-concat (xdg-cache-home) "image-dired")))
|
@ -0,0 +1 @@
|
||||
(use-package nasm-mode)
|
@ -0,0 +1,3 @@
|
||||
(use-package recentf
|
||||
:custom
|
||||
(recentf-save-file (file-name-concat (xdg-state-home) "emacs/recentf")))
|
@ -1,4 +1,4 @@
|
||||
(use-package savehist
|
||||
:custom
|
||||
(savehist-file (file-name-concat user-emacs-directory "savehist"))
|
||||
(savehist-file (file-name-concat (xdg-state-home) "emacs/savehist"))
|
||||
(savehist-save-minibuffer-history t))
|
||||
|
@ -0,0 +1,4 @@
|
||||
(use-package saveplace
|
||||
:custom
|
||||
(save-place-file (file-name-concat (xdg-state-home) "saveplace/places"))
|
||||
(save-place-limit nil))
|
@ -1,9 +1,8 @@
|
||||
(use-package tramp
|
||||
:custom
|
||||
(tramp-password-cache nil)
|
||||
(tramp-persistency-file-name nil)
|
||||
(tramp-persistency-file-name (file-name-concat (xdg-state-home) "emacs/tramp/persistency-file"))
|
||||
:config
|
||||
(add-to-list 'tramp-connection-properties
|
||||
(list (regexp-quote (format "/sudo:root@%s:" system-name))
|
||||
"session-timeout" (* 60 60)))
|
||||
(add-to-list 'tramp-remote-path "/root/bin"))
|
||||
"session-timeout" (* 60 60))))
|
||||
|
@ -0,0 +1,5 @@
|
||||
(use-package transient
|
||||
:custom
|
||||
(transient-levels-file (file-name-concat (xdg-state-home) "emacs/transient/levels.el"))
|
||||
(transient-values-file (file-name-concat (xdg-state-home) "emacs/transient/values.el"))
|
||||
(transient-history-file (file-name-concat (xdg-state-home) "emacs/transient/history.el")))
|
Loading…
Reference in New Issue