mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-06-14 12:21:20 +00:00
Let's not do tramp for now
This commit is contained in:
parent
a4e62fe73e
commit
cf32daf8ce
4 changed files with 36 additions and 51 deletions
|
|
@ -54,7 +54,7 @@
|
||||||
(defclass comp-dev-config ()
|
(defclass comp-dev-config ()
|
||||||
((root-dir :initarg :root-dir :type string)
|
((root-dir :initarg :root-dir :type string)
|
||||||
(target :initarg :target :type string)
|
(target :initarg :target :type string)
|
||||||
(tramp-connection :initarg :tramp :type list :initform nil)
|
;; (tramp-connection :initarg :tramp :type list :initform nil)
|
||||||
|
|
||||||
(aux-props :initarg :aux-props :type list :initform nil)))
|
(aux-props :initarg :aux-props :type list :initform nil)))
|
||||||
|
|
||||||
|
|
@ -105,20 +105,6 @@
|
||||||
(setf (slot-value (comp-dev/get-config) key)
|
(setf (slot-value (comp-dev/get-config) key)
|
||||||
val))
|
val))
|
||||||
|
|
||||||
(defun lls/tramp-connection ()
|
|
||||||
(lls/conf-get 'tramp-connection))
|
|
||||||
|
|
||||||
(defun lls/trampify (path)
|
|
||||||
(if-let ((vec (lls/tramp-connection)))
|
|
||||||
(tramp-make-tramp-file-name vec path)
|
|
||||||
path))
|
|
||||||
|
|
||||||
(defun lls/un-trampify (path)
|
|
||||||
(if-let ((vec (lls/tramp-connection)))
|
|
||||||
(with-parsed-tramp-file-name path nil
|
|
||||||
localname)
|
|
||||||
path))
|
|
||||||
|
|
||||||
(defun lls/default-initialize ()
|
(defun lls/default-initialize ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((lls/target-init-fun #'lls/default-target-init))
|
(let ((lls/target-init-fun #'lls/default-target-init))
|
||||||
|
|
@ -200,17 +186,16 @@
|
||||||
collection nil nil initial-input)))))
|
collection nil nil initial-input)))))
|
||||||
|
|
||||||
(defun lls/prompt-tool (tool-regexp &optional directories)
|
(defun lls/prompt-tool (tool-regexp &optional directories)
|
||||||
(lls/un-trampify
|
(let (;;(vertico-sort-function nil)
|
||||||
(let (;;(vertico-sort-function nil)
|
)
|
||||||
)
|
(my/completing-read tool-regexp
|
||||||
(my/completing-read tool-regexp
|
(lls/get-tool tool-regexp
|
||||||
(lls/get-tool tool-regexp
|
(or (and (eq 'string (type-of directories))
|
||||||
(or (and (eq 'string (type-of directories))
|
(list directories))
|
||||||
(list directories))
|
directories))
|
||||||
directories))
|
(awhen (ti/current-tools-directory)
|
||||||
(awhen (ti/current-tools-directory)
|
(concat (file-name-nondirectory it)
|
||||||
(concat (file-name-nondirectory it)
|
" ")))))
|
||||||
" "))))))
|
|
||||||
|
|
||||||
(defun lls/get-tool (tool-regexp &optional directories)
|
(defun lls/get-tool (tool-regexp &optional directories)
|
||||||
(cl-mapcan #'(lambda (dir)
|
(cl-mapcan #'(lambda (dir)
|
||||||
|
|
|
||||||
|
|
@ -134,8 +134,8 @@
|
||||||
(ediff-files "/tmp/no-option.asm" "/tmp/yes-option.asm")))
|
(ediff-files "/tmp/no-option.asm" "/tmp/yes-option.asm")))
|
||||||
|
|
||||||
(defun ll/diff-on-compiler (file action)
|
(defun ll/diff-on-compiler (file action)
|
||||||
(let ((comm (ll/build-clang-command (lls/un-trampify file) action))
|
(let ((comm (ll/build-clang-command file action))
|
||||||
(second-command (ll/build-clang-command (lls/un-trampify file) action))
|
(second-command (ll/build-clang-command file action))
|
||||||
(pipe (if (y-or-n-p "Diff assembly (y) or debug (n)? ")
|
(pipe (if (y-or-n-p "Diff assembly (y) or debug (n)? ")
|
||||||
">" "2>")))
|
">" "2>")))
|
||||||
(when (save-window-excursion
|
(when (save-window-excursion
|
||||||
|
|
@ -165,7 +165,7 @@
|
||||||
(t ".ll")))))
|
(t ".ll")))))
|
||||||
(if (eq action 'diff)
|
(if (eq action 'diff)
|
||||||
(ll/diff-c-on-two-compilations file action)
|
(ll/diff-c-on-two-compilations file action)
|
||||||
(let ((comm (ll/build-clang-command (lls/un-trampify file) action output)))
|
(let ((comm (ll/build-clang-command file action output)))
|
||||||
(aprog1
|
(aprog1
|
||||||
(compilation-start
|
(compilation-start
|
||||||
comm
|
comm
|
||||||
|
|
|
||||||
|
|
@ -33,14 +33,14 @@
|
||||||
(cons build-dir it)
|
(cons build-dir it)
|
||||||
(reverse it)
|
(reverse it)
|
||||||
(cons (file-name-directory file) it)
|
(cons (file-name-directory file) it)
|
||||||
(mapcar #'(lambda (x) (concat "-I" (lls/un-trampify x))) it)
|
(mapcar #'(lambda (x) (concat "-I" x)) it)
|
||||||
(string-join it " ")))
|
(string-join it " ")))
|
||||||
|
|
||||||
(defun ll-tblgen/gen-command (file flags output-file build-dir)
|
(defun ll-tblgen/gen-command (file flags output-file build-dir)
|
||||||
(let ((bin (car (lls/get-tool "llvm-tblgen$" (list (expand-file-name "bin" build-dir))))))
|
(let ((bin (car (lls/get-tool "llvm-tblgen$" (list (expand-file-name "bin" build-dir))))))
|
||||||
(format "%s %s %s %s"
|
(format "%s %s %s %s"
|
||||||
bin
|
bin
|
||||||
(lls/un-trampify file)
|
file
|
||||||
(ll-tblgen/get-includes file build-dir)
|
(ll-tblgen/get-includes file build-dir)
|
||||||
(string-join
|
(string-join
|
||||||
(list
|
(list
|
||||||
|
|
@ -142,11 +142,11 @@
|
||||||
(setq comm (concat comm " --print-records")))
|
(setq comm (concat comm " --print-records")))
|
||||||
((eq action ?c)
|
((eq action ?c)
|
||||||
(setq comm (concat (format "mkdir -p %s"
|
(setq comm (concat (format "mkdir -p %s"
|
||||||
(lls/un-trampify (diredp-parent-dir out)))
|
(diredp-parent-dir out))
|
||||||
" && "
|
" && "
|
||||||
comm
|
comm
|
||||||
(format " -o %s"
|
(format " -o %s"
|
||||||
(lls/un-trampify out))))))
|
out)))))
|
||||||
|
|
||||||
(compilation-start
|
(compilation-start
|
||||||
comm
|
comm
|
||||||
|
|
|
||||||
|
|
@ -46,24 +46,24 @@
|
||||||
(let ((file (or (buffer-file-name)
|
(let ((file (or (buffer-file-name)
|
||||||
(aprog1 (make-temp-file nil nil ".ll")
|
(aprog1 (make-temp-file nil nil ".ll")
|
||||||
(write-file it)))))
|
(write-file it)))))
|
||||||
(when-let ((vec (lls/tramp-connection))
|
;; (when-let ((vec (lls/tramp-connection))
|
||||||
((not (file-remote-p file))))
|
;; ((not (file-remote-p file))))
|
||||||
;; If there's a cache entry, and the cache timestamp matches,
|
;; ;; If there's a cache entry, and the cache timestamp matches,
|
||||||
;; then we just reuse the file
|
;; ;; then we just reuse the file
|
||||||
(-->
|
;; (-->
|
||||||
(if-let* ((cache (gethash file ll/buffer-map))
|
;; (if-let* ((cache (gethash file ll/buffer-map))
|
||||||
(time (visited-file-modtime))
|
;; (time (visited-file-modtime))
|
||||||
((equal time (car cache))))
|
;; ((equal time (car cache))))
|
||||||
(cdr cache)
|
;; (cdr cache)
|
||||||
;; Otherwise, generate a new tmp file, copy that over, and
|
;; ;; Otherwise, generate a new tmp file, copy that over, and
|
||||||
;; update the cache.
|
;; ;; update the cache.
|
||||||
(let ((tmp (concat (tramp-make-tramp-temp-name vec)
|
;; (let ((tmp (concat (tramp-make-tramp-temp-name vec)
|
||||||
"." (file-name-extension file))))
|
;; "." (file-name-extension file))))
|
||||||
(puthash file (cons time tmp) ll/buffer-map)
|
;; (puthash file (cons time tmp) ll/buffer-map)
|
||||||
(copy-file file tmp)
|
;; (copy-file file tmp)
|
||||||
tmp))
|
;; tmp))
|
||||||
(setq file it)))
|
;; (setq file it)))
|
||||||
;; Let further compilation-commands be run over tramp
|
;; ;; Let further compilation-commands be run over tramp
|
||||||
(let ((default-directory (file-name-directory file)))
|
(let ((default-directory (file-name-directory file)))
|
||||||
(pcase (file-name-extension file)
|
(pcase (file-name-extension file)
|
||||||
((and _ (guard (ll/is-test-file file)))
|
((and _ (guard (ll/is-test-file file)))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue