emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] possible patch: org-edit-src-code breaking window configur


From: Dan Davison
Subject: Re: [Orgmode] possible patch: org-edit-src-code breaking window configuration
Date: Tue, 03 Nov 2009 18:18:05 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

"Eric Schulte" <address@hidden> writes:

> 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

Nice. I think it's a desirable improvement to my changes. I've had a
quick test (with all 4 possible values of org-src-window-setup) and it
seemed to work as hoped. I guess the new variable should be defvar'd as
nil in org-edit-src? There are already a number of other not-for-users
global variables used in a similar way in org-src, so it won't be
out-of-place.

Dan

>
> 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."
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode




reply via email to

[Prev in Thread] Current Thread [Next in Thread]