all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* two windows switch buffer
@ 2014-01-18 10:23 henry atting
  2014-01-18 13:01 ` Deric Bytes
  2014-01-18 15:01 ` Deric Bytes
  0 siblings, 2 replies; 8+ messages in thread
From: henry atting @ 2014-01-18 10:23 UTC (permalink / raw)
  To: help-gnu-emacs

Let's say I have a gnus summery buffer and below a gnus article buffer
opened. Now I switch to another buffer, for instance
scratch. Then I have still two windows, at top the scratch buffer and
below the gnus article buffer.

Is there a (hopefully built-in) way to treat this two windows as one and
finally have one single window when switching to the scratch buffer?


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

* Re: two windows switch buffer
  2014-01-18 10:23 two windows switch buffer henry atting
@ 2014-01-18 13:01 ` Deric Bytes
  2014-01-18 15:01 ` Deric Bytes
  1 sibling, 0 replies; 8+ messages in thread
From: Deric Bytes @ 2014-01-18 13:01 UTC (permalink / raw)
  To: help-gnu-emacs

http://www.emacswiki.org/emacs/WindowsAndRegisters

    C-x r w <letter> – stores the current configuration in a register
    C-x r j <letter> – restores the configuration from a register


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

* Re: two windows switch buffer
  2014-01-18 10:23 two windows switch buffer henry atting
  2014-01-18 13:01 ` Deric Bytes
@ 2014-01-18 15:01 ` Deric Bytes
  2014-01-18 17:07   ` henry atting
  1 sibling, 1 reply; 8+ messages in thread
From: Deric Bytes @ 2014-01-18 15:01 UTC (permalink / raw)
  To: help-gnu-emacs

(defun my-find-file-delete-other-windows ()
  ""
  (interactive)
   (prog1
   (call-interactively 'find-file)
   (delete-other-windows)))


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

* Re: two windows switch buffer
  2014-01-18 15:01 ` Deric Bytes
@ 2014-01-18 17:07   ` henry atting
  2014-01-18 17:56     ` Deric Bytes
  2014-01-19  5:07     ` Emanuel Berg
  0 siblings, 2 replies; 8+ messages in thread
From: henry atting @ 2014-01-18 17:07 UTC (permalink / raw)
  To: help-gnu-emacs

> (defun my-find-file-delete-other-windows ()
>   ""
>   (interactive)
>    (prog1
>    (call-interactively 'find-file)
>    (delete-other-windows)))

Thanks! I changed it slightly

(defun my-buffer-switch ()
  ""
  (interactive)
   (prog1
   (call-interactively 'switch-to-buffer)
   (delete-other-windows)))


When I want my two windows back I think I have to use register which you
already pointed out. Unfortunately I do not like register, I will not
use it.
Thanks anyway!


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

* Re: two windows switch buffer
  2014-01-18 17:07   ` henry atting
@ 2014-01-18 17:56     ` Deric Bytes
  2014-01-18 18:07       ` henry atting
  2014-01-19  5:14       ` Emanuel Berg
  2014-01-19  5:07     ` Emanuel Berg
  1 sibling, 2 replies; 8+ messages in thread
From: Deric Bytes @ 2014-01-18 17:56 UTC (permalink / raw)
  To: help-gnu-emacs

registers are amazing you should learn to love them.

I would use 

winner-undo (winner.el) in this case. 


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

* Re: two windows switch buffer
  2014-01-18 17:56     ` Deric Bytes
@ 2014-01-18 18:07       ` henry atting
  2014-01-19  5:14       ` Emanuel Berg
  1 sibling, 0 replies; 8+ messages in thread
From: henry atting @ 2014-01-18 18:07 UTC (permalink / raw)
  To: help-gnu-emacs

> registers are amazing you should learn to love them.
>
> I would use 
>
> winner-undo (winner.el) in this case. 

Great!

I did not know it. And it's already part of emacs.

You just made my day!


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

* Re: two windows switch buffer
  2014-01-18 17:07   ` henry atting
  2014-01-18 17:56     ` Deric Bytes
@ 2014-01-19  5:07     ` Emanuel Berg
  1 sibling, 0 replies; 8+ messages in thread
From: Emanuel Berg @ 2014-01-19  5:07 UTC (permalink / raw)
  To: help-gnu-emacs

henry atting <snd@online.de> writes:

> (defun my-buffer-switch ...

You probably want that to be transparent, so you could
use something like

(dolist (mode (list gnus-article-mode-map
                    gnus-summary-mode-map) )
  (define-key mode
    [remap switch-to-buffer] 'my-buffer-switch) )

-- 
underground experts united:
http://user.it.uu.se/~embe8573


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

* Re: two windows switch buffer
  2014-01-18 17:56     ` Deric Bytes
  2014-01-18 18:07       ` henry atting
@ 2014-01-19  5:14       ` Emanuel Berg
  1 sibling, 0 replies; 8+ messages in thread
From: Emanuel Berg @ 2014-01-19  5:14 UTC (permalink / raw)
  To: help-gnu-emacs

Deric Bytes <dericbytes@gmail.com> writes:

> registers are amazing you should learn to love them.

You can also put *files* in registers:

(set-register ?Z (cons 'file "~/.zprofile"))
(set-register ?a (cons 'file "/sudo::/etc/apt/sources.list"))

Then with jump-to-register (bound to a keystroke) you
can bounce around really fast. Some say you should use
bookmarks for that but there are many ways to do
things.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


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

end of thread, other threads:[~2014-01-19  5:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-18 10:23 two windows switch buffer henry atting
2014-01-18 13:01 ` Deric Bytes
2014-01-18 15:01 ` Deric Bytes
2014-01-18 17:07   ` henry atting
2014-01-18 17:56     ` Deric Bytes
2014-01-18 18:07       ` henry atting
2014-01-19  5:14       ` Emanuel Berg
2014-01-19  5:07     ` Emanuel Berg

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.