[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/visual-fill-column cf3e2bc632 137/137: Add option `visual-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/visual-fill-column cf3e2bc632 137/137: Add option `visual-fill-column-adjust-for-text-scale`. |
Date: |
Sun, 2 Jan 2022 22:59:30 -0500 (EST) |
branch: elpa/visual-fill-column
commit cf3e2bc632b68d54145c79beede85d3458a337de
Author: Joost Kremers <joostkremers@fastmail.fm>
Commit: Joost Kremers <joostkremers@fastmail.fm>
Add option `visual-fill-column-adjust-for-text-scale`.
This option controls whether the text scaling factor is taken into account
in
calculating the width of the margins.
See Github issue
[#54](https://github.com/joostkremers/visual-fill-column/issues/54) for
details.
---
README.md | 13 ++++++++++---
visual-fill-column.el | 12 +++++++++++-
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index bbfdedcd63..b3dbfc5631 100644
--- a/README.md
+++ b/README.md
@@ -71,10 +71,12 @@ Alternatively, you can advise the function
`text-size-adjust` with the function
(advice-add 'text-scale-adjust :after #'visual-fill-column-adjust)
+Note that this functionality is controlled by the option
`visual-fill-column-adjust-for-text-scale`. If this is set to `nil`, the
margins are not adjusted for the text size.
+
## Customisation ##
-The customisation group `visual-fill-column` has five options (beside
`global-visual-fill-column-mode`) that can be used to customise
`visual-fill-column`:
+The customisation group `visual-fill-column` has several options that can be
used to customise the package.
`visual-fill-column-width`: column at which to wrap lines. If set to `nil`
(the default), use the value of `fill-column` instead.
@@ -84,8 +86,13 @@ The customisation group `visual-fill-column` has five
options (beside `global-vi
`visual-fill-column-fringes-outside-margins`: if set to `t`, put the fringes
outside the margins. Widening the margin would normally cause the fringes to be
pushed inward, because by default, they appear between the margins and the
text. This effect may be visually less appealing, therefore,
`visual-fill-column-mode` places the fringes outside the margins. If you prefer
to have the fringes inside the margins, unset this option.
-These four 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.
+These 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.
+
+The following options apply to all buffers with `visual-fill-column-mode`
enabled:
+
+`visual-fill-column-inhibit-sensible-window-split` can be set to keep
`visual-fill-column-mode` from setting `split-window-preferred-function`, as
discussed above.
+
+`visual-fill-column-adjust-for-text-scale` determines whether text scaling is
taken into account when computing the width of the margins.
-The fifth option, `visual-fill-column-inhibit-sensible-window-split` can be
set to keep `visual-fill-column-mode` from setting
`split-window-preferred-function`, as discussed above.
`visual-fill-column-mode` also binds several mouse events for the left and
right margins, so that scrolling or clicking on the margins does what you'd
expect (rather than cause an "event not bound" error). If you wish to adjust
these bindings, you should do so in `visual-fill-column-mode-map`.
diff --git a/visual-fill-column.el b/visual-fill-column.el
index a36a5992eb..f5f22f99fb 100644
--- a/visual-fill-column.el
+++ b/visual-fill-column.el
@@ -95,6 +95,15 @@ If this option is set, `visual-fill-column' sets the variable
:type '(choice (const :tag "Allow vertical window split" nil)
(const :tag "Use standard window split" t)))
+(defcustom visual-fill-column-adjust-for-text-scale t
+ "Adjust the margins for text scaling.
+If set to t, the calculated margins are additionally adjusted for
+the text scale factor, so that the text is wrapped at
+`fill-column'."
+ :group 'visual-fill-column
+ :type '(choice (const :tag "Adjust margins for text scaling" t)
+ (const :tag "Do not adjust margins for text scaling" nil)))
+
(defvar visual-fill-column--use-split-window-parameter nil "If set, the window
parameter `split-window' is used.")
(defvar visual-fill-column--use-min-margins nil "If set, the window parameter
`min-margins' is used.")
@@ -273,7 +282,8 @@ and `text-scale-mode-step'."
(or window (setq window (selected-window)))
(let* ((margins (window-margins window))
(buffer (window-buffer window))
- (scale (if (and (boundp 'text-scale-mode-step)
+ (scale (if (and visual-fill-column-adjust-for-text-scale
+ (boundp 'text-scale-mode-step)
(boundp 'text-scale-mode-amount))
(with-current-buffer buffer
(expt text-scale-mode-step
- [nongnu] elpa/visual-fill-column 772d4b25ba 073/137: Merge pull request #38 from peterwvj/patch-1, (continued)
- [nongnu] elpa/visual-fill-column 772d4b25ba 073/137: Merge pull request #38 from peterwvj/patch-1, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column b1a91caac6 075/137: Merge pull request #9 from xuchunyang/patch-1, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 930c5b2c42 047/137: Add note about text size adjustments to README., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 159dcee48e 051/137: Make sure we only affect margins of buffers with v-f-c-mode enabled., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column bf262d9823 081/137: Fix README III, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 3bfeefa365 094/137: Use min-margins window parameter., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column f317adbb83 003/137: Write README.md, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 8aa3417784 109/137: Fix markup in the README., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 6fa9e7912a 127/137: Do not set `split-window-preferred-function` by default., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 3bd339520f 129/137: Add screenshot for centred text., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column cf3e2bc632 137/137: Add option `visual-fill-column-adjust-for-text-scale`.,
ELPA Syncer <=
- [nongnu] elpa/visual-fill-column 8e25e8416e 022/137: Add URL header, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column ed3dec104f 032/137: Fix doc string of `visual-fill-column-split-window-sensibly', ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column d24354e79b 039/137: Update version number., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column d96fefd6be 056/137: Further change to the README., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column ccb017b24e 069/137: Bug fix: calculate right margin on the basis of left margin., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 0cba0dcc15 087/137: Add example code for setting split-window-preferred-function., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column f72b9d3740 008/137: Add small comment to header block., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 9ab9d05139 020/137: Merge pull request #7 from expez/tweak-readme, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 055933e93c 023/137: Fix doc string., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 56355c305b 028/137: Update copyright statement., ELPA Syncer, 2022/01/02