GNU bug report logs - #7782
24.0.50; 24.0.50: set-scroll-bar-mode missing under non-GUI environments

Previous Next

Package: emacs;

Reported by: Tim Cross <theophilusx <at> gmail.com>

Date: Tue, 4 Jan 2011 12:04:01 UTC

Severity: wishlist

Tags: moreinfo, wontfix

Found in version 24.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7782 in the body.
You can then email your comments to 7782 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7782; Package emacs. (Tue, 04 Jan 2011 12:04:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tim Cross <theophilusx <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 04 Jan 2011 12:04:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tim Cross <theophilusx <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50;
	24.0.50: set-scroll-bar-mode missing under non-GUI environments
Date: Tue, 04 Jan 2011 19:21:03 +1100
According to the documentation for scroll-bar-mode, the way to
set/change scroll-bar settings from within elisp code is to use the
set-scroll-bar-mode function. However, this function is only defined
when run under graphic capable environments, such as X, but not in other
environments such as the Linux console. 

This means that if you don't want your elisp or .emacs to raise an
error, you also need to wrap calls to this function inside something
like (when display-graphic-p ...). This is not required for other
display related functions that depend on an environment requiring
support for graphics i.e. tool-bar-mode. 

For consistency and to help reduce environment related bugs, I would
like to request a feature enhancement whereby set-scroll-bar-mode is
defined in all environmennts, even if it is just a stub / do nothing
operation in environments that do not support scroll bars. 

thanks,

Tim

In GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0)
 of 2011-01-04 on puma
Windowing system distributor `The X.Org Foundation', version 11.0.10900000
configured using `configure  '--prefix=/usr/local''





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7782; Package emacs. (Mon, 10 Jan 2011 22:52:02 GMT) Full text and rfc822 format available.

Message #8 received at 7782 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Tim Cross <theophilusx <at> gmail.com>
Cc: 7782 <at> debbugs.gnu.org
Subject: Re: bug#7782: 24.0.50;
	24.0.50: set-scroll-bar-mode missing under non-GUI environments
Date: Mon, 10 Jan 2011 17:58:48 -0500
Tim Cross wrote:

> According to the documentation for scroll-bar-mode, the way to
> set/change scroll-bar settings from within elisp code is to use the
> set-scroll-bar-mode function. However, this function is only defined
> when run under graphic capable environments, such as X, but not in other
> environments such as the Linux console. 
>
> This means that if you don't want your elisp or .emacs to raise an
> error, you also need to wrap calls to this function inside something
> like (when display-graphic-p ...). This is not required for other
> display related functions that depend on an environment requiring
> support for graphics i.e. tool-bar-mode. 

It's not clear to me whether you mean --without-x builds or --with-x
builds started with -nw (or both), but in either case:

In a with-x build:
emacs -Q -nw

C-h f tool-bar-mode
 tool-bar-mode is an interactive compiled Lisp function in `tool-bar.el'.

C-h f set-scroll-bar-mode
 set-scroll-bar-mode is a compiled Lisp function in `scroll-bar.el'.

(tool-bar-mode 1)             ; no error

