commit 19f71dcdc47d9b1ee0a3982391f1a2332fbc765e (HEAD, refs/remotes/origin/master) Author: Martin Rudalics Date: Sat Jul 4 10:13:22 2015 +0200 Have `compilation-set-window' use right window for getting fringes (Bug#20829) * lisp/progmodes/compile.el (compilation-set-window): Take `window-fringes' from argument window. (Bug#20829) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 37d3fe8..9a44335 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -2521,9 +2521,9 @@ displays at the top of the window; there is no arrow." (- 1 compilation-context-lines)) (point))) ;; If there is no left fringe. - (if (equal (car (window-fringes)) 0) - (set-window-start w (save-excursion - (goto-char mk) + (when (equal (car (window-fringes w)) 0) + (set-window-start w (save-excursion + (goto-char mk) (beginning-of-line 1) (point))))) (set-window-point w mk)) commit fc4151f285ffb6939ada39d342b885eb5f23543d Author: Glenn Morris Date: Fri Jul 3 17:25:51 2015 -0700 Update eieio tests for recent eieio-core change. * test/automated/eieio-test-persist.el (persist-test-save-and-compare): * test/automated/eieio-tests.el (eieio-test-32-slot-attribute-override-2): Replace the deleted eieio--class-v with cl--find-class. diff --git a/test/automated/eieio-test-persist.el b/test/automated/eieio-test-persist.el index 6710ead..9b21b73 100644 --- a/test/automated/eieio-test-persist.el +++ b/test/automated/eieio-test-persist.el @@ -48,7 +48,7 @@ This is usually a symbol that starts with `:'." (let* ((file (oref original file)) (class (eieio-object-class original)) (fromdisk (eieio-persistent-read file class)) - (cv (eieio--class-v class)) + (cv (cl--find-class class)) (slots (eieio--class-slots cv)) ) (unless (object-of-class-p fromdisk class) @@ -62,7 +62,7 @@ This is usually a symbol that starts with `:'." (origvalue (eieio-oref original oneslot)) (fromdiskvalue (eieio-oref fromdisk oneslot)) (initarg-p (eieio--attribute-to-initarg - (eieio--class-v class) oneslot)) + (cl--find-class class) oneslot)) ) (if initarg-p diff --git a/test/automated/eieio-tests.el b/test/automated/eieio-tests.el index 01131d8..5709a1b 100644 --- a/test/automated/eieio-tests.el +++ b/test/automated/eieio-tests.el @@ -803,7 +803,7 @@ Subclasses to override slot attributes.") (should (eq (oref-default 'slotattr-class-ok initform) 'no-init))) (ert-deftest eieio-test-32-slot-attribute-override-2 () - (let* ((cv (eieio--class-v 'slotattr-ok)) + (let* ((cv (cl--find-class 'slotattr-ok)) (slots (eieio--class-slots cv)) (args (eieio--class-initarg-tuples cv))) ;; :initarg should override for subclass commit e3c4cd0074344fe92e7df3e59d1bbdca969252a2 Author: Martin Rudalics Date: Fri Jul 3 15:15:51 2015 +0200 Fix some issues with `window-divider-mode' * lisp/frame.el (window-divider-default-places): New option. (window-divider-mode): Remove option. (window-divider-mode): Make it a "regular" minor mode. (window-divider-width-valid-p): Drop frame- prefix. (window-divider-mode-apply): New argument ENABLE. Drop frame- prefix. Handle `window-divider-default-places'. (frame--window-divider-mode-set-and-apply): Remove. (window-divider-default-bottom-width) (window-divider-default-right-width): Drop :group entries. * lisp/menu-bar.el (menu-bar-bottom-and-right-window-divider) (menu-bar-right-window-divider, menu-bar-bottom-window-divider) (menu-bar-no-window-divider): Set `window-divider-default-places' and call `window-divider-mode'. * doc/emacs/frames.texi (Window Dividers): Document `window-divider-default-places'. diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 8d24fc5..4a193dd 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -1011,13 +1011,16 @@ scroll bar height, change the @code{scroll-bar-height} frame parameter separate windows visually. Window dividers are bars that can be dragged with the mouse, thus allowing to easily resize adjacent windows. -@vindex window-divider-mode - To control the display of window dividers, customize the variable -@code{window-divider-mode}. Its value should be either +@findex window-divider-mode + To toggle the display of window dividers, use the command @kbd{M-x +window-divider-mode}. + +@vindex window-divider-default-places + To customize where dividers should appear, use the option +@code{window-divider-default-places}. Its value should be either @code{bottom-only} (to show dividers only on the bottom of windows), -@code{right-only} (to show dividers only on the right of windows), -@code{t} (to show them on the bottom and on the right) or @code{nil} (to -disable window dividers). +@code{right-only} (to show dividers only on the right of windows), or +@code{t} (to show them on the bottom and on the right). @vindex window-divider-default-bottom-width @vindex window-divider-default-right-width diff --git a/lisp/frame.el b/lisp/frame.el index cd6823a..1177a00 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1756,48 +1756,29 @@ left untouched. FRAME nil or omitted means use the selected frame." :group 'frames :group 'windows) -(defvar frame--window-divider-previous-mode nil - "Previous value of `window-divider-mode'. -This is the value seen when `window-divider-mode' was switched -off the last time. It's reused when `window-divider-mode' is -switched on again.") - -(defcustom window-divider-mode nil - "Specify whether to display window dividers and where. -Possible values are nil (no dividers), `bottom-only' (dividers on -the bottom of each window only), `right-only' (dividers on the -right of each window only), and t (dividers on the bottom and on -the right of each window)." - :type '(choice (const :tag "None (nil)" nil) - (const :tag "Bottom only" bottom-only) +(defcustom window-divider-default-places 'right-only + "Default positions of window dividers. +Possible values are `bottom-only' (dividers on the bottom of each +window only), `right-only' (dividers on the right of each window +only), and t (dividers on the bottom and on the right of each +window). The default is `right-only'. + +The value takes effect if and only if dividers are enabled by +`window-divider-mode'. + +To position dividers on frames individually, use the frame +parameters `bottom-divider-width' and `right-divider-width'." + :type '(choice (const :tag "Bottom only" bottom-only) (const :tag "Right only" right-only) (const :tag "Bottom and right" t)) :initialize 'custom-initialize-default - :set (lambda (_symbol value) - (frame--window-divider-mode-set-and-apply value)) - :group 'window-divider + :set (lambda (symbol value) + (set-default symbol value) + (when window-divider-mode + (window-divider-mode-apply t))) :version "25.1") -(define-minor-mode window-divider-mode - "Display dividers between windows (Window Divider mode). -With a prefix argument ARG, enable Window Divider mode if ARG is -positive, and disable it otherwise. If called from Lisp, enable -the mode if ARG is omitted or nil. - -The options `window-divider-default-bottom-width' and -`window-divider-default-right-width' allow to customize the width -of dividers displayed by this mode." - :group 'window-divider - :global t - :variable (window-divider-mode - . (lambda (value) - (frame--window-divider-mode-set-and-apply - (and value - (or frame--window-divider-previous-mode - (default-value 'window-divider-mode) - 'right-only)))))) - -(defun frame-window-divider-width-valid-p (value) +(defun window-divider-width-valid-p (value) "Return non-nil if VALUE is a positive number." (and (numberp value) (> value 0))) @@ -1809,14 +1790,13 @@ dividers are displayed by `window-divider-mode'. To adjust bottom dividers for frames individually, use the frame parameter `bottom-divider-width'." :type '(restricted-sexp - :tag "Default bottom divider width" + :tag "Default width of bottom dividers" :match-alternatives (frame-window-divider-width-valid-p)) - :group 'window-divider :initialize 'custom-initialize-default :set (lambda (symbol value) (set-default symbol value) - (when window-divider-mode - (frame--window-divider-mode-apply))) + (when window-divider-mode + (window-divider-mode-apply t))) :version "25.1") (defcustom window-divider-default-right-width 6 @@ -1827,22 +1807,27 @@ dividers are displayed by `window-divider-mode'. To adjust right dividers for frames individually, use the frame parameter `right-divider-width'." :type '(restricted-sexp - :tag "Default right divider width" + :tag "Default width of right dividers" :match-alternatives (frame-window-divider-width-valid-p)) - :group 'window-divider :initialize 'custom-initialize-default :set (lambda (symbol value) (set-default symbol value) - (when window-divider-mode - (frame--window-divider-mode-apply))) + (when window-divider-mode + (window-divider-mode-apply t))) :version "25.1") -(defun frame--window-divider-mode-apply () - "Apply window divider widths." - (let ((bottom (if (memq window-divider-mode '(bottom-only t)) +(defun window-divider-mode-apply (enable) + "Apply window divider places and widths to all frames. +If ENABLE is nil, apply default places and widths. Else reset +all divider widths to zero." + (let ((bottom (if (and enable + (memq window-divider-default-places + '(bottom-only t))) window-divider-default-bottom-width 0)) - (right (if (memq window-divider-mode '(right-only t)) + (right (if (and enable + (memq window-divider-default-places + '(right-only t))) window-divider-default-right-width 0))) (modify-all-frames-parameters @@ -1865,18 +1850,20 @@ parameter `right-divider-width'." (cons 'right-divider-width right) default-frame-alist))))) -(defun frame--window-divider-mode-set-and-apply (value) - "Set window divider mode to VALUE and apply widths." - (unless value - ;; Remember current mode. - (setq frame--window-divider-previous-mode window-divider-mode)) - (set-default 'window-divider-mode value) - ;; Pacify customize rigmarole. - (put 'window-divider-mode 'customized-value - (if (memq value '(nil t)) - (list value) - (list (list 'quote value)))) - (frame--window-divider-mode-apply)) +(define-minor-mode window-divider-mode + "Display dividers between windows (Window Divider mode). +With a prefix argument ARG, enable Window Divider mode if ARG is +positive, and disable it otherwise. If called from Lisp, enable +the mode if ARG is omitted or nil. + +The option `window-divider-default-places' specifies on which +side of a window dividers are displayed. The options +`window-divider-default-bottom-width' and +`window-divider-default-right-width' specify their respective +widths." + :group 'window-divider + :global t + (window-divider-mode-apply window-divider-mode)) ;; Blinking cursor diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 5a69084..72c05fe 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -719,22 +719,25 @@ by \"Save Options\" in Custom buffers.") (defun menu-bar-bottom-and-right-window-divider () "Display dividers on the bottom and right of each window." (interactive) - (customize-set-variable 'window-divider-mode t)) + (customize-set-variable 'window-divider-default-places t) + (window-divider-mode 1)) (defun menu-bar-right-window-divider () "Display dividers only on the right of each window." (interactive) - (customize-set-variable 'window-divider-mode 'right-only)) + (customize-set-variable 'window-divider-default-places 'right-only) + (window-divider-mode 1)) (defun menu-bar-bottom-window-divider () "Display dividers only at the bottom of each window." (interactive) - (customize-set-variable 'window-divider-mode 'bottom-only)) + (customize-set-variable 'window-divider-default-places 'bottom-only) + (window-divider-mode 1)) (defun menu-bar-no-window-divider () "Do not display window dividers." (interactive) - (customize-set-variable 'window-divider-mode nil)) + (window-divider-mode -1)) ;; For the radio buttons below we check whether the respective dividers ;; are displayed on the selected frame. This is not fully congruent @@ -753,10 +756,10 @@ by \"Save Options\" in Custom buffers.") :help "Display window divider on the bottom and right of each window" :visible (memq (window-system) '(x w32)) :button (:radio - . (and (frame-window-divider-width-valid-p + . (and (window-divider-width-valid-p (cdr (assq 'bottom-divider-width (frame-parameters)))) - (frame-window-divider-width-valid-p + (window-divider-width-valid-p (cdr (assq 'right-divider-width (frame-parameters)))))))) (bindings--define-key menu [right-only] @@ -765,10 +768,10 @@ by \"Save Options\" in Custom buffers.") :help "Display window divider on the right of each window only" :visible (memq (window-system) '(x w32)) :button (:radio - . (and (not (frame-window-divider-width-valid-p + . (and (not (window-divider-width-valid-p (cdr (assq 'bottom-divider-width (frame-parameters))))) - (frame-window-divider-width-valid-p + (window-divider-width-valid-p (cdr (assq 'right-divider-width (frame-parameters)))))))) (bindings--define-key menu [bottom-only] @@ -777,10 +780,10 @@ by \"Save Options\" in Custom buffers.") :help "Display window divider on the bottom of each window only" :visible (memq (window-system) '(x w32)) :button (:radio - . (and (frame-window-divider-width-valid-p + . (and (window-divider-width-valid-p (cdr (assq 'bottom-divider-width (frame-parameters)))) - (not (frame-window-divider-width-valid-p + (not (window-divider-width-valid-p (cdr (assq 'right-divider-width (frame-parameters))))))))) (bindings--define-key menu [no-divider] @@ -789,10 +792,10 @@ by \"Save Options\" in Custom buffers.") :help "Do not display window dividers" :visible (memq (window-system) '(x w32)) :button (:radio - . (and (not (frame-window-divider-width-valid-p + . (and (not (window-divider-width-valid-p (cdr (assq 'bottom-divider-width (frame-parameters))))) - (not (frame-window-divider-width-valid-p + (not (window-divider-width-valid-p (cdr (assq 'right-divider-width (frame-parameters))))))))) menu))