From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: dieter@duenenhof-wilhelm.de (H. Dieter Wilhelm) Newsgroups: gmane.emacs.help Subject: Re: When do you prefer frames instead of windows? Date: Mon, 24 Nov 2014 23:12:45 +0100 Organization: The Church of Emacs Message-ID: <877fykgsde.fsf@vsl28t2g.ww011> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1416867205 2581 80.91.229.3 (24 Nov 2014 22:13:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Nov 2014 22:13:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 24 23:13:18 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xt1sj-0000Iv-FJ for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Nov 2014 23:13:17 +0100 Original-Received: from localhost ([::1]:54657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xt1si-0000IM-K2 for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Nov 2014 17:13:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xt1sP-0000Hp-1U for help-gnu-emacs@gnu.org; Mon, 24 Nov 2014 17:13:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xt1sI-0007ey-1L for help-gnu-emacs@gnu.org; Mon, 24 Nov 2014 17:12:56 -0500 Original-Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:50642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xt1sH-0007ej-N4 for help-gnu-emacs@gnu.org; Mon, 24 Nov 2014 17:12:49 -0500 Original-Received: by mail-wg0-f44.google.com with SMTP id b13so13532919wgh.3 for ; Mon, 24 Nov 2014 14:12:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=pBlsUudeBxJGL2EaHNJsKexax1YFTKtZOuZv+a2hGfE=; b=NLNfXm3baruBL0WSi2DtjMdkRI/FdvC3hdIKc/ipqj+l7o1lhDzmJVIVesBNfKGNQg fyQbNPCbJOMUqu1y+mFVvXg0S0WS5O0GQqpcVLiBOd9JjXfXpaeY9q57Q/Y9FCWyIeJO s2B+JcpHgtM2Swv//47VUD2kQDAej5hzyuMzqutzkEYVf3JUm+EqTkxr3HQIJGiOBw1Y Yil+UNDX/JziG7nPt3/yM6azjZgx4w0m2tG7Yr3l6X6NXGDdFw+fbAt8BcEcTTQaheif wEFsV8INMOCxq3RlgCdUGds7lez4kxZv2swkfD6sPnL/9yVleIYuPSB9KXgbgIgmDyMm Qd/g== X-Received: by 10.194.237.101 with SMTP id vb5mr38341398wjc.30.1416867168215; Mon, 24 Nov 2014 14:12:48 -0800 (PST) Original-Received: from vsl28t2g.ww011 (p57ACDB1C.dip0.t-ipconnect.de. [87.172.219.28]) by mx.google.com with ESMTPSA id mu4sm13849613wib.2.2014.11.24.14.12.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Nov 2014 14:12:47 -0800 (PST) In-Reply-To: (Raffaele Ricciardi's message of "Mon, 24 Nov 2014 17:40:42 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::22c X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:101138 Archived-At: Raffaele Ricciardi writes: > The usefulness of frames is evident for buffers that update their > content according to the current buffer (like Speedbar and > ECB). Besides this kind of use, when do you prefer frames instead of > windows? To preserve sane window layouts despite a multitude of major modes. For example: Barry Margolin pointed out that he prefers 4 ansi terminals in a "shell frame". I like to have a "file manager" frame with two dired buffers side by side. Gnus literally "demands" his own frame in its default mode of operation! Here's an illustration of my frame setup which is based on Alan Mackenzie work, so that I'm able to open frames with predefined window layouts according to various tasks or - if a task frame already exists, just switch to it. ;; ====================================================================== ;; `frames' based on Alan Mackenzie's setup (set-frame-name "Work") (modify-frame-parameters (selected-frame) '((acm-no . 2))) (find-file "~/org/blog/dddlll.org") (defun assign-acm-no (frame) "FRAME is a (typically newly created) frame. Give it an acm-no frame-parameter if there is one free (in the range 0..11). Return that number or nil." (let ((assigned (make-bool-vector 12 nil)) (f (frame-list)) n) (while f (if (setq n (frame-parameter (car f) 'acm-no)) (aset assigned n t)) (setq f (cdr f))) (setq n 0) (while (and (< n 12) (aref assigned n)) (setq n (1+ n))) (if (= n 12) nil (modify-frame-parameters frame `((acm-no . ,n))) n))) ;(add-hook 'after-make-frame-functions 'assign-acm-no) (defun find-acm-no-frame (n) "Return the frame with parameter (acm-no . N), or nil." (let ((f (frame-list))) (while (and f (not (eq (frame-parameter (car f) 'acm-no) n))) (setq f (cdr f))) (car f))) (defun focus-frame-acm-no (n) "Select the frame with acm-no frame-parameter N, or do nothing." (let ((frame (find-acm-no-frame n))) (when frame (select-frame-set-input-focus frame)) (framep frame))) ;; frame 2, 3, ... (defun focus-or-make-named-frame ( no) "bla" (unless (focus-frame-acm-no no) (let ((frame (make-frame-command))) (select-frame-set-input-focus frame) (cond ((= no 1) (modify-frame-parameters frame '((acm-no . 1))) (set-frame-name "F1 Informations, info, eww") (unless (get-buffer "*info*") (info)) ) ((= no 2) (modify-frame-parameters frame '((acm-no . 2))) (set-frame-name "F2 Work") ) ((= no 3) (modify-frame-parameters frame '((acm-no . 3))) (set-frame-name "F3 Communications Gnus, BBDB") (unless (get-buffer "*Group*") (gnus-unplugged)) ) ((= no 4) (modify-frame-parameters frame '((acm-no . 4))) (set-frame-name "F4 OS terminal, shell") (split-window-horizontally) (unless (get-buffer "*terminal*") (term "/bin/bash")) ) ((= no 5) (modify-frame-parameters frame '((acm-no . 5))) (set-frame-name "Time Management and Planning") (unless (get-buffer "*Calendar*") (calendar)) ) ((= no 6) (modify-frame-parameters frame '((acm-no . 6))) (set-frame-name "Programming and Configuration") (unless (get-buffer "init.el") (find-file "~/.emacs.d/init.el")) ) ((= no 7) (modify-frame-parameters frame '((acm-no . 7))) (set-frame-name "Dired File Manipulations") (dired "~")) ((= no 8) (modify-frame-parameters frame '((acm-no . 8))) (set-frame-name "Helper Frame")) ((= no 9) (modify-frame-parameters frame '((acm-no . 9))) (set-frame-name "ERC")) ((= no 10) (modify-frame-parameters frame '((acm-no . 9))) (set-frame-name "Image Dired")) )))) (global-set-key [f1] (lambda () "Switch to frame 1" (interactive) (focus-or-make-named-frame 1))) (global-set-key [f2] (lambda () "Switch to frame 2" (interactive) (focus-or-make-named-frame 2))) (global-set-key [f3] (lambda () "Switch to frame 3" (interactive) (focus-or-make-named-frame 3))) (global-set-key [f4] (lambda () "Switch to frame 4" (interactive) (focus-or-make-named-frame 4))) (global-set-key [f5] (lambda () "Switch to frame 5" (interactive) (focus-or-make-named-frame 5))) (global-set-key [f6] (lambda () "Switch to frame 6" (interactive) (focus-or-make-named-frame 6))) (global-set-key [f7] (lambda () "Switch to frame 7" (interactive) (focus-or-make-named-frame 7))) (global-set-key [f8] (lambda () "Switch to frame 8" (interactive) (focus-or-make-named-frame 8))) (global-set-key [f9] (lambda () "Switch to frame 9" (interactive) (focus-or-make-named-frame 9))) (global-set-key [f10] (lambda () "Switch to frame 10" (interactive) (focus-or-make-named-frame 10))) ;; F11 is toggle full-screen ;; (global-set-key [f12] (lambda () "Switch to frame 12" (interactive) (focus-or-make-named-frame 12))) Dieter -- Best wishes H. Dieter Wilhelm Darmstadt, Germany