Emacs 30.1!!!

This commit is contained in:
Alexander Rosenberg 2025-02-21 17:42:54 -08:00
parent 226ea54105
commit 89e010474f
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
3 changed files with 152 additions and 1158 deletions

View File

@ -61,7 +61,8 @@ appear at most once to denote \"all remaining modules\"."
:type 'boolean) :type 'boolean)
(defcustom eshell-starship-overridden-remote-methods (defcustom eshell-starship-overridden-remote-methods
'("docker" "podman" "kubernetes" "doas" "su" "sudo" "sudoedit") '("docker" "podman" "kubernetes" "doas" "su" "sudo" "sudoedit" "dockercp"
"podmancp" "toolbox" "distrobox" "flatpak" "apptainer" "nspawn" "run0")
"List of `file-remote-p' mwthods that should NOT be considered remote. "List of `file-remote-p' mwthods that should NOT be considered remote.
Any eshell buffer with a `default-directory' managed by one of these methods Any eshell buffer with a `default-directory' managed by one of these methods
will not be considered remote and all modules that would be disabled because of will not be considered remote and all modules that would be disabled because of
@ -430,7 +431,7 @@ should be as for `eshell-starship--git-interpret-branch-status'."
(not (zerop behind))) (not (zerop behind)))
(when merge-conflicts "=") (when merge-conflicts "=")
(when stash "$") (when stash "$")
(apply 'string (sort (seq-uniq status-chars) #'<))))) (apply 'string (sort (seq-uniq status-chars))))))
(defun eshell-starship--git-current-operation () (defun eshell-starship--git-current-operation ()
"Return the current git operation. "Return the current git operation.
@ -758,7 +759,7 @@ This does not mean anything if pyenv-mode is not installed.")
:predicate :predicate
(lambda () (lambda ()
(member (file-remote-p default-directory 'method) (member (file-remote-p default-directory 'method)
'("doas" "sudo" "su" "sudoedit"))) '("doas" "sudo" "su" "sudoedit" "run0")))
:action :action
(lambda () (lambda ()
(format "%s in" (format "%s in"
@ -769,7 +770,7 @@ This does not mean anything if pyenv-mode is not installed.")
(eshell-starship-defmodule newline (eshell-starship-defmodule newline
:predicate 'always :predicate 'always
:action (lambda () (propertize "\n" 'read-only t 'rear-nonsticky t)) :action (lambda () (progn "\n"))
:doc "A newline in the prompt.") :doc "A newline in the prompt.")
(eshell-starship-defmodule container (eshell-starship-defmodule container
@ -777,7 +778,8 @@ This does not mean anything if pyenv-mode is not installed.")
:color "firebrick" :color "firebrick"
:predicate (lambda () :predicate (lambda ()
(member (file-remote-p default-directory 'method) (member (file-remote-p default-directory 'method)
'("docker" "podman" "kubernetes"))) '("docker" "podman" "kubernetes" "dockercp" "podmancp"
"toolbox" "distrobox" "flatpak" "apptainer" "nspawn")))
:action (lambda () :action (lambda ()
(format "[%s]" (file-remote-p default-directory 'host))) (format "[%s]" (file-remote-p default-directory 'host)))
:reload-on 'cwd :reload-on 'cwd
@ -791,8 +793,7 @@ This does not mean anything if pyenv-mode is not installed.")
" " 'face `(:foreground " " 'face `(:foreground
,(if (= eshell-last-command-status 0) ,(if (= eshell-last-command-status 0)
"lime green" "lime green"
"red")) "red"))))
'rear-nonsticky t))
:doc "An arrow that appears next to where you type.") :doc "An arrow that appears next to where you type.")
@ -989,7 +990,9 @@ Return a hash table mapping module names to their output."
(concat (concat
(unless (<= (line-number-at-pos) 3) (unless (<= (line-number-at-pos) 3)
"\n") "\n")
(eshell-starship--build-module-string))) (let ((mods (eshell-starship--build-module-string)))
(add-face-text-property 0 (length mods) 'default t mods)
mods)))
(defvar-local eshell-starship--last-prompt-info nil (defvar-local eshell-starship--last-prompt-info nil
"A list of the last prompt and the time it took to render it.") "A list of the last prompt and the time it took to render it.")
@ -1020,11 +1023,7 @@ Return a hash table mapping module names to their output."
"Enable eshell-starship." "Enable eshell-starship."
(setq-local eshell-starship--restore-state (setq-local eshell-starship--restore-state
(buffer-local-set-state (buffer-local-set-state
eshell-prompt-function eshell-prompt-function 'eshell-starship--prompt-function)
'eshell-starship--prompt-function
;; temporary fix until the next version where eshell uses fields
eshell-prompt-regexp (rx bol (? "⬢ [" (+ any) "] ") " ")
eshell-highlight-prompt nil)
eshell-starship--module-cache (make-hash-table :test 'equal)) eshell-starship--module-cache (make-hash-table :test 'equal))
(add-hook 'eshell-pre-command-hook (add-hook 'eshell-pre-command-hook
#'eshell-starship--run-module-precmd-actions nil t) #'eshell-starship--run-module-precmd-actions nil t)

File diff suppressed because it is too large Load Diff

209
init.el
View File

@ -60,7 +60,8 @@
:hook (;;(emacs-lisp-mode . my/-emacs-lisp-mode-setup-evil-lookup) :hook (;;(emacs-lisp-mode . my/-emacs-lisp-mode-setup-evil-lookup)
;;(prog-mode . electric-pair-local-mode) ;;(prog-mode . electric-pair-local-mode)
((text-mode tex-mode prog-mode) . auto-fill-mode) ((text-mode tex-mode prog-mode) . auto-fill-mode)
((text-mode tex-mode prog-mode) . my/-enable-show-trailing-whitespace)) ((text-mode tex-mode prog-mode) . my/-enable-show-trailing-whitespace)
((tex-mode prog-mode) . kill-ring-deindent-mode))
:init :init
(with-eval-after-load 'find-func (with-eval-after-load 'find-func
(when (and (file-directory-p "~/src/emacs/src/")) (when (and (file-directory-p "~/src/emacs/src/"))
@ -79,8 +80,34 @@
(describe-symbol (cadr form)) (describe-symbol (cadr form))
(describe-symbol form)))) (describe-symbol form))))
;; Trusted buffer stuff
(defun my/temp-trust-buffer ()
"Set the current buffers local value of `trusted-content' to \\=:all."
(interactive)
(setq-local trusted-content :all)
(cond
((and (buffer-modified-p) (y-or-n-p "Save and reload buffer?"))
(save-buffer)
(revert-buffer-quick))
((y-or-n-p "Revert buffer?")
(revert-buffer-quick))))
(put 'trusted-content 'permanent-local t)
(defun my/-trusted-content-segment ()
(when (and (derived-mode-p 'prog-mode)
(not buffer-read-only))
(cond
((and (local-variable-p 'trusted-content)
(equal trusted-content :all)
buffer-file-name)
(propertize "[Temp. Trusted]" 'face 'warning))
((not (trusted-content-p))
(propertize "[Untrusted]" 'face 'error)))))
(add-to-list 'mode-line-misc-info
'(:eval (my/-trusted-content-segment)))
;; Increase responsiveness ;; Increase responsiveness
(setq gc-cons-threshold 80000000 (setq gc-cons-threshold 80000000
inhibit-compacting-font-caches t
read-process-output-max (* 1024 1024)) ;; 1mb read-process-output-max (* 1024 1024)) ;; 1mb
(global-so-long-mode 1) (global-so-long-mode 1)
@ -138,6 +165,9 @@
;; Visual line mode ;; Visual line mode
(global-visual-line-mode 1) (global-visual-line-mode 1)
;; Better line wrapping
(global-visual-wrap-prefix-mode 1)
;; Make some commands easier to enter multiple times ;; Make some commands easier to enter multiple times
(repeat-mode 1) (repeat-mode 1)
@ -226,35 +256,27 @@ Interactively, force the recompile if called with a prefix."
:custom :custom
(auth-sources '("~/.authinfo.gpg"))) (auth-sources '("~/.authinfo.gpg")))
(setopt remote-file-name-access-timeout 10)
(use-package tramp (use-package tramp
:ensure nil :ensure nil
:custom
(tramp-file-name-with-method "doas")
:config :config
(add-to-list 'tramp-connection-properties (connection-local-set-profile-variables
(list (rx bos "/" (or "podman" "docker") ":") 'direct-async
"direct-async-process" t)) '((tramp-direct-async-process . t)))
(add-to-list 'tramp-connection-properties
(list (rx bos "/" (or "ssh" "sshx") ":")
"direct-async-process" t))
(add-to-list 'tramp-connection-properties
(list (rx bos "/" (or "sudo" "su" "doas"
"sudoedit")
":")
"direct-async-process" t))
(connection-local-set-profile-variables (connection-local-set-profile-variables
'error-only 'error-only
'((tramp-verbose . 1))) '((tramp-verbose . 1)))
(connection-local-set-profiles (dolist (method '("podman" "docker" "ssh" "sshx" "sudo" "su" "doas"
'(:method "sudo") "sudoedit" "run0" "kubernetes" "dockercp" "podmancp"
'error-only) "distrobox" "toolbox" "flatpak" "apptainer" "nspawn"))
(connection-local-set-profiles (let ((inhibit-message t)
'(:method "doas") (message-log-max nil))
'error-only) (tramp-enable-method (intern method)))
(connection-local-set-profiles (connection-local-set-profiles
'(:method "su") `(:method ,method)
'error-only) 'error-only 'direct-async)))
(connection-local-set-profiles
'(:method "sudoedit")
'error-only))
(use-package midnight (use-package midnight
:ensure nil :ensure nil
@ -757,11 +779,6 @@ With NO-EDGE, return nil if beg or end fall on the edge of the range."
(advice-add 'sp-region-ok-p :around 'my/-evil-cp-region-ok-p-no-string) (advice-add 'sp-region-ok-p :around 'my/-evil-cp-region-ok-p-no-string)
(advice-add 'evil-cp--balanced-block-p :around 'my/-evil-cp-block-ok-p-no-string)) (advice-add 'evil-cp--balanced-block-p :around 'my/-evil-cp-block-ok-p-no-string))
;; be (hopefully) safer
(require 'trusted-files)
(keymap-global-set "C-c t" 'trusted-files-map)
(trusted-files-modeline-mode)
;; better lisp editing ;; better lisp editing
(use-package adjust-parens (use-package adjust-parens
:hook (prog-mode . adjust-parens-mode) :hook (prog-mode . adjust-parens-mode)
@ -911,7 +928,11 @@ visual states."
;; better `replace-regexp' ;; better `replace-regexp'
(use-package visual-regexp (use-package visual-regexp
:bind (("C-c q" . vr/replace) :bind (("C-c q" . vr/replace)
("C-M-%" . vr/query-replace))) ("C-M-%" . vr/query-replace))
:init
(let ((val minibuffer-regexp-prompts))
(cl-pushnew "Replace" val :test 'equal)
(setopt minibuffer-regexp-prompts val)))
;; better `align-regexp' ;; better `align-regexp'
(use-package ialign (use-package ialign
@ -975,15 +996,15 @@ visual states."
(defun my/-setup-text-mode-completion-styles () (defun my/-setup-text-mode-completion-styles ()
(setq-local completion-styles '(basic))) (setq-local completion-styles '(basic)))
(orderless-define-completion-style my/orderless-with-initialism (orderless-define-completion-style my/orderless-with-initialism
(orderless-matching-styles '(orderless-initialism (orderless-matching-styles '(orderless-initialism orderless-regexp)))
orderless-regexp)))
(setq orderless-matching-styles '(orderless-regexp) (setq orderless-matching-styles '(orderless-regexp)
completion-styles '(orderless basic) completion-styles '(orderless basic)
completion-category-defaults nil completion-category-defaults nil
completion-category-overrides '((file completion-category-overrides '((file
(styles basic partial-completion)) (styles basic partial-completion))
(command (command
(styles my/orderless-with-initialism basic))))) (styles my/orderless-with-initialism
basic)))))
;; marginalia ;; marginalia
(use-package marginalia (use-package marginalia
@ -1068,6 +1089,15 @@ visual states."
(use-package embark-consult (use-package embark-consult
:hook (embark-collect-mode . consult-preview-at-point-mode)) :hook (embark-collect-mode . consult-preview-at-point-mode))
(use-package completion-preview
:ensure nil
:defer nil
;; adjust parens can shadow this if it is not bound to <tab>
:bind (:map completion-preview-active-mode-map
("<tab>" . #'completion-preview-insert))
:config
(global-completion-preview-mode 1))
;; corfu (autocomplete) ;; corfu (autocomplete)
(use-package corfu (use-package corfu
:bind (("M-<tab>" . completion-at-point) :bind (("M-<tab>" . completion-at-point)
@ -1084,7 +1114,7 @@ visual states."
(completion-cycle-threshold completion-cycling)) (completion-cycle-threshold completion-cycling))
(apply #'consult-completion-in-region completion-in-region--data)))) (apply #'consult-completion-in-region completion-in-region--data))))
(setq corfu-cycle t (setq corfu-cycle t
corfu-auto t corfu-auto nil
corfu-on-exact-match nil corfu-on-exact-match nil
corfu-popupinfo-delay '(1.0 . 0.5) corfu-popupinfo-delay '(1.0 . 0.5)
completion-cycle-threshold nil completion-cycle-threshold nil
@ -1187,15 +1217,20 @@ to `posframe-show' if the display is graphical."
;; flymake ;; flymake
(use-package flymake (use-package flymake
:config :config
(require 'consult-flymake)) (require 'consult-flymake)
:custom
(flymake-indicator-type 'margins))
;; flycheck ;; flycheck
(use-package flycheck (use-package flycheck
:hook ((sh-mode emacs-lisp-mode) . trusted-files-flycheck-mode-if-safe) :hook ((sh-mode emacs-lisp-mode) . my/flycheck-if-trusted)
:custom :custom
(flycheck-indication-mode 'left-margin) (flycheck-indication-mode 'left-margin)
:init :init
(setq flycheck-display-errors-function nil)) (setq flycheck-display-errors-function nil)
(defun my/flycheck-if-trusted ()
(when (trusted-content-p)
(flycheck-mode))))
(use-package consult-flycheck) (use-package consult-flycheck)
(defun my/sly-notes-at-point (&optional pos buffer) (defun my/sly-notes-at-point (&optional pos buffer)
@ -1337,7 +1372,10 @@ With PROJECT, give diagnostics for all buffers in the current project."
:init :init
;; (defun my/eglot-in-text-mode-only () ;; (defun my/eglot-in-text-mode-only ()
;; (when (eq major-mode 'text-mode) ;; (when (eq major-mode 'text-mode)
;; (trusted-files-eglot-ensure-if-safe))) ;; (eglot-ensure)))
(defun my/eglot-if-trusted ()
(when (trusted-content-p)
(eglot-ensure)))
(defvar my/-eglot-documentation-buffer nil (defvar my/-eglot-documentation-buffer nil
"Buffer for showing documentation for `my/eglot-documentation-at-point'.") "Buffer for showing documentation for `my/eglot-documentation-at-point'.")
(define-derived-mode my/eglot-documentation-mode special-mode "Eglot-Doc" (define-derived-mode my/eglot-documentation-mode special-mode "Eglot-Doc"
@ -1432,6 +1470,8 @@ With PROJECT, give diagnostics for all buffers in the current project."
:after (project evil) :after (project evil)
:bind (:map project-prefix-map :bind (:map project-prefix-map
("U" . my/project-gdb)) ("U" . my/project-gdb))
:custom
(gud-highlight-current-line t)
:config :config
(setq gdb-debuginfod-enable-setting t) (setq gdb-debuginfod-enable-setting t)
(defvar my/project-gdb-command nil (defvar my/project-gdb-command nil
@ -1527,11 +1567,13 @@ With PROJECT, give diagnostics for all buffers in the current project."
;; project.el ;; project.el
(use-package project (use-package project
:defer nil
:bind (([remap project-compile] . my/project-compile-or-default) :bind (([remap project-compile] . my/project-compile-or-default)
:map project-prefix-map :map project-prefix-map
("s" . my/project-eshell) ("s" . my/project-eshell)
("u" . my/project-run)) ("u" . my/project-run))
:init :init
(setq uniquify-dirname-transform #'project-uniquify-dirname-transform)
(defvar eshell-buffer-name) (defvar eshell-buffer-name)
(defun my/project-eshell (prompt &optional arg) (defun my/project-eshell (prompt &optional arg)
"Switch to or create an eshell buffer in the current projects root." "Switch to or create an eshell buffer in the current projects root."
@ -1615,6 +1657,13 @@ COMMAND and COMINT are like `compile'."
:config :config
(evil-set-initial-state 'comint-mode 'normal)) (evil-set-initial-state 'comint-mode 'normal))
;; editorconfig
(use-package editorconfig
:demand t
:ensure nil
:init
(editorconfig-mode 1))
;; nxml ;; nxml
(use-package nxml-mode (use-package nxml-mode
:ensure nil :ensure nil
@ -1718,7 +1767,8 @@ otherwise, call `bibtex-find-text'."
:hook ((LaTeX-mode . turn-on-reftex) :hook ((LaTeX-mode . turn-on-reftex)
(LaTeX-mode . LaTeX-math-mode) (LaTeX-mode . LaTeX-math-mode)
(LaTeX-mode . my/-setup-LaTeX-mode) (LaTeX-mode . my/-setup-LaTeX-mode)
(LaTeX-mode . trusted-files-flycheck-mode-if-safe)) (LaTeX-mode . my/flycheck-if-trusted)
(TeX-mode . kill-ring-deindent-mode))
:bind (:map TeX-mode-map :bind (:map TeX-mode-map
("C-c ?" . latex-help)) ("C-c ?" . latex-help))
:init :init
@ -1771,13 +1821,13 @@ otherwise, call `bibtex-find-text'."
;; blueprint ;; blueprint
(use-package blueprint-ts-mode (use-package blueprint-ts-mode
:hook (blueprint-ts-mode . trusted-files-eglot-ensure-if-safe) :hook (blueprint-ts-mode . my/eglot-if-trusted)
:after eglot) :after eglot)
;; python-ts-mode ;; python-ts-mode
(use-package python-ts-mode (use-package python-ts-mode
:ensure nil :ensure nil
:hook (python-ts-mode . trusted-files-eglot-ensure-if-safe)) :hook (python-ts-mode . my/eglot-if-trusted))
;; python virtual environments ;; python virtual environments
(use-package pyvenv) (use-package pyvenv)
(use-package pyenv-mode) (use-package pyenv-mode)
@ -1787,7 +1837,7 @@ otherwise, call `bibtex-find-text'."
;; java-ts-mode ;; java-ts-mode
(use-package java-ts-mode (use-package java-ts-mode
:hook ((java-ts-mode . trusted-files-eglot-ensure-if-safe) :hook ((java-ts-mode . my/eglot-if-trusted)
(java-ts-mode . my/-setup-java-ts-mode)) (java-ts-mode . my/-setup-java-ts-mode))
:config :config
(defun my/-setup-java-ts-mode () (defun my/-setup-java-ts-mode ()
@ -1801,7 +1851,7 @@ otherwise, call `bibtex-find-text'."
;; c-ts-mode ;; c-ts-mode
(use-package c-ts-mode (use-package c-ts-mode
:after evil :after evil
:hook ((c-ts-mode c++-ts-mode) . trusted-files-eglot-ensure-if-safe) :hook ((c-ts-mode c++-ts-mode) . my/eglot-if-trusted)
:init :init
(setq-default c-ts-mode-indent-offset 4) (setq-default c-ts-mode-indent-offset 4)
:config :config
@ -1819,12 +1869,13 @@ otherwise, call `bibtex-find-text'."
(use-package glsl-mode) (use-package glsl-mode)
;; php-mode ;; php-mode
(use-package php-mode (use-package php-ts-mode
:hook (php-mode . trusted-files-eglot-ensure-if-safe)) :ensure nil
:hook (php-mode . my/eglot-if-trusted))
;; web-mode ;; web-mode
(use-package web-mode (use-package web-mode
:hook (web-mode . trusted-files-eglot-ensure-if-safe) :hook (web-mode . my/eglot-if-trusted)
:init :init
(add-to-list 'eglot-server-programs (add-to-list 'eglot-server-programs
'(web-mode . ("vscode-html-language-server" "--stdio")))) '(web-mode . ("vscode-html-language-server" "--stdio"))))
@ -1832,7 +1883,7 @@ otherwise, call `bibtex-find-text'."
;; JavaScript ;; JavaScript
(use-package js (use-package js
:ensure nil :ensure nil
:hook (js-ts-mode . trusted-files-eglot-ensure-if-safe)) :hook (js-ts-mode . my/eglot-if-trusted))
(use-package js-comint (use-package js-comint
:bind (:map js-ts-mode-map :bind (:map js-ts-mode-map
("C-x C-e" . js-send-last-sexp) ("C-x C-e" . js-send-last-sexp)
@ -1853,7 +1904,7 @@ otherwise, call `bibtex-find-text'."
;; TypeScript ;; TypeScript
(use-package typescript-ts-mode (use-package typescript-ts-mode
:ensure nil :ensure nil
:hook (typescript-ts-mode . trusted-files-eglot-ensure-if-safe) :hook (typescript-ts-mode . my/eglot-if-trusted)
:init :init
(add-to-list 'auto-mode-alist `(,(rx ".ts" eos) . typescript-ts-mode))) (add-to-list 'auto-mode-alist `(,(rx ".ts" eos) . typescript-ts-mode)))
@ -1863,7 +1914,7 @@ otherwise, call `bibtex-find-text'."
(define-hostmode my/poly-web-hostmode (define-hostmode my/poly-web-hostmode
:mode 'web-mode) :mode 'web-mode)
(define-innermode my/poly-php-innermode (define-innermode my/poly-php-innermode
:mode 'php-mode :mode 'php-ts-mode
:head-matcher (regexp-quote "<?php") :head-matcher (regexp-quote "<?php")
:tail-matcher (regexp-quote "?>") :tail-matcher (regexp-quote "?>")
:head-mode 'body :head-mode 'body
@ -1884,24 +1935,24 @@ otherwise, call `bibtex-find-text'."
;; go mode ;; go mode
(use-package go-mode (use-package go-mode
:defer nil :defer nil
:hook (go-mode . trusted-files-eglot-ensure-if-safe)) :hook (go-mode . my/eglot-if-trusted))
(use-package go-ts-mode (use-package go-ts-mode
:ensure nil :ensure nil
:hook (go-ts-mode . trusted-files-eglot-ensure-if-safe)) :hook (go-ts-mode . my/eglot-if-trusted))
;; rust ;; rust
(use-package rust-mode) (use-package rust-mode)
(use-package rust-ts-mode (use-package rust-ts-mode
:ensure nil :ensure nil
:hook (rust-ts-mode . trusted-files-eglot-ensure-if-safe)) :hook (rust-ts-mode . my/eglot-if-trusted))
;; zig ;; zig
(use-package zig-mode (use-package zig-mode
:hook (zig-mode . trusted-files-eglot-ensure-if-safe)) :hook (zig-mode . my/eglot-if-trusted))
;; lua ;; lua
(use-package lua-mode (use-package lua-mode
:hook (lua-mode . trusted-files-eglot-ensure-if-safe)) :hook (lua-mode . my/eglot-if-trusted))
;; markdown ;; markdown
(use-package markdown-mode (use-package markdown-mode
@ -1923,7 +1974,7 @@ otherwise, call `bibtex-find-text'."
;; json ;; json
(use-package json-ts-mode (use-package json-ts-mode
:hook (json-ts-mode . trusted-files-eglot-ensure-if-safe) :hook (json-ts-mode . my/eglot-if-trusted)
:custom :custom
(json-ts-mode-indent-offset 4) (json-ts-mode-indent-offset 4)
:init :init
@ -1938,7 +1989,7 @@ otherwise, call `bibtex-find-text'."
;; yaml ;; yaml
(use-package yaml-ts-mode (use-package yaml-ts-mode
:hook (;; (yaml-ts-mode . trusted-files-eglot-ensure-if-safe) :hook (;; (yaml-ts-mode . my/eglot-if-trusted)
(yaml-ts-mode . my/-setup-yaml-ts-mode)) (yaml-ts-mode . my/-setup-yaml-ts-mode))
:init :init
(add-to-list 'auto-mode-alist `("\\.clangd\\'" . yaml-ts-mode)) (add-to-list 'auto-mode-alist `("\\.clangd\\'" . yaml-ts-mode))
@ -2027,7 +2078,7 @@ line in the block and manually deal with indentation."
:init :init
(defun my/-lisp-mode-autoconnect-sly () (defun my/-lisp-mode-autoconnect-sly ()
(unless (sly-connected-p) (unless (sly-connected-p)
(trusted-files-sly-if-safe))) (sly)))
(setq inferior-lisp-program "/usr/bin/sbcl") (setq inferior-lisp-program "/usr/bin/sbcl")
(defun my/-sly-fix-special-buffers () (defun my/-sly-fix-special-buffers ()
(when (string-match-p (rx bos "*" (* any) "*" eos) (buffer-name)) (when (string-match-p (rx bos "*" (* any) "*" eos) (buffer-name))
@ -2309,7 +2360,15 @@ current buffer is a Jupyter buffer, just use that."
(visual-line-mode -1) (visual-line-mode -1)
(display-line-numbers-mode -1) (display-line-numbers-mode -1)
(toggle-truncate-lines 1)) (toggle-truncate-lines 1))
(setq mode-line-right-align-edge 'right-margin)
:config :config
(defun my/-window-dedicated-modeline-segment ()
(let ((dedicated (window-dedicated-p)))
(cond
((eq dedicated t) "[SD]")
(dedicated "[D]"))))
(add-to-list 'mode-line-misc-info
'(:eval (my/-window-dedicated-modeline-segment)))
(evil-define-key '(normal visual motion) calc-edit-mode-map (evil-define-key '(normal visual motion) calc-edit-mode-map
(kbd "RET") 'calc-edit-return (kbd "RET") 'calc-edit-return
(kbd "<return>") 'calc-edit-return) (kbd "<return>") 'calc-edit-return)
@ -2406,14 +2465,18 @@ argument."
(use-package gnuplot) (use-package gnuplot)
(defun my/dir-container-p (&optional dir) (defun my/dir-container-p (&optional dir)
"Return non-nil if DIR is a remote directory that is a container." "Return non-nil if DIR is a remote directory that is a container.
(member (file-remote-p default-directory 'method) Actually, return the method name."
'("docker" "podman"))) (car (member (file-remote-p default-directory 'method)
'("docker" "podman" "kubernetes" "dockercp" "podmancp"
"toolbox" "distrobox" "flatpak" "apptainer" "nspawn"))))
(defun my/dir-distrobox-p (&optional dir) (defun my/dir-distrobox-p (&optional dir)
"Return non-nil if DIR is a remote directory that is a distrobox container." "Return non-nil if DIR is a remote directory that is a distrobox container."
(and (my/dir-container-p dir) (let ((method (my/dir-container-p dir)))
(let ((default-directory (or dir default-directory))) (or (equal method "distrobox")
(executable-find "distrobox-host-exec" t)))) (and method
(let ((default-directory (or dir default-directory)))
(executable-find "distrobox-host-exec" t))))))
(defun my/dir-sudo-p (&optional dir) (defun my/dir-sudo-p (&optional dir)
"Return non-nil if DIR is a remote directory that is sudo, doas, etc.." "Return non-nil if DIR is a remote directory that is sudo, doas, etc.."
(member (file-remote-p (or dir default-directory) 'method) (member (file-remote-p (or dir default-directory) 'method)
@ -2495,6 +2558,8 @@ argument."
:bind (:map eshell-mode-map :bind (:map eshell-mode-map
("TAB" . completion-at-point) ("TAB" . completion-at-point)
("<tab>" . completion-at-point)) ("<tab>" . completion-at-point))
:custom
(eshell-history-append t)
:init :init
(defun my/-eshell-filter-alias-list () (defun my/-eshell-filter-alias-list ()
(cl-remove-if-not (lambda (elt) (cl-remove-if-not (lambda (elt)
@ -2751,9 +2816,7 @@ ARG is the same as for either of the above functions."
(let (out) (let (out)
(dolist (bme bookmarks (dolist (bme bookmarks
(append my/-dirvish-base-quick-access-entries (append my/-dirvish-base-quick-access-entries
(sort out (sort out :key 'car)))
(lambda (elt1 elt2)
(string< (car elt1) (car elt2))))))
(let ((name (car bme))) (let ((name (car bme)))
(let-alist (cdr bme) (let-alist (cdr bme)
(when (and (file-directory-p .filename) (when (and (file-directory-p .filename)
@ -2917,7 +2980,7 @@ R is rest of the arguments to OLDFUN."
;; ledger ;; ledger
(use-package ledger-mode) (use-package ledger-mode)
(use-package flycheck-ledger (use-package flycheck-ledger
:hook (ledger-mode . trusted-files-flycheck-mode-if-safe)) :hook (ledger-mode . my/flycheck-if-trusted))
;; khard contacts ;; khard contacts
(require 'khard) (require 'khard)
@ -3073,7 +3136,7 @@ The name is compared with the field name using TESTFN (defaults to `equal')."
;; "Setup up stuff in `org-mu4e-compose' buffers." ;; "Setup up stuff in `org-mu4e-compose' buffers."
;; (setq-local ltex-eglot-variable-save-method 'file) ;; (setq-local ltex-eglot-variable-save-method 'file)
;; ;; this should come last so it can pick up the above ;; ;; this should come last so it can pick up the above
;; ;; (trusted-files-eglot-ensure-if-safe) ;; ;; (my/eglot-if-trusted)
;; ) ;; )
;; (add-hook 'org-mu4e-compose-mode-hook #'my/-setup-org-mu4e-compose-mode) ;; (add-hook 'org-mu4e-compose-mode-hook #'my/-setup-org-mu4e-compose-mode)
@ -3098,7 +3161,7 @@ The name is compared with the field name using TESTFN (defaults to `equal')."
("f" . helpful-callable) ("f" . helpful-callable)
("v" . helpful-variable) ("v" . helpful-variable)
("k" . helpful-key) ("k" . helpful-key)
("o" . helpful-symbol) ("O" . helpful-symbol)
("x" . helpful-command) ("x" . helpful-command)
("F" . helpful-function) ("F" . helpful-function)
:map helpful-mode-map :map helpful-mode-map
@ -3399,6 +3462,14 @@ one of the normal rainbow-delimiters-depth-N-face faces."
("Europe/Paris" "Paris") ("Europe/Paris" "Paris")
("Asia/Calcutta" "Bangalore"))) ("Asia/Calcutta" "Bangalore")))
;; dictionaries
(use-package dictionary
:defer t
:ensure nil
:custom
(dictionary-read-word-function . #'dictionary-completing-read-word)
(dictionary-read-dictionary-function . #'dictionary-completing-read-dictionary))
;; page break lines ;; page break lines
(use-package page-break-lines (use-package page-break-lines
:config :config