unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* A cache directory?
@ 2020-08-16 19:30 Yuan Fu
  2020-08-16 19:45 ` Yuri Khan
  2020-08-16 20:10 ` Cleaning up and structuring user-emacs-directory (was: A cache directory?) Amin Bandali
  0 siblings, 2 replies; 34+ messages in thread
From: Yuan Fu @ 2020-08-16 19:30 UTC (permalink / raw)
  To: emacs-devel

Maybe this has been discussed but I can’t find any threads in the archive. .emacs.d is pretty crowded: every package puts their temporary files under it. I wonder if there could be a standard cache directory? I know there are packages that's solely for this purpose: resetting every single xxx-file to be under a cache directory. However, it would be better if there is just a standard one and everybody uses it.

Even if we don’t appoint a standard cache directory, we could provide a built-in function that searches for possible cache directories, and ask every one to use that function. Specifically, something like:

(defun cache-directory ()
  "Return a possible cache directory.
Return nil if none found."
  (catch 'found
    (dolist (candidate '(".cache" "cache"
                         ".tmp" "tmp"
                         ".temp" "temp"))
      (let ((path (expand-file-name candidate user-emacs-directory)))
        (when (and (file-exists-p path)
                   (file-writable-p path)
                   (file-directory-p path))
          (throw 'found path))))))

Yuan


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2020-08-24  3:22 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-16 19:30 A cache directory? Yuan Fu
2020-08-16 19:45 ` Yuri Khan
2020-08-16 20:43   ` Yuan Fu
2020-08-16 20:10 ` Cleaning up and structuring user-emacs-directory (was: A cache directory?) Amin Bandali
2020-08-18  4:06   ` Richard Stallman
2020-08-18  7:51   ` Cleaning up and structuring user-emacs-directory Gunnar Horrigmo
2020-08-18 22:41     ` Paul Eggert
2020-08-18  7:57   ` Gunnar Horrigmo
2020-08-19  4:01     ` Richard Stallman
2020-08-19  5:03       ` Amin Bandali
2020-08-19  8:28         ` tomas
2020-08-19 13:59           ` Amin Bandali
2020-08-19 14:18             ` tomas
2020-08-19 14:47               ` noah swainland
2020-08-19 14:42           ` David De La Harpe Golden
2020-08-19 16:14             ` tomas
2020-08-19 16:47               ` Yuan Fu
2020-08-19 17:33                 ` Stefan Monnier
2020-08-19 18:39                   ` Eli Zaretskii
2020-08-20  3:55                     ` Stefan Monnier
2020-08-20  7:08                       ` Andreas Schwab
2020-08-20 11:51                         ` Stefan Monnier
2020-08-19 13:33         ` Stefan Monnier
2020-08-19 14:15           ` tomas
2020-08-20  3:09         ` Richard Stallman
2020-08-20 14:56           ` Yuan Fu
2020-08-20 15:24             ` Stefan Monnier
2020-08-20 17:14               ` T.V Raman
2020-08-21  3:33               ` Richard Stallman
2020-08-23 15:15                 ` Stefan Monnier
2020-08-23 16:11                   ` Stefan Kangas
2020-08-23 19:02                   ` John Yates
2020-08-24  3:22                   ` Richard Stallman
2020-08-21  9:49         ` Gunnar Horrigmo

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).