(set-scroll-bar-mode 'left)   ; no error


In a without-x build, neither tool-bar-mode nor set-scroll-bar-mode is
defined.

Thus, I see no inconsistency here and don't understand your request.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7782; Package emacs. (Mon, 10 Jan 2011 23:39:01 GMT) Full text and rfc822 format available.

Message #11 received at 7782 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Tim Cross <theophilusx <at> gmail.com>, 7782 <at> debbugs.gnu.org
Subject: Re: bug#7782: 24.0.50;
	24.0.50: set-scroll-bar-mode missing under non-GUI environments
Date: Mon, 10 Jan 2011 18:45:32 -0500
> In a without-x build, neither tool-bar-mode nor set-scroll-bar-mode is
> defined.

That's the problem.  I know Emacs has many such things already, but
I think these are all bugs: I think we should adopt a convention that
functions/variables should either be specific to one particular kind of
display, or be display-independent.  Since (set-)scroll-bar-mode is not
specific to one particular kind of display (it is shared by w32, X11,
and ns), it should exist independently from any particular display.

Similarly, if a function doesn't signal an error when run in -nw, it
should generally work just as well in --without-x.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7782; Package emacs. (Thu, 13 Jan 2011 09:38:02 GMT) Full text and rfc822 format available.

Message #14 received at 7782 <at> debbugs.gnu.org (full text, mbox):

From: David De La Harpe Golden <david <at> harpegolden.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Glenn Morris <rgm <at> gnu.org>, Tim Cross <theophilusx <at> gmail.com>,
	7782 <at> debbugs.gnu.org
Subject: Re: bug#7782: 24.0.50;	24.0.50: set-scroll-bar-mode missing under
	non-GUI environments
Date: Thu, 13 Jan 2011 09:45:26 +0000
On 10/01/11 23:45, Stefan Monnier wrote:

> Since (set-)scroll-bar-mode is not
> specific to one particular kind of display (it is shared by w32, X11,
> and ns), it should exist independently from any particular display.

Plus there's no real reason in principle we couldn't draw text-mode 
scroll bars on text terminals too, like old msdos borland ides etc.








Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7782; Package emacs. (Thu, 13 Jan 2011 12:13:02 GMT) Full text and rfc822 format available.

Message #17 received at 7782 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: David De La Harpe Golden <david <at> harpegolden.net>
Cc: theophilusx <at> gmail.com, monnier <at> iro.umontreal.ca, 7782 <at> debbugs.gnu.org
Subject: Re: bug#7782: 24.0.50;
	24.0.50: set-scroll-bar-mode missing under non-GUI environments
Date: Thu, 13 Jan 2011 07:20:27 -0500
> Date: Thu, 13 Jan 2011 09:45:26 +0000
> From: David De La Harpe Golden <david <at> harpegolden.net>
> Cc: Tim Cross <theophilusx <at> gmail.com>, 7782 <at> debbugs.gnu.org
> 
> On 10/01/11 23:45, Stefan Monnier wrote:
> 
> > Since (set-)scroll-bar-mode is not
> > specific to one particular kind of display (it is shared by w32, X11,
> > and ns), it should exist independently from any particular display.
> 
> Plus there's no real reason in principle we couldn't draw text-mode 
> scroll bars on text terminals too, like old msdos borland ides etc.

There's one valid reason, as usual: someone should write the code.
Volunteers are welcome (no, I don't).




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7782; Package emacs. (Sat, 15 Jan 2011 23:30:03 GMT) Full text and rfc822 format available.

Message #20 received at 7782 <at> debbugs.gnu.org (full text, mbox):

From: Tim Cross <theophilusx <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Subject: Re: bug#7782: 24.0.50; 24.0.50: set-scroll-bar-mode missing under
	non-GUI environments
Date: Sun, 16 Jan 2011 10:31:32 +1100
[Message part 1 (text/plain, inline)]
On Tue, Jan 11, 2011 at 9:58 AM, Glenn Morris <rgm <at> gnu.org> wrote:

> Tim Cross wrote:
>
> > According to the documentation for scroll-bar-mode, the way to
> > set/change scroll-bar settings from within elisp code is to use the
> > set-scroll-bar-mode function. However, this function is only defined
> > when run under graphic capable environments, such as X, but not in other
> > environments such as the Linux console.
> >
> > This means that if you don't want your elisp or .emacs to raise an
> > error, you also need to wrap calls to this function inside something
> > like (when display-graphic-p ...). This is not required for other
> > display related functions that depend on an environment requiring
> > support for graphics i.e. tool-bar-mode.
>
> It's not clear to me whether you mean --without-x builds or --with-x
> builds started with -nw (or both), but in either case:
>
> In a with-x build:
> emacs -Q -nw
>
> C-h f tool-bar-mode
>  tool-bar-mode is an interactive compiled Lisp function in `tool-bar.el'.
>
> C-h f set-scroll-bar-mode
>  set-scroll-bar-mode is a compiled Lisp function in `scroll-bar.el'.
>
> (tool-bar-mode 1)             ; no error
>
> (set-scroll-bar-mode 'left)   ; no error
>
>
> In a without-x build, neither tool-bar-mode nor set-scroll-bar-mode is
> defined.
>
> Thus, I see no inconsistency here and don't understand your request.
>

OK, I just tried to re-create the error I was getting and now it isn't
occurring. I have updated emacs since logging the report, but cannot see
anything obvious in the change log that would explain the difference, so not
sure. For the record, here is what I did originally and which does not
repeat the problem now.

1. Built emacs under X with the GTK libs (emacs from bzr 24.0.50).
2. Login under the Linux console and run emacs --debug-init

Originally, I got a backtrace with a void function error for
set-scroll-bar-mode. Fixed this by putting the call inside a when block
which tested for a window-syste of X. However, noticed that this was not an
issue with tool-bar-mode. I could place a direct top-level call to
tool-bar-mode in my .emacs without needing to wrap it in a test. This was
the original inconsistency I observed. i.e. tool-bar-mode was defined but
set-scroll-bar-mode was not when running an emacs built with X under a Linux
console (not an xterm or X console).

C-h f tool-bar-mode returns docs on that function as would be expected.
C-h f set-scroll-bar-mode fails saying the function is not defined.

After removing the when block from my .emacs and just having a top level
call to set-scrolll-bar-mode and restarting emacs just now, I no longer get
the error and backtrace. C-h f returns info on both functions.

I cannot see anything in the change log which would explain why it was not
working and now is, so I guess I must have screwed up somewhere. Sorry for
the noise.

The main reason for the report was I figured we should have consistency -
either *all* graphics display related functions are always defined i.e. as
tool-bar-mode appears to be or *all* of them are defined only for
environments where they maie sense, such as X, but above all, avoid
situations where some appear to be defined and some do not.
Personally, I think they should all be defined regardless of the
environment, even if in many environments, they are just function stubs that
don't actually do anything. This avoids having to remember to put such code
inside tests and to somehow know which such functions are defined in which
environments. For the envrionments I've tested, this does not appear to be
the case for tool-bar-mode and set-scroll-bar-mode, so all appears to be
fine for at least these two cases.

thanks,

Tim
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7782; Package emacs. (Sat, 04 Dec 2021 20:30:02 GMT) Full text and rfc822 format available.

Message #23 received at 7782 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Glenn Morris <rgm <at> gnu.org>, Tim Cross <theophilusx <at> gmail.com>,
 7782 <at> debbugs.gnu.org
Subject: Re: bug#7782: 24.0.50; 24.0.50: set-scroll-bar-mode missing under
 non-GUI environments
Date: Sat, 04 Dec 2021 21:29:09 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> In a without-x build, neither tool-bar-mode nor set-scroll-bar-mode is
>> defined.
>
> That's the problem.  I know Emacs has many such things already, but
> I think these are all bugs: I think we should adopt a convention that
> functions/variables should either be specific to one particular kind of
> display, or be display-independent.  Since (set-)scroll-bar-mode is not
> specific to one particular kind of display (it is shared by w32, X11,
> and ns), it should exist independently from any particular display.

I think that makes sense conceptually, but I think that people that do
a --without-x build do so for a particular reason: They want to have as
lean an Emacs as possible.  (Otherwise -- why bother?)

So we could certainly do this (and similarly for a bunch of other
stuff):

diff --git a/lisp/loadup.el b/lisp/loadup.el
index ed1570e778..b7e63cc656 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -260,8 +260,7 @@
 (load "jit-lock")
 
 (load "mouse")
-(if (boundp 'x-toolkit-scroll-bars)
-    (load "scroll-bar"))
+(load "scroll-bar")
 (load "select")
 (load "emacs-lisp/timer")
 (load "emacs-lisp/easymenu")

But I'm not sure we'd be doing anybody any favours.

Does anybody have an opinion here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 04 Dec 2021 20:30:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7782; Package emacs. (Wed, 29 Dec 2021 03:06:01 GMT) Full text and rfc822 format available.

Message #28 received at 7782 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Glenn Morris <rgm <at> gnu.org>, Tim Cross <theophilusx <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, 7782 <at> debbugs.gnu.org
Subject: Re: bug#7782: 24.0.50; 24.0.50: set-scroll-bar-mode missing under
 non-GUI environments
Date: Tue, 28 Dec 2021 19:05:40 -0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
>>> In a without-x build, neither tool-bar-mode nor set-scroll-bar-mode is
>>> defined.
>>
>> That's the problem.  I know Emacs has many such things already, but
>> I think these are all bugs: I think we should adopt a convention that
>> functions/variables should either be specific to one particular kind of
>> display, or be display-independent.  Since (set-)scroll-bar-mode is not
>> specific to one particular kind of display (it is shared by w32, X11,
>> and ns), it should exist independently from any particular display.
>
> I think that makes sense conceptually, but I think that people that do
> a --without-x build do so for a particular reason: They want to have as
> lean an Emacs as possible.  (Otherwise -- why bother?)
[snip]
> Does anybody have an opinion here?

How many kilobytes does not preloading it save?  It might be that the
savings are so small that the code simplification is more worthwhile.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7782; Package emacs. (Wed, 29 Dec 2021 14:50:02 GMT) Full text and rfc822 format available.

Message #31 received at 7782 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Glenn Morris <rgm <at> gnu.org>, Tim Cross <theophilusx <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, 7782 <at> debbugs.gnu.org
Subject: Re: bug#7782: 24.0.50; 24.0.50: set-scroll-bar-mode missing under
 non-GUI environments
Date: Wed, 29 Dec 2021 15:49:30 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> How many kilobytes does not preloading it save?  It might be that the
> savings are so small that the code simplification is more worthwhile.

I think it's less a matter of kilobytes, but more a sense of
"cleanliness" that some people want to achieve.  On the other hand,
there's not really much to win to cater to that feeling, so perhaps we
should always define functions like that.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7782; Package emacs. (Sat, 22 Jan 2022 14:27:01 GMT) Full text and rfc822 format available.

Message #34 received at 7782 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Glenn Morris <rgm <at> gnu.org>, Tim Cross <theophilusx <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, 7782 <at> debbugs.gnu.org
Subject: Re: bug#7782: 24.0.50; 24.0.50: set-scroll-bar-mode missing under
 non-GUI environments
Date: Sat, 22 Jan 2022 15:26:04 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I think it's less a matter of kilobytes, but more a sense of
> "cleanliness" that some people want to achieve.  On the other hand,
> there's not really much to win to cater to that feeling, so perhaps we
> should always define functions like that.

Nobody seemed to have a strong opinion one way or another, but
pre-loading these things in all configurations may lead to regressions
for people (they may be doing (fboundp 'scroll-bar-scale) etc to see
whether we're in a non-X build), so I think it makes more sense to
change nothing here, and I'm therefore closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 22 Jan 2022 14:27:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 7782 <at> debbugs.gnu.org and Tim Cross <theophilusx <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 22 Jan 2022 14:27:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 20 Feb 2022 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 58 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.