summaryrefslogtreecommitdiff
path: root/settings/setup-keychain-environment.el
diff options
context:
space:
mode:
authorbenj <benj@rse8.com>2023-11-25 10:02:42 -0800
committerbenj <benj@rse8.com>2023-11-25 10:02:42 -0800
commit4cfa8246ea7eec4139ba6c34d3fb3a4545956824 (patch)
tree450ba709847d3740eef79753c428095bdb08fe62 /settings/setup-keychain-environment.el
parent4f78ee33bfc828707a79cd79d296bf4a9c25b5b9 (diff)
downloademacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.tar
emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.tar.gz
emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.tar.bz2
emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.tar.lz
emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.tar.xz
emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.tar.zst
emacs-4cfa8246ea7eec4139ba6c34d3fb3a4545956824.zip
rewrite emacs init.el and go back to basics
This is a complete rewrite leveraging the very popular use-package to see how I like it. We reduce init.el to a bare minimum configuration and remove the previous homebrew organizational scheme. A number of packages have yet to be setup, but we'll wait and do in JIT.
Diffstat (limited to '')
-rw-r--r--settings/setup-keychain-environment.el75
1 files changed, 0 insertions, 75 deletions
diff --git a/settings/setup-keychain-environment.el b/settings/setup-keychain-environment.el
deleted file mode 100644
index 6d6c294..0000000
--- a/settings/setup-keychain-environment.el
+++ /dev/null
@@ -1,75 +0,0 @@
-;;; keychain-environment.el --- load keychain environment variables
-
-;; Copyright (C) 2011-2016 Jonas Bernoulli
-;; Copyright (C) 2008-2011 Paul Tipper
-
-;; Author: Paul Tipper <bluefoo at googlemail dot com>
-;; Maintainer: Jonas Bernoulli <jonas@bernoul.li>
-;; Created: 20081218
-;; Homepage: https://github.com/tarsius/keychain-environment
-;; Keywords: gnupg, pgp, ssh
-
-;; This file is not part of GNU Emacs.
-
-;; This file 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, or (at your option)
-;; any later version.
-
-;; This file 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.
-
-;; For a full copy of the GNU General Public License
-;; see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; Keychain is a script that manages ssh-agent and gpg-agent. It is
-;; typically run from the shell's initialization file. It allows your
-;; shells and cron jobs to share a single ssh-agent and/or gpg-agent.
-
-;; When keychain is run, it checks for running agent, otherwise it
-;; starts them. It saves the agents' environment variables to files
-;; inside ~/.keychain/, so that subsequent shells can source these
-;; files.
-
-;; When Emacs is started under X11 and not directly from a terminal
-;; these variables are not set. This library looks for these files
-;; created by keychain and then sets Emacs' environment variables
-;; accordingly. It does not actually run keychain, so you still
-;; have to run that from a login shell first.
-
-;; To use run the function `keychain-refresh-environment' in your
-;; init file. If keychain has not been run yet when you start Emacs
-;; you can also later call that function interactively.
-
-;; Also see: http://www.funtoo.org/wiki/Keychain
-
-;;; Code:
-
-;;;###autoload
-(defun keychain-refresh-environment ()
- "Set ssh-agent and gpg-agent environment variables.
-Set the environment variables `SSH_AUTH_SOCK', `SSH_AGENT_PID'
-and `GPG_AGENT' in Emacs' `process-environment' according to
-information retrieved from files created by the keychain script."
- (interactive)
- (let* ((ssh (shell-command-to-string "keychain -q --noask --agents ssh --eval"))
- (gpg (shell-command-to-string "keychain -q --noask --agents gpg --eval")))
- (list (and ssh
- (string-match "SSH_AUTH_SOCK[=\s]\\([^\s;\n]*\\)" ssh)
- (setenv "SSH_AUTH_SOCK" (match-string 1 ssh)))
- (and ssh
- (string-match "SSH_AGENT_PID[=\s]\\([0-9]*\\)?" ssh)
- (setenv "SSH_AGENT_PID" (match-string 1 ssh)))
- (and gpg
- (string-match "GPG_AGENT_INFO[=\s]\\([^\s;\n]*\\)" gpg)
- (setenv "GPG_AGENT_INFO" (match-string 1 gpg))))))
-
-(provide 'setup-keychain-environment)
-;; Local Variables:
-;; indent-tabs-mode: nil
-;; End:
-;;; setup-keychain-environment.el ends here