From 05312716ea3173956bad7e47984a1420b3994094 Mon Sep 17 00:00:00 2001 From: Seven of Nine Date: Sat, 24 Aug 2024 16:08:18 +0000 Subject: [PATCH 1/4] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/758aa1deb09d8d2dce7bd3a016434e8fcedfab89' (2024-08-21) → 'github:nix-community/emacs-overlay/0780b82798307b08982e766e039f7a1680fadfe8' (2024-08-24) • Updated input 'emacs-overlay/nixpkgs': 'github:NixOS/nixpkgs/8a3354191c0d7144db9756a74755672387b702ba' (2024-08-18) → 'github:NixOS/nixpkgs/c374d94f1536013ca8e92341b540eba4c22f9c62' (2024-08-21) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/f1bad50880bae73ff2d82fafc22010b4fc097a9c' (2024-08-19) → 'github:NixOS/nixpkgs/797f7dc49e0bc7fab4b57c021cdf68f595e47841' (2024-08-22) --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index e92d0cd..e0ac327 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1724231640, - "narHash": "sha256-1FnV0jk8GAItH71zVTzrhULylMKyXsb4FNmtn9b46Ug=", + "lastModified": 1724490633, + "narHash": "sha256-Ok9pSW0ge++fbNDu6pac9tJaTSIfxaTyjl8Xvl2tCf4=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "758aa1deb09d8d2dce7bd3a016434e8fcedfab89", + "rev": "0780b82798307b08982e766e039f7a1680fadfe8", "type": "github" }, "original": { @@ -145,11 +145,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1723991338, - "narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=", + "lastModified": 1724224976, + "narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8a3354191c0d7144db9756a74755672387b702ba", + "rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", "type": "github" }, "original": { @@ -173,11 +173,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1724098845, - "narHash": "sha256-D5HwjQw/02fuXbR4LCTo64koglP2j99hkDR79/3yLOE=", + "lastModified": 1724316499, + "narHash": "sha256-Qb9MhKBUTCfWg/wqqaxt89Xfi6qTD3XpTzQ9eXi3JmE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f1bad50880bae73ff2d82fafc22010b4fc097a9c", + "rev": "797f7dc49e0bc7fab4b57c021cdf68f595e47841", "type": "github" }, "original": { From d0071068403d870cc7029f141a742438e0ee6eb1 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Sun, 25 Aug 2024 08:46:57 +0200 Subject: [PATCH 2/4] Things --- init.el | 55 +++++++------------------------------------ packages/packages.nix | 6 +++-- 2 files changed, 13 insertions(+), 48 deletions(-) diff --git a/init.el b/init.el index d67be8f..255151a 100644 --- a/init.el +++ b/init.el @@ -581,49 +581,9 @@ (eshell 'N) (add-hook 'kill-buffer-hook 'delete-frame nil 't)) ;; destroy frame on exit - (defun ccr/eshell-history () - "Interactive search eshell history." - (interactive) - (require 'em-hist) - (save-excursion - (eshell-bol) - (let* ((start-pos (point)) - (end-pos (line-end-position)) - (input (buffer-substring-no-properties start-pos end-pos))) - (message input) - (let* ( - (history-shell (split-string (shell-command-to-string "history") "\n")) - (history-eshell (delete-dups (when (> (ring-size eshell-history-ring) 0) - (ring-elements eshell-history-ring)))) - (history (append history-shell history-eshell)) - ;; (history-highlighted (mapcar #'(lambda (cmd) - ;; (with-temp-buffer - ;; (text-mode) - ;; (insert cmd) - ;; (forward-line 0) - ;; ;; FIXME it breaks trying to highlight commands like `cd /ssh:host:~' - ;; ;; (eshell-syntax-highlighting--parse-and-highlight 'command (point-max)) - ;; (add-face-text-property (point-min) (point-max) '(:background nil)) - ;; (buffer-string))) - ;; history)) - (command (completing-read - "Command: " - history - nil - nil - input - ))) - (kill-region start-pos end-pos) - (insert command) - ))) - (end-of-line)) - - (defun ccr/wrap-eshell-write-history (orig-fun &optional filename &rest _) - (apply orig-fun `(,filename 't))) - ;; Wrapping this in order to merge histories from different shells - (advice-add 'eshell-write-history - :around #'ccr/wrap-eshell-write-history) + ;; (advice-add 'eshell-write-history + ;; :around #'ccr/wrap-eshell-write-history) (add-to-list 'eshell-modules-list 'eshell-tramp) ;; to use sudo in eshell ;; (add-to-list 'eshell-modules-list 'eshell-smart) ;; plan 9 style @@ -644,11 +604,14 @@ :hook (eshell-mode . (lambda () (setq-local scroll-margin 0))) :bind (("C-c o e" . project-eshell) :map eshell-mode-map - ("C-r" . ccr/eshell-history))) ;; i.e. just C-r in semi-char-mode + ("C-r" . eshell-atuin-history))) ;; i.e. just C-r in semi-char-mode -(use-package esh-autosuggest - ;; :hook (eshell-mode . esh-autosuggest-mode) # FIXME otherwise emacs stucks - ) +(use-package eshell-command-not-found + :custom ((eshell-command-not-found-command "command-not-found")) + :hook ((eshell-mode . eshell-command-not-found-mode))) + +(use-package eshell-atuin + :hook ((eshell-mode . eshell-atuin-mode))) (use-package fish-completion-mode :hook ((eshell-mode . fish-completion-mode))) diff --git a/packages/packages.nix b/packages/packages.nix index 2b115bc..99105b9 100644 --- a/packages/packages.nix +++ b/packages/packages.nix @@ -53,10 +53,12 @@ pkgs: epkgs: let eshell-syntax-highlighting fish-completion # fish completion for eshell eshell-prompt-extras - esh-autosuggest + eshell-atuin + eshell-command-not-found clipetty sideline - sideline-flymake + consult-eglot + # sideline-flymake rainbow-delimiters vertico marginalia From ed1787c8bcbc6e56f0a40de4172c4a47d668148c Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Sun, 25 Aug 2024 10:08:58 +0200 Subject: [PATCH 3/4] Add `haskell-ts-mode` --- flake.lock | 17 +++++++++++++++++ flake.nix | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/flake.lock b/flake.lock index e92d0cd..32dfaa4 100644 --- a/flake.lock +++ b/flake.lock @@ -36,6 +36,22 @@ "type": "github" } }, + "extra-package-haskell-ts-mode": { + "flake": false, + "locked": { + "lastModified": 1724558409, + "narHash": "sha256-dmY9tE5xKB+8od/EJkcUsAZGFBsRiGmz26StbWxfXxo=", + "ref": "refs/heads/main", + "rev": "5d3bd04e43066164feaa864953d30e53e0e137e3", + "revCount": 46, + "type": "git", + "url": "https://codeberg.org/pranshu/haskell-ts-mode.git" + }, + "original": { + "type": "git", + "url": "https://codeberg.org/pranshu/haskell-ts-mode.git" + } + }, "extra-package-indent-bars": { "flake": false, "locked": { @@ -207,6 +223,7 @@ "inputs": { "emacs-overlay": "emacs-overlay", "extra-package-copilot": "extra-package-copilot", + "extra-package-haskell-ts-mode": "extra-package-haskell-ts-mode", "extra-package-indent-bars": "extra-package-indent-bars", "extra-package-notmuch-notify": "extra-package-notmuch-notify", "flake-parts": "flake-parts", diff --git a/flake.nix b/flake.nix index 11d8b45..f48cc79 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,10 @@ url = "github:zerolfx/copilot.el"; flake = false; }; + extra-package-haskell-ts-mode = { + url = "git+https://codeberg.org/pranshu/haskell-ts-mode.git"; + flake = false; + }; }; outputs = inputs @ {flake-parts, ...}: From b2c45c5169a9a0393fc0b784f760bebc248ee962 Mon Sep 17 00:00:00 2001 From: Seven of Nine Date: Sun, 25 Aug 2024 12:30:23 +0000 Subject: [PATCH 4/4] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'emacs-overlay': 'github:nix-community/emacs-overlay/758aa1deb09d8d2dce7bd3a016434e8fcedfab89' (2024-08-21) → 'github:nix-community/emacs-overlay/d945c2ba0421e0c1b239b5882f2c0725fe8cfba1' (2024-08-25) • Updated input 'emacs-overlay/nixpkgs': 'github:NixOS/nixpkgs/8a3354191c0d7144db9756a74755672387b702ba' (2024-08-18) → 'github:NixOS/nixpkgs/c374d94f1536013ca8e92341b540eba4c22f9c62' (2024-08-21) • Updated input 'emacs-overlay/nixpkgs-stable': 'github:NixOS/nixpkgs/f1bad50880bae73ff2d82fafc22010b4fc097a9c' (2024-08-19) → 'github:NixOS/nixpkgs/797f7dc49e0bc7fab4b57c021cdf68f595e47841' (2024-08-22) • Updated input 'extra-package-haskell-ts-mode': 'git+https://codeberg.org/pranshu/haskell-ts-mode.git?ref=refs/heads/main&rev=5d3bd04e43066164feaa864953d30e53e0e137e3' (2024-08-25) → 'git+https://codeberg.org/pranshu/haskell-ts-mode.git?ref=refs/heads/main&rev=d9afd84e46b41c9912539face04ec7bb2a16ba78' (2024-08-25) --- flake.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index 32dfaa4..03f598d 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1724231640, - "narHash": "sha256-1FnV0jk8GAItH71zVTzrhULylMKyXsb4FNmtn9b46Ug=", + "lastModified": 1724577031, + "narHash": "sha256-C3ufe7meLX9zNEOawPKdIpfmFQ+D5d2oqQ3iQMFdva4=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "758aa1deb09d8d2dce7bd3a016434e8fcedfab89", + "rev": "d945c2ba0421e0c1b239b5882f2c0725fe8cfba1", "type": "github" }, "original": { @@ -39,11 +39,11 @@ "extra-package-haskell-ts-mode": { "flake": false, "locked": { - "lastModified": 1724558409, - "narHash": "sha256-dmY9tE5xKB+8od/EJkcUsAZGFBsRiGmz26StbWxfXxo=", + "lastModified": 1724579033, + "narHash": "sha256-cwkJY5kLgcTuTMy2/5t/CkEnN1x7aj6BaSX1wYg7Vw8=", "ref": "refs/heads/main", - "rev": "5d3bd04e43066164feaa864953d30e53e0e137e3", - "revCount": 46, + "rev": "d9afd84e46b41c9912539face04ec7bb2a16ba78", + "revCount": 47, "type": "git", "url": "https://codeberg.org/pranshu/haskell-ts-mode.git" }, @@ -161,11 +161,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1723991338, - "narHash": "sha256-Grh5PF0+gootJfOJFenTTxDTYPidA3V28dqJ/WV7iis=", + "lastModified": 1724224976, + "narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8a3354191c0d7144db9756a74755672387b702ba", + "rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", "type": "github" }, "original": { @@ -189,11 +189,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1724098845, - "narHash": "sha256-D5HwjQw/02fuXbR4LCTo64koglP2j99hkDR79/3yLOE=", + "lastModified": 1724316499, + "narHash": "sha256-Qb9MhKBUTCfWg/wqqaxt89Xfi6qTD3XpTzQ9eXi3JmE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f1bad50880bae73ff2d82fafc22010b4fc097a9c", + "rev": "797f7dc49e0bc7fab4b57c021cdf68f595e47841", "type": "github" }, "original": {