Re: How to disable completely org-persist

2023-01-01 Thread Jean Louis
* to...@tuxteam.de  [2022-12-31 10:12]:
> Perhaps it would make sense to state the goals in more
> detail. I can see many "aspects":
> 
>  - "I don't want my ~/.emacs.d/ littered beyond my explicit
>control"

Isn't that happening anyway by various packages and functions? I see
there "auto-install", "auto-save-list" directories, I did not create
them myself. I see "desktop", though I used "desktop" package nobody
warned me it will be there. There is "erc-log" which I did not know it
will be there, there is "eshell", "games", "icons", "image-dired",
"multisession", "newsticker", "todo" and so on, too many.

I never had explicit control over creation of those files.

Using a package alone is not what I consider under "explicit", as I
was not asked directly about any of those directories.

>  - "I don't have (nor want to have) XDG directories"

Me too, I do not want to have, and I do not have, but some XDG
environment variables are there.

>  - "I don't want things in /tmp" [1]

Me too, but I keep it in my private $TMPDIR, as it is unsafe to keep
it in /tmp

I do keep /tmp encrypted for that reason as it is not safe. And my
/home is also encrypted on different partition. 

In general it is unsafe to choose /tmp for private information as then
maybe /tmp is not encrypted.

>  - "I don't want my Emacs's session state to spill to
>persistent media"

Me too, unless I use "desktop" and that is saved on encrypted
partition.

But I would not like using Org files on remote servers and that
information is anywhere else stored unencrypted about which file I
opened and what I wrote.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Re: How to disable completely org-persist

2022-12-31 Thread Angelo Graziosi


> Il 30/12/2022 18:42 Colin Baxter ha scritto:
> 
>  
> > Angelo Graziosi writes:
> 
> > tomas wrote:
> >> there is now a defvar `org-element-cache-persistent'
> 
> > Ah! didn't knew that..
> 
> > Setting
> 
> > (setq org-element-cache-persistent nil)
> 
> > seems to work..
> 
> Indeed, although I'm not yet convinced that org-persist directories wont
> eventually start showing up in /tmp!

...or in ~/.cache..



Re: How to disable completely org-persist

2022-12-30 Thread tomas
On Sat, Dec 31, 2022 at 02:29:43AM +0100, Angelo Graziosi wrote:
> 
> > Il 30/12/2022 18:42 Colin Baxter ha scritto:
> > 
> >  
> > > Angelo Graziosi writes:
> > 
> > > tomas wrote:
> > >> there is now a defvar `org-element-cache-persistent'
> > 
> > > Ah! didn't knew that..
> > 
> > > Setting
> > 
> > > (setq org-element-cache-persistent nil)
> > 
> > > seems to work..
> > 
> > Indeed, although I'm not yet convinced that org-persist directories wont
> > eventually start showing up in /tmp!
> 
> I fear that sooner or later it will reappear somewhere.. 

Hm. I'm sure people are accepting patches?

Having persistence "centralised" in an org-persist facility
should make it easier for you (or me) to control what happens.

Otherwise, each exporter might be creating files everywhere.

Perhaps it would make sense to state the goals in more
detail. I can see many "aspects":

 - "I don't want my ~/.emacs.d/ littered beyond my explicit
   control"
 - "I don't have (nor want to have) XDG directories"
 - "I don't want things in /tmp" [1]
 - "I don't want my Emacs's session state to spill to
   persistent media"

What is it what you (or me, or anyone) wants to achieve?

Cheers

