From: Tim Cross <theophilusx@gmail.com>
To: Glenn Morris <rgm@gnu.org>
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 [thread overview]
Message-ID: <AANLkTim4PHkT_p4a+8sezVUrtJxXiCbMCxSdUadVnJnj@mail.gmail.com> (raw)
In-Reply-To: <frei8kcqmv.fsf@fencepost.gnu.org>
[-- Attachment #1: Type: text/plain, Size: 3711 bytes --]
On Tue, Jan 11, 2011 at 9:58 AM, Glenn Morris <rgm@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
[-- Attachment #2: Type: text/html, Size: 4405 bytes --]
prev parent reply other threads:[~2011-01-15 23:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-04 8:21 bug#7782: 24.0.50; 24.0.50: set-scroll-bar-mode missing under non-GUI environments Tim Cross
2011-01-10 22:58 ` Glenn Morris
2011-01-10 23:45 ` Stefan Monnier
2011-01-13 9:45 ` David De La Harpe Golden
2011-01-13 12:20 ` Eli Zaretskii
2021-12-04 20:29 ` Lars Ingebrigtsen
2021-12-29 3:05 ` Stefan Kangas
2021-12-29 14:49 ` Lars Ingebrigtsen
2022-01-22 14:26 ` Lars Ingebrigtsen
2011-01-15 23:31 ` Tim Cross [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTim4PHkT_p4a+8sezVUrtJxXiCbMCxSdUadVnJnj@mail.gmail.com \
--to=theophilusx@gmail.com \
--cc=rgm@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).