bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: other-window: say there is none if none


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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]