[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/visual-fill-column 78a21e1ee2 113/137: Revert "Add `visual
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/visual-fill-column 78a21e1ee2 113/137: Revert "Add `visual-fill-column-offset`." |
Date: |
Sun, 2 Jan 2022 22:59:18 -0500 (EST) |
branch: elpa/visual-fill-column
commit 78a21e1ee2ae3596af636fd0ed8e8b58da38f156
Author: Joost Kremers <joostkremers@fastmail.fm>
Commit: Joost Kremers <joostkremers@fastmail.fm>
Revert "Add `visual-fill-column-offset`."
This reverts commit 99d78162d9a524340607c11500ddc8cf6607d3c0.
---
README.md | 4 +---
test/visual-fill-column-test.el | 13 -------------
visual-fill-column.el | 42 +++++------------------------------------
3 files changed, 6 insertions(+), 53 deletions(-)
diff --git a/README.md b/README.md
index 46da90a437..a37d96e106 100644
--- a/README.md
+++ b/README.md
@@ -32,7 +32,7 @@ Note that while `visual-fill-column-mode` was written with
the purpose of wrappi
`visual-fill-column-mode` works by widening the right window margin. This
reduces the area that is available for text display, creating the appearance
that the text is wrapped at `fill-column`. The amount by which the right margin
is widened depends on the window width and is automatically adjusted when the
window’s width changes (e.g., when the window is split in two side-by-side
windows).
-In buffers that are explicitly right-to-left (i.e., those where
`bidi-paragraph-direction` is set to `right-to-left`), the left margin is
expanded, so that the text appears at the window’s right side, and the meaning
of `visual-fill-column-offset` is reversed.
+In buffers that are explicitly right-to-left (i.e., those where
`bidi-paragraph-direction` is set to `right-to-left`), the left margin is
expanded, so that the text appears at the window’s right side.
Widening the margin normally causes the fringes to be pushed inward. Since
this is visually less appealing, the fringes are placed outside the margins.
You can undo this by setting the variable
`visual-fill-column-fringes-outside-margins` to `nil`.
@@ -63,8 +63,6 @@ The customisation group `visual-fill-column` has four options
(beside `global-vi
`visual-fill-column-center-text`: if set to `t`, centre the text area in the
window. By default, the text is displayed at the window’s (left) edge,
mimicking the effect of `fill-column`.
-`visual-fill-column-offset`: offset the text area by a certain number of
columns. The value can be positive (offset to the left) or negative (offset to
the right). A negative value only makes sense if
`visual-fill-column-center-text` is set.
-
`visual-fill-column-fringes-outside-margins`: if set to `t`, put the fringes
outside the margins.
These three options are buffer-local, so the values you set in your init file
are default values. They can also be set in mode hooks or directory or file
local variables in order to customise particular files or file types.
diff --git a/test/visual-fill-column-test.el b/test/visual-fill-column-test.el
index bbd4071a25..0d51b61457 100644
--- a/test/visual-fill-column-test.el
+++ b/test/visual-fill-column-test.el
@@ -1,16 +1,3 @@
;;; visual-fill-column-test.el --- Tests for visual-fill-column
-;;; Commentary:
-;; Tests for the visual-fill-column package.
-
-;;; Code:
-
-(require 'visual-fill-column)
-
-(ert-deftest visual-fill-column--calculate-margin-shift ()
- (should (equal (visual-fill-column--calculate-margin-shift 0 80 4) '(4 .
76)))
- (should (equal (visual-fill-column--calculate-margin-shift 10 80 -4) '(6 .
84)))
- (should (equal (visual-fill-column--calculate-margin-shift 0 80 -4) '(0 .
80)))
- (should (equal (visual-fill-column--calculate-margin-shift 80 0 4) '(80 .
0))))
-
;;; visual-fill-column-test.el ends here
diff --git a/visual-fill-column.el b/visual-fill-column.el
index 0b96498f5a..950951e79f 100644
--- a/visual-fill-column.el
+++ b/visual-fill-column.el
@@ -66,15 +66,6 @@ this option is set to a value, it is used instead."
(make-variable-buffer-local 'visual-fill-column-center-text)
(put 'visual-fill-column-center-text 'safe-local-variable 'symbolp)
-(defcustom visual-fill-column-offset 0
- "Number of columns to shift the text area.
-The text area is shifted to the right (positive value) or
-left (negative value). A negative value only makes sense if
-`visual-fill-column-center-text' is set."
- :group 'visual-fill-column
- :type '(integer :tag "Offset (in columns)"))
-(put 'visual-fill-column-center-text 'safe-local-variable 'integerp)
-
(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
@@ -278,24 +269,6 @@ selected window. The return value is scaled to account for
0))
(float scale)))))
-(defun visual-fill-column--calculate-margin-shift (left right offset)
- "Calculate new margins for LEFT and RIGHT based on OFFSET.
-OFFSET is added to LEFT and subtracted from RIGHT. If either
-value then becomes less than zero, it is set to zero and the
-other value is compensated for the difference.
-
-Return a cons cell of the new left and right margins."
- (let ((shifted-left (+ left offset))
- (shifted-right (- right offset)))
- (cond
- ((< shifted-left 0)
- (setq shifted-right (+ shifted-right shifted-left))
- (setq shifted-left 0))
- ((< shifted-right 0)
- (setq shifted-left (+ shifted-left shifted-right))
- (setq shifted-right 0)))
- (cons shifted-left shifted-right)))
-
(defun visual-fill-column--set-margins (window)
"Set window margins for WINDOW."
;; Calculate left & right margins.
@@ -310,16 +283,11 @@ Return a cons cell of the new left and right margins."
0))
(right (- margins left)))
- (if (/= visual-fill-column-offset 0)
- (let ((shift (visual-fill-column--calculate-margin-shift left right
visual-fill-column-offset)))
- (setq left (car shift)
- right (cdr shift))))
-
- ;; In an explicitly R2L buffer, swap left and right margins.
- (when (eq bidi-paragraph-direction 'right-to-left)
- (setq left (prog1
- right
- (setq right left))))
+ ;; put an explicitly R2L buffer on the right side of the window
+ (when (and (eq bidi-paragraph-direction 'right-to-left)
+ (= left 0))
+ (setq left right)
+ (setq right 0))
(set-window-margins window left right)))
- [nongnu] elpa/visual-fill-column e73f99e09f 104/137: Fix the values of `visual-fill-column-inhibit-sensible-window-split`., (continued)
- [nongnu] elpa/visual-fill-column e73f99e09f 104/137: Fix the values of `visual-fill-column-inhibit-sensible-window-split`., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 0c410828e0 101/137: Use `window-configuration-change-hook' in Emacs 27 as well., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column f833fb94ff 095/137: Use the window's previous margins as minimum margins., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column ff329c5ffd 105/137: Merge branch 'devel', ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 1da41f73a4 096/137: Use `window-size-change-functions`., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 9258eaf705 100/137: Resurrect `visual-fill-column-split-window'., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column ca98d4bb93 112/137: Revert "Make `visual-fill-column-offset` buffer-local.", ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 043867c469 108/137: Fix comment., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 5f5d816b5c 106/137: Correctly take width of line numbers into account., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 26cf5171ca 110/137: Make `visual-fill-column-offset` buffer-local., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 78a21e1ee2 113/137: Revert "Add `visual-fill-column-offset`.",
ELPA Syncer <=
- [nongnu] elpa/visual-fill-column 5b08b9ae9d 116/137: Add test for `visual-fill-column--add-extra-width`., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 46b7cb720f 120/137: Do not try to restore the margin width when disabling v-f-c-mode., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column ad76c1692e 115/137: Update doc string of `visual-fill-column--adjust-window`., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 2e877fabf1 125/137: Update doc string of `visual-fill-column-inhibit-sensible-window-split`., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 6854932d7f 126/137: Small fixes to README.md, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column a93dc5fc64 117/137: Do not set `visual-fill-column--min-margins` if already set., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 68784162d7 114/137: Add `visual-fill-column-extra-text-width`., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 7b8525757d 122/137: Remove `visual-fill-column--original-split-window-function`., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 06bb6157d1 124/137: Use `cond` instead of a series of `when`s., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column c1f6accd9e 121/137: Update version number to 2.3, ELPA Syncer, 2022/01/02