From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/19736 Path: main.gmane.org!not-for-mail From: Julian Assange Newsgroups: gmane.emacs.gnus.general Subject: Re: Article headers & virtual windows Date: 05 Dec 1998 05:33:46 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035158031 13126 80.91.224.250 (20 Oct 2002 23:53:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:53:51 +0000 (UTC) Cc: ding@gnus.org Return-Path: Original-Received: from gizmo.hpc.uh.edu (gizmo.hpc.uh.edu [129.7.102.31]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id UAA29577 for ; Sun, 6 Dec 1998 20:11:59 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@sina.hpc.uh.edu [129.7.3.5]) by gizmo.hpc.uh.edu (8.9.1/8.9.1) with ESMTP id TAA15518; Sun, 6 Dec 1998 19:09:31 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 06 Dec 1998 19:09:35 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id TAA01512 for ; Sun, 6 Dec 1998 19:09:24 -0600 (CST) Original-Received: from yoshi.iq.org (Dial1INnet.vr.in-berlin.de [192.109.21.224]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id UAA29508 for ; Sun, 6 Dec 1998 20:09:13 -0500 (EST) Original-Received: (from proff@localhost) by yoshi.iq.org (8.8.8/8.8.8) id FAA00402; Sat, 5 Dec 1998 05:33:48 +0100 (CET) Original-To: Lars Magne Ingebrigtsen Original-cc: proff@iq.org In-Reply-To: Lars Magne Ingebrigtsen's message of "02 Dec 1998 03:45:13 +0100" User-Agent: Gnus/5.070048 (Pterodactyl Gnus v0.48) XEmacs/20.4 (Emerald) Precedence: list X-Majordomo: 1.94.jlt7 Original-Lines: 115 Xref: main.gmane.org gmane.emacs.gnus.general:19736 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:19736 Lars Magne Ingebrigtsen writes: > But the thing is that an Emacs frame with more than two windows in it > sucks, because `C-x o' doesn't really do what you want it to and > stuff. I often use frames with 4+ windows. The below is probably what you want (though, I've only tested it with xemacs thus far). ;; change-windows-intuitively.el (c) 1998 Julian Assange ;; move around (x)emacs windows intuitively (e.g ;; take me to the window to the immediate left/right/top/bottem of ;; the current one) ;; ;; TODO move relative to the cursor, rather than relative ;; to the currently selected window (which in some ;; circumstances i.e when you have a lot of different size ;; windows stacked near each other, is is more intuitive). ;; ;; uncomment the following keybindings if you like them - ;; note however that shift+arrow keys may not be bindable ;; on your terminal (e.g if you are not running X) ;; (global-set-key [(shift left)] 'proff-select-window-left) ;; (global-set-key [(shift right)] 'proff-select-window-right) ;; (global-set-key [(shift up)] 'proff-select-window-up) ;; (global-set-key [(shift down)] 'proff-select-window-down) (defun proff-find-window-down (win) (let ((swin)) (walk-windows (lambda (wwin) (and (<= (nth 0 (window-pixel-edges wwin)) (nth 0 (window-pixel-edges win))) (> (nth 2 (window-pixel-edges wwin)) (nth 0 (window-pixel-edges win))) (> (nth 1 (window-pixel-edges wwin)) (nth 1 (window-pixel-edges win))) (or (not swin) (< (nth 1 (window-pixel-edges wwin)) (nth 1 (window-pixel-edges swin)))) (setq swin wwin))) t 'visible) swin)) (defun proff-select-window-down () (interactive) (let ((win (proff-find-window-down (selected-window)))) (if win (select-window win)))) (defun proff-find-window-up (win) (let ((swin)) (walk-windows (lambda (wwin) (and (<= (nth 0 (window-pixel-edges wwin)) (nth 0 (window-pixel-edges win))) (> (nth 2 (window-pixel-edges wwin)) (nth 0 (window-pixel-edges win))) (< (nth 1 (window-pixel-edges wwin)) (nth 1 (window-pixel-edges win))) (or (not swin) (> (nth 1 (window-pixel-edges wwin)) (nth 1 (window-pixel-edges swin)))) (setq swin wwin))) t 'visible) swin)) (defun proff-select-window-up () (interactive) (let ((win (proff-find-window-up (selected-window)))) (if win (select-window win)))) (defun proff-find-window-left (win) (let ((swin)) (walk-windows (lambda (wwin) (and (<= (nth 1 (window-pixel-edges wwin)) (nth 1 (window-pixel-edges win))) (> (nth 3 (window-pixel-edges wwin)) (nth 1 (window-pixel-edges win))) (< (nth 0 (window-pixel-edges wwin)) (nth 0 (window-pixel-edges win))) (or (not swin) (> (nth 0 (window-pixel-edges wwin)) (nth 0 (window-pixel-edges swin)))) (setq swin wwin))) t 'visible) swin)) (defun proff-select-window-left () (interactive) (let ((win (proff-find-window-left (selected-window)))) (if win (select-window win)))) (defun proff-find-window-right (win) (let ((swin)) (walk-windows (lambda (wwin) (and (<= (nth 1 (window-pixel-edges wwin)) (nth 1 (window-pixel-edges win))) (> (nth 3 (window-pixel-edges wwin)) (nth 1 (window-pixel-edges win))) (> (nth 0 (window-pixel-edges wwin)) (nth 0 (window-pixel-edges win))) (or (not swin) (< (nth 0 (window-pixel-edges wwin)) (nth 0 (window-pixel-edges swin)))) (setq swin wwin))) t 'visible) swin)) (defun proff-select-window-right () (interactive) (let ((win (proff-find-window-right (selected-window)))) (if win (select-window win))))