From: Amin Bandali Date: Sun, 27 Sep 2020 16:38:49 +0000 (-0400) Subject: Drop no-littering X-Git-Url: https://git.shemshak.org/~bandali/configs/commitdiff_plain/0596e3cf82c0d9a5bf898e027824c0a0229c65fb?ds=inline;hp=944ef93215ad453a4cdab9a2a6ebe3144b85b590 Drop no-littering --- diff --git a/.gitmodules b/.gitmodules index ef689ca..66e31e9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -62,9 +62,6 @@ [submodule "minions"] path = lib/minions url = https://github.com/tarsius/minions.git -[submodule "no-littering"] - path = lib/no-littering - url = https://github.com/emacscollective/no-littering.git [submodule "org"] path = lib/org url = https://code.orgmode.org/bzg/org-mode.git @@ -116,9 +113,6 @@ [submodule "unkillable-scratch"] path = lib/unkillable-scratch url = https://github.com/EricCrosson/unkillable-scratch.git -[submodule "use-package"] - path = lib/use-package - url = https://github.com/jwiegley/use-package.git [submodule "which-key"] path = lib/which-key url = https://github.com/justbur/emacs-which-key.git diff --git a/etc/eshell/aliases b/etc/eshell/aliases new file mode 100644 index 0000000..203b616 --- /dev/null +++ b/etc/eshell/aliases @@ -0,0 +1,20 @@ +alias .. cd .. +alias ... cd ../.. +alias d dired $* +alias e find-file-other-window $1 +alias ee find-file $1 +alias emacs find-file $1 +alias gd magit-diff-unstaged +alias gds magit-diff-staged +alias git git --no-pager $* +alias l ls -l $* +alias la ls -al $* +alias ll ls -al $* +alias man woman $1 +alias up eshell-up $1 +alias pk eshell-up-peek $1 +alias vi find-file $1 +alias vim find-file $1 +alias mbsync mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc $* +alias getmail getmail --getmaildir $XDG_CONFIG_HOME/getmail --rcfile getmailrc $* +alias m mbsync csclub; mbsync uwaterloo; mbsync shemshak; mbsync gnub; getmail diff --git a/init.el b/init.el index 5ba4c72..17732a7 100644 --- a/init.el +++ b/init.el @@ -123,9 +123,24 @@ This sets each user option VAR's value to the corresponding VALUE. ;;; Initial setup ;; keep ~/.emacs.d clean -(require 'no-littering) -(defalias 'b/etc 'no-littering-expand-etc-file-name) -(defalias 'b/var 'no-littering-expand-var-file-name) +(defvar b/etc-dir + (expand-file-name + (convert-standard-filename "etc/") user-emacs-directory) + "The directory where packages place their configuration files.") +(defvar b/var-dir + (expand-file-name + (convert-standard-filename "var/") user-emacs-directory) + "The directory where packages place their persistent data files.") +(defun b/etc (file) + "Expand filename FILE relative to `b/etc-dir'." + (expand-file-name (convert-standard-filename file) b/etc-dir)) +(defun b/var (file) + "Expand filename FILE relative to `b/var-dir'." + (expand-file-name (convert-standard-filename file) b/var-dir)) + +(csetq + auto-save-list-file-prefix (b/var "auto-save/sessions/") + nsm-settings-file (b/var "nsm-settings.el")) (require 'auto-compile) (auto-compile-on-load-mode) @@ -159,7 +174,7 @@ This sets each user option VAR's value to the corresponding VALUE. (run-with-idle-timer 0.5 nil #'require 'server) (with-eval-after-load 'server (declare-function server-edit "server") - (bind-key "C-c F D" 'server-edit) + (global-set-key (kbd "C-c F D") #'server-edit) (declare-function server-running-p "server") (or (server-running-p) (server-mode))) @@ -256,6 +271,7 @@ This sets each user option VAR's value to the corresponding VALUE. (csetq ;; backups (C-h v make-backup-files RET) backup-by-copying t + backup-directory-alist (list (cons "." (b/var "backup/"))) version-control t delete-old-versions t ;; auto-save @@ -434,7 +450,10 @@ This sets each user option VAR's value to the corresponding VALUE. (require 'bandali-theme) -;; *the* right way to do git +;; magit, *the* right way to do git +(csetq transient-history-file (b/var "transient/history.el") + transient-levels-file (b/etc "transient/levels.el") + transient-values-file (b/etc "transient/values.el")) (with-eval-after-load 'magit (declare-function magit-add-section-hook "magit-section" (hook function &optional at append local)) @@ -477,11 +496,13 @@ This sets each user option VAR's value to the corresponding VALUE. ;; recently opened files (run-with-idle-timer 0.2 nil #'require 'recentf) (with-eval-after-load 'recentf - (csetq recentf-max-saved-items 2000) + (csetq recentf-max-saved-items 2000 + recentf-save-file (b/var "recentf-save.el")) (add-to-list 'recentf-keep #'file-remote-p) (recentf-mode)) ;; needed for history for counsel +(csetq amx-save-file (b/var "amx-save.el")) (run-with-idle-timer 0.3 nil #'require 'amx) (with-eval-after-load 'amx (amx-mode)) @@ -535,6 +556,8 @@ This sets each user option VAR's value to the corresponding VALUE. (define-key help-mode-map (kbd "n") #'forward-button)) (with-eval-after-load 'tramp + (csetq tramp-auto-save-directory (b/var "tramp/auto-save/") + tramp-persistency-file-name (b/var "tramp/persistency.el")) (add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:")) (add-to-list 'tramp-default-proxies-alist '("localhost" nil nil)) (add-to-list 'tramp-default-proxies-alist @@ -561,6 +584,8 @@ This sets each user option VAR's value to the corresponding VALUE. (with-eval-after-load 'scpaste (csetq scpaste-http-destination "https://p.bndl.org" scpaste-scp-destination "p:~")) +(global-set-key (kbd "C-c a p p") #'scpaste) +(global-set-key (kbd "C-c a p r") #'scpaste-region) ;;; Editing @@ -588,11 +613,13 @@ This sets each user option VAR's value to the corresponding VALUE. ;; save minibuffer history (require 'savehist) +(csetq savehist-file (b/var "savehist.el")) (savehist-mode) (add-to-list 'savehist-additional-variables 'kill-ring) ;; automatically save place in files (when (version< "25" emacs-version) + (csetq save-place-file (b/var "save-place.el")) (save-place-mode)) (defun indicate-buffer-boundaries-left () @@ -648,6 +675,8 @@ This sets each user option VAR's value to the corresponding VALUE. ;; (advice-add #'ispell-parse-output :filter-args ;; #'endless/replace-quote)) +;; abbrev +(csetq abbrev-file-name (b/var "abbrev.el")) (add-hook 'text-mode-hook #'abbrev-mode) @@ -814,6 +843,7 @@ This sets each user option VAR's value to the corresponding VALUE. (defconst yas-verbosity-cur yas-verbosity) (setq yas-verbosity 2) + (csetq yas-snippet-dirs `(,(b/etc "yasnippet/snippets"))) (add-to-list 'yas-snippet-dirs "~/src/git/guix/etc/snippets" t) (yas-reload-all) (setq yas-verbosity yas-verbosity-cur) @@ -857,6 +887,11 @@ This sets each user option VAR's value to the corresponding VALUE. (debbugs-gnu debbugs-gnu-default-severities '("guix-patches")))) +;; url and url-cache +(csetq + url-configuration-directory (b/var "url/configuration/") + url-cache-directory (b/var "url/cache/")) + ;; eww (csetq eww-download-directory (file-name-as-directory (getenv "XDG_DOWNLOAD_DIR"))) diff --git a/lib/no-littering b/lib/no-littering deleted file mode 160000 index aaa3c36..0000000 --- a/lib/no-littering +++ /dev/null @@ -1 +0,0 @@ -Subproject commit aaa3c36b25e07017595b54e91e190f69f0de0487 diff --git a/lib/use-package b/lib/use-package deleted file mode 160000 index 4fb1f9a..0000000 --- a/lib/use-package +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4fb1f9a68f1e7e7d614652afc017a6652fd029f1 diff --git a/lisp/bandali-dired.el b/lisp/bandali-dired.el index 394715d..4755a64 100644 --- a/lisp/bandali-dired.el +++ b/lisp/bandali-dired.el @@ -25,10 +25,12 @@ ;;; Code: (with-eval-after-load 'dired - (csetq dired-dwim-target t - dired-listing-switches "-alh" - ls-lisp-dirs-first t - ls-lisp-use-insert-directory-program nil) + (csetq + dired-dwim-target t + dired-listing-switches "-alh" + dired-recent-directories-file (b/var "dired-recent-directories.el") + ls-lisp-dirs-first t + ls-lisp-use-insert-directory-program nil) (declare-function dired-dwim-target-directory "dired-aux") ;; easily diff 2 marked files diff --git a/lisp/bandali-erc.el b/lisp/bandali-erc.el index 0166140..754f7ee 100644 --- a/lisp/bandali-erc.el +++ b/lisp/bandali-erc.el @@ -25,11 +25,14 @@ ;;; Code: (with-eval-after-load 'erc + (make-directory (b/var "erc/dcc/") t) (csetq erc-auto-query 'bury erc-autojoin-domain-only nil + erc-dcc-get-default-directory (b/var "erc/dcc/") erc-format-nick-function 'erc-format-@nick erc-join-buffer 'bury + erc-log-channels-directory (b/var "erc/log-channels/") erc-lurker-hide-list '("JOIN" "PART" "QUIT") erc-nick "bandali" erc-prompt "erc>" diff --git a/lisp/bandali-eshell.el b/lisp/bandali-eshell.el index 5a83c6d..820dc05 100644 --- a/lisp/bandali-eshell.el +++ b/lisp/bandali-eshell.el @@ -25,7 +25,10 @@ ;;; Code: (with-eval-after-load 'eshell + (make-directory (b/etc "eshell/") t) (csetq + eshell-aliases-file (b/etc "eshell/aliases") + eshell-directory-name (b/var "eshell/") eshell-hist-ignoredups t eshell-input-filter #'eshell-input-filter-initial-space eshell-prompt-regexp "\\(.*\n\\)*[$#] " diff --git a/lisp/bandali-org.el b/lisp/bandali-org.el index ed2a3bd..38a4a5a 100644 --- a/lisp/bandali-org.el +++ b/lisp/bandali-org.el @@ -28,6 +28,7 @@ (csetq org-src-tab-acts-natively t org-src-preserve-indentation nil org-edit-src-content-indentation 0 + org-id-locations-file (b/var "org/id-locations.el") org-link-email-description-format "Email %c: %s" ; %.30s org-highlight-latex-and-related '(entities) org-use-speed-commands t diff --git a/lisp/bandali-projectile.el b/lisp/bandali-projectile.el index 41504e6..dbef93e 100644 --- a/lisp/bandali-projectile.el +++ b/lisp/bandali-projectile.el @@ -29,6 +29,7 @@ :defer 0.5 :bind-keymap ("C-c p" . projectile-command-map) :config + (make-directory (b/var "projectile/") t) (projectile-mode) (defun b/projectile-mode-line-fun () @@ -60,7 +61,9 @@ "C-c p x" "projectile/execute" "C-c p 4" "projectile/other-window")) :custom + (projectile-cache-file (b/var "projectile/cache.el")) (projectile-completion-system 'ivy) + (projectile-known-projects-file (b/var "projectile/known-projects.el")) (projectile-mode-line-prefix " proj")) (provide 'bandali-projectile) diff --git a/var/eshell/alias b/var/eshell/alias deleted file mode 100644 index 203b616..0000000 --- a/var/eshell/alias +++ /dev/null @@ -1,20 +0,0 @@ -alias .. cd .. -alias ... cd ../.. -alias d dired $* -alias e find-file-other-window $1 -alias ee find-file $1 -alias emacs find-file $1 -alias gd magit-diff-unstaged -alias gds magit-diff-staged -alias git git --no-pager $* -alias l ls -l $* -alias la ls -al $* -alias ll ls -al $* -alias man woman $1 -alias up eshell-up $1 -alias pk eshell-up-peek $1 -alias vi find-file $1 -alias vim find-file $1 -alias mbsync mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc $* -alias getmail getmail --getmaildir $XDG_CONFIG_HOME/getmail --rcfile getmailrc $* -alias m mbsync csclub; mbsync uwaterloo; mbsync shemshak; mbsync gnub; getmail