emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] org-edit-src-code : same window?


From: Samuel Wales
Subject: Re: [Orgmode] org-edit-src-code : same window?
Date: Wed, 1 Sep 2010 12:27:43 -0700

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 <address@hidden> 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.
> address@hidden
> 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.



reply via email to

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