emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Richard Kim <Richard.Kim1@synopsys.com>
To: emacs-orgmode@gnu.org
Subject: restore window configuration after org-edit-src-exit
Date: Sat, 14 Dec 2019 11:06:44 -0800	[thread overview]
Message-ID: <qtmfthmafqz.fsf@synopsys.com> (raw)

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

About a year ago change 819e98afd018cad3c13fd58bfcbd979ab36dfbc7 was checked in
to remove code that restored window configuration when =org-edit-src-exit=
finished. The net result is af if =C-x 1= is called to remove all windows except
the org buffer just edited. This is very inconvenient.

Why not call =winner-undo= to restore window configuration as shown here?

#+begin_src diff
From bd0a2abaa8097338d7f33c7ca9a1d45f5da67e7a Mon Sep 17 00:00:00 2001
From: kimr <kimr@synopsys.com>
Date: Sat, 14 Dec 2019 10:59:00 -0800
Subject: [PATCH] restore window config by calling winner-undo

---
 lisp/org-src.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-src.el b/lisp/org-src.el
index 5e50a1b4..c8c30889 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -1182,7 +1182,8 @@ Throw an error if there is no such buffer."
        (write-back (org-src--goto-coordinates coordinates beg end))))
     ;; Clean up left-over markers and restore window configuration.
     (set-marker beg nil)
-    (set-marker end nil)))
+    (set-marker end nil)
+    (winner-undo)))
 
 
 (provide 'org-src)
-- 
2.22.1
#+end_src


For now I'm using the following advice do the same thing.


#+begin_src elisp
(defadvice org-edit-src-exit (after restore-window-config activate)
  (winner-undo))
#+end_src




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

             reply	other threads:[~2019-12-14 21:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14 19:06 Richard Kim [this message]
2019-12-16 16:30 ` restore window configuration after org-edit-src-exit Nicolas Goaziou
2019-12-17  1:51   ` Kyle Meyer
2019-12-17 14:11     ` Jack Kamm
2019-12-17 14:28       ` Jack Kamm
2019-12-17 15:16         ` Fraga, Eric
2019-12-22 14:45         ` Nicolas Goaziou
2019-12-23  1:46           ` Jack Kamm
2019-12-23  8:17             ` Nicolas Goaziou
2019-12-23 17:15               ` Jack Kamm
2019-12-23 17:20                 ` Nicolas Goaziou
2019-12-23 18:18                   ` [PATCH] " Jack Kamm
2020-01-07  8:49                     ` Nicolas Goaziou
2020-01-09 15:03                       ` Matt Price
2020-01-09 17:43                       ` Jack Kamm
2020-01-14 23:10                         ` Jack Kamm
  -- strict thread matches above, loose matches on Subject: below --
2020-05-17 19:08 edgar
2020-09-05  7:38 ` Bastien

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=qtmfthmafqz.fsf@synopsys.com \
    --to=richard.kim1@synopsys.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).