emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 52e798b: Fix minor issues with removing left or r


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-25 52e798b: Fix minor issues with removing left or right fringes
Date: Sat, 16 Apr 2016 10:54:37 +0000

branch: emacs-25
commit 52e798b7cd6626d83622206839ddaf7353e4f942
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix minor issues with removing left or right fringes
    
    * lisp/window.el (window-max-chars-per-line): Account for
    'left-fringe-width' and 'right-fringe-width' variables.
    
    * doc/lispref/windows.texi (Window Sizes): Document the effect on
    window text width when setting the width of one or both fringes to
    zero.
    * doc/emacs/display.texi (Fringes): Document the effect on window
    text width when setting the width of one or both fringes to zero.
    (Bug#22891)
---
 doc/emacs/display.texi   |   17 +++++++++++++++++
 doc/lispref/windows.texi |    6 ++++++
 lisp/window.el           |   14 ++++++++++++--
 3 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index 01f899f..8039291 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1087,6 +1087,23 @@ To disable this, change the variable
 @code{overflow-newline-into-fringe} to @code{nil}; this causes Emacs
 to continue or truncate lines that are exactly as wide as the window.
 
+  If you customize @code{fringe-mode} to remove the fringes on one or
+both sides of the window display, the features that display on the
+fringe are not available.  Indicators of line continuation and
+truncation are an exception: when fringes are not available, Emacs
+uses the leftmost and rightmost character cells to indicate
+continuation and truncation with special ASCII characters, see
address@hidden Lines}, and @ref{Line Truncation}.  This reduces the
+width available for displaying text on each line, because the
+character cells used for truncation and continuation indicators are
+reserved for that purpose.  Since buffer text can include
+bidirectional text, and thus both left-to-right and right-to-left
+paragraphs (@pxref{Bidirectional Editing}), removing only one of the
+fringes still reserves two character cells, one on each side of the
+window, for truncation and continuation indicators, because these
+indicators are displayed on opposite sides of the window in
+right-to-left paragraphs.
+
 @node Displaying Boundaries
 @section Displaying Boundaries
 
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index f61f08a..0665eb9 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -605,6 +605,12 @@ exceed its total height as returned by 
@code{window-total-height}.
 @cindex body width of a window
 The @dfn{body width} of a window is the width of its text area, which
 does not include the scroll bar, fringes, margins or a right divider.
+Note that when one or both fringes are removed (by setting their width
+to zero), the display engine reserves two character cells, one on each
+side of the window, for displaying the continuation and truncation
+glyphs, which leaves 2 columns less for text display.  (The function
address@hidden, described below, takes this
+peculiarity into account.)
 
 @defun window-body-width &optional window pixelwise
 This function returns the width, in columns, of the body of window
diff --git a/lisp/window.el b/lisp/window.el
index 7e46aa8..fd0fcc9 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1889,9 +1889,19 @@ the font."
           (ncols (/ window-width font-width)))
       (if (and (display-graphic-p)
               overflow-newline-into-fringe
-              (/= (frame-parameter nil 'left-fringe) 0)
-              (/= (frame-parameter nil 'right-fringe) 0))
+               (not
+                (or (eq left-fringe-width 0)
+                    (and (null left-fringe-width)
+                         (= (frame-parameter nil 'left-fringe) 0))))
+               (not
+                (or (eq right-fringe-width 0)
+                    (and (null right-fringe-width)
+                         (= (frame-parameter nil 'right-fringe) 0)))))
          ncols
+        ;; FIXME: This should remove 1 more column when there are no
+        ;; fringes, lines are truncated, and the window is hscrolled,
+        ;; but EOL is not in the view, because then there are 2
+        ;; truncation glyphs, not one.
        (1- ncols)))))
 
 (defun window-current-scroll-bars (&optional window)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]