[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r117810: Clean up initialization and customization o
From: |
Martin Rudalics |
Subject: |
[Emacs-diffs] trunk r117810: Clean up initialization and customization of horizontal scroll bars. |
Date: |
Wed, 03 Sep 2014 15:11:03 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117810
revision-id: address@hidden
parent: address@hidden
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Wed 2014-09-03 17:10:29 +0200
message:
Clean up initialization and customization of horizontal scroll bars.
* frame.el (frame-initialize): Remove horizontal-scroll-bars
from frame-initial-frame-alist.
* scroll-bar.el (previous-horizontal-scroll-bar-mode)
(horizontal-scroll-bar-mode-explicit)
(set-horizontal-scroll-bar-mode, get-horizontal-scroll-bar-mode)
(toggle-horizontal-scroll-bar): Remove.
(horizontal-scroll-bar-mode): Remove defcustom.
(horizontal-scroll-bar-mode): Fix doc-string.
(scroll-bar-toolkit-scroll)
(scroll-bar-toolkit-horizontal-scroll): Add doc-strings stubs.
* buffer.c (scroll-bar-height): Fix typo in doc-string.
* frame.c (Vdefault_frame_horizontal_scroll_bars): Remove
variable.
* nsfns.m (Fx_create_frame):
* w32fns.c (Fx_create_frame):
* xfns.c (Fx_create_frame): Default horizontal scroll bars to
nil.
modified:
etc/NEWS news-20100311060928-aoit31wvzf25yr1z-1
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/frame.el frame.el-20091113204419-o5vbwnq5f7feedwu-275
lisp/scroll-bar.el
scrollbar.el-20091113204419-o5vbwnq5f7feedwu-535
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/buffer.c buffer.c-20091113204419-o5vbwnq5f7feedwu-264
src/frame.c frame.c-20091113204419-o5vbwnq5f7feedwu-243
src/nsfns.m nsfns.m-20091113204419-o5vbwnq5f7feedwu-8741
src/w32fns.c w32fns.c-20091113204419-o5vbwnq5f7feedwu-945
src/xfns.c xfns.c-20091113204419-o5vbwnq5f7feedwu-274
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2014-09-01 14:57:21 +0000
+++ b/etc/NEWS 2014-09-03 15:10:29 +0000
@@ -232,6 +232,17 @@
as the first or last argument of subsequent forms.
+* Changes in Frames and Windows Code in Emacs 24.5
+
+** Emacs can now draw horizontal scroll bars on some platforms that
+provide toolkit scroll bars, namely Gtk, Lucid, Motif and Windows.
+Horizontal scroll bars are turned off by default. Use the command
+`horizontal-scroll-bar-mode' to toggle them on all frames; the frame
+parameter `horizontal-scroll-bars' to turn them on/off on individual
+frames; the function `set-window-scroll-bars' to turn them on/off on
+individual windows.
+
+
* Changes in Emacs 24.5 on Non-Free Operating Systems
---
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-09-03 04:21:40 +0000
+++ b/lisp/ChangeLog 2014-09-03 15:10:29 +0000
@@ -1,3 +1,16 @@
+2014-09-03 Martin Rudalics <address@hidden>
+
+ * frame.el (frame-initialize): Remove horizontal-scroll-bars
+ from frame-initial-frame-alist.
+ * scroll-bar.el (previous-horizontal-scroll-bar-mode)
+ (horizontal-scroll-bar-mode-explicit)
+ (set-horizontal-scroll-bar-mode, get-horizontal-scroll-bar-mode)
+ (toggle-horizontal-scroll-bar): Remove.
+ (horizontal-scroll-bar-mode): Remove defcustom.
+ (horizontal-scroll-bar-mode): Fix doc-string.
+ (scroll-bar-toolkit-scroll)
+ (scroll-bar-toolkit-horizontal-scroll): Add doc-strings stubs.
+
2014-09-03 Stefan Monnier <address@hidden>
* emacs-lisp/package.el (package-generate-description-file):
=== modified file 'lisp/frame.el'
--- a/lisp/frame.el 2014-08-07 09:55:09 +0000
+++ b/lisp/frame.el 2014-09-03 15:10:29 +0000
@@ -174,10 +174,6 @@
(progn
(setq frame-initial-frame-alist
(append initial-frame-alist default-frame-alist nil))
- (or (assq 'horizontal-scroll-bars frame-initial-frame-alist)
- (setq frame-initial-frame-alist
- (cons '(horizontal-scroll-bars . t)
- frame-initial-frame-alist)))
(setq frame-initial-frame-alist
(cons (cons 'window-system initial-window-system)
frame-initial-frame-alist))
=== modified file 'lisp/scroll-bar.el'
--- a/lisp/scroll-bar.el 2014-08-28 06:46:58 +0000
+++ b/lisp/scroll-bar.el 2014-09-03 15:10:29 +0000
@@ -90,16 +90,11 @@
(defvar scroll-bar-mode)
(defvar horizontal-scroll-bar-mode)
(defvar previous-scroll-bar-mode nil)
-(defvar previous-horizontal-scroll-bar-mode nil)
(defvar scroll-bar-mode-explicit nil
"Non-nil means `set-scroll-bar-mode' should really do something.
This is nil while loading `scroll-bar.el', and t afterward.")
-(defvar horizontal-scroll-bar-mode-explicit nil
- "Non-nil means `set-horizontal-scroll-bar-mode' should really do something.
-This is nil while loading `scroll-bar.el', and t afterward.")
-
(defun set-scroll-bar-mode (value)
"Set the scroll bar mode to VALUE and put the new value into effect.
See the `scroll-bar-mode' variable for possible values to use."
@@ -112,18 +107,6 @@
(modify-all-frames-parameters (list (cons 'vertical-scroll-bars
scroll-bar-mode)))))
-(defun set-horizontal-scroll-bar-mode (value)
- "Set the horizontal scroll bar mode to VALUE and put the new value into
effect.
-See the `horizontal-scroll-bar-mode' variable for possible values to use."
- (if horizontal-scroll-bar-mode
- (setq previous-horizontal-scroll-bar-mode horizontal-scroll-bar-mode))
-
- (setq horizontal-scroll-bar-mode value)
-
- (when horizontal-scroll-bar-mode-explicit
- (modify-all-frames-parameters (list (cons 'horizontal-scroll-bars
- horizontal-scroll-bar-mode)))))
-
(defcustom scroll-bar-mode default-frame-scroll-bars
"Specify whether to have vertical scroll bars, and on which side.
Possible values are nil (no scroll bars), `left' (scroll bars on left)
@@ -140,32 +123,14 @@
:initialize 'custom-initialize-default
:set (lambda (_sym val) (set-scroll-bar-mode val)))
-(defcustom horizontal-scroll-bar-mode default-frame-horizontal-scroll-bars
- "Specify whether to have horizontal scroll bars, and on which side.
-To set this variable in a Lisp program, use `set-horizontal-scroll-bar-mode'
-to make it take real effect.
-Setting the variable with a customization buffer also takes effect."
- :type '(choice (const :tag "none (nil)" nil)
- (const t))
- :group 'frames
- ;; The default value for :initialize would try to use :set
- ;; when processing the file in cus-dep.el.
- :initialize 'custom-initialize-default
- :set (lambda (_sym val) (set-horizontal-scroll-bar-mode val)))
-
;; We just set scroll-bar-mode, but that was the default.
;; If it is set again, that is for real.
(setq scroll-bar-mode-explicit t)
-(setq horizontal-scroll-bar-mode-explicit t)
(defun get-scroll-bar-mode ()
(declare (gv-setter set-scroll-bar-mode))
scroll-bar-mode)
-(defun get-horizontal-scroll-bar-mode ()
- (declare (gv-setter set-horizontal-scroll-bar-mode))
- horizontal-scroll-bar-mode)
-
(define-minor-mode scroll-bar-mode
"Toggle vertical scroll bars on all frames (Scroll Bar mode).
With a prefix argument ARG, enable Scroll Bar mode if ARG is
@@ -187,10 +152,17 @@
This command applies to all frames that exist and frames to be
created in the future."
- :variable ((get-horizontal-scroll-bar-mode)
- . (lambda (v) (set-horizontal-scroll-bar-mode
- (if v (or previous-scroll-bar-mode
- default-frame-horizontal-scroll-bars))))))
+ :init-value nil
+ :global t
+ :group 'frames
+ (dolist (frame (frame-list))
+ (set-frame-parameter
+ frame 'horizontal-scroll-bars horizontal-scroll-bar-mode))
+ ;; Handle `default-frame-alist' entry.
+ (setq default-frame-alist
+ (cons (cons 'horizontal-scroll-bars horizontal-scroll-bar-mode)
+ (assq-delete-all 'horizontal-scroll-bars
+ default-frame-alist))))
(defun toggle-scroll-bar (arg)
"Toggle whether or not the selected frame has vertical scroll bars.
@@ -209,22 +181,6 @@
(list (cons 'vertical-scroll-bars
(if (> arg 0)
(or scroll-bar-mode default-frame-scroll-bars))))))
-
-(defun toggle-horizontal-scroll-bar (arg)
- "Toggle whether or not the selected frame has horizontal scroll bars.
-With arg, turn horizontal scroll bars on if and only if arg is positive."
- (interactive "P")
- (if (null arg)
- (setq arg
- (if (cdr (assq 'horizontal-scroll-bars
- (frame-parameters (selected-frame))))
- -1 1))
- (setq arg (prefix-numeric-value arg)))
- (modify-frame-parameters
- (selected-frame)
- (list (cons 'horizontal-scroll-bars
- (if (> arg 0)
- (or horizontal-scroll-bar-mode
default-frame-horizontal-scroll-bars))))))
;;;; Buffer navigation using the scroll bar.
@@ -412,6 +368,7 @@
;;; Tookit scroll bars.
(defun scroll-bar-toolkit-scroll (event)
+ "Handle event EVENT on vertical scroll bar."
(interactive "e")
(let* ((end-position (event-end event))
(window (nth 0 end-position))
@@ -453,6 +410,7 @@
(setq point-before-scroll before-scroll))))))
(defun scroll-bar-toolkit-horizontal-scroll (event)
+ "Handle event EVENT on horizontal scroll bar."
(interactive "e")
(let* ((end-position (event-end event))
(window (nth 0 end-position))
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2014-09-03 04:21:40 +0000
+++ b/src/ChangeLog 2014-09-03 15:10:29 +0000
@@ -1,3 +1,13 @@
+2014-09-03 Martin Rudalics <address@hidden>
+
+ * buffer.c (scroll-bar-height): Fix typo in doc-string.
+ * frame.c (Vdefault_frame_horizontal_scroll_bars): Remove
+ variable.
+ * nsfns.m (Fx_create_frame):
+ * w32fns.c (Fx_create_frame):
+ * xfns.c (Fx_create_frame): Default horizontal scroll bars to
+ nil.
+
2014-09-03 Eli Zaretskii <address@hidden>
* dispnew.c (buffer_posn_from_coords): Fix an off-by-one error in
=== modified file 'src/buffer.c'
--- a/src/buffer.c 2014-09-02 18:05:00 +0000
+++ b/src/buffer.c 2014-09-03 15:10:29 +0000
@@ -5919,7 +5919,7 @@
DEFVAR_PER_BUFFER ("scroll-bar-height", &BVAR (current_buffer,
scroll_bar_height),
Qintegerp,
doc: /* Height of this buffer's scroll bars in pixels.
-A value of nil means to use the scroll bar heiht from the window's frame. */);
+A value of nil means to use the scroll bar height from the window's frame.
*/);
DEFVAR_PER_BUFFER ("vertical-scroll-bar", &BVAR (current_buffer,
vertical_scroll_bar_type),
Qvertical_scroll_bar,
=== modified file 'src/frame.c'
--- a/src/frame.c 2014-08-12 09:47:27 +0000
+++ b/src/frame.c 2014-09-03 15:10:29 +0000
@@ -4872,16 +4872,6 @@
Vdefault_frame_scroll_bars = Qnil;
#endif
- DEFVAR_LISP ("default-frame-horizontal-scroll-bars",
Vdefault_frame_horizontal_scroll_bars,
- doc: /* Default value for horizontal scroll bars on this
window-system. */);
-#if (defined (HAVE_WINDOW_SYSTEM) \
- && ((defined (USE_TOOLKIT_SCROLL_BARS) && !defined (HAVE_NS)) \
- || defined (HAVE_NTGUI)))
- Vdefault_frame_horizontal_scroll_bars = Qt;
-#else
- Vdefault_frame_horizontal_scroll_bars = Qnil;
-#endif
-
DEFVAR_BOOL ("scroll-bar-adjust-thumb-portion",
scroll_bar_adjust_thumb_portion_p,
doc: /* Adjust thumb for overscrolling for Gtk+ and MOTIF.
=== modified file 'src/nsfns.m'
--- a/src/nsfns.m 2014-08-11 13:16:31 +0000
+++ b/src/nsfns.m 2014-09-03 15:10:29 +0000
@@ -1244,7 +1244,7 @@
"verticalScrollBars", "VerticalScrollBars",
RES_TYPE_SYMBOL);
}
- x_default_parameter (f, parms, Qhorizontal_scroll_bars, Qt,
+ x_default_parameter (f, parms, Qhorizontal_scroll_bars, Qnil,
"horizontalScrollBars", "HorizontalScrollBars",
RES_TYPE_SYMBOL);
x_default_parameter (f, parms, Qforeground_color, build_string ("Black"),
=== modified file 'src/w32fns.c'
--- a/src/w32fns.c 2014-07-27 13:21:30 +0000
+++ b/src/w32fns.c 2014-09-03 15:10:29 +0000
@@ -4569,7 +4569,7 @@
NULL, NULL, RES_TYPE_NUMBER);
x_default_parameter (f, parameters, Qvertical_scroll_bars, Qright,
"verticalScrollBars", "ScrollBars", RES_TYPE_SYMBOL);
- x_default_parameter (f, parameters, Qhorizontal_scroll_bars, Qbottom,
+ x_default_parameter (f, parameters, Qhorizontal_scroll_bars, Qnil,
"horizontalScrollBars", "ScrollBars", RES_TYPE_SYMBOL);
/* Also do the stuff which must be set before the window exists. */
=== modified file 'src/xfns.c'
--- a/src/xfns.c 2014-08-03 20:34:33 +0000
+++ b/src/xfns.c 2014-09-03 15:10:29 +0000
@@ -3112,15 +3112,9 @@
#endif
"verticalScrollBars", "ScrollBars",
RES_TYPE_SYMBOL);
- x_default_parameter (f, parms, Qhorizontal_scroll_bars,
-#if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS)
- Qt,
-#else
- Qnil,
-#endif
+ x_default_parameter (f, parms, Qhorizontal_scroll_bars, Qnil,
"horizontalScrollBars", "ScrollBars",
RES_TYPE_SYMBOL);
-
/* Also do the stuff which must be set before the window exists. */
x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
"foreground", "Foreground", RES_TYPE_STRING);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r117810: Clean up initialization and customization of horizontal scroll bars.,
Martin Rudalics <=