all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Feature request: other-previous-window
@ 2012-11-20 15:17 Miguel Guedes
  2012-11-20 15:26 ` Davis Herring
  2012-11-20 18:24 ` Stefan Monnier
  0 siblings, 2 replies; 11+ messages in thread
From: Miguel Guedes @ 2012-11-20 15:17 UTC (permalink / raw)
  To: emacs-devel

This is a request proposal for a very simple feature: the twin brother 
of other-window.

I often keep multiple windows open in my always maximized Emacs frame, 
rarely ever less than 2 and usually 3 windows tiled vertically. Having 
an inverse to other-window would be a blessing as I often need to jump 
from a window in one extreme to the other (skip the window in the 
middle.) When moving forwards (other-window), this is not a problem. 
However, sometimes I find myself at the leftmost window in need of 
moving to the rightmost window.

In other words, if in a given instance of Emacs there are windows A B C, 
being able to quickly and effortlessly jump from A to C would be great.

Being a complete newbie to ELISP I don't know if the following code is 
up to ELISP standards practiced by the Emacs devs but I suppose it is a 
starting point at least:


(defun other-previous-window (count &optional all-frames)
   (interactive "p")
   (other-window (* count -1) all-frames))

(define-key ctl-x-map "p" 'other-previous-window)

-- 
Miguel



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

* Re: Feature request: other-previous-window
  2012-11-20 15:17 Feature request: other-previous-window Miguel Guedes
@ 2012-11-20 15:26 ` Davis Herring
  2012-11-20 15:44   ` Miguel Guedes
  2012-11-20 18:24 ` Stefan Monnier
  1 sibling, 1 reply; 11+ messages in thread
From: Davis Herring @ 2012-11-20 15:26 UTC (permalink / raw)
  To: Miguel Guedes; +Cc: emacs-devel

> This is a request proposal for a very simple feature: the twin brother
> of other-window.

What about C-- C-x o?  (Or C-u - C-x o, etc.)

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.



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

* Re: Feature request: other-previous-window
  2012-11-20 15:26 ` Davis Herring
@ 2012-11-20 15:44   ` Miguel Guedes
  2012-11-21  3:55     ` Kyle C. Andrews
  2012-11-21  4:28     ` Stephen J. Turnbull
  0 siblings, 2 replies; 11+ messages in thread
From: Miguel Guedes @ 2012-11-20 15:44 UTC (permalink / raw)
  To: Davis Herring; +Cc: emacs-devel

On 20/11/12 15:26, Davis Herring wrote:
>> This is a request proposal for a very simple feature: the twin brother
>> of other-window.
>
> What about C-- C-x o?  (Or C-u - C-x o, etc.)
>

It just seemed to me overly complicated for such a simple task.

Why should the inverse of C-x o require twice as effort, when the effort 
required should (IMHO) be exactly the same only having the inverse result?

-- 
Miguel



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

* Re: Feature request: other-previous-window
  2012-11-20 15:17 Feature request: other-previous-window Miguel Guedes
  2012-11-20 15:26 ` Davis Herring
@ 2012-11-20 18:24 ` Stefan Monnier
  2012-11-20 19:10   ` Miguel Guedes
  2012-11-21  9:15   ` Bastien
  1 sibling, 2 replies; 11+ messages in thread
From: Stefan Monnier @ 2012-11-20 18:24 UTC (permalink / raw)
  To: Miguel Guedes; +Cc: emacs-devel

> In other words, if in a given instance of Emacs there are windows A B C,
> being able to quickly and effortlessly jump from A to C would be great.

You might like to try some window-navigation packages like windmove,


        Stefan



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

* Re: Feature request: other-previous-window
  2012-11-20 18:24 ` Stefan Monnier
@ 2012-11-20 19:10   ` Miguel Guedes
  2012-11-20 19:31     ` Lennart Borgman
  2012-11-20 21:20     ` Juanma Barranquero
  2012-11-21  9:15   ` Bastien
  1 sibling, 2 replies; 11+ messages in thread
From: Miguel Guedes @ 2012-11-20 19:10 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 441 bytes --]

I had done but unfortunately windmove  doesn't allow for circular movement
between windows like other-window does.
On Nov 20, 2012 6:25 PM, "Stefan Monnier" <monnier@iro.umontreal.ca> wrote:

> > In other words, if in a given instance of Emacs there are windows A B C,
> > being able to quickly and effortlessly jump from A to C would be great.
>
> You might like to try some window-navigation packages like windmove,
>
>
>         Stefan
>

