emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/visual-fill-column 6fa9e7912a 127/137: Do not set `split-w


From: ELPA Syncer
Subject: [nongnu] elpa/visual-fill-column 6fa9e7912a 127/137: Do not set `split-window-preferred-function` by default.
Date: Sun, 2 Jan 2022 22:59:20 -0500 (EST)

branch: elpa/visual-fill-column
commit 6fa9e7912af412533aec0da8b8f62c227f9f3f54
Author: Joost Kremers <joostkremers@fastmail.fm>
Commit: Joost Kremers <joostkremers@fastmail.fm>

    Do not set `split-window-preferred-function` by default.
    
    Setting this option overrides any user setting, which should be avoided.
---
 README.md             |  8 +++++---
 visual-fill-column.el | 15 +++++++--------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/README.md b/README.md
index 1ea0821351..404267c0c6 100644
--- a/README.md
+++ b/README.md
@@ -39,11 +39,13 @@ Widening the margin normally causes the fringes to be 
pushed inward. Since this
 
 ## Splitting a Window ##
 
-Emacs won’t vertically split a window (i.e., into two side-by-side windows) 
that has wide margins. As a result, displaying buffers such as `*Help*` 
buffers, `*Completion*` buffers, etc., won’t split a window vertically, even if 
there appears to be enough space for a vertical split. This is technically not 
problematic, but it may be undesirable from a user's point of view. To remedy 
this, `visual-fill-column-mode` sets the option 
`split-window-preferred-function` to `visual-fill-column-sp [...]
+Emacs won’t vertically split a window (i.e., into two side-by-side windows) 
that has wide margins. As a result, displaying buffers such as `*Help*` 
buffers, `*Completion*` buffers, etc., won’t split a window vertically, even if 
there appears to be enough space for a vertical split. This is technically not 
problematic, but it may be undesirable from a user's point of view. To remedy 
this, you can set the option `visual-fill-column-enable-sensible-window-split`. 
When this option is set, th [...]
 
-You can set the option `visual-fill-column-inhibit-sensible-window-split` to 
inhibit this and use the default function `split-window-sensibly` or another 
custom function.
+This option does not affect the ability to split windows manually. Even if you 
keep `visual-fill-column-enable-sensible-window-split` unset, you can still 
split a window into two side-by-side windows by invoking e.g., 
`split-window-right` (`C-x 3`).
 
-Note that this option does not affect the ability to split windows manually. 
Even if you set `visual-fill-column-inhibit-sensible-window-split`, you can 
still split a window into two side-by-side windows by invoking e.g., 
`split-window-right` (`C-x 3`).
+Note that this option replaces the option 
`visual-fill-column-inhibit-sensible-window-split`. This option was unset by 
default, causing `split-window-preferred-function` to be set, which had the 
unfortunate side effect that it would overwrite a user-defined setting for that 
variable without warning.
+
+To get the old behaviour back, simply customise the option 
`visual-fill-column-enable-sensible-window-split` or set it to `t` in your init 
file.
 
 
 ## Adjusting Text Size ##
diff --git a/visual-fill-column.el b/visual-fill-column.el
index dcc2393a3d..a6b1db11ad 100644
--- a/visual-fill-column.el
+++ b/visual-fill-column.el
@@ -8,7 +8,7 @@
 ;; Maintainer: Joost Kremers <joostkremers@fastmail.fm>
 ;; URL: https://github.com/joostkremers/visual-fill-column
 ;; Created: 2015
-;; Version: 2.3
+;; Version: 2.4
 ;; Package-Requires: ((emacs "25.1"))
 
 ;; This file is NOT part of GNU Emacs.
@@ -79,13 +79,12 @@ otherwise reduce the actual size of the text area."
 (make-variable-buffer-local 'visual-fill-column-center-text)
 (put 'visual-fill-column-center-text 'safe-local-variable 'symbolp)
 
-(defcustom visual-fill-column-inhibit-sensible-window-split nil
-  "Do not set `split-window-preferred-function' to allow vertical window 
splits.
-By default, `split-window-preferred-function' is set to
+(defcustom visual-fill-column-enable-sensible-window-split nil
+  "Set `split-window-preferred-function' so as to allow vertical window splits.
+If this option is set, `visual-fill-column' sets the variable
+`split-window-preferred-function' to
 `visual-fill-column-split-window-sensibly', in order to allow
-`display-buffer' to split windows in two side-by-side windows.
-Unset this option if you wish to use the default or a custom
-function for `split-window-sensibly'."
+`display-buffer' to split windows in two side-by-side windows."
   :group 'visual-fill-column
   :type '(choice (const :tag "Allow vertical window split" nil)
                  (const :tag "Use standard window split" t)))
@@ -152,7 +151,7 @@ that actually visit a file."
   "Set up `visual-fill-column-mode' for the current buffer."
   (add-hook 'window-configuration-change-hook 
#'visual-fill-column--adjust-window 'append 'local)
 
-  (when (not visual-fill-column-inhibit-sensible-window-split)
+  (when visual-fill-column-enable-sensible-window-split
     ;; Note that `split-window-preferred-function' is not reset to its original
     ;; value when `visual-fill-column-mode' is disabled, because it may still 
be
     ;; enabled in other buffers.  When `visual-fill-column-mode' is disabled,



reply via email to

[Prev in Thread] Current Thread [Next in Thread]