emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please document the caching and its user options


From: Eli Zaretskii
Subject: Re: Please document the caching and its user options
Date: Sat, 15 Jun 2024 16:01:23 +0300

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: emacs-orgmode@gnu.org
> Date: Sat, 15 Jun 2024 12:47:29 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> I am not convinced that we have to do it.
> >
> > That's too bad.  When a user finds out about this caching, how do you
> > propose that he/she looks for the information about it?  I wanted to
> > know what is being cached, why, and in what file/directory.  It took
> > me quite some time to find the answers, since Org is a very large
> > package, and there's no org-cache.el file or similar to serve as the
> > immediate suspect.  Surely, such a basic functionality should be at
> > least hinted in the documentation, so that users new which options to
> > look at and where?
> 
> Maybe. Although it is not clear where to document such things.
> Ideally, it would be nice if caches were managed by Emacs itself, with
> all the cache storage locations customizeable across various packages.
> Then, documenting cache locations in the Emacs manual would suffice.
> 
> Would it be possible for Emacs to define a framework for cache/var/data
> locations? Such framework would not only be useful in the context of
> this discussion, but also to tackle the issue with packages sprinkling
> things randomly into .emacs.d or ~/ (see
> https://github.com/emacscollective/no-littering/)

I think Emacs already provides all the framework for caching that is
needed.  Caching simply means you write some data to file, and all the
building blocks of that already exist, for quite some time, actually.
The only thing that is application dependent is the data to be cached
and how to serialize that, but that cannot be usefully generalized.

> >> Emacs user manual does not document `multisession-directory' - something
> >> very close to how we implement Org caches.  So, apparently, customizing
> >> `multisession-directory' and even the very multisession feature
> >> existence is not deemed necessary inside Emacs manual. Why would it be
> >> different for Org mode manual?
> >
> > multisession is an optional package, it is neither preloaded nor
> > turned on by default in Emacs.
> 
> It is used by default in emoji.el (C-x 8 e r)

Which is also optional.  And a minor feature at that.

> Of course, if you say that multisession and similar things should be
> documented, I will follow. Let's discuss the details.

I think at least emoji.el should say somewhere in its doc strings that
it caches the previously used emoji sequences, yes.

> (Also, should we open some kind of bug report to track documenting
> multisession in the manual?)

I don't mind, but it sounds like an exaggeration to me.

> > The emacs-internal encoding is not binary.  In almost all the cases it
> > is indistinguishable from utf-8-unix.  It differs where a buffer
> > includes characters outside of the Unicode codespace.  The usual
> > practice in Emacs is that files holding internal data use
> > emacs-internal to make sure all the characters are saved correctly and
> > can be later restored correctly.
> 
> Then, I agree that using emacs-internal for cached data makes sense.
> 
> Note, however, that I see no indication about such convention in the
> manual.

The opportunities for using it are rare enough.  But I added that now,
in the hope that someone will actually read all those recommendations.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]