|
From: | Kevin Rodgers |
Subject: | Re: other-window: say there is none if none |
Date: | Mon, 13 Nov 2006 08:50:09 -0700 |
User-agent: | Thunderbird 1.5.0.8 (Windows/20061025) |
Dan Jacobson wrote:
C-x o runs the command other-window. But if there is none, it should say something, else dumbo me will just keep hitting it.
Here's what I use: (defadvice other-window (before one-window-p activate)"When called interactively, signal an error if there are no other windows."
(when (and (interactive-p) (one-window-p)) (error "No other windows"))) (defadvice other-frame (before one-frame-p activate)"When called interactively, signal an error if there are no other frames."
(when (and (interactive-p) (= (length (frame-list)) 1)) (error "No other frames"))) -- Kevin
[Prev in Thread] | Current Thread | [Next in Thread] |