From a05cc4363b9421cf553bc86a733675da738e65cb Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Wed, 17 Apr 2024 10:08:58 -0500 Subject: [PATCH] adding rust compilation pieces to compile errors --- README.org | 9 +++++---- init.el | 9 +++++---- lumina.el | 49 +++++++++++++++++++++++++++++++++++++------------ 3 files changed, 47 insertions(+), 20 deletions(-) diff --git a/README.org b/README.org index bf1eceb3..4fb86355 100644 --- a/README.org +++ b/README.org @@ -3429,15 +3429,16 @@ I'd like to start learning and using rust if I can. rustic-lsp-client 'eglot rustic-clippy-arguments "-- -W clippy::pedantic") (advice-add 'eglot-completion-at-point :around #'cape-wrap-buster) + (add-to-list 'compilation-error-regexp-alist rustic-compilation-error) + (add-to-list 'compilation-error-regexp-alist rustic-compilation-warning) :general (general-def 'normal rustic-mode-map "!" 'rustic-run-shell-command "gC" 'rustic-cargo-clippy "gA" 'rustic-cargo-add - "gt" 'rustic-cargo-test) - (chris/leader-keys - :states 'normal - :keymaps '(rustic-mode) + "gt" 'rustic-cargo-test + "gT" 'rustic-cargo-current-test) + (chris/leader-keys 'normal rustic-mode-map "gc" 'rustic-compile "gr" 'projectile-run-project "si" 'consult-imenu-multi)) diff --git a/init.el b/init.el index af7a1865..c8efaffe 100644 --- a/init.el +++ b/init.el @@ -2546,15 +2546,16 @@ targets." rustic-lsp-client 'eglot rustic-clippy-arguments "-- -W clippy::pedantic") (advice-add 'eglot-completion-at-point :around #'cape-wrap-buster) + (add-to-list 'compilation-error-regexp-alist rustic-compilation-error) + (add-to-list 'compilation-error-regexp-alist rustic-compilation-warning) :general (general-def 'normal rustic-mode-map "!" 'rustic-run-shell-command "gC" 'rustic-cargo-clippy "gA" 'rustic-cargo-add - "gt" 'rustic-cargo-test) - (chris/leader-keys - :states 'normal - :keymaps '(rustic-mode) + "gt" 'rustic-cargo-test + "gT" 'rustic-cargo-current-test) + (chris/leader-keys 'normal rustic-mode-map "gc" 'rustic-compile "gr" 'projectile-run-project "si" 'consult-imenu-multi)) diff --git a/lumina.el b/lumina.el index d9fcba1b..6642428a 100644 --- a/lumina.el +++ b/lumina.el @@ -13,7 +13,16 @@ (define-derived-mode lumina-mode tabulated-list-mode "lumina:songs" "A mode for working with the lumina database and updating and adding songs" - (setf tabulated-list-format ['("Title" 10 t) '("Lyrics" 30 nil) '("Author" 10 t) '("CCLI" 7 nil) '("B" 1 nil) '("BT" 10 nil) '("h" 1 nil) '("v" 1 nil) '("f" 10 nil) '("fs" 2 nil)])) + (setf tabulated-list-format ['("Title" 10 t) + '("Lyrics" 30 nil) + '("Author" 10 t) + '("CCLI" 7 nil) + '("B" 1 nil) + '("BT" 10 nil) + '("h" 1 nil) + '("v" 1 nil) + '("f" 10 nil) + '("fs" 2 nil)])) (defun lumina-get-ids () "Gets the ids of all songs in the sql result" @@ -36,7 +45,8 @@ (setf lumina-buffer (get-buffer-create "*lumina*")) (with-current-buffer lumina-buffer (lumina-mode) - (setf tabulated-list-entries (cl-mapcar #'list (lumina-get-ids) (lumina-get-songs))) + (setf tabulated-list-entries + (cl-mapcar #'list (lumina-get-ids) (lumina-get-songs))) (tabulated-list-print t t)) (switch-to-buffer lumina-buffer)) @@ -109,29 +119,44 @@ (search-forward "#+VERSE_ORDER: ") (buffer-substring-no-properties (point) nil))) -(defvar lumina-lyrics-update-query (concat "update songs set lyrics = \"?" (lumina-grab-lyrics) "\" where title = " lumina-current-song)) +(defvar lumina-lyrics-update-query + (concat "update songs set lyrics = \"?" + (lumina-grab-lyrics) + "\" where title = " + lumina-current-song)) (defun lumina-update-lyrics () "Update the lyrics in the db" (interactive) - (sqlite-execute lumina-db "update songs set lyrics = ? where title = ?" `(,(lumina-grab-lyrics) ,lumina-current-song)) + (sqlite-execute lumina-db + "update songs set lyrics = ? where title = ?" + `(,(lumina-grab-lyrics) ,lumina-current-song)) (setf lumina-songs (sqlite-select lumina-db "select * from songs;"))) (defun lumina-get-lyrics-genius (song) "retrieve lyrics to a song from genius lyrics" - (let* ((url (concat "https://api.genius.com/search?" "access_token=" "R0Y0ZW50Il9LSh5su3LKfdyfmQRx41NpVvLFJ0VxMo-hQ_4H1OVg_IE0Q-UUoFQx" "&q=" song)) + (let* ((url (concat "https://api.genius.com/search?" + "access_token=" + "R0Y0ZW50Il9LSh5su3LKfdyfmQRx41NpVvLFJ0VxMo-hQ_4H1OVg_IE0Q-UUoFQx" + "&q=" + song)) (songs (cl-loop for song across - (cdr (cadadr (plz 'get (url-encode-url url) :as #'json-read))) - collect `(,(concat (cdr (elt (elt song 3) 19)) " by " - (cdr (elt (elt (elt song 3) 23) 7)) - " with id " - (number-to-string - (cdr (elt (elt song 3) 7))))))) + (cdr (cadadr + (plz 'get (url-encode-url url) :as #'json-read))) + collect `(,(concat + (cdr (elt (elt song 3) 19)) " by " + (cdr (elt (elt (elt song 3) 23) 7)) + " with id " + (number-to-string + (cdr (elt (elt song 3) 7))))))) (selected-song (completing-read "song? " songs)) (id (replace-regexp-in-string "[^0-9]" "" selected-song))) - (plz 'get (url-encode-url (concat "https://api.genius.com/songs/" id "?access_token=R0Y0ZW50Il9LSh5su3LKfdyfmQRx41NpVvLFJ0VxMo-hQ_4H1OVg_IE0Q-UUoFQx"))))) + (plz 'get + (url-encode-url + (concat "https://api.genius.com/songs/" id + "?access_token=R0Y0ZW50Il9LSh5su3LKfdyfmQRx41NpVvLFJ0VxMo-hQ_4H1OVg_IE0Q-UUoFQx"))))) (cdr (elt (elt (elt (lumina-get-lyrics-genius "Death Was Arrested") 0) 3) 7))