dotfiles

🎜 Clone'em, tweak'em, stick'em in your $HOME 🎝
git clone https://git.kevinlegouguec.net/dotfiles
Log | Files | Refs | README

commit 1d1bac10dd5c314701cc5d375d2dd6f3c9bbf468
parent a550929fe645ee12e91dc568a71d7aa51a89bc5d
Author: KΓ©vin Le Gouguec <kevin.legouguec@gmail.com>
Date:   Sat, 19 Aug 2023 13:57:55 +0200

Cleanup project-related commands

* Remove provisions for Emacs<28.
* Move Magit command to my/magit-map.

Diffstat:
M.emacs | 20+-------------------
1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/.emacs b/.emacs @@ -213,14 +213,6 @@ (shell-command (concat command--help) help-buf) (display-buffer help-buf))) -(defun my/make-project-wide (f) - "Make a function which will run F from the project's root directory." - (lambda () - (:documentation (format "Run `%s' from the project's root directory." f)) - (interactive) - (let ((default-directory (my/project-root))) - (call-interactively f)))) - (defun my/magit-project () (interactive) (require 'project) @@ -272,6 +264,7 @@ '(("d" my/magit-toggle-margin-date) ("f" magit-file-dispatch) ("g" magit-status) + ("p" my/magit-project) ("x" magit-dispatch) ("\C-f" magit-find-file))) @@ -294,10 +287,6 @@ ("m" man) ("s" shortdoc-display-group))) -(my/define-prefix-command my/project-map - "Keymap for project-related commands." - '(("g" my/magit-project))) - (my/define-prefix-command my/whitespace-map "Keymap for whitespace-related commands." '(("c" whitespace-cleanup) @@ -315,15 +304,8 @@ (global-set-key (kbd "C-c i") 'my/input-map) (global-set-key (kbd "C-c k") 'my/kill-map) (global-set-key (kbd "C-c m") 'my/manual-map) -(global-set-key (kbd "C-c p") 'my/project-map) (global-set-key (kbd "C-c w") 'my/whitespace-map) -(unless (>= emacs-major-version 28) - (define-key my/project-map "c" (my/make-project-wide 'compile)) - (define-key my/project-map "f" 'project-find-file) - (define-key my/project-map "!" (my/make-project-wide 'shell-command)) - (define-key my/project-map "&" (my/make-project-wide 'async-shell-command))) - (rg-enable-default-bindings) ; Uses the C-c s prefix. ;; What's life without a little risk?