From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: other-window-or-frame
Date: Thu, 05 Jan 2006 10:05:21 -0700 [thread overview]
Message-ID: <dpjjkl$b3u$1@sea.gmane.org> (raw)
In-Reply-To: <MEEKKIABFKKDFJMPIOEBIEEOCOAA.drew.adams@oracle.com>
Drew Adams wrote:
> If a frame is `one-window-p', command `other-window' silently does nothing.
> It might be better to let it do `other-frame' in that case. The optional
> second arg to `other-window' is not accessible interactively anyway, so what
> about this:
>
> 1. Bind a new command to `C-x o', to replace `other-window'. It would do the
> same thing except when `one-window-p' - in that case, it would do
> `other-frame'.
>
> 2. Keep function `other-window' as is (with its second arg), for Lisp.
>
> IOW (but with a better doc string):
>
> (defun other-window-or-frame (arg)
> "`other-frame', if `one-window-p'; otherwise, `other-window'."
> (interactive "p")
> (if (one-window-p) (other-frame arg) (other-window arg)))
>
> (define-key ctl-x-map "o" 'other-window-or-frame)
Actually, now that you mention it, I've just added this to my .emacs:
(defadvice other-window (before one-window-p activate)
"If there are no other windows, signal an error."
(when (one-window-p)
(error "No other windows")))
(defadvice other-frame (before one-frame-p activate)
"If there are no other frames, signal an error."
(when (= (length (frame-list)) 1)
(error "No other frames")))
(setq debug-ignored-errors
(cons "\\`No other \\(window\\|frame\\)s\\'" debug-ignored-errors))
--
Kevin
next prev parent reply other threads:[~2006-01-05 17:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-05 4:28 other-window-or-frame Drew Adams
2006-01-05 17:05 ` Kevin Rodgers [this message]
2006-02-01 19:13 ` other-window-or-frame Kevin Rodgers
2006-01-05 23:11 ` other-window-or-frame Richard M. Stallman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='dpjjkl$b3u$1@sea.gmane.org' \
--to=ihs_4664@yahoo.com \
/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 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.