From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.bugs Subject: 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-ID: References: <87aajhgjv4.fsf@puma.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=90e6ba18199878a68f0499eaf3fa X-Trace: dough.gmane.org 1295135678 13687 80.91.229.12 (15 Jan 2011 23:54:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 15 Jan 2011 23:54:38 +0000 (UTC) To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 16 00:54:34 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PeFx4-0003MF-2j for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Jan 2011 00:54:34 +0100 Original-Received: from localhost ([127.0.0.1]:51626 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PeFx3-0002H2-3K for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Jan 2011 18:54:33 -0500 Original-Received: from [140.186.70.92] (port=45793 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PeFwy-0002Gk-Id for bug-gnu-emacs@gnu.org; Sat, 15 Jan 2011 18:54:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PeFwx-0005Aa-5I for bug-gnu-emacs@gnu.org; Sat, 15 Jan 2011 18:54:28 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PeFww-0005AW-UX for bug-gnu-emacs@gnu.org; Sat, 15 Jan 2011 18:54:27 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PeFZL-0007d6-Hw; Sat, 15 Jan 2011 18:30:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tim Cross Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jan 2011 23:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7782 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7782-submit@debbugs.gnu.org id=B7782.129513420029303 (code B ref 7782); Sat, 15 Jan 2011 23:30:03 +0000 Original-Received: (at 7782) by debbugs.gnu.org; 15 Jan 2011 23:30:00 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PeFZH-0007ca-7C for submit@debbugs.gnu.org; Sat, 15 Jan 2011 18:29:59 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PeFZE-0007cN-UB for 7782@debbugs.gnu.org; Sat, 15 Jan 2011 18:29:57 -0500 Original-Received: from localhost ([127.0.0.1]:35776) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PeFga-0000Fi-Iq for 7782@debbugs.gnu.org; Sat, 15 Jan 2011 18:37:32 -0500 Resent-Message-ID: <19762.12220.298428.361256@fencepost.gnu.org> Resent-Date: Sat, 15 Jan 2011 18:37:32 -0500 Resent-From: Glenn Morris Resent-To: 7782@debbugs.gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=C0bqZ2bDIpFiqKiS/7/CJib1urH6W44AQ0wB5f61nI4=; b=OODRkfltqK+ZZrGkzmzxLpU23XluouBZ+iFSPBVM1xK0iPJ0ZQGD0u+36oJBMP97vK 7D5beWnDSEPTSgrgT8+IOYng5NwPx8vuQTo+Te4H+8k8FVckYQr11Gv1cpNdmiV9EeQ3 JBKUVxEStDu+xcb+jvF5XcXGyig4uVh/4xsn0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rNiBbPwDsXZfSFZgr/9KptLpUmoSqe+sknVQ83kH/9LjQvzaJMpXd8xLaF9Ah1FbPA Uh/GXRKBfBZvL3GW+ReIqYaMdU+J//7PD6u2hAaYzZxaMPr+8TS71C9gp7g9bvjgVQIL dFwibYPi85HkI7nAH5jg+bkPrAv1X+PiWoKmM= In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Bogosity: no, spamicity=0.016172, v1.1.5 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 15 Jan 2011 18:29:59 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:43387 Archived-At: --90e6ba18199878a68f0499eaf3fa Content-Type: text/plain; charset=ISO-8859-1 On Tue, Jan 11, 2011 at 9:58 AM, Glenn Morris 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 --90e6ba18199878a68f0499eaf3fa Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Tue, Jan 11, 2011 at 9:58 AM, Glenn M= orris <rgm@gnu.org&= gt; 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 oth= er
> 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
=A0tool-bar-mode is an interactive compiled Lisp function in `tool-bar.el&#= 39;.

C-h f set-scroll-bar-mode
=A0set-scroll-bar-mode is a compiled Lisp function in `scroll-bar.el'.<= br>
(tool-bar-mode 1) =A0 =A0 =A0 =A0 =A0 =A0 ; no error

(set-scroll-bar-mode 'left) =A0 ; 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 log= ging the report, but cannot see anything obvious in the change log that wou= ld explain the difference, so not sure. For the record, here is what I did = originally and which does not repeat the problem now.=A0

1. Built emacs under X with the GTK libs (emacs from bz= r 24.0.50).
2. Login under the Linux console and run emacs --debu= g-init

Originally, I got a backtrace with a void f= unction error for set-scroll-bar-mode. Fixed this by putting the call insid= e 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. Th= is was the original inconsistency I observed. i.e. tool-bar-mode was define= d but set-scroll-bar-mode was not when running an emacs built with X under = a Linux console (not an xterm or X console).=A0

C-h f tool-bar-mode returns docs on that function as wo= uld be expected.
C-h f set-scroll-bar-mode fails saying the funct= ion 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.=A0

I cannot see anything in the change log which would exp= lain why it was not working and now is, so I guess I must have screwed up s= omewhere. Sorry for the noise.=A0

The main reason = for the report was I figured we should have consistency - either *all* grap= hics display related functions are always defined i.e. as tool-bar-mode app= ears to be or *all* of them are defined only for environments where they ma= ie sense, such as X, but above all, avoid situations where some appear to b= e defined and some do not.=A0
Personally, I think they should all be defined regardless of the envir= onment, even if in many environments, they are just function stubs that don= 't actually do anything. This avoids having to remember to put such cod= e inside tests and to somehow know which such functions are defined in whic= h 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


--90e6ba18199878a68f0499eaf3fa--