From e8267b4b165f6a6a086f4a9786e9df8ffe31d55c Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 24 Jun 2023 13:41:13 +1000 Subject: Enhancements for org and elisp - org: adding an :after advice to org-insert-structure-template so that it goes into editing immediately - elisp: C-M-x evals a region when region is active --- emacs/.emacs.d/init/ycp-complete.el | 4 ++-- emacs/.emacs.d/init/ycp-grep.el | 3 --- emacs/.emacs.d/init/ycp-org.el | 8 +++++--- emacs/.emacs.d/init/ycp-prog.el | 7 ++++++- 4 files changed, 13 insertions(+), 9 deletions(-) (limited to 'emacs/.emacs.d/init') diff --git a/emacs/.emacs.d/init/ycp-complete.el b/emacs/.emacs.d/init/ycp-complete.el index a27e980..e59bbfd 100644 --- a/emacs/.emacs.d/init/ycp-complete.el +++ b/emacs/.emacs.d/init/ycp-complete.el @@ -144,8 +144,8 @@ (define-key corfu-map [remap beginning-of-buffer] nil) (define-key corfu-map [remap end-of-buffer] nil) (my-keybind corfu-map - "C-j" 'corfu-insert - "" 'nil + "C-j" #'corfu-insert + "" nil "C-s" #'corfu-next "C-r" #'corfu-previous) (require 'my-corfu) diff --git a/emacs/.emacs.d/init/ycp-grep.el b/emacs/.emacs.d/init/ycp-grep.el index 715f643..3c784f0 100644 --- a/emacs/.emacs.d/init/ycp-grep.el +++ b/emacs/.emacs.d/init/ycp-grep.el @@ -81,9 +81,6 @@ "C-g" #'isearch-cancel ; instead of `isearch-abort' "M-/" #'isearch-complete "C-o" #'isearch-occur) - (my-keybind global-map - "C-s" 'isearch-forward-regexp - "C-r" 'isearch-backward-regexp) ) (my-package replace diff --git a/emacs/.emacs.d/init/ycp-org.el b/emacs/.emacs.d/init/ycp-org.el index 75d36d7..edf2dca 100644 --- a/emacs/.emacs.d/init/ycp-org.el +++ b/emacs/.emacs.d/init/ycp-org.el @@ -2,6 +2,7 @@ ;;; the glorious org mode (my-package org + (require 'my-org) (my-keybind global-map "M-u" #'org-store-link "C-c a" #'org-agenda @@ -405,9 +406,10 @@ (org-defkey org-agenda-mode-map "2" #'my-org-agenda-priority-B) (org-defkey org-agenda-mode-map "3" #'my-org-agenda-priority-C) (with-eval-after-load "org-capture" - (advice-add 'org-capture-place-template - :around 'my-org-capture-place-template-dont-delete-windows)) - ) + (advice-add + 'org-capture-place-template + :around 'my-org-capture-place-template-dont-delete-windows)) + (advice-add 'org-insert-structure-template :after 'my-org-edit-special)) (my-package my-org (:delay 30) diff --git a/emacs/.emacs.d/init/ycp-prog.el b/emacs/.emacs.d/init/ycp-prog.el index 11c4f62..6392cf8 100644 --- a/emacs/.emacs.d/init/ycp-prog.el +++ b/emacs/.emacs.d/init/ycp-prog.el @@ -197,7 +197,9 @@ ;;; emacs-lisp mode (my-package elisp-mode - (my-keybind emacs-lisp-mode-map "C-c C-c" #'eval-buffer) + (:delay 10) + (my-keybind emacs-lisp-mode-map + "C-c C-c" #'eval-buffer) (add-hook 'emacs-lisp-mode-hook (lambda () (auto-fill-mode 1))) (setq print-length 1000) (my-keybind global-map @@ -213,6 +215,9 @@ 'emacs-lisp-mode))) ;; for deep recursion, e.g. in radix tree (setq max-specpdl-size 32000) + (require 'my-prog) + (my-keybind emacs-lisp-mode-map + "C-M-x" #'my-eval-defun-or-region) ) ;;; paredit -- cgit v1.2.3