[1] Currently I see two directories in /tmp made by my emacs
   session: some `babel-...', which seems to be made at Org mode
   load (before any babel things are invoked), and `emacs1000'
   (I start Emacs as a server, so that's where the socket goes)
   
-- 
t


signature.asc
Description: PGP signature


Re: How to disable completely org-persist

2022-12-30 Thread Ihor Radchenko
Angelo Graziosi  writes:

>> Indeed, although I'm not yet convinced that org-persist directories wont
>> eventually start showing up in /tmp!
>
> I fear that sooner or later it will reappear somewhere.. 
>
> When it showed up few week ago, I found that setting and added it to the init 
> file but that time it didn't solved the issue. That folder showed up even 
> with that setting.. Instead now it seems to fix the issue hmm.. I wouldn't 
> want it to be a Pyrrhic victory!

I may indeed reappear somewhere.
As I stated in my last message and the commits, we now have the
following:

1. For emacs -Q, the folder, if created, is removed upon closing Emacs
   It may still stay if you do something like kill -9 (I can't do much
   about this scenario).
   Note that this situation is rather unlikely scenario. You need to do
   something manually with emacs -Q.
2. For normal emacs usage, the folder is created only when it is needed
   If you set org-element-cache-persistent to nil, Org may still use
   org-persist for other purposes, like LaTeX previews or caching remote
   images during export.
3. As I suggested in my other message, if you don't like (2), set
   `org-persist-directory' to the location that does not bother you.

   Alternatively, you can use
   https://github.com/emacscollective/no-littering that will organize
   .emacs.d closer to XDG schema.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: How to disable completely org-persist

2022-12-30 Thread Angelo Graziosi


> Il 30/12/2022 18:42 Colin Baxter ha scritto:
> 
>  
> > Angelo Graziosi writes:
> 
> > tomas wrote:
> >> there is now a defvar `org-element-cache-persistent'
> 
> > Ah! didn't knew that..
> 
> > Setting
> 
> > (setq org-element-cache-persistent nil)
> 
> > seems to work..
> 
> Indeed, although I'm not yet convinced that org-persist directories wont
> eventually start showing up in /tmp!

I fear that sooner or later it will reappear somewhere.. 

When it showed up few week ago, I found that setting and added it to the init 
file but that time it didn't solved the issue. That folder showed up even with 
that setting.. Instead now it seems to fix the issue hmm.. I wouldn't want it 
to be a Pyrrhic victory!



Re: How to disable completely org-persist

2022-12-30 Thread Colin Baxter
> Angelo Graziosi  writes:

> tomas wrote:
>> there is now a defvar `org-element-cache-persistent'

> Ah! didn't knew that..

> Setting

> (setq org-element-cache-persistent nil)

> seems to work..

Indeed, although I'm not yet convinced that org-persist directories wont
eventually start showing up in /tmp!

Best wishes,



Re: How to disable completely org-persist

2022-12-30 Thread Ihor Radchenko
to...@tuxteam.de writes:

>> The variable has been there since the beginning.
>
> But you made me aware of it, and thanks for it :)

https://orgmode.org/Changes.html ;)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: How to disable completely org-persist

2022-12-30 Thread tomas
On Fri, Dec 30, 2022 at 01:35:39PM +, Ihor Radchenko wrote:
>  writes:
> 
> > AFAIK there is now a defvar `org-element-cache-persistent'. Maybe it
> > works for you?
> 
> The variable has been there since the beginning.

But you made me aware of it, and thanks for it :)

> Now, org-persist is just more careful not to create the directory when
> nothing needs to be stored there.

Understood.

Cheers & may the new year...
-- 
t


signature.asc
Description: PGP signature


Re: How to disable completely org-persist

2022-12-30 Thread Ihor Radchenko
 writes:

> AFAIK there is now a defvar `org-element-cache-persistent'. Maybe it
> works for you?

The variable has been there since the beginning.
Now, org-persist is just more careful not to create the directory when
nothing needs to be stored there.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: How to disable completely org-persist

2022-12-30 Thread Angelo Graziosi
tomas wrote:

> there is now a defvar `org-element-cache-persistent'

Ah! didn't knew that..

Setting 

(setq org-element-cache-persistent nil)

seems to work..

Thanks,
 Angelo.



Re: How to disable completely org-persist

2022-12-30 Thread tomas
On Fri, Dec 30, 2022 at 01:11:12PM +0100, Angelo Graziosi wrote:
> > Il 05/12/2022 18:58 Colin Baxter ha scritto:
> > 
> >  
> > > Angelo Graziosi writes:
> > 
> > > Colin Baxter wrote:
> > >> I too would like a means to disable org-persist.
> > 
> > > On emacs-devel there was this suggestion:
> > 
> > > https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg00125.html
> > 
> > It appears to work, after removing a couple of surplus brackets from the
> > end of the last line.
> 
> After the last Emacs master build, the what suggested there, i.e.
> 
> ;; As suggested here:
> ;; https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg00125.html
> (setq org-persist-disable-when-emacs-Q t)
> 
> (defun tv/advice--org-persist (old-fn  args)
>   (let (user-init-file)
> (apply old-fn args)))
> 
> (advice-add 'org-persist-write :around #'tv/advice--org-persist)
> (advice-add 'org-persist-read :around #'tv/advice--org-persist)
> (advice-add 'org-persist-gc :around #'tv/advice--org-persist)
> 
> does not work any more: that directory is recreated even with that cod in the 
> init.el
> 
> Someone knows how to avoid that?

AFAIK there is now a defvar `org-element-cache-persistent'. Maybe it
works for you?

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: How to disable completely org-persist

2022-12-30 Thread Angelo Graziosi
> Il 05/12/2022 18:58 Colin Baxter ha scritto:
> 
>  
> > Angelo Graziosi writes:
> 
> > Colin Baxter wrote:
> >> I too would like a means to disable org-persist.
> 
> > On emacs-devel there was this suggestion:
> 
> > https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg00125.html
> 
> It appears to work, after removing a couple of surplus brackets from the
> end of the last line.

After the last Emacs master build, the what suggested there, i.e.

;; As suggested here:
;; https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg00125.html
(setq org-persist-disable-when-emacs-Q t)

(defun tv/advice--org-persist (old-fn  args)
  (let (user-init-file)
(apply old-fn args)))

(advice-add 'org-persist-write :around #'tv/advice--org-persist)
(advice-add 'org-persist-read :around #'tv/advice--org-persist)
(advice-add 'org-persist-gc :around #'tv/advice--org-persist)

does not work any more: that directory is recreated even with that cod in the 
init.el

Someone knows how to avoid that?

TIA,
 Angelo.



Re: How to disable completely org-persist

2022-12-17 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Ihor Radchenko  writes:
>
>> Upon further investigation, it looks like we need Org persist all the
>> time. As temporary storage, at least. In particular, downloading remote
>> images requires org-persist to store files somewhere. All the times.
>> ...
>> So, we cannot disable org-persist and should not even do it with Emacs
>> -Q. Instead, we may redirect org-persist-directory to /tmp in some
>> scenarios. I will look into doing this soon.
>
> I am going to do the following in order to reduce the issue with
> littering `user-emacs-directory':
> ...

Done on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=aa86ed534
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=2944a2152

Fixed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: How to disable completely org-persist

2022-12-15 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Upon further investigation, it looks like we need Org persist all the
> time. As temporary storage, at least. In particular, downloading remote
> images requires org-persist to store files somewhere. All the times.
> ...
> So, we cannot disable org-persist and should not even do it with Emacs
> -Q. Instead, we may redirect org-persist-directory to /tmp in some
> scenarios. I will look into doing this soon.

I am going to do the following in order to reduce the issue with
littering `user-emacs-directory':

1. When there is no data stored by org-persist (e.g. when the user
   disabled `org-element-cache-persistent' and never uses image
   downloading), do not write anything and do not create the empty
   index.

2. `org-persist-disable-when-emacs-Q' will redirect
   `org-persist-directory' to a temporary directory.
   (this is a bugfix)
   
3. Users who think that org-persist is still on the way may set
   `org-persist-directory' explicitly to, say,
   `temporary-file-directory'.

Let me know if there are any objections.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: How to disable completely org-persist

2022-12-13 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Colin Baxter  writes:
>
>> I too would like a means to disable org-persist. I don't doubt it may be
>> useful for those users with "large" org files with multiply src-blocks,
>> etc., etc., but, for me, I have not found any improvement in
>> performance. As remarked by the OP, the feature should not be
>> default-enabled.
>
> Note that org-persist is not only used to cache parser data for large
> files. For example, exported online images are also cached instead of
> being downloaded on every export. Other things may also be cached in
> future.

Upon further investigation, it looks like we need Org persist all the
time. As temporary storage, at least. In particular, downloading remote
images requires org-persist to store files somewhere. All the times.

> That being said, it should not be a big deal to allow disabling
> org-persist when desired. In fact, org-persist is already auto-disabled
> when using emacs -Q. I can add a user switch on top.

So, we cannot disable org-persist and should not even do it with Emacs
-Q. Instead, we may redirect org-persist-directory to /tmp in some
scenarios. I will look into doing this soon.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: How to disable completely org-persist

2022-12-05 Thread Colin Baxter
> Angelo Graziosi  writes:

> Colin Baxter wrote:
>> I too would like a means to disable org-persist.

> On emacs-devel there was this suggestion:

> https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg00125.html

It appears to work, after removing a couple of surplus brackets from the
end of the last line.

Best wishes,



Re: How to disable completely org-persist

2022-12-05 Thread Angelo Graziosi
Colin Baxter wrote:
>  I too would like a means to disable org-persist. 

On emacs-devel there was this suggestion:

https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg00125.html



Re: How to disable completely org-persist

2022-12-04 Thread Colin Baxter
> Ihor Radchenko  writes:

> Colin Baxter  writes:
>> I too would like a means to disable org-persist. I don't doubt it
>> may be useful for those users with "large" org files with
>> multiply src-blocks, etc., etc., but, for me, I have not found
>> any improvement in performance. As remarked by the OP, the
>> feature should not be default-enabled.

> Note that org-persist is not only used to cache parser data for
> large files. For example, exported online images are also cached
> instead of being downloaded on every export. Other things may also
> be cached in future.

> Normally, org-persist stores the data in $XDG_CACHE_HOME. It only
> falls back to .emacs.d when cache directory does not exist. One
> can also customize the value manually.

> That being said, it should not be a big deal to allow disabling
> org-persist when desired. In fact, org-persist is already
> auto-disabled when using emacs -Q. I can add a user switch on top.

When you have time, of course, a disabling switch would be most useful -
in my opinion.

Best wishes,



Re: How to disable completely org-persist

2022-12-04 Thread Ihor Radchenko
Angelo Graziosi  writes:

> Ihor Radchenko on emacs-orgmode wrote:
>
>> That being said, it should not be a big deal to allow disabling
>> org-persist when desired. In fact, org-persist is already 
>> auto-disabled when using emacs -Q. I can add a user switch 
>> on top.
>
> I wonder what kind of answer is this.. Also not using ORG mode at all fixes 
> the issue..

The answer is: will do later when I have free time. It is not a critical
bug blocking usage for all users.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: How to disable completely org-persist

2022-12-04 Thread Angelo Graziosi



> Ihor Radchenko on emacs-orgmode wrote:
> I can add a user switch 
> > on top.
> 

Please, add an option to disable the caching

(org-cache 0)

which disables *all* other thing (org-persist and friends)..

...or disable *all* by default and the user that like that will set

(org-cache 1)

..



Re: How to disable completely org-persist

2022-12-04 Thread Angelo Graziosi


Ihor Radchenko on emacs-orgmode wrote:

> That being said, it should not be a big deal to allow disabling
> org-persist when desired. In fact, org-persist is already 
> auto-disabled when using emacs -Q. I can add a user switch 
> on top.

I wonder what kind of answer is this.. Also not using ORG mode at all fixes the 
issue..



Re: How to disable completely org-persist

2022-12-04 Thread Ihor Radchenko
Colin Baxter  writes:

> I too would like a means to disable org-persist. I don't doubt it may be
> useful for those users with "large" org files with multiply src-blocks,
> etc., etc., but, for me, I have not found any improvement in
> performance. As remarked by the OP, the feature should not be
> default-enabled.

Note that org-persist is not only used to cache parser data for large
files. For example, exported online images are also cached instead of
being downloaded on every export. Other things may also be cached in
future.

Normally, org-persist stores the data in $XDG_CACHE_HOME. It only falls
back to .emacs.d when cache directory does not exist. One can also
customize the value manually.

That being said, it should not be a big deal to allow disabling
org-persist when desired. In fact, org-persist is already auto-disabled
when using emacs -Q. I can add a user switch on top.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: How to disable completely org-persist

2022-12-04 Thread Colin Baxter


>writes:

> On Sat, Dec 03, 2022 at 01:19:47AM +0100, Angelo Graziosi wrote:
>> I have already posted this to emacs-devel people (see
>> https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg00045.html).
>> 
>> After a recent Emacs build from master I find `org-persist`
>> directory in my `.emacs.d` folder. It brings no benefit but only
>> garbage in `.emacs.d`. So how can I disable the creation of that
>> folder?

> Now, now... "garbage" seems unnecessarily loaded, But...

>> You should not enable this by default and let people that finds
>> it really useful to enable it in its own init.el.

> ...I won't quibble about the default, but I'd like to have a way
> to disable it, too.

I too would like a means to disable org-persist. I don't doubt it may be
useful for those users with "large" org files with multiply src-blocks,
etc., etc., but, for me, I have not found any improvement in
performance. As remarked by the OP, the feature should not be
default-enabled.

Best wishes,

Colin Baxter.



Re: How to disable completely org-persist

2022-12-02 Thread tomas
On Sat, Dec 03, 2022 at 01:19:47AM +0100, Angelo Graziosi wrote:
> I have already posted this to emacs-devel people (see 
> https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg00045.html).
> 
> After a recent Emacs build from master I find `org-persist` directory in my 
> `.emacs.d` folder. It brings no benefit but only garbage in `.emacs.d`. So 
> how can I disable the creation of that folder?

Now, now... "garbage" seems unnecessarily loaded, But...

> You should not enable this by default and let people that finds it really 
> useful to enable it in its own init.el.

...I won't quibble about the default, but I'd like to have a way
to disable it, too.

Cheers
-- 
t


signature.asc
Description: PGP signature


How to disable completely org-persist

2022-12-02 Thread Angelo Graziosi
I have already posted this to emacs-devel people (see 
https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg00045.html).

After a recent Emacs build from master I find `org-persist` directory in my 
`.emacs.d` folder. It brings no benefit but only garbage in `.emacs.d`. So how 
can I disable the creation of that folder?

Emacs-devel people suggests to disable `org-element-cache-persistent` but

(setq org-element-cache-persistent nil)

does not fix the issue because the directory is recreated each time I quit from 
Emacs.. All this is very annoying.

You should not enable this by default and let people that finds it really 
useful to enable it in its own init.el.

Best wishes,