1
0
Fork 0

Add oni-data-dir

This commit is contained in:
Tom Willemse 2019-02-27 23:43:16 -08:00
parent ba7e1b9308
commit bab53707b6
5 changed files with 57 additions and 18 deletions

View file

@ -4,8 +4,8 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 20190218165405 ;; Version: 20190227232633
;; Package-Requires: (clojure-mode cider clojure-mode-extra-font-locking paredit rainbow-delimiters) ;; Package-Requires: (clojure-mode cider clojure-mode-extra-font-locking paredit rainbow-delimiters oni-data-dir)
;; This program is free software; you can redistribute it and/or modify ;; 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 ;; it under the terms of the GNU General Public License as published by
@ -26,10 +26,11 @@
;;; Code: ;;; Code:
(require 'cider)
(require 'clojure-mode) (require 'clojure-mode)
(require 'clojure-mode-extra-font-locking) (require 'clojure-mode-extra-font-locking)
(require 'inf-lisp) (require 'inf-lisp)
(require 'cider) (require 'oni-data-dir)
(defun oni-clojure-set-inferior-lisp () (defun oni-clojure-set-inferior-lisp ()
"Set `inferior-lisp-program' to use Lein." "Set `inferior-lisp-program' to use Lein."
@ -54,8 +55,7 @@
(setq cider-show-error-buffer t (setq cider-show-error-buffer t
cider-auto-select-error-buffer t) cider-auto-select-error-buffer t)
(setq cider-repl-history-file (setq cider-repl-history-file (oni-data-dir-locate "cider-history"))
(concat user-emacs-directory "data/cider-history"))
(setq cider-repl-wrap-history t) (setq cider-repl-wrap-history t)

37
oni-data-dir.el Normal file
View file

@ -0,0 +1,37 @@
;;; oni-data-dir.el --- Data dir configuration -*- lexical-binding: t; -*-
;; Copyright (C) 2019 Tom Willemse
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 20190227232656
;; 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 <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Utilities for placing all state files in "data/" inside my
;; `user-emacs-directory'.
;;; Code:
(defconst oni-data-dir--name "data"
"The name of the directory all data should live in.")
(defun oni-data-dir-locate (filename)
"Return the location of FILENAME inside the data directory."
(concat user-emacs-directory oni-data-dir--name "/" filename))
(provide 'oni-data-dir)
;;; oni-data-dir.el ends here

View file

@ -4,7 +4,8 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 20190226022941 ;; Version: 20190227233916
;; Package-Requires: (oni-data-dir)
;; This program is free software; you can redistribute it and/or modify ;; 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 ;; it under the terms of the GNU General Public License as published by
@ -30,14 +31,15 @@
(require 'mail-source) (require 'mail-source)
(require 'message) (require 'message)
(require 'nnfolder) (require 'nnfolder)
(require 'oni-data-dir)
(require 'sendmail) (require 'sendmail)
(setq gnus-directory (locate-user-emacs-file "data/News") (setq gnus-directory (oni-data-dir-locate "News")
gnus-article-save-directory gnus-directory gnus-article-save-directory gnus-directory
gnus-cache-directory gnus-directory gnus-cache-directory gnus-directory
gnus-kill-files-directory gnus-directory) gnus-kill-files-directory gnus-directory)
(setq mail-source-directory (locate-user-emacs-file "data/Mail") (setq mail-source-directory (oni-data-dir-locate "Mail")
message-directory mail-source-directory message-directory mail-source-directory
nnfolder-directory mail-source-directory) nnfolder-directory mail-source-directory)

View file

@ -4,8 +4,8 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 20190221004411 ;; Version: 20190227233209
;; Package-Requires: (jabber) ;; Package-Requires: (jabber oni-data-dir)
;; This program is free software; you can redistribute it and/or modify ;; 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 ;; it under the terms of the GNU General Public License as published by
@ -27,6 +27,7 @@
;;; Code: ;;; Code:
(require 'jabber) (require 'jabber)
(require 'oni-data-dir)
(defun oni-jabber-set-default-directory () (defun oni-jabber-set-default-directory ()
"Set the default directory to my home directory." "Set the default directory to my home directory."
@ -55,10 +56,9 @@ Insert PROPOSED-ALERT in the buffer if it is non-nil."
(:connection-type . starttls)))) (:connection-type . starttls))))
(setq jabber-avatar-cache-directory (setq jabber-avatar-cache-directory
(concat user-emacs-directory "data/jabber/avatars/")) (oni-data-dir-locate "jabber/avatars/"))
(setq jabber-history-dir (setq jabber-history-dir (oni-data-dir-locate "jabber/hist/"))
(concat user-emacs-directory "data/jabber/hist/"))
(setq jabber-chat-buffer-format "+%n" (setq jabber-chat-buffer-format "+%n"
jabber-chat-foreign-prompt-format "%t %n " jabber-chat-foreign-prompt-format "%t %n "

View file

@ -4,8 +4,8 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 20190219003930 ;; Version: 20190227233727
;; Package-Requires: (projectile ivy) ;; Package-Requires: (projectile ivy oni-data-dir)
;; This program is free software; you can redistribute it and/or modify ;; 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 ;; it under the terms of the GNU General Public License as published by
@ -26,15 +26,15 @@
;;; Code: ;;; Code:
(require 'oni-data-dir)
(require 'projectile) (require 'projectile)
(setq projectile-known-projects-file (setq projectile-known-projects-file
(concat user-emacs-directory "data/projectile-bookmarks.eld")) (oni-data-dir-locate "projectile-bookmarks.eld"))
(setq projectile-mode-line-prefix " P") (setq projectile-mode-line-prefix " P")
(setq projectile-cache-file (setq projectile-cache-file (oni-data-dir-locate "projectile.cache"))
(concat user-emacs-directory "data/projectile.cache"))
(setq projectile-completion-system 'ivy) (setq projectile-completion-system 'ivy)