all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27717: other-window when there is no other window
@ 2017-07-15 19:48 積丹尼 Dan Jacobson
  2017-07-16  8:28 ` martin rudalics
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-07-15 19:48 UTC (permalink / raw)
  To: 27717

C-x o runs the command other-window.

Alas, if there is no other window, it does nothing.

It doesn't even print a message "no other window". BUG!

Better yet in this case would be just switch to an other buffer (the
same buffer that switch-to-buffer asks the user about, but without
asking the user.)

And only if there is also no other buffer, then print the message.





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

* bug#27717: other-window when there is no other window
  2017-07-15 19:48 bug#27717: other-window when there is no other window 積丹尼 Dan Jacobson
@ 2017-07-16  8:28 ` martin rudalics
  2017-07-16 15:13 ` 積丹尼 Dan Jacobson
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: martin rudalics @ 2017-07-16  8:28 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson, 27717

 > C-x o runs the command other-window.
 >
 > Alas, if there is no other window, it does nothing.
 >
 > It doesn't even print a message "no other window". BUG!
 >
 > Better yet in this case would be just switch to an other buffer (the
 > same buffer that switch-to-buffer asks the user about, but without
 > asking the user.)
 >
 > And only if there is also no other buffer, then print the message.

The documentation of ‘other-window’ contains the sentence "COUNT zero
means do not skip any window, so select the selected window."  which
clearly indicates that "doing nothing" is a valid action in this case.
C-x 5 o behaves in a similar way.

Admittedly, saying that ‘other-window’ does "Select another window in
cyclic ordering of windows." is misleading.

martin






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

* bug#27717: other-window when there is no other window
  2017-07-15 19:48 bug#27717: other-window when there is no other window 積丹尼 Dan Jacobson
  2017-07-16  8:28 ` martin rudalics
@ 2017-07-16 15:13 ` 積丹尼 Dan Jacobson
  2017-07-16 16:04   ` Eli Zaretskii
  2017-07-16 16:11 ` 積丹尼 Dan Jacobson
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-07-16 15:13 UTC (permalink / raw)
  To: martin rudalics; +Cc: 27717

>>>>> "mr" == martin rudalics <rudalics@gmx.at> writes:

mr> The documentation of ‘other-window’ contains the sentence "COUNT zero
mr> means do not skip any window, so select the selected window."  which
mr> clearly indicates that "doing nothing" is a valid action in this case.

"In an interactive call, COUNT is the numeric prefix argument."

All I know is the user did C-x o, not C-u 0 C-x o.

So I would hope the program would distinguish the two.






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

* bug#27717: other-window when there is no other window
  2017-07-16 15:13 ` 積丹尼 Dan Jacobson
@ 2017-07-16 16:04   ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2017-07-16 16:04 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 27717

> From: 積丹尼 Dan Jacobson
> 	<jidanni@jidanni.org>
> Date: Sun, 16 Jul 2017 23:13:33 +0800
> Cc: 27717@debbugs.gnu.org
> 
> "In an interactive call, COUNT is the numeric prefix argument."
> 
> All I know is the user did C-x o, not C-u 0 C-x o.
> 
> So I would hope the program would distinguish the two.

If your ring has exactly one slot, then going to the next will end up
right where you started.  There's nothing odd about that, and no
special reason to signal an error or output a message.  You can
instantly know what happened without any message.





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

* bug#27717: other-window when there is no other window
  2017-07-15 19:48 bug#27717: other-window when there is no other window 積丹尼 Dan Jacobson
  2017-07-16  8:28 ` martin rudalics
  2017-07-16 15:13 ` 積丹尼 Dan Jacobson
@ 2017-07-16 16:11 ` 積丹尼 Dan Jacobson
  2017-07-16 19:13 ` Marcin Borkowski
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-07-16 16:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 27717

>>>>> "EZ" == Eli Zaretskii <eliz@gnu.org> writes:

EZ> If your ring has exactly one slot, then going to the next will end up
EZ> right where you started.  There's nothing odd about that, and no
EZ> special reason to signal an error or output a message.  You can
EZ> instantly know what happened without any message.

OK then don't print a message. But I hope you will implement my ideas
when the ring has more than one slot.





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

* bug#27717: other-window when there is no other window
  2017-07-15 19:48 bug#27717: other-window when there is no other window 積丹尼 Dan Jacobson
                   ` (2 preceding siblings ...)
  2017-07-16 16:11 ` 積丹尼 Dan Jacobson
@ 2017-07-16 19:13 ` Marcin Borkowski
  2017-07-16 23:31 ` 積丹尼 Dan Jacobson
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Marcin Borkowski @ 2017-07-16 19:13 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 27717


On 2017-07-15, at 21:48, 積丹尼 Dan Jacobson <jidanni@jidanni.org> wrote:

