From 0b7d9bbc8ace172ce5602f78c9b3357f754052d9 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 23 Feb 2023 21:49:02 +0800 Subject: [PATCH] Make sure scroll-bar.el is loaded on Android * lisp/loadup.el: Update commentary. * src/androidterm.c (syms_of_androidterm): Define Vx_toolkit_scroll_bars. * src/xterm.c (syms_of_xterm): Update doc string.xf64 --- lisp/loadup.el | 3 +++ src/androidterm.c | 5 +++++ src/xterm.c | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/loadup.el b/lisp/loadup.el index 3b30414b146..47565f809af 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -258,6 +258,9 @@ (load "jit-lock") (load "mouse") +;; This loading happens on Android despite scroll bars being +;; unsupported, because scroll-bar-mode (the variable) must be +;; defined. (if (boundp 'x-toolkit-scroll-bars) (load "scroll-bar")) (load "select") diff --git a/src/androidterm.c b/src/androidterm.c index 0701ef44436..07d9f90a356 100644 --- a/src/androidterm.c +++ b/src/androidterm.c @@ -5570,6 +5570,11 @@ If set to a non-float value, there will be no wait at all. */); This is a string that uniquely identifies the version of Android Emacs is running on. */); + /* Only defined so loadup.el loads scroll-bar.el. */ + DEFVAR_LISP ("x-toolkit-scroll-bars", Vx_toolkit_scroll_bars, + doc: /* SKIP: real doc in xterm.c. */); + Vx_toolkit_scroll_bars = Qnil; + /* Avoid dumping Vandroid_build_fingerprint. */ pdumper_do_now_and_after_load (android_set_build_fingerprint); diff --git a/src/xterm.c b/src/xterm.c index e191f7a6a77..5e6378db30d 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -31955,7 +31955,9 @@ adjusted if the default value does not work for whatever reason. */); A value of nil means Emacs doesn't use toolkit scroll bars. With the X Window system, the value is a symbol describing the X toolkit. Possible values are: gtk, motif, xaw, or xaw3d. -With MS Windows, Haiku windowing or Nextstep, the value is t. */); +With MS Windows, Haiku windowing or Nextstep, the value is t. +With Android, the value is nil, but that is because Emacs on +Android does not support scroll bars at all. */); #ifdef USE_TOOLKIT_SCROLL_BARS #ifdef USE_MOTIF Vx_toolkit_scroll_bars = intern_c_string ("motif"); -- 2.39.5