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

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

Re: customizing emacs windows


From: Petter Gustad
Subject: Re: customizing emacs windows
Date: 26 May 2007 12:18:51 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Tim X <address@hidden> writes:


> so rarely that its not really been necessary. I usually have about
> 15 different workspaces and different emacs frames on most of
> them. I then just switch between workspaces using two function keys
> or by moving the mouse to the left or right edge of the screen.

I prefer to select Emacs frames using a popup menu. I've made a
function in sawfish which pops up a menu of all Emacs frames:

(provide 'menu-of)
(require 'sawfish.wm.menus)

(defun wm-class-is (w class)
  (equal (aref (get-x-text-property w 'WM_CLASS) 1) class))

(defun emacs-p (w)
  (wm-class-is w "Emacs"))

(defun xterm-p (w)
  (wm-class-is w "XTerm"))

(defun popup-menu-of (pred)
  "make popup windows of a certain type"
  (popup-menu 
   (mapcar #'(lambda (w) 
               (list (window-name w) 
                     (lambda () 
                       (uniconify-window w)
                       (x-raise-window w)
                       (set-input-focus w))))
           (filter pred (managed-windows)))))

(defun menu-of-emacs ()
  "make a popup menu of emacs windows"
  (interactive)
  (popup-menu-of emacs-p))

(defun menu-of-xterm ()
  "make a popup menu of xterm windows"
  (interactive)
  (popup-menu-of xterm-p))


Then in the global keymap I bind menu-of-emacs to e.g. to H-1 so when I
press the Windows key and 1 I get a popup menu of all Emacs frames.

Petter

-- 
________________________________________________________________________
Petter Gustad         8'h2B | ~8'h2B        http://www.gustad.com/petter


reply via email to

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