[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/visual-fill-column fac6a4ce67 044/137: Take text scaling i
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/visual-fill-column fac6a4ce67 044/137: Take text scaling into account when computing margins |
Date: |
Sun, 2 Jan 2022 22:59:10 -0500 (EST) |
branch: elpa/visual-fill-column
commit fac6a4ce674dbc6cc1e034f5012e8584d33dd07d
Author: Clément Pit--Claudel <clement.pitclaudel@live.com>
Commit: Clément Pit--Claudel <clement.pitclaudel@live.com>
Take text scaling into account when computing margins
---
visual-fill-column.el | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/visual-fill-column.el b/visual-fill-column.el
index ba560e66fd..3527ced83c 100644
--- a/visual-fill-column.el
+++ b/visual-fill-column.el
@@ -146,12 +146,22 @@ windows with wide margins."
"Return the maximum possible text width of WINDOW.
The maximum possible text width is the width of the current text
area plus the margins, but excluding the fringes, scroll bar and
-right divider. WINDOW defaults to the selected window."
+right divider. WINDOW defaults to the selected window. The
+return value is scaled to account for `text-scale-mode-amount'
+and `text-scale-mode-step'."
(or window (setq window (selected-window)))
- (let ((margins (window-margins window)))
- (+ (window-width window)
- (or (car margins) 0)
- (or (cdr margins) 0))))
+ (let* ((margins (window-margins window))
+ (buffer (window-buffer window))
+ (scale (if (and (boundp 'text-scale-mode-step)
+ (boundp 'text-scale-mode-amount))
+ (with-current-buffer buffer
+ (expt text-scale-mode-step
+ text-scale-mode-amount))
+ 1.0)))
+ (truncate (/ (+ (window-width window)
+ (or (car margins) 0)
+ (or (cdr margins) 0))
+ (float scale)))))
(defun visual-fill-column--set-margins ()
"Set window margins for the current window."
- [nongnu] elpa/visual-fill-column f72b9d3740 008/137: Add small comment to header block., (continued)
- [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
- [nongnu] elpa/visual-fill-column 5c1f26f1b8 037/137: Make visual-fill-column-split-window a public function., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column bad073f941 079/137: Fix README, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 9ddc876975 067/137: Remove space between #' and function symbol., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 8aee572de5 062/137: Merge branch 'master' of https://github.com/joostkremers/visual-fill-column, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column a19fbe8bcf 076/137: Update version number., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column d6b09e5533 078/137: Add screenshots before and after., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column fac6a4ce67 044/137: Take text scaling into account when computing margins,
ELPA Syncer <=
- [nongnu] elpa/visual-fill-column db89c32b4d 059/137: Update copyright statement to 2018., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column d3f64e7206 050/137: Update README, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column c0e5ec8f88 052/137: Fix potentially serious typos in license, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 606d86e38c 060/137: Update doc string of `turn-on-visual-fill-column-mode'., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column dd6f1e0cf2 084/137: Resize screenshots., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 14e841218d 083/137: Add text introducing screenshots to the README., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 48a3690b01 091/137: Add more bindings for mouse events in the margins., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 2048a0ce91 089/137: turn-on-visual-fill-column-mode: Do not depend on `visual-line-mode`., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 7ca18f37af 092/137: Rewrap comment., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 598bc992f0 093/137: Update Emacs dependency to 25.1., ELPA Syncer, 2022/01/02