From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: Adding parameters to windows Date: Fri, 23 May 2008 16:10:19 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1211552116 3500 80.91.229.12 (23 May 2008 14:15:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 May 2008 14:15:16 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 23 16:15:54 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JzY3d-0005OY-Gc for ged-emacs-devel@m.gmane.org; Fri, 23 May 2008 16:15:45 +0200 Original-Received: from localhost ([127.0.0.1]:41009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzY2s-0002vd-Sl for ged-emacs-devel@m.gmane.org; Fri, 23 May 2008 10:14:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JzY2o-0002vE-2V for emacs-devel@gnu.org; Fri, 23 May 2008 10:14:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JzY2l-0002ut-Iq for emacs-devel@gnu.org; Fri, 23 May 2008 10:14:53 -0400 Original-Received: from [199.232.76.173] (port=43099 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzY2l-0002uq-Da for emacs-devel@gnu.org; Fri, 23 May 2008 10:14:51 -0400 Original-Received: from iwfs.imcode.com ([82.115.149.64]:46999 helo=gate.verona.se) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JzY2k-0000Bx-Gb for emacs-devel@gnu.org; Fri, 23 May 2008 10:14:50 -0400 Original-Received: from chopper (IDENT:1005@localhost [127.0.0.1]) by gate.verona.se (8.13.4/8.11.4) with ESMTP id m4NEEild018499; Fri, 23 May 2008 16:14:45 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 15 May 2008 13:51:50 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:97591 Archived-At: --=-=-= Stefan Monnier writes: > Now that your copyright papers are on file, could you send us a patch > together with a corresponding ChangeLog entry? > > > Stefan Changelog entry: 2008-05-23 Joakim Verona * window.h (window):Added window_parameters. * window.c (syms_of_window): Add new symbols. * window.c (DEFUN): New defun set-window-parameter. * window.c (make_window): Initialize window_parameters to nil. I edited out the parts of the patch for "pinning" and "grouping" windows. Please find it attached. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=winpropp-1st.diff === modified file 'src/window.c' --- src/window.c 2008-04-03 02:15:43 +0000 +++ src/window.c 2008-04-29 09:40:34 +0000 @@ -275,6 +278,7 @@ p->frame = Qnil; p->display_table = Qnil; p->dedicated = Qnil; + p->window_parameters = Qnil; p->pseudo_window_p = 0; bzero (&p->cursor, sizeof (p->cursor)); bzero (&p->last_cursor, sizeof (p->last_cursor)); @@ -1325,6 +1329,38 @@ return w->dedicated; } +DEFUN ("window-parameters", Fwindow_parameters, Swindow_parameters, + 1, 1, 0, + doc: /* Return WINDOW's window-parameters. + returns nil or an alist where values affect window operations. */) + (window) + Lisp_Object window; +{ + return decode_window (window)->window_parameters; +} + + +DEFUN ("set-window-parameter", Fset_window_parameter, + Sset_window_parameter, 3, 3, 0, + doc: /* set window parameters */) + (window, prop, val) + Lisp_Object window, prop, val; +{ + register struct window *w = decode_window (window); + register Lisp_Object old_alist_elt; + + old_alist_elt = Fassq (prop, w->window_parameters); + if (EQ (old_alist_elt, Qnil)) + w->window_parameters = Fcons (Fcons (prop, val), w->window_parameters); + else + Fsetcdr (old_alist_elt, val); + + //Fplist_put(w->window_parameters,key,value); + + return w->window_parameters; +} + + DEFUN ("window-display-table", Fwindow_display_table, Swindow_display_table, 0, 1, 0, doc: /* Return the display-table that WINDOW is using. @@ -7714,6 +7771,9 @@ defsubr (&Sset_window_vscroll); defsubr (&Scompare_window_configurations); defsubr (&Swindow_list); + defsubr (&Swindow_parameters); + defsubr (&Sset_window_parameter); + } void === modified file 'src/window.h' --- src/window.h 2008-01-29 02:05:10 +0000 +++ src/window.h 2008-04-29 10:04:07 +0000 @@ -229,6 +229,11 @@ enlarged. */ Lisp_Object orig_total_lines, orig_top_line; + /* an alist with flags that modifies behaviour of certain window operations. + currently "pin" and "group" are special + */ + Lisp_Object window_parameters; + /* No Lisp data may follow below this point without changing mark_object in alloc.c. The member current_matrix must be the first non-Lisp member. */ --=-=-= -- Joakim Verona --=-=-=--