;;; ;;;; startup-window-prop-list --- a general way to give windows properties when they start ;;; Copyright (C) 2000 John Heidemann ;;; $Id$ ;;; ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License, ;;; version 2, as published by the Free Software Foundation. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License along ;;; with this program; if not, write to the Free Software Foundation, Inc., ;;; 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ;;; ;;; ;;; to use: ;;; put the file in a directory in your load-path ;;; (require 'startup-window-prop-list) ;;; redefine startup-window-prop-list as appropriate. ;;; I have: ;;; (custom-set-variable 'startup-window-prop-list ;;; (list '("monitor" sticky sticky-viewport (frame-type . transient)) ;;; '("console" sticky sticky-viewport) ;;; '("lavaps" sticky sticky-viewport (frame-type shaped)))) ;;; (defcustom startup-window-prop-list nil "list of (name . props) telling to sticky on startup props are a list of things that are marked true, or a list of cons-cells with the prop and its value. For example: (\"monitor\" sticky) (\"lavaps\" sticky sticky-viewport) (\"console\" (sticky nil))") (defun startup-put-window-props (w prop-list) "tag WINDOW with properties in prop-list" (if prop-list (let ((head (car prop-list)) (tail (cdr prop-list))) (if (listp head) (window-put w (car head) (cdr head)) (window-put w head t)) (startup-put-window-props w tail)))) (defun startup-window-prop-list-before-add-window-hook-function (w) "tweak the attributes of some windows" (let ((pair (assoc-regexp (window-name w) startup-window-prop-list))) (if pair (startup-put-window-props w (cdr pair))))) (add-hook 'before-add-window-hook startup-window-prop-list-before-add-window-hook-function t) (provide 'startup-window-prop-list) ;;; -*-lisp-*-