From: Eshel Yaron Date: Wed, 19 Jul 2023 16:12:07 +0000 (+0300) Subject: Update Emacs configuration X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=40e74dc18162fec4ab795fcbbe0ea8b2acdfd68d;p=dotfiles.git Update Emacs configuration --- diff --git a/.emacs.d/init.el b/.emacs.d/init.el index e04f149..1feeb3f 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -72,6 +72,8 @@ bookmark-save-flag 1 ;; show matches count in isearch prompt isearch-lazy-count t + ;; kill Eat terminal buffers when their process exits + eat-kill-buffer-on-exit t ;; don't spawn new frames in Ediff ediff-window-setup-function #'ediff-setup-windows-plain duplicate-line-final-position -1 @@ -532,6 +534,11 @@ (interactive) (eat "ttyper" t)) + (defun esy/hut-builds () + (interactive) + (let ((eat-kill-buffer-on-exit nil)) + (eat "hut builds show -f" t))) + (defun esy/pulse-line (&optional _) "Pulse current line." (interactive) @@ -715,6 +722,13 @@ Interactively, POINT is point and KILL is the prefix argument." (replace-match "" nil t)) (buffer-string)))))) + (defun esy/dedicate-window (window flag) + (interactive (list (get-buffer-window) (not current-prefix-arg))) + (message "Window is %s dedicated to buffer %s." + (if flag (if (window-dedicated-p) "already" "now") "no longer") + (buffer-name)) + (set-window-dedicated-p window flag)) + (defun esy/bump (tag-prefix) (interactive (list "v")) (require 'lisp-mnt) @@ -875,6 +889,7 @@ Interactively, POINT is point and KILL is the prefix argument." (keymap-set window-prefix-map "n" #'windmove-swap-states-down) (keymap-set window-prefix-map "a" #'windmove-swap-states-left) (keymap-set window-prefix-map "e" #'windmove-swap-states-right) + (keymap-set window-prefix-map "d" #'esy/dedicate-window) (dolist (command '(windmove-swap-states-up windmove-swap-states-down @@ -1277,6 +1292,8 @@ as the initial input for completion, and return that directory." (esy/init-step elfeed "Configure news feeds." (with-eval-after-load 'elfeed + (keymap-set elfeed-show-mode-map "S-SPC" #'scroll-down-command) + (defvar esy/feeds-file (locate-user-emacs-file "feeds.eld")) (defun esy/feeds () @@ -1332,18 +1349,6 @@ as the initial input for completion, and return that directory." ;; read feeds list from a separate file elfeed-feeds (esy/feeds)))) -(esy/init-step eat - "Configure Eat." - (with-eval-after-load 'eat - - (defun esy/eat-exit-hook (process) - (let ((buffer (process-buffer process))) - (set-process-buffer process nil) - (when (buffer-live-p buffer) - (kill-buffer buffer)))) - - (add-hook 'eat-exit-hook #'esy/eat-exit-hook))) - (dolist (step (sort esy/init-step-times (lambda (l r) (time-less-p (cdr r) (cdr l))))) (message "%f %s" (float-time (cdr step))