emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-edit-src-code : same window?
@ 2010-09-01 19:03 Richard Riley
  2010-09-01 19:14 ` Erik Iverson
  2010-09-01 19:27 ` Samuel Wales
  0 siblings, 2 replies; 6+ messages in thread
From: Richard Riley @ 2010-09-01 19:03 UTC (permalink / raw)
  To: emacs-orgmode


Is there a way to configure emacs/org so that C-c ' which calls
org-edit-src-code for me opens the source in the  same window rather
than splitting the window and continuing to show the then redundant org
babel source?

cheers

r.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: org-edit-src-code : same window?
  2010-09-01 19:03 org-edit-src-code : same window? Richard Riley
@ 2010-09-01 19:14 ` Erik Iverson
  2010-09-01 19:22   ` [PATCH] " Richard Riley
  2010-09-01 19:27 ` Samuel Wales
  1 sibling, 1 reply; 6+ messages in thread
From: Erik Iverson @ 2010-09-01 19:14 UTC (permalink / raw)
  To: Richard Riley; +Cc: emacs-orgmode

See the org-src-window-setup variable.

I think you want it set to current-window.

Richard Riley wrote:
> Is there a way to configure emacs/org so that C-c ' which calls
> org-edit-src-code for me opens the source in the  same window rather
> than splitting the window and continuing to show the then redundant org
> babel source?
> 
> cheers
> 
> r.
> 
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] Re: org-edit-src-code : same window?
  2010-09-01 19:14 ` Erik Iverson
@ 2010-09-01 19:22   ` Richard Riley
  2010-09-02  4:20     ` Dan Davison
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Riley @ 2010-09-01 19:22 UTC (permalink / raw)
  To: emacs-orgmode


Erik Iverson <eriki@ccbr.umn.edu> writes:

> See the org-src-window-setup variable.
>
> I think you want it set to current-window.

Well spotted. Thanks. Here is a small path to update the docs to mention
this :-

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/org-src.el b/lisp/org-src.el
index 7ed7606..920fa8a 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -200,7 +200,7 @@ The example is copied to a separate buffer, and that buffer is switched
 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. Optional argument CONTEXT is used by
