From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: Re: bug? the position of scroll-bar Date: Mon, 22 Sep 2003 18:22:41 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20030922.182241.152505591.jet@gyve.org> References: <20030921.145130.208947415.jet@gyve.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1064222833 9755 80.91.224.253 (22 Sep 2003 09:27:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 22 Sep 2003 09:27:13 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Sep 22 11:27:11 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A1MyN-0003xX-00 for ; Mon, 22 Sep 2003 11:27:11 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1A1N47-0001XM-00 for ; Mon, 22 Sep 2003 11:33:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A1MuG-0000ra-26 for emacs-devel@quimby.gnus.org; Mon, 22 Sep 2003 05:22:56 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 1A1MuB-0000rS-B9 for emacs-devel@gnu.org; Mon, 22 Sep 2003 05:22:51 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 1A1Mu9-0000rE-R5 for emacs-devel@gnu.org; Mon, 22 Sep 2003 05:22:50 -0400 Original-Received: from [210.130.136.40] (helo=r-maa.spacetown.ne.jp) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A1Mu9-0000qX-5d for emacs-devel@gnu.org; Mon, 22 Sep 2003 05:22:49 -0400 Original-Received: from localhost (mx.jp.redhat.com [219.96.218.186]) by r-maa.spacetown.ne.jp (8.11.6) with ESMTP id h8M9MfR28235; Mon, 22 Sep 2003 18:22:41 +0900 (JST) Original-To: storm@cua.dk In-Reply-To: X-Mailer: Mew version 3.1.52 on Emacs 21.3 / Mule 5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:16549 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16549 > > (progn (set-window-scroll-bars (selected-window) 10 'hippopotamus) > > (window-scroll-bars (selected-window))) > > => (10 2 hippopotamus nil) > > > > hippopotamus is accepted. > > It shouldn't, so your fix is ok (read on)... > > > set-window-scroll-bars is a built-in function. > > (set-window-scroll-bars WINDOW WIDTH &optional VERTICAL-TYPE HORIZONTAL-TYPE) > > > > Set width and type of scroll bars of window WINDOW. > > If window is nil, set scroll bars of the currently selected window. > > Second parameter WIDTH specifies the pixel width for the scroll bar; > > this is automatically adjusted to a multiple of the frame column width. > > Third parameter VERTICAL-TYPE specifies the type of the vertical scroll > > bar: left, right, or nil. > > ^^^^^^^^^^^^^^^^^^^^^^^^^ > > A width of nil and type of t means to use the frame's corresponding value. > ^^^^^^^^^ > > You need to allow Qt as well: Thank you. I've validated more strictly. How about this one? 2003-09-22 Masatake YAMATO * window.c (Fset_window_scroll_bars): Validate the value of `vertical_type'. Index: src/window.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/window.c,v retrieving revision 1.447 diff -u -r1.447 window.c --- src/window.c 20 Sep 2003 23:38:54 -0000 1.447 +++ src/window.c 22 Sep 2003 09:18:19 -0000 @@ -5873,6 +5873,12 @@ if (XINT (width) == 0) vertical_type = Qnil; + if (!(EQ (vertical_type, Qnil) + || EQ (vertical_type, Qleft) + || EQ (vertical_type, Qright) + || (EQ (vertical_type, Qt) && NILP (width)))) + error ("Invalid type of vertical scroll bar"); + if (!EQ (w->scroll_bar_width, width) || !EQ (w->vertical_scroll_bar_type, vertical_type)) {