emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Price <moptop99@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] don't always restore previous window configuration?
Date: Sat, 24 Nov 2018 10:24:23 -0500	[thread overview]
Message-ID: <CAN_Dec_XGaLxbyGT8VFzBFVzrS2RdLUJZonBW3gZcWjsmc27Cg@mail.gmail.com> (raw)
In-Reply-To: <87tvk62199.fsf@nicolasgoaziou.fr>

[-- Attachment #1: Type: text/plain, Size: 3137 bytes --]

On Sat, Nov 24, 2018 at 5:55 AM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Matt Price <moptop99@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.
>
Then I'm sorry for the noise (and also for this aside!).  Magit, or git, or
some other tool was doing something quite strange and disturbing, and I am
now seeing these remotes in my repo:
dup       /tmp/tmp-orgtest/org-annex-testoRSq4r/ (fetch)
dup     /tmp/tmp-orgtest/org-annex-testoRSq4r/ (push)
origin  https://code.orgmode.org/bzg/org-mode.git (fetch)
origin  https://code.orgmode.org/bzg/org-mode.git (push)
original        /tmp/tmp-orgtest/org-annex-testrgbPft/ (fetch)
original        /tmp/tmp-orgtest/org-annex-testrgbPft/ (push)



> > * 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?
>
I'm not sure. Until now only Eric and I had commented on this feature.  I
will say that I will probably never go back to the old behavior, but maybe
there are people who prefer it. I believe there are 6 possible options for
org-src-window-setup (though only 5 are listed in the defcustom definition,
I think that org-src-switch-to-buffer also recognizes 'silently). It may be
that some of those options only make sense if the window config is restored
after closing the src buffer.

~org-src--saved-window-config~ is only used in this function, so instead of
adding a new variable we could just get rid of an old one :-).

> * 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
>
thank you for the improvements. I'll wait to see what is decided about the
other issue above.

[-- Attachment #2: Type: text/html, Size: 4466 bytes --]

  reply	other threads:[~2018-11-24 15:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22 19:09 don't always restore previous window configuration? Matt Price
2018-11-23  6:31 ` Eric S Fraga
2018-11-23 15:20   ` [PATCH] " Matt Price
2018-11-24 10:55     ` Nicolas Goaziou
2018-11-24 15:24       ` Matt Price [this message]
2018-11-25  9:02         ` Nicolas Goaziou
2018-11-25 20:56           ` Matt Price
2018-11-25 22:30             ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAN_Dec_XGaLxbyGT8VFzBFVzrS2RdLUJZonBW3gZcWjsmc27Cg@mail.gmail.com \
    --to=moptop99@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).