-\\[org-edit-src-save] when calling this function."
+\\[org-edit-src-save] when calling this function. See \\[org-src-window-setup] to configure the buffer open mode."
   (interactive)
   (unless (eq context 'save)
     (setq org-edit-src-saved-temp-window-config (current-window-configuration)))
--8<---------------cut here---------------end--------------->8---


>
> Richard Riley wrote:
>> Is there a way to configure emacs/org so that C-c ' which calls
>> org-edit-src-code for me opens the source in the  same window rather
>> than splitting the window and continuing to show the then redundant org
>> babel source?
>> 
>> cheers
>> 
>> r.
>> 
>> 
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

-- 
☘ http://www.shamrockirishbar.com, http://www.richardriley.net

"Learning French is trivial: the word for horse is 'cheval' and
 everything follows thusly." : quotemaster, #emacs on irc.freenode.net

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: org-edit-src-code : same window?
  2010-09-01 19:03 org-edit-src-code : same window? Richard Riley
  2010-09-01 19:14 ` Erik Iverson
@ 2010-09-01 19:27 ` Samuel Wales
  2010-09-01 19:30   ` Samuel Wales
  1 sibling, 1 reply; 6+ messages in thread
From: Samuel Wales @ 2010-09-01 19:27 UTC (permalink / raw)
  To: Richard Riley; +Cc: emacs-orgmode

Here are my kludges to get almost-optimal pop-up-windows
behavior, gathered over years.

You want org-src-window-setup.

Basically, people who use pop-up-windows set to nil want
same window for most things except modes like org agenda and
rare completion and menu popups where you need to see the
original text.  Keys can be bound to next-buffer and
previous-.

Most people are unaware that this is an important
accessibility issue.  People who require large fonts cannot
put up with unnecessary popped-up windows.  There aren't
enough lines left.  So they have to do all this.

I hope this helps somebody.

Samuel


;;;
;;;org
;;;

;;(setf (cdr (assoc* 'file org-link-frame-setup)) 'find-file)
(pushnew '(file . find-file) org-link-frame-setup :test #'equal)
;;it might be nice to have a 'dedicated-buffer option
(setf org-indirect-buffer-display 'current-window)
;;could make pop kill the buffer
;;;(setf org-display-internal-link-with-indirect-buffer t)
(setf org-src-window-setup 'current-window)
(add-hook 'remember-mode-hook 'delete-other-windows)
(add-hook 'org-capture-mode-hook 'delete-other-windows)

;;;
;;;pop-up-windows
;;;

;;this fixes some problems but not all and makes completions not work in
;;lisp and shell.  maybe turn this off and try . for regexp in
;;same-window-regexps?!!!!
(setf pop-up-windows nil)

;;emacs 22 puts help in another window.  otoh it also does not let
;;you quit the buffer.  so will use bury-buffer ka.
;;trying this, but screws up dired other window and appt
;;(add-to-list 'same-window-regexps ".*")
(add-to-list 'same-window-regexps "\\*Customize.*") ;notwork?
;;pushy and quiet are good but the buffer random burying bug makes quiet bad
(setf Man-notify-method 'pushy)
(add-to-list 'same-window-regexps "\\*Man .*") ;notwork
;;i wonder if these might work.  but i might need to do every one manually
;;in order to exclude.
(add-to-list 'same-window-regexps "\\*.*\\*")
;;(add-to-list 'same-window-regexps " \\*.*")
;;non-regexps
;;(setf same-window-buffer-names nil)
(add-to-list 'same-window-buffer-names "*Remember*")
;;why isn't this fixing the crappy moronic bug
(add-to-list 'same-window-buffer-names "*Help*")
(add-to-list 'same-window-buffer-names "*Apropos*")
(add-to-list 'same-window-buffer-names "*Summary*")
;;i don't know why these work to prevent the disappearing buffer problem,
;;but they do.  apparently *buffers* are special-cased by some moron to go
;;into a different part of the buffer list.
(add-to-list 'same-window-buffer-names "*Compile-Log*")
;;;     ;;emacs seems to put buffers with asterisks inadvisedly in a different
;;;     ;;place in the buffer list.  Samuel's 10th law of programming states:
;;;     ;;don't special-case anything without very good reason.
;;;     ;;
;;;     ;;summary: some buffers disappear when you cycle using next-buffer and
;;;     ;;previous-buffer.
;;;     ;;
;;;     ;;i think i determined that there are 2 bugs, one with next- and
;;;     ;;previous-buffer and one with bury-buffer.  the former is only
;;;     ;;partly worked around with same-window-regexps set to \*.  the
;;;     ;;latter has no solution.
;;;     ;;
;;;     ;;these are significant bugs in emacs.
;;emacs still fails to make this restorable.  the problem is bury-buffer,
;;which manually, in c, sticks it with other *buffers* ka.  not sure.  but
;;this is a separate bug from next- and previous-buffer hardcoding nonsense
;;we are working around.  probably.
;;
;;fixme the manual says how to rearrange the buffer list.  we can have a
;;command to keep all major modes together, then by alpha.  but that does
;;not help us here.  we want to get back to ibuffer after it is buried.
(add-to-list 'same-window-buffer-names "*Ibuffer*")
;;maybe unnec
(add-to-list 'same-window-buffer-names " *Ibuffer*")
;;(defvar alpha-same-window-buffer-names same-window-buffer-names)
;;;'(defadvice pop-to-buffer (around alpha-one-window first activate)
;;;  "the original is c source code and in emacs 22 pops up a new
;;;buffer.  in principle i could fix the complicated help code so
;;;that clicking on a button puts the result in the current window,
;;;but this way i can fix other similar things by checking the
;;;buffer name that it is from, very similar to the target buffer
;;;name thing that it already pays attention to."
;;;  (let ((b (buffer-name)))
;;;    (unless nil (message "hi")))
;;;  ad-do-it
;;;  )
;;this is a kludge -- there are prob bet ones -- for fixing hte disappearing
;;buffer cycle bug.  see alpha-cleandiff.  describe-bindings needs it.
;;i am told all this crap is because *asterisk* buffers are put in some
;;magic place
;;
;;;(defadvice ibuffer (after disappearing-buffer first () activate)
;;;  ;;doesn't seem to work
;;;  (switch-to-buffer (current-buffer)))
;;(ad-unadvise 'ibuffer)

(defadvice comint-dynamic-complete (around windows first () activate)
  (let ((pop-up-windows t)
        (same-window-buffer-names)
        (same-window-regexps))
    ad-do-it))


On 2010-09-01, Richard Riley <rileyrg@gmail.com> wrote:
>
> Is there a way to configure emacs/org so that C-c ' which calls
> org-edit-src-code for me opens the source in the  same window rather
> than splitting the window and continuing to show the then redundant org
> babel source?
>
> cheers
>
> r.
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>


-- 
Q: How many CDC "scientists" does it take to change a lightbulb?
A: "You only think it's dark." [CDC has denied a deadly serious
disease for 25 years]
==========
Retrovirus: http://www.wpinstitute.org/xmrv/index.html -- PLEASE DONATE
===
I would like to see the original Lo et al. 2010 NIH/FDA XMRV paper.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: org-edit-src-code : same window?
  2010-09-01 19:27 ` Samuel Wales
@ 2010-09-01 19:30   ` Samuel Wales
  0 siblings, 0 replies; 6+ messages in thread
From: Samuel Wales @ 2010-09-01 19:30 UTC (permalink / raw)
  To: Richard Riley; +Cc: emacs-orgmode

I guess I needed to edit (but not able to at this time)....

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Re: org-edit-src-code : same window?
  2010-09-01 19:22   ` [PATCH] " Richard Riley
@ 2010-09-02  4:20     ` Dan Davison
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Davison @ 2010-09-02  4:20 UTC (permalink / raw)
  To: Richard Riley; +Cc: emacs-orgmode

Richard Riley <rileyrg@gmail.com> writes:

> Erik Iverson <eriki@ccbr.umn.edu> writes:
>
>> See the org-src-window-setup variable.
>>
>> I think you want it set to current-window.
>
> Well spotted. Thanks. Here is a small path to update the docs to mention
> this :-

Thanks Richard, I've added that.

Dan

>
> diff --git a/lisp/org-src.el b/lisp/org-src.el
> index 7ed7606..920fa8a 100644
> --- a/lisp/org-src.el
> +++ b/lisp/org-src.el
> @@ -200,7 +200,7 @@ The example is copied to a separate buffer, and that buffer is switched
>  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. Optional argument CONTEXT is used by
> -\\[org-edit-src-save] when calling this function."
> +\\[org-edit-src-save] when calling this function. See \\[org-src-window-setup] to configure the buffer open mode."
>    (interactive)
>    (unless (eq context 'save)
>      (setq org-edit-src-saved-temp-window-config (current-window-configuration)))
>
>
>>
>> Richard Riley wrote:
>>> Is there a way to configure emacs/org so that C-c ' which calls
>>> org-edit-src-code for me opens the source in the  same window rather
>>> than splitting the window and continuing to show the then redundant org
>>> babel source?
>>> 
>>> cheers
>>> 
>>> r.
>>> 
>>> 
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Please use `Reply All' to send replies to the list.
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>
>>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-09-02  4:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-01 19:03 org-edit-src-code : same window? Richard Riley
2010-09-01 19:14 ` Erik Iverson
2010-09-01 19:22   ` [PATCH] " Richard Riley
2010-09-02  4:20     ` Dan Davison
2010-09-01 19:27 ` Samuel Wales
2010-09-01 19:30   ` Samuel Wales

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).