unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Juanma Barranquero" <lekktu@gmail.com>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: other-window: say there is none if none
Date: Tue, 21 Nov 2006 17:24:39 +0100	[thread overview]
Message-ID: <f7ccd24b0611210824t23636b14jabda64619ae76667@mail.gmail.com> (raw)
In-Reply-To: <ejv8ne$ffn$1@sea.gmane.org>

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

On 11/21/06, Kevin Rodgers <ihs_4664@yahoo.com> wrote:

> If *you* want this behavior, *you* can either patch the source and build
> it *yourself*

In fact, here's the patch, with a small fix.

                    /L/e/k/t/u

[-- Attachment #2: dan.patch --]
[-- Type: application/octet-stream, Size: 1446 bytes --]

Index: lisp/frame.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/frame.el,v
retrieving revision 1.241
diff -u -2 -r1.241 frame.el
--- lisp/frame.el	23 Sep 2006 09:16:40 -0000	1.241
+++ lisp/frame.el	15 Nov 2006 16:41:34 -0000
@@ -728,5 +728,7 @@
 	(setq frame (previous-frame frame)))
       (setq arg (1+ arg)))
-    (select-frame-set-input-focus frame)))
+    (if (and (interactive-p) (eq frame (next-frame frame)))
+        (error "No other frames")
+      (select-frame-set-input-focus frame))))
 
 (defun iconify-or-deiconify-frame ()
Index: src/window.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/window.c,v
retrieving revision 1.564
diff -u -2 -r1.564 window.c
--- src/window.c	28 Oct 2006 22:03:51 -0000	1.564
+++ src/window.c	15 Nov 2006 16:40:43 -0000
@@ -1981,8 +1981,9 @@
 {
   Lisp_Object window;
+  Lisp_Object old;
   int i;
 
   CHECK_NUMBER (arg);
-  window = selected_window;
+  old = window = selected_window;
 
   for (i = XINT (arg); i > 0; --i)
@@ -1991,5 +1992,9 @@
     window = Fprevious_window (window, Qnil, all_frames);
 
-  Fselect_window (window, Qnil);
+  if (!EQ (window, old))
+    Fselect_window (window, Qnil);
+  else if (Finteractive_p () && EQ (window, Fnext_window (window, Qnil, Qnil)))
+    error ("No other windows");
+
   return Qnil;
 }

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

  reply	other threads:[~2006-11-21 16:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-20 11:32 other-window: say there is none if none Dan Jacobson
2006-11-21 16:14 ` Kevin Rodgers
2006-11-21 16:24   ` Juanma Barranquero [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-11-10 19:22 Dan Jacobson
2006-11-13  0:39 ` Drew Adams
2006-11-13 15:50 ` Kevin Rodgers
2006-11-13 17:19   ` Juanma Barranquero
2006-11-14 12:26     ` Richard Stallman
2006-11-14 15:31       ` Juanma Barranquero

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.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7ccd24b0611210824t23636b14jabda64619ae76667@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=bug-gnu-emacs@gnu.org \
    /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.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).