[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/visual-fill-column 5f5928fd7f 045/137: Merge pull request
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/visual-fill-column 5f5928fd7f 045/137: Merge pull request #19 from cpitclaudel/master |
Date: |
Sun, 2 Jan 2022 22:59:10 -0500 (EST) |
branch: elpa/visual-fill-column
commit 5f5928fd7fc3716632b02deac58b198eeda37d84
Merge: 865c9b32ea fac6a4ce67
Author: Joost Kremers <joostkremers@fastmail.fm>
Commit: GitHub <noreply@github.com>
Merge pull request #19 from cpitclaudel/master
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 7b8525757d 122/137: Remove `visual-fill-column--original-split-window-function`., (continued)
- [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
- [nongnu] elpa/visual-fill-column ceb2c74827 133/137: Update the README., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 84638e9ff4 130/137: Add a note about writeroom-mode to the README., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column bd78372bd3 131/137: Fix link to writeroom-mode., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column a2657f20f6 128/137: Add note about centring text., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column a44fe8d78c 135/137: Point URL header to Codeberg., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 2df643827a 134/137: Add adaptive-wrap screen shots., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column dde0aa6535 061/137: Update README, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 5f5928fd7f 045/137: Merge pull request #19 from cpitclaudel/master,
ELPA Syncer <=
- [nongnu] elpa/visual-fill-column 34ce0d22da 072/137: Guard against non-existing mouse events, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 0044394939 054/137: Make some changes to the README.md, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 982606896e 077/137: Change :group parameter of defgroup to `text`., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column d97017e9bc 058/137: Use correct option `visual-fill-column-fringes-outside-margins' in README., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column d05a7e9c62 004/137: Allow `visual-fill-column-width` to be set to an integer., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column b63174ec24 006/137: Update README, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column d3ebba9e60 009/137: Update version number in header block., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 7bf332089a 012/137: Fix typo., ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 261e27c062 024/137: Update version number to 1.5, ELPA Syncer, 2022/01/02
- [nongnu] elpa/visual-fill-column 043485d16a 026/137: Rename ::window-body-width to ::window-max-text-width, ELPA Syncer, 2022/01/02