diff options
author | Yuchen Pei <id@ypei.org> | 2023-06-26 16:26:51 +1000 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2023-06-26 16:29:08 +1000 |
commit | a60e3f385317d4f35d1ab7a853ede6640b4fccc5 (patch) | |
tree | e53d7d34c9816860f020396151c1243edbb982d7 /emacs | |
parent | 02dd867703e71304983bdc27ab92a20b23f0edf0 (diff) |
Some small fixes and changes
* emacs/.emacs.d/init/ycp-editing.el: fix a require
* emacs/.emacs.d/init/ycp-prog.el: fix sql require
* emacs/.emacs.d/init/ycp-system.el: remove double removal of tramp
from file-name-handler-alist
* emacs/.emacs.d/init/ycp-vc.el: add a post commit hook to revert
project buffers
* emacs/.emacs.d/lisp/my/my-mariadb.el: fix sql require
* emacs/.emacs.d/lisp/my/my-project.el: add a command to revert
project buffers
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/.emacs.d/init/ycp-editing.el | 3 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-prog.el | 5 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-system.el | 6 | ||||
-rw-r--r-- | emacs/.emacs.d/init/ycp-vc.el | 7 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-mariadb.el | 1 | ||||
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-project.el | 5 |
6 files changed, 17 insertions, 10 deletions
diff --git a/emacs/.emacs.d/init/ycp-editing.el b/emacs/.emacs.d/init/ycp-editing.el index 4bdeb32..5ed3eca 100644 --- a/emacs/.emacs.d/init/ycp-editing.el +++ b/emacs/.emacs.d/init/ycp-editing.el @@ -72,6 +72,7 @@ "<C-M-backspace>" #'backward-kill-sexp ) (electric-pair-mode) + (my-add-hooks #'my-non-special-modes-setup '(text-mode-hook prog-mode-hook)) ) (setq viper-mode nil) @@ -132,8 +133,6 @@ (add-hook 'text-mode-hook #'turn-on-auto-fill) -(my-add-hooks #'my-non-special-modes-setup '(text-mode-hook prog-mode-hook)) - (add-to-list 'auto-mode-alist '("\\(README\\|CHANGELOG\\|COPYING\\|LICENSE\\)\\'" . text-mode)) diff --git a/emacs/.emacs.d/init/ycp-prog.el b/emacs/.emacs.d/init/ycp-prog.el index 0b04509..27d860b 100644 --- a/emacs/.emacs.d/init/ycp-prog.el +++ b/emacs/.emacs.d/init/ycp-prog.el @@ -428,7 +428,7 @@ (add-to-list 'load-path (locate-user-emacs-file "lisp/elisp-tree-sitter/core")) (add-to-list 'load-path (locate-user-emacs-file "lisp/elisp-tree-sitter/lisp")) (my-package tree-sitter - (:delay 15) + (:delay 30) (require 'tree-sitter-hl) (require 'tree-sitter-langs) (require 'tree-sitter-debug) @@ -451,7 +451,7 @@ (setq sml-indent-level 2)) ;;; mariadb development -(my-package my-mariadb +(my-package sql (:delay 15) (setq sql-product 'mariadb) (add-to-list 'auto-mode-alist @@ -463,6 +463,7 @@ (sql-mode) (setq comment-start "#")))) (add-to-list 'auto-mode-alist '("\\.cnf\\'" . conf-mode)) + (require 'my-mariadb) (define-key sql-mode-map (kbd "C-c C-c") 'my-sql-maybe-mtrr) (my-keybind global-map "C-c d m" 'my-gdb-maria diff --git a/emacs/.emacs.d/init/ycp-system.el b/emacs/.emacs.d/init/ycp-system.el index 6dbcf7d..5951aac 100644 --- a/emacs/.emacs.d/init/ycp-system.el +++ b/emacs/.emacs.d/init/ycp-system.el @@ -50,11 +50,6 @@ "tramp"))) ;; Use discovered value for ssh options (setq tramp-ssh-controlmaster-options "") - ;; Stop tramp from interfering with everything - (setq file-name-handler-alist - (seq-filter - (--remove (string-match-p "^tramp" (symbol-name (cdr it))) - file-name-handler-alist))) (connection-local-set-profile-variables 'termux-bash '((explicit-shell-file-name . "/data/data/com.termux/files/usr/bin/bash") @@ -90,6 +85,7 @@ '(: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) diff --git a/emacs/.emacs.d/init/ycp-vc.el b/emacs/.emacs.d/init/ycp-vc.el index 66bb06f..232639e 100644 --- a/emacs/.emacs.d/init/ycp-vc.el +++ b/emacs/.emacs.d/init/ycp-vc.el @@ -75,7 +75,12 @@ (:install t) (:delay 30) (setq git-commit-summary-max-length 50) - (setq git-commit-style-convention-checks '(non-empty-second-line))) + (setq git-commit-style-convention-checks '(non-empty-second-line)) + ;; Revert all buffers in the project after a commit, to refresh + ;; diff-hl + (require 'my-project) + (add-hook 'git-commit-post-finish-hook #'my-project-revert-all-buffers) + ) (my-package magit (:install t) diff --git a/emacs/.emacs.d/lisp/my/my-mariadb.el b/emacs/.emacs.d/lisp/my/my-mariadb.el index 5ffd6a0..bc91856 100644 --- a/emacs/.emacs.d/lisp/my/my-mariadb.el +++ b/emacs/.emacs.d/lisp/my/my-mariadb.el @@ -27,6 +27,7 @@ ;;; Code: (require 'my-prog) +(require 'sql) (defun my-sql-maybe-mtrr () (interactive) diff --git a/emacs/.emacs.d/lisp/my/my-project.el b/emacs/.emacs.d/lisp/my/my-project.el index 6835487..d318e75 100644 --- a/emacs/.emacs.d/lisp/my/my-project.el +++ b/emacs/.emacs.d/lisp/my/my-project.el @@ -144,6 +144,11 @@ projects." (insert default-directory "\n") (call-process "cloc" nil "*cloc*" nil "HEAD" "--quiet"))) +(defun my-project-revert-all-buffers () + "Revert all buffers in the current project." + (interactive) + (dolist (buffer (project-buffers (project-current))) + (revert-buffer-quick buffer))) (provide 'my-project) ;;; my-project.el ends here |