diff options
author | Yuchen Pei <id@ypei.org> | 2023-06-28 19:54:44 +1000 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2023-06-28 19:54:44 +1000 |
commit | b0e256586c24c6fb169d61e98302b11026ff10d2 (patch) | |
tree | a62223150703df6c66e3c42448efd881366448f8 | |
parent | 5142e4227a0d10f8e5481523710b2c17b2054889 (diff) |
Some minor fixes
-rw-r--r-- | emacs/.emacs.d/init/ycp-editing.el | 2 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-org.el | 2 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-system.el | 4 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-vc.el | 1 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-editing.el | 6 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-mariadb.el | 2 | ||||
-rwxr-xr-x | misc/bin/watch-make.sh | 10 |
7 files changed, 20 insertions, 7 deletions
diff --git a/emacs/.emacs.d/init/ycp-editing.el b/emacs/.emacs.d/init/ycp-editing.el index b77f1ea..bddd955 100644 --- a/emacs/.emacs.d/init/ycp-editing.el +++ b/emacs/.emacs.d/init/ycp-editing.el @@ -133,7 +133,7 @@ (setq delete-old-versions t) (setq version-control t) -(add-hook 'text-mode-hook #'turn-on-auto-fill) +(add-hook 'text-mode-hook #'my-text-modes-setup) (add-to-list 'auto-mode-alist diff --git a/emacs/.emacs.d/init/ycp-org.el b/emacs/.emacs.d/init/ycp-org.el index 578932e..25a8a2a 100644 --- a/emacs/.emacs.d/init/ycp-org.el +++ b/emacs/.emacs.d/init/ycp-org.el @@ -60,8 +60,6 @@ (add-hook 'org-mode-hook (lambda () (electric-indent-local-mode -1))) ;; disable truncate lines (add-hook 'org-mode-hook #'toggle-truncate-lines) - ;; disable yas-minor-mode for org - (add-hook 'org-mode-hook (lambda () (yas-minor-mode -1))) (add-hook 'org-mode-hook (lambda () (setq-local tab-width 2))) (setq org-adapt-indentation 'headline-data) diff --git a/emacs/.emacs.d/init/ycp-system.el b/emacs/.emacs.d/init/ycp-system.el index 5951aac..5670eed 100644 --- a/emacs/.emacs.d/init/ycp-system.el +++ b/emacs/.emacs.d/init/ycp-system.el @@ -84,9 +84,7 @@ (connection-local-set-profiles '(:application tramp :protocol "adb") 'adb-shell) - (require 'my-system) - ;; Stop tramp from interfering with everything - (setq file-name-handler-alist (my-file-handlers-without-tramp))) + ) (provide 'ycp-system) ;;; ycp-system.el ends here diff --git a/emacs/.emacs.d/init/ycp-vc.el b/emacs/.emacs.d/init/ycp-vc.el index d30fcc7..1f52df6 100644 --- a/emacs/.emacs.d/init/ycp-vc.el +++ b/emacs/.emacs.d/init/ycp-vc.el @@ -70,6 +70,7 @@ "=======" B ">>>>>>> B: Incoming")) (setq ediff-diff-options "-w") + (setq ediff-window-setup-function 'ediff-setup-windows-plain) ) (my-package vc-git diff --git a/emacs/.emacs.d/lisp/my/my-editing.el b/emacs/.emacs.d/lisp/my/my-editing.el index 174504d..975b9ae 100644 --- a/emacs/.emacs.d/lisp/my/my-editing.el +++ b/emacs/.emacs.d/lisp/my/my-editing.el @@ -397,6 +397,12 @@ With an prefix-arg, copy the file name relative to project root." (setq show-trailing-whitespace t) ) +(defun my-text-modes-setup () + ;; it can be hard to preserve balance in text mode + (setq-local electric-pair-preserve-balance nil) + (turn-on-auto-fill) + ) + (defun my-find-file-line-number (orig filename &rest args) "Turn files like file.cpp:14 into file.cpp and going to the 14-th line." (save-match-data diff --git a/emacs/.emacs.d/lisp/my/my-mariadb.el b/emacs/.emacs.d/lisp/my/my-mariadb.el index a74cceb..773ddbd 100644 --- a/emacs/.emacs.d/lisp/my/my-mariadb.el +++ b/emacs/.emacs.d/lisp/my/my-mariadb.el @@ -57,7 +57,7 @@ (my-gdb-quit)) (sleep-for 1) (my-gdb - (format "rr replay %s -d /home/ycp/source/mariadb-tools/gdb-mi.sh" + (format "rr replay %s -d ~/bin/gdb-mi.sh" (expand-file-name (replace-regexp-in-string "/src" diff --git a/misc/bin/watch-make.sh b/misc/bin/watch-make.sh new file mode 100755 index 0000000..db9129f --- /dev/null +++ b/misc/bin/watch-make.sh @@ -0,0 +1,10 @@ +#!/bin/bash +cmd="$@" + +while true; do + $cmd + inotify_result= + while [ -z "$inotify_result" ]; do + inotify_result=$(inotifywait -qre close_write ../src | grep -E '\.(cc|h)$') + done +done |