> C-x o runs the command other-window.
>
> Alas, if there is no other window, it does nothing.
>
> It doesn't even print a message "no other window". BUG!
>
> Better yet in this case would be just switch to an other buffer (the
> same buffer that switch-to-buffer asks the user about, but without
> asking the user.)
>
> And only if there is also no other buffer, then print the message.

How about this

http://mbork.pl/2017-02-26_other-window-or-switch-buffer

and that

http://mbork.pl/2017-06-12_smart-next-window-or-buffer

?

Best,

-- 
Marcin Borkowski





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

* bug#27717: other-window when there is no other window
  2017-07-15 19:48 bug#27717: other-window when there is no other window 積丹尼 Dan Jacobson
                   ` (3 preceding siblings ...)
  2017-07-16 19:13 ` Marcin Borkowski
@ 2017-07-16 23:31 ` 積丹尼 Dan Jacobson
  2017-07-17  7:03   ` martin rudalics
  2017-07-17  8:18 ` 積丹尼 Dan Jacobson
  2019-08-17 23:37 ` Lars Ingebrigtsen
  6 siblings, 1 reply; 10+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-07-16 23:31 UTC (permalink / raw)
  To: Marcin Borkowski; +Cc: 27717

>>>>> "MB" == Marcin Borkowski <mbork@mbork.pl> writes:

MB> How about this

MB> http://mbork.pl/2017-02-26_other-window-or-switch-buffer

Something's wrong.

I tried to modify this from your blog post,

(defun other-window-or-switch-buffer ()
  "Call `other-window' if more than one window is visible, switch
to next buffer otherwise."
  (interactive)
  (if (one-window-p)
	  (switch-to-buffer nil)
	(other-window 1)))
(global-set-key "\C-xb" #'other-window-or-switch-buffer)

but there is something wrong with the ASCII or something.





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

* bug#27717: other-window when there is no other window
  2017-07-16 23:31 ` 積丹尼 Dan Jacobson
@ 2017-07-17  7:03   ` martin rudalics
  0 siblings, 0 replies; 10+ messages in thread
From: martin rudalics @ 2017-07-17  7:03 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson, Marcin Borkowski; +Cc: 27717

 > (global-set-key "\C-xb" #'other-window-or-switch-buffer)
 >
 > but there is something wrong with the ASCII or something.

Try adding a space to get "\C-x b".

martin





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

* bug#27717: other-window when there is no other window
  2017-07-15 19:48 bug#27717: other-window when there is no other window 積丹尼 Dan Jacobson
                   ` (4 preceding siblings ...)
  2017-07-16 23:31 ` 積丹尼 Dan Jacobson
@ 2017-07-17  8:18 ` 積丹尼 Dan Jacobson
  2019-08-17 23:37 ` Lars Ingebrigtsen
  6 siblings, 0 replies; 10+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-07-17  8:18 UTC (permalink / raw)
  To: martin rudalics; +Cc: Marcin Borkowski, 27717

OK. I think this would be a great redefinition of C-x o:

(defun other-window-or-switch-buffer ()
  "Call `other-window' if more than one window is visible, switch
to next buffer otherwise."
  (interactive)
  (if (one-window-p)
	  (switch-to-buffer nil)
	(other-window 1)))
(global-set-key (kbd "C-x o") 'other-window-or-switch-buffer)

(I don't use frames. So don't know much about that part.)






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

* bug#27717: other-window when there is no other window
  2017-07-15 19:48 bug#27717: other-window when there is no other window 積丹尼 Dan Jacobson
                   ` (5 preceding siblings ...)
  2017-07-17  8:18 ` 積丹尼 Dan Jacobson
@ 2019-08-17 23:37 ` Lars Ingebrigtsen
  6 siblings, 0 replies; 10+ messages in thread
From: Lars Ingebrigtsen @ 2019-08-17 23:37 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 27717

積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

> C-x o runs the command other-window.
>
> Alas, if there is no other window, it does nothing.
>
> It doesn't even print a message "no other window". BUG!

This has been fixed on the trunk now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2019-08-17 23:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-15 19:48 bug#27717: other-window when there is no other window 積丹尼 Dan Jacobson
2017-07-16  8:28 ` martin rudalics
2017-07-16 15:13 ` 積丹尼 Dan Jacobson
2017-07-16 16:04   ` Eli Zaretskii
2017-07-16 16:11 ` 積丹尼 Dan Jacobson
2017-07-16 19:13 ` Marcin Borkowski
2017-07-16 23:31 ` 積丹尼 Dan Jacobson
2017-07-17  7:03   ` martin rudalics
2017-07-17  8:18 ` 積丹尼 Dan Jacobson
2019-08-17 23:37 ` Lars Ingebrigtsen

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.