[-- Attachment #2: Type: text/html, Size: 732 bytes --]

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

* Re: Feature request: other-previous-window
  2012-11-20 19:10   ` Miguel Guedes
@ 2012-11-20 19:31     ` Lennart Borgman
  2012-11-20 20:21       ` Stefan Monnier
  2012-11-20 21:20     ` Juanma Barranquero
  1 sibling, 1 reply; 11+ messages in thread
From: Lennart Borgman @ 2012-11-20 19:31 UTC (permalink / raw)
  To: Miguel Guedes; +Cc: Stefan Monnier, Emacs-Devel devel

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

Yes, that is very inconvenient in windmove.
On Nov 20, 2012 8:10 PM, "Miguel Guedes" <miguel.a.guedes@gmail.com> wrote:

> I had done but unfortunately windmove  doesn't allow for circular movement
> between windows like other-window does.
> On Nov 20, 2012 6:25 PM, "Stefan Monnier" <monnier@iro.umontreal.ca>
> wrote:
>
>> > In other words, if in a given instance of Emacs there are windows A B C,
>> > being able to quickly and effortlessly jump from A to C would be great.
>>
>> You might like to try some window-navigation packages like windmove,
>>
>>
>>         Stefan
>>
>

[-- Attachment #2: Type: text/html, Size: 1102 bytes --]

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

* Re: Feature request: other-previous-window
  2012-11-20 19:31     ` Lennart Borgman
@ 2012-11-20 20:21       ` Stefan Monnier
  0 siblings, 0 replies; 11+ messages in thread
From: Stefan Monnier @ 2012-11-20 20:21 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Miguel Guedes, Emacs-Devel devel

> Yes, that is very inconvenient in windmove.

Shouldn't be too hard to change.


        Stefan



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

* Re: Feature request: other-previous-window
  2012-11-20 19:10   ` Miguel Guedes
  2012-11-20 19:31     ` Lennart Borgman
@ 2012-11-20 21:20     ` Juanma Barranquero
  1 sibling, 0 replies; 11+ messages in thread
From: Juanma Barranquero @ 2012-11-20 21:20 UTC (permalink / raw)
  To: Miguel Guedes; +Cc: Stefan Monnier, emacs-devel

On Tue, Nov 20, 2012 at 8:10 PM, Miguel Guedes
<miguel.a.guedes@gmail.com> wrote:

> I had done but unfortunately windmove  doesn't allow for circular movement
> between windows like other-window does.

Isn't that windmove-wrap-around?

    Juanma



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

* Re: Feature request: other-previous-window
  2012-11-20 15:44   ` Miguel Guedes
@ 2012-11-21  3:55     ` Kyle C. Andrews
  2012-11-21  4:28     ` Stephen J. Turnbull
  1 sibling, 0 replies; 11+ messages in thread
From: Kyle C. Andrews @ 2012-11-21  3:55 UTC (permalink / raw)
  To: Miguel Guedes; +Cc: emacs-devel


Miguel Guedes writes:

> On 20/11/12 15:26, Davis Herring wrote:
>>> This is a request proposal for a very simple feature: the twin brother
>>> of other-window.
>>
>> What about C-- C-x o?  (Or C-u - C-x o, etc.)
>>
>
> It just seemed to me overly complicated for such a simple task.
>
> Why should the inverse of C-x o require twice as effort, when the effort 
> required should (IMHO) be exactly the same only having the inverse result?

Phil Hagelberg's excellent Emacs Starter Kit has this key binding for
the reverse operation of C-x o.

(global-set-key (kbd "C-x O") (lambda () (interactive) (other-window -1)))

-- 
Kyle C. Andrews
kyle.c.andrews@gmail.com



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

* Re: Feature request: other-previous-window
  2012-11-20 15:44   ` Miguel Guedes
  2012-11-21  3:55     ` Kyle C. Andrews
@ 2012-11-21  4:28     ` Stephen J. Turnbull
  1 sibling, 0 replies; 11+ messages in thread
From: Stephen J. Turnbull @ 2012-11-21  4:28 UTC (permalink / raw)
  To: Miguel Guedes; +Cc: emacs-devel

Miguel Guedes writes:

 > Why should the inverse of C-x o require twice as effort, when the effort 
 > required should (IMHO) be exactly the same only having the inverse result?

Of course, you could remove the "&optional" from the signature and
then you'd need to do C-1 C-x o to move forward in the list, with more
symmetric effort. ;-)  Seriously, the reason is that keystrokes in the
global map are a scarce resource.

If you personally have some keystroke you never use, then

C-x ( C-u - C-x 0 C-x ) M-x assign-kbd-macro-to-key RET <KEYSTROKE>

is your friend.



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

* Re: Feature request: other-previous-window
  2012-11-20 18:24 ` Stefan Monnier
  2012-11-20 19:10   ` Miguel Guedes
@ 2012-11-21  9:15   ` Bastien
  1 sibling, 0 replies; 11+ messages in thread
From: Bastien @ 2012-11-21  9:15 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Miguel Guedes, emacs-devel

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> In other words, if in a given instance of Emacs there are windows A B C,
>> being able to quickly and effortlessly jump from A to C would be great.
>
> You might like to try some window-navigation packages like windmove,

You can also try windresize.el from GNU ELPA.

  M-x windresize RET
  [then `o' will cycle through windows]

HTH,

-- 
 Bastien



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

end of thread, other threads:[~2012-11-21  9:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-20 15:17 Feature request: other-previous-window Miguel Guedes
2012-11-20 15:26 ` Davis Herring
2012-11-20 15:44   ` Miguel Guedes
2012-11-21  3:55     ` Kyle C. Andrews
2012-11-21  4:28     ` Stephen J. Turnbull
2012-11-20 18:24 ` Stefan Monnier
2012-11-20 19:10   ` Miguel Guedes
2012-11-20 19:31     ` Lennart Borgman
2012-11-20 20:21       ` Stefan Monnier
2012-11-20 21:20     ` Juanma Barranquero
2012-11-21  9:15   ` Bastien

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.