[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/visual-fill-column 9863702b53 015/137: Use `fringes-outsid
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/visual-fill-column 9863702b53 015/137: Use `fringes-outside-margins` instead of disabling the fringes. |
Date: |
Sun, 2 Jan 2022 22:59:08 -0500 (EST) |
branch: elpa/visual-fill-column
commit 9863702b53ff6738bd2a3f71295957b084e72831
Author: Joost Kremers <joostkremers@fastmail.fm>
Commit: Joost Kremers <joostkremers@fastmail.fm>
Use `fringes-outside-margins` instead of disabling the fringes.
---
README.md | 4 ++--
visual-fill-column.el | 28 ++++++++--------------------
2 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/README.md b/README.md
index 86985e020b..adfa713b84 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ However, `visual-fill-column-mode` is not tied to
`visual-line-mode`: it is perf
`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`. 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 causes the fringe to be pushed inward. Since the fringe is
visible, this has a somewhat disturbing effect, because it looks like there’s
another window to the left, even though there isn’t. For this reason, the left
fringe is disabled by default.
+Widening the margin causes the fringe to be pushed inward. For this reason,
the fringes are placed outside the margins by setting the variable
`fringes-outside-margins` to `t`.
## Options ##
@@ -25,6 +25,6 @@ Widening the margin causes the fringe to be pushed inward.
Since the fringe is v
`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-disable-fringe`: if set to `t`, the left fringe is
disabled. Note that if `visual-fill-column-center-text` is set to `t`, both the
left and right fringes are disabled.
+`visual-fill-column-fringes-outside-margins`: if set to `t`, put the fringes
outside the margins.
All three options are buffer-local, so the values you set through Customize
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/visual-fill-column.el b/visual-fill-column.el
index 099bee3d1b..bd014be6ce 100644
--- a/visual-fill-column.el
+++ b/visual-fill-column.el
@@ -6,7 +6,7 @@
;; Author: Joost Kremers <joostkremers@fastmail.fm>
;; Maintainer: Joost Kremers <joostkremers@fastmail.fm>
;; Created: 2015
-;; Version: 1.2
+;; Version: 1.3
;; Package-Requires: ((emacs "24.3"))
;; This file is NOT part of GNU Emacs.
@@ -48,13 +48,13 @@ this option is set to a value, it is used instead."
(make-variable-buffer-local 'visual-fill-column-width)
(put 'visual-fill-column-width 'safe-local-variable 'numberp)
-(defcustom visual-fill-column-disable-fringe t
- "Disable the fringe when `visual-fill-column-mode' is active."
+(defcustom visual-fill-column-fringes-outside-margins t
+ "Put the fringes outside the margins."
:group 'visual-fill-column
- :type '(choice (const :tag "Do not disable the fringes" nil)
- (const :tag "Disable the fringes" t)))
-(make-variable-buffer-local 'visual-fill-column-disable-fringe)
-(put 'visual-fill-column-disable-fringe 'safe-local-variable 'symbolp)
+ :type '(choice (const :tag "Put fringes outside the margins" t)
+ (const :tag "Keep the fringes inside the margins" nil)))
+(make-variable-buffer-local 'visual-fill-column-fringes-outside-margins)
+(put 'visual-fill-column-fringes-outside-margins 'safe-local-variable 'symbolp)
(defcustom visual-fill-column-center-text nil
"If set, center the text area in the window."
@@ -98,21 +98,9 @@ in which `visual-line-mode' is active as well."
(defun visual-fill-column--adjust-window ()
"Adjust the window margins and fringes."
- (visual-fill-column--set-fringes)
+ (setq fringes-outside-margins visual-fill-column-fringes-outside-margins)
(visual-fill-column--set-margins))
-(defun visual-fill-column--set-fringes ()
- "Set the fringes for the current window."
- (when visual-fill-column-disable-fringe
- ;; the left fringe is only disabled if the text is centered
- (let ((left (if visual-fill-column-center-text 0 nil))
- (right 0))
- ;; swap left & right fringes in explicitly R2L buffers
- (when (eq bidi-paragraph-direction 'right-to-left)
- (setq right left)
- (setq left 0))
- (set-window-fringes (selected-window) left right))))
-
(defun visual-fill-column--set-margins ()
"Set window margins for the current window."
;; calculate left & right margins
- [nongnu] elpa/visual-fill-column d9d4d78914 065/137: Enable scrolling in margins, (continued)
- [nongnu] elpa/visual-fill-column d9d4d78914 065/137: Enable scrolling in margins, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column a969db2eb3 042/137: mark visual-fill-column-split-window-sensibly as autoload, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 543ef21c3a 080/137: Fix README II, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column a84e36e483 071/137: Update copyright date., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 62ccf200cf 086/137: Small change to README.md, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column afa1615420 082/137: Fix README IV, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 141eaf1d1b 111/137: Update version number., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column f7eb2139ea 001/137: Initial commit, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 1bb832f3a4 011/137: Change titel of README, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column a20db331f2 014/137: Fix error in `visual-fill-column-disable-fringe'., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 9863702b53 015/137: Use `fringes-outside-margins` instead of disabling the fringes.,
ELPA Syncer <=
- [nongnu] elpa/visual-fill-column db1ca8f337 016/137: Use set-window-fringes to set fringes outside the margins, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 60d8a031d5 017/137: Do not use `window-total-width'., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 8b98476819 018/137: Update README.md, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 5908ad2422 019/137: Use package name in installation instructions, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 7ec32c974a 027/137: Some optical code improvements., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 6e6b71177d 025/137: Make calls to `add-hook' a bit more self-documenting., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 4223f9b6f9 034/137: Add PIXELWISE argument to visual-fill-column-split-window, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 62ecc38450 036/137: Make arguments of `visual-fill-column--split-window' optional., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 54b941caa6 057/137: Fix code quote in README., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 4b903a0adb 002/137: Implement visual-fill-column, ELPA Syncer, 2022/01/02