From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: possible patch: org-edit-src-code breaking window configuration Date: Tue, 03 Nov 2009 14:00:44 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N5QUo-0007KA-Ak for emacs-orgmode@gnu.org; Tue, 03 Nov 2009 16:00:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N5QUj-0007Gl-SU for emacs-orgmode@gnu.org; Tue, 03 Nov 2009 16:00:54 -0500 Received: from [199.232.76.173] (port=41140 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N5QUj-0007Gf-Kg for emacs-orgmode@gnu.org; Tue, 03 Nov 2009 16:00:49 -0500 Received: from mail-pw0-f47.google.com ([209.85.160.47]:56574) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N5QUj-0005PH-53 for emacs-orgmode@gnu.org; Tue, 03 Nov 2009 16:00:49 -0500 Received: by pwj10 with SMTP id 10so2865628pwj.26 for ; Tue, 03 Nov 2009 13:00:48 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode Hi, I've noticed that org-edit-src breaks my window configuration. The patch below fixes this, but introduces a new global variable, and might not have sensible behavior if multiple source-code blocks are edited at once. Even so I personally prefer it's behavior to the current default behavior of removing all windows from the current frame. thoughts? -- Eric --8<---------------cut here---------------start------------->8--- diff --git a/lisp/org-src.el b/lisp/org-src.el index eba8ef3..2f578b9 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -193,6 +193,7 @@ to the correct language mode. When done, exit with \\[org-edit-src-exit]. This will remove the original code in the Org buffer, and replace it with the edited version." (interactive) + (setq org-edit-src-saved-temp-window-config (current-window-configuration)) (let ((line (org-current-line)) (col (current-column)) (case-fold-search t) @@ -574,7 +575,10 @@ the language, a switch telling if the content should be in a single line." (org-goto-line (1- (+ (org-current-line) line))) (org-move-to-column (if preserve-indentation col (+ col total-nindent delta))) (move-marker beg nil) - (move-marker end nil))) + (move-marker end nil)) + (when org-edit-src-saved-temp-window-config + (set-window-configuration org-edit-src-saved-temp-window-config) + (setq org-edit-src-saved-temp-window-config nil))) (defun org-edit-src-save () "Save parent buffer with current state source-code buffer." --8<---------------cut here---------------end--------------->8---