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: PATCH: do not restore window config on exit from src buffer
Date: Tue, 27 Nov 2018 08:26:50 -0500	[thread overview]
Message-ID: <CAN_Dec9uxxxnJ13cQspW3XOdBZpYXPj6=NufeX0H2R-cNVrORQ@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 104 bytes --]

As per our earlier thread, here is a patch to remove
org-src--saved-temp-window-config from org-src.el.

[-- Attachment #1.2: Type: text/html, Size: 130 bytes --]

[-- Attachment #2: 0001-Org-sr.el-On-exiting-src-buffer-do-not-restore-prior.patch --]
[-- Type: text/x-patch, Size: 2638 bytes --]

From ad2d8d26eee6c2bcfa517e0f7352406c9980bfd4 Mon Sep 17 00:00:00 2001
From: Matt Price <matt.price@utoronto.ca>
Date: Tue, 27 Nov 2018 08:19:03 -0500
Subject: [PATCH] Org-sr.el: On exiting src buffer, do not restore prior config

org-src.el (org-src--saved-temp-window-config): remove all references
to org-src--saved-temp-window-config.  Org will no longer attempt to
restore the previous window configuration on exit from a src buffer.
---
 etc/ORG-NEWS    |  5 ++++-
 lisp/org-src.el | 10 ++--------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 811e98147..6ec90bfc2 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -9,7 +9,10 @@ Copyright (C) 2012-2018 Free Software Foundation, Inc.
 See the end of the file for license conditions.
 
 Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
-
+* Version 9.3
+** Incompatible changes
+*** Change in behavior on exit from an Org Src buffer
+Org will no longer attempt to restore the window configuration in the frame to which the user returns after editing a source block with ~org-edit-src-code~. Instead, the window configuration will remain as it is. 
 * Version 9.2
 ** Incompatible changes
 *** Removal of OrgStruct mode mode and radio lists
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 12163156f..f024b31a9 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -270,9 +270,6 @@ issued in the language major mode buffer."
 (defvar-local org-src--remote nil)
 (put 'org-src--remote 'permanent-local t)
 
-(defvar-local org-src--saved-temp-window-config nil)
-(put 'org-src--saved-temp-window-config 'permanent-local t)
-
 (defvar-local org-src--source-type nil
   "Type of element being edited, as a symbol.")
 (put 'org-src--source-type 'permanent-local t)
@@ -475,8 +472,7 @@ When REMOTE is non-nil, do not try to preserve point or mark when
 moving from the edit area to the source.
 
 Leave point in edit buffer."
-  (setq org-src--saved-temp-window-config (current-window-configuration))
-  (let* ((area (org-src--contents-area datum))
+    (let* ((area (org-src--contents-area datum))
 	 (beg (copy-marker (nth 0 area)))
 	 (end (copy-marker (nth 1 area) t))
 	 (old-edit-buffer (org-src--edit-buffer beg end))
@@ -1173,9 +1169,7 @@ 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)
-      (setq org-src--saved-temp-window-config nil))))
+    ))
 
 
 (provide 'org-src)
-- 
2.19.1


             reply	other threads:[~2018-11-27 13:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27 13:26 Matt Price [this message]
2018-11-27 20:33 ` PATCH: do not restore window config on exit from src buffer 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_Dec9uxxxnJ13cQspW3XOdBZpYXPj6=NufeX0H2R-cNVrORQ@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).