mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-06-14 12:21:20 +00:00
Compare commits
5 commits
ff50e7aaf6
...
78b2de42bf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78b2de42bf | ||
|
|
b961c7e779 | ||
|
|
790b4666f3 | ||
|
|
a33ad42fbe | ||
|
|
5e1a286b07 |
9 changed files with 74 additions and 9 deletions
|
|
@ -386,3 +386,35 @@
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'rgrep-patch)
|
(require 'rgrep-patch)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
* Delete-region
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun my/delete-region (beg end &optional region)
|
||||||
|
;; Pass mark first, then point, because the order matters when
|
||||||
|
;; calling `kill-append'.
|
||||||
|
(interactive (progn
|
||||||
|
(let ((beg (mark))
|
||||||
|
(end (point)))
|
||||||
|
(unless (and beg end)
|
||||||
|
(user-error "The mark is not set now, so there is no region"))
|
||||||
|
(list beg end 'region))))
|
||||||
|
(condition-case nil
|
||||||
|
(let ((string (if region
|
||||||
|
(funcall region-extract-function 'delete-only)
|
||||||
|
(filter-buffer-substring beg end 'delete))))
|
||||||
|
(when (or string (eq last-command 'kill-region))
|
||||||
|
(setq this-command 'kill-region))
|
||||||
|
(setq deactivate-mark t)
|
||||||
|
nil)
|
||||||
|
((buffer-read-only text-read-only)
|
||||||
|
;; Set this-command now, so it will be set even if we get an error.
|
||||||
|
(setq this-command 'kill-region)
|
||||||
|
;; This should barf, if appropriate, and give us the correct error.
|
||||||
|
(if kill-read-only-ok
|
||||||
|
(progn (message "Read only text copied to kill ring") nil)
|
||||||
|
;; Signal an error if the buffer is read-only.
|
||||||
|
(barf-if-buffer-read-only)
|
||||||
|
;; If the buffer isn't read-only, the text is.
|
||||||
|
(signal 'text-read-only (list (current-buffer)))))))
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-M-w") #'my/delete-region)
|
||||||
|
#+end_src
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
(defun ll/ensure-clang-binary-built (dir)
|
(defun ll/ensure-clang-binary-built (dir)
|
||||||
;; TODO: assumed build-dir constant, should take as argument and prompt
|
;; TODO: assumed build-dir constant, should take as argument and prompt
|
||||||
;; further up
|
;; further up
|
||||||
(lls/ninja-build-tools dir '("clang")))
|
(lls/run-build-command dir '("clang")))
|
||||||
|
|
||||||
(defun ll/clang-output-disassemble-command (file)
|
(defun ll/clang-output-disassemble-command (file)
|
||||||
(let ((compiler (lls/prompt-tool "clang$"))
|
(let ((compiler (lls/prompt-tool "clang$"))
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
(let ((dir (lls/get-llvm-build-dir)))
|
(let ((dir (lls/get-llvm-build-dir)))
|
||||||
(--> file
|
(--> file
|
||||||
(list (format "touch %s" it)
|
(list (format "touch %s" it)
|
||||||
(lls/ninja-build-tools dir (list (concat it "^")) t))
|
(lls/run-build-command dir (list (concat it "^")) t))
|
||||||
(string-join it " && ")
|
(string-join it " && ")
|
||||||
(compilation-start it nil
|
(compilation-start it nil
|
||||||
(lambda (_)
|
(lambda (_)
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@
|
||||||
;; further up
|
;; further up
|
||||||
(let ((dir (lls/get-llvm-build-dir))
|
(let ((dir (lls/get-llvm-build-dir))
|
||||||
(tools (ll/get-required-binaries-for-test file)))
|
(tools (ll/get-required-binaries-for-test file)))
|
||||||
(lls/ninja-build-tools dir tools)))
|
(lls/run-build-command dir tools)))
|
||||||
|
|
||||||
(defun ll/build-lit-command (file action)
|
(defun ll/build-lit-command (file action)
|
||||||
(format "%s %s %s"
|
(format "%s %s %s"
|
||||||
|
|
@ -164,7 +164,7 @@
|
||||||
(when tools
|
(when tools
|
||||||
(-->
|
(-->
|
||||||
;; TODO: Assuming debug folder, (lls/get-llvm-build-dir) doesn't work
|
;; TODO: Assuming debug folder, (lls/get-llvm-build-dir) doesn't work
|
||||||
(lls/ninja-build-tools "/scratch/benson/tools3/llvm_cgt/build/Debug/llvm" (seq-uniq tools))
|
(lls/run-build-command "/scratch/benson/tools3/llvm_cgt/build/Debug/llvm" (seq-uniq tools))
|
||||||
(compilation-start
|
(compilation-start
|
||||||
it
|
it
|
||||||
nil
|
nil
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
(compilation-start (-->
|
(compilation-start (-->
|
||||||
(list
|
(list
|
||||||
(format "touch %s" file)
|
(format "touch %s" file)
|
||||||
(lls/ninja-build-tools
|
(lls/run-build-command
|
||||||
build-dir (list (format "%s^" file)) t))
|
build-dir (list (format "%s^" file)) t))
|
||||||
(string-join it " && "))
|
(string-join it " && "))
|
||||||
nil
|
nil
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
;; "llc")))))
|
;; "llc")))))
|
||||||
;; (let* ((buffer-name (funcall lls/name-llvm-build-buffer directory tools)))
|
;; (let* ((buffer-name (funcall lls/name-llvm-build-buffer directory tools)))
|
||||||
;; (compilation-start
|
;; (compilation-start
|
||||||
;; (lls/ninja-build-tools (lls/un-trampify directory) tools)
|
;; (lls/run-build-command (lls/un-trampify directory) tools)
|
||||||
;; nil
|
;; nil
|
||||||
;; (lambda (_) buffer-name))))
|
;; (lambda (_) buffer-name))))
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
"llc")))))
|
"llc")))))
|
||||||
(name (funcall lls/name-llvm-build-buffer directory tools))
|
(name (funcall lls/name-llvm-build-buffer directory tools))
|
||||||
|
|
||||||
(lls/ninja-build-tools (lls/un-trampify directory) tools))
|
(lls/run-build-command (lls/un-trampify directory) tools))
|
||||||
|
|
||||||
(provide 'llvm-build-tool)
|
(provide 'llvm-build-tool)
|
||||||
;;; llvm-build-tool.el ends here
|
;;; llvm-build-tool.el ends here
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
(defvar llvm-core-count
|
(defvar llvm-core-count
|
||||||
(nprocs))
|
(nprocs))
|
||||||
|
|
||||||
(defun lls/ninja-build-tools (build-dir targets &optional verbose)
|
(defun lls/run-build-command (build-dir targets &optional verbose)
|
||||||
(let ((cmake-make-program
|
(let ((cmake-make-program
|
||||||
(if (string= "Makefile" (car (directory-files build-dir nil "^\\(build\\.ninja$\\|Makefile\\)$")))
|
(if (string= "Makefile" (car (directory-files build-dir nil "^\\(build\\.ninja$\\|Makefile\\)$")))
|
||||||
"make"
|
"make"
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,29 @@
|
||||||
:config
|
:config
|
||||||
(setq realgud-window-split-orientation 'horizontal)
|
(setq realgud-window-split-orientation 'horizontal)
|
||||||
(setq realgud:pdb-command-name "python3 -m pdb"
|
(setq realgud:pdb-command-name "python3 -m pdb"
|
||||||
realgud:remake-command-name "/db/sds/packages2/remake/bin/remake"))
|
realgud:remake-command-name "/db/sds/packages2/remake/bin/remake")
|
||||||
|
|
||||||
|
(defun rename-gdb-replay-buffer ()
|
||||||
|
(when-let ((buff (get-buffer "*gdb replay shell*")))
|
||||||
|
(let ((i 1)
|
||||||
|
name)
|
||||||
|
(while (progn
|
||||||
|
(setq name
|
||||||
|
(format "*gdb replay shell<%d>*" i))
|
||||||
|
(get-buffer name))
|
||||||
|
(cl-incf i))
|
||||||
|
(with-current-buffer buff
|
||||||
|
(rename-buffer name)))))
|
||||||
|
|
||||||
|
(defun realgud:rr ()
|
||||||
|
(interactive)
|
||||||
|
(rename-gdb-replay-buffer)
|
||||||
|
(call-interactively #'realgud:gdb))
|
||||||
|
|
||||||
|
(defun realgud:rr-replay ()
|
||||||
|
(interactive)
|
||||||
|
(rename-gdb-replay-buffer)
|
||||||
|
(realgud:gdb "rr replay")))
|
||||||
|
|
||||||
(use-package realgud-lldb)
|
(use-package realgud-lldb)
|
||||||
|
|
||||||
|
|
@ -247,5 +269,14 @@
|
||||||
:around
|
:around
|
||||||
#'always-expand-mail-abbrevs-in-commit-buffer)
|
#'always-expand-mail-abbrevs-in-commit-buffer)
|
||||||
|
|
||||||
|
(use-package claude-code
|
||||||
|
:config
|
||||||
|
(defun claude-code-write-to-file ()
|
||||||
|
(interactive)
|
||||||
|
(let ((str (buffer-string)))
|
||||||
|
(with-temp-buffer
|
||||||
|
(insert str)
|
||||||
|
(call-interactively #'write-file)))))
|
||||||
|
|
||||||
(provide 'work-config)
|
(provide 'work-config)
|
||||||
;;; work-config.el ends here
|
;;; work-config.el ends here
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,8 @@
|
||||||
(require 'ti-mail-identity)
|
(require 'ti-mail-identity)
|
||||||
(require 'gnus-article-hack)
|
(require 'gnus-article-hack)
|
||||||
|
|
||||||
|
(setq mu4e-update-interval (* 60 5))
|
||||||
|
|
||||||
(defun my/goto-mail ()
|
(defun my/goto-mail ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(switch-or-create-tab "mail")
|
(switch-or-create-tab "mail")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue