• .emacs.desktop files are saving too much state

    From emacsusr@opngid@gmail.com to gnu.emacs.help on Tue Aug 15 13:27:58 2023
    From Newsgroup: gnu.emacs.help

    I just finished tracking down a bug that had resulted from my .emacs.desktop file oddly snapshotting all of my environment variables and then restoring them from that frozen state each time I reloaded that desktop file.
    Environment variables are not saved by default when I run desktop-save from a freshly invoked emacs -q instance.
    Not sure what condition in my init.el is triggering emacs to save that type of info in my .emacs.desktop, but since environment variables can easily change external to emacs, restoring stale versions of these variables can introduce subtle bugs that are difficult to track down.
    It's also not clear from the documentation how to modify this feature: https://emacsdocs.org/docs/emacs/Saving-Emacs-Sessions
    The variable desktop-globals-to-clear looked promising, but unfortunately I don't think it will help here.
    So how can users exercise better control over what type of state information gets saved in their .emacs.desktop files?
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Ralf Fassel@ralfixx@gmx.de to gnu.emacs.help on Wed Aug 16 10:29:23 2023
    From Newsgroup: gnu.emacs.help

    * emacsusr <opngid@gmail.com>
    | I just finished tracking down a bug that had resulted from my
    | .emacs.desktop file oddly snapshotting all of my environment variables
    | and then restoring them from that frozen state each time I reloaded
    | that desktop file.

    | Environment variables are not saved by default when I run desktop-save
    | from a freshly invoked emacs -q instance.

    There is also no mention of 'env' in desktop.el (emacs 27.2 here).
    Maybe some hook which jumps in here?

    I'd check where the section with that information in .emacs.desktop gets written in the code of 'desktop-save'. Then maybe you get a clue which
    part of desktop.el is the culprit.

    Good luck!
    R'
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From emacsusr@opngid@gmail.com to gnu.emacs.help on Sat Aug 26 12:57:51 2023
    From Newsgroup: gnu.emacs.help

    I'd check where the section with that information in .emacs.desktop gets written in the code of 'desktop-save'. Then maybe you get a clue which
    part of desktop.el is the culprit.

    Good luck!
    R'

    Thanks. I just checked

    http://doc.endlessparentheses.com/Var/desktop-globals-to-save.html

    to no avail.
    --- Synchronet 3.21d-Linux NewsLink 1.2