From 195618bcf36a4ee2fe6f038d6d27936f1c1f22df Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 31 Jan 2022 00:54:53 -0600 Subject: Random stuff --- init.el | 13 ++++++++----- lisp/+eshell.el | 7 ++++++- lisp/+setup.el | 17 +++++++++++++++++ 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/init.el b/init.el index 280f7e6..c06e44d 100644 --- a/init.el +++ b/init.el @@ -186,7 +186,7 @@ (seq "." (or "mp4" "gif" "mov" "MOV" "webm") eos) ;; music "soundcloud.com" "bandcamp.com" - (seq "." (or "ogg" "mp3") eos))) + (seq "." (or "ogg" "mp3" "opus" "m4a") eos))) (lambda (&rest args) (apply (if (executable-find "mpv") #'+browse-url-with-mpv @@ -302,7 +302,10 @@ eshell-scroll-to-bottom-on-input 'all eshell-smart-space-goes-to-end t eshell-where-to-jump 'begin - eshell-banner-message "") + eshell-banner-message "" + eshell-prompt-regexp (rx bol (* (not (any ?# ?$ ?\n))) + " " (any ?# ?$) + (* " "))) (with-eval-after-load 'mwim (setf (alist-get 'eshell-mode mwim-beginning-of-line-function) #'eshell-bol)) @@ -318,7 +321,7 @@ (concat eshell-prompt-regexp "\\(.*\\)") 1)) - truncate-lines t)) + (cons 'truncate-lines t))) (set (make-local-variable (car setting)) (cdr setting))) ;; Bind keys (dolist (binding '(("C-d" . +eshell-quit-or-delete-char))) @@ -1442,8 +1445,8 @@ See also `crux-reopen-as-root-mode'." (setup (:straight macrostep) (:require macrostep) - (:with-mode emacs-lisp-mode - (:bind "C-c e" #'macrostep-expand))) + (:bind-into (emacs-lisp-mode lisp-interaction-mode) + "C-c e" #'macrostep-expand)) (setup (:straight (magit :host github :repo "magit/magit"))) diff --git a/lisp/+eshell.el b/lisp/+eshell.el index d49358d..d70bed7 100644 --- a/lisp/+eshell.el +++ b/lisp/+eshell.el @@ -29,7 +29,12 @@ any directory proferred by `consult-dir'." "Delete the character to the right, or quit eshell on an empty line." (interactive "p") (if (and (eolp) (looking-back eshell-prompt-regexp)) - (eshell-life-is-too-much) + (progn (eshell-life-is-too-much) + (when (and (<= 1 (count-windows)) + ;; I'm guessing the extra frame is for the server? + (> (length (frame-list)) 2) + server-process) + (delete-frame))) (delete-forward-char arg))) ;;; Insert previous arguments diff --git a/lisp/+setup.el b/lisp/+setup.el index 367fb01..d8e9bb8 100644 --- a/lisp/+setup.el +++ b/lisp/+setup.el @@ -94,5 +94,22 @@ replace itself with the RECIPE's package." :indent 1 :shorthand #'+setup-straight-shorthand) + +;;; Redefines of `setup' forms + +(setup-define :bind-into + (lambda (feature-or-map &rest rest) + (cl-loop for f/m in (ensure-list feature-or-map) + collect (if (string-match-p "-map\\'" (symbol-name f/m)) + `(:with-map ,f/m (:bind ,@rest)) + `(:with-feature ,f/m (:bind ,@rest))) + into forms + finally return `(progn ,@forms))) + :documentation "Bind into keys into the map(s) of FEATURE-OR-MAP. +FEATURE-OR-MAP can be a feature or map name or a list of them. +The arguments REST are handled as by `:bind'." + :debug '(sexp &rest form sexp) + :indent 1) + (provide '+setup) ;;; +setup.el ends here -- cgit 1.4.1-21-gabe81