diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 74a7b2b..89fb362 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -336,6 +336,19 @@ (add-hook 'yaml-mode-hook (lambda () (setq-local show-trailing-whitespace t)))) +(use-package auth-source-pass :demand + :config + (auth-source-pass-enable) + (defun auth-source-pass--remap (orig-fun host &optional user port) + (let ((new-host (pcase host + ("hosting" "hosting.tardisventures.net") + (_ host))) + (new-user (if (string= port "sudo") (user-login-name) user))) + (message "remapped %s@%s:%s -> %s@%s:%s" host user port new-host new-user port) + (funcall orig-fun new-host new-user port))) + + (advice-add 'auth-source-pass--find-match-unambiguous :around #'auth-source-pass--remap)) + (use-package calc :bind ("C-x M-e" . calc-eval-in-place) :init