emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: Richard Riley <rileyrg@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-edit-src-code : same window?
Date: Wed, 1 Sep 2010 12:27:43 -0700	[thread overview]
Message-ID: <AANLkTin+M+XCeKm1087KKucaKayGHBwYKr1tsT=+uUhq@mail.gmail.com> (raw)
In-Reply-To: <i5m81c$veu$1@dough.gmane.org>

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.

  parent reply	other threads:[~2010-09-01 19:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2010-09-01 19:30   ` Samuel Wales

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='AANLkTin+M+XCeKm1087KKucaKayGHBwYKr1tsT=+uUhq@mail.gmail.com' \
    --to=samologist@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rileyrg@gmail.com \
    /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).