From 08bdb9d3a2f96319055099f42fed96d3bb3271a7 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Oct 2021 11:15:16 -0500 Subject: [PATCH] =?UTF-8?q?Fix=20eshell...=20I=C2=A0think?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eshell'sĀ loading order is so confusing --- eshell.el | 25 +++++-------------------- init.el | 6 ++---- 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/eshell.el b/eshell.el index 05f90bc..c6078c2 100644 --- a/eshell.el +++ b/eshell.el @@ -3,20 +3,6 @@ ;; Copyright (C) 2021 Case Duckworth ;; Author: Case Duckworth <(rot13-string "npqj@npqj.arg")> -;; Keywords: - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . ;;; Commentary: @@ -26,6 +12,8 @@ ;;; Code: (require 'setup) +(require 'eshell) +(require 'em-alias) ;;; Environment (setenv "PAGER" "cat") @@ -52,8 +40,8 @@ (setup (:straight eshell-syntax-highlighting) (eshell-syntax-highlighting-global-mode +1)) -(setup (:straight-if fish-completion - (executable-find "fish")) +(setup (:straight-when fish-completion + (executable-find "fish")) (:autoload global-fish-completion-mode) (global-fish-completion-mode +1)) @@ -63,8 +51,5 @@ (when (boundp 'simple-modeline--mode-line) (setq mode-line-format '(:eval simple-modeline--mode-line))) -;;; Tell Emacs our customizations are loaded. -(defvar eshell-customizations-loaded t - "Whether eshell's customizations have been loaded yet.") - +(provide 'eshellrc) ;;; eshell.el ends here diff --git a/init.el b/init.el index 4ad55a9..a1536c5 100644 --- a/init.el +++ b/init.el @@ -446,12 +446,10 @@ (:local-set outline-regexp eshell-prompt-regexp page-delimiter eshell-prompt-regexp) - (:bind "C-d" #'eshell-quit-or-delete-char) - (:hook #'eshell-arg-hist-mode (defun eshell-mode@setup () - (unless (bound-and-true-p eshell-customizations-loaded) - (load (expand-file-name "eshell" user-emacs-directory)))))) + (require 'eshellrc (locate-user-emacs-file "eshell") :noerror) + (:bind "C-d" #'eshell-quit-or-delete-char)))) (setup eww (:also-load acdw-eww)