[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master a17bdde 6/7: Ensure positive number of glyphs for m
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master a17bdde 6/7: Ensure positive number of glyphs for margins of positive width |
Date: |
Tue, 22 Mar 2016 00:06:00 +0000 |
branch: master
commit a17bddeaa430715bf98f662a2c24ae5af50cc6b8
Author: Eli Zaretskii <address@hidden>
Commit: Paul Eggert <address@hidden>
Ensure positive number of glyphs for margins of positive width
* src/dispnew.c (margin_glyphs_to_reserve): Always return a
positive value when a non-zero width of the marginal area was
requested. (Bug#22356)
[This reapplies commit 740849fe986b62a839bce4bbf67d0036fc1be0b9,
which was inadvertently lost by merge commit
7823745acbe9b87eea2db4ef434e379fc903ec35.]
---
src/dispnew.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/dispnew.c b/src/dispnew.c
index 9cf12f1..3a0532a 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -321,7 +321,9 @@ margin_glyphs_to_reserve (struct window *w, int
total_glyphs, int margin)
int width = w->total_cols;
double d = max (0, margin);
d = min (width / 2 - 1, d);
- return (int) ((double) total_glyphs / width * d);
+ /* Since MARGIN is positive, we cannot possibly have less than
+ one glyph for the marginal area. */
+ return max (1, (int) ((double) total_glyphs / width * d));
}
return 0;
}
- [Emacs-diffs] master updated (5283593 -> 515ce25), Paul Eggert, 2016/03/21
- [Emacs-diffs] master 5a78876 5/7: In comment-dwim with style `extra-line', respect indent-tabs-mode., Paul Eggert, 2016/03/21
- [Emacs-diffs] master 515ce25 7/7: Don't confuse "::" with ":" when trying to parse member initializers., Paul Eggert, 2016/03/21
- [Emacs-diffs] master fa5c69c 1/7: ; * etc/NEWS: Remove unneeded text., Paul Eggert, 2016/03/21
- [Emacs-diffs] master 1e9a122 2/7: Fix picture-mode wrt double-width characters, Paul Eggert, 2016/03/21
- [Emacs-diffs] master a17bdde 6/7: Ensure positive number of glyphs for margins of positive width,
Paul Eggert <=
- [Emacs-diffs] master 05b6268 4/7: Merge doc fixes for 'random' lost in previous merge, Paul Eggert, 2016/03/21
- [Emacs-diffs] master a1f71da 3/7: Unhide the --no-line-directive option to 'etags', Paul Eggert, 2016/03/21