Hello, Matt Price <mopto...@gmail.com> writes:
> OH man, that was a little harder than I thought it would be. Does `make > test` randomly checkout a new branch or something? No, it doesn't. > This patch adds a new long-winded variable `org-src-restore-window-config`, > t by default, which if set to `nil` will inhibit restoration of previous > window config in `org-edit-src-exit`. > I'm afraid I don't really understand the tests and I learn so slowly that I > don't have time to keep trying today. But hopefully this simple patch is > adequate. I also wrote a changelog entry in my git commit msg, which is > here: > > Make restoration of window config optional on exit from src buffer > > * org-srce.el (org-src-restore-window-config, org-exit-from-src): New > variable org-src-restore-window-config allows user to opt out of > restoring window config when exiting from source buffer with > org-exit-from-src. Thank you. Should it be a variable, though? Is there any strong reason, e.g., a valid use-case, to preserve window configuration? > * org-srce.el (org-src-restore-window-config, org-exit-from-src): New ^^^ typo > +(defcustom org-src-restore-saved-window-config t > + "Whether to restore windows to previous configuration. Non-nil means preserve window configuration after editing a source block. > +When non-nil (default), on exit from a source buffer, org will org -> Org > +try to restore the window configuration that was active when > +the source buffer was created." > + :group 'org-edit-structure > + :type 'boolean) You need to specify :version and :safe keyword. > + > (defvar org-src-mode-hook nil > "Hook run after Org switched a source code snippet to its Emacs mode. > \\<org-mode-map> > @@ -1173,8 +1181,8 @@ Throw an error if there is no such buffer." > ;; Clean up left-over markers and restore window configuration. > (set-marker beg nil) > (set-marker end nil) > - (when org-src--saved-temp-window-config > - (set-window-configuration org-src--saved-temp-window-config) > + (when (and org-src--saved-temp-window-config > org-src-restore-saved-window-config) ^^^ spurious space Regards, -- Nicolas Goaziou