emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug? the position of scroll-bar


From: Masatake YAMATO
Subject: Re: bug? the position of scroll-bar
Date: Mon, 22 Sep 2003 18:22:41 +0900 (JST)

> > (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  <address@hidden>

        * 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))
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]