From c78804211171e93be10322f2e5f10e49659c1606 Mon Sep 17 00:00:00 2001 From: TCCQ Date: Wed, 9 Jul 2025 10:46:51 -0700 Subject: eshell, remove range, remove old exwm fast switch variable --- emacs/init.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'emacs/init.el') diff --git a/emacs/init.el b/emacs/init.el index eaec53b..491c9a8 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -126,17 +126,16 @@ dedicated." (with-selected-window cw (switch-to-buffer ob))))))) -(require 'range) (defun my/c-x-n-to-m-n (&optional keymap) "Rebind the keys starting with C-x [number] to M-[number] in the given keymap or in the global keymap." (unless keymap (setq keymap global-map)) - (range-map (lambda (n) + (mapc (lambda (n) (let* ((from (concat "C-x " (format "%d" n))) (to (concat "M-" (format "%d" n))) (bind (keymap-lookup keymap from))) (keymap-set keymap to bind))) - '((0 . 9)))) + '(0 1 2 3 4 5 6 7 8 9))) (my/c-x-n-to-m-n) (use-package server ; allow emacsclient @@ -724,12 +723,18 @@ changes." (interactive) (start-process-shell-command "firefox" nil "firefox")) + (defun my/eshell (&optional arg) + (interactive "P") + (if (eq major-mode 'eshell-mode) + ;; switch back + (switch-to-prev-buffer) + (eshell arg))) + (exwm-randr-mode) (exwm-systemtray-mode) (push ?\C-\\ exwm-input-prefix-keys) ;;C-\ to switch input method (push ?\C-u exwm-input-prefix-keys) ;; send C-u to all windows too (push ?\M-L exwm-input-prefix-keys) - (setq exwm-marked-buffer "*scratch*") ;; store the buffer we were at before a jump (when (equal window-system 'x) (exwm-enable)) :hook @@ -756,7 +761,7 @@ changes." ([?\M-D] . my/dmenu) ([?\M-E] . my/browser) - ([M-return] . eshell) + ([M-return] . my/eshell) ,@(mapcar (lambda (n) (let* ((from (concat "C-x " (format "%d" n))) -- cgit v1.2.3