Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Issues with 'truncate-lines nil (Wrap at window edge) #26

Open
MLopez-Ibanez opened this Issue Oct 22, 2012 · 21 comments

Comments

Projects
None yet
4 participants

I know the instructions warn that Fill-Column-Indicator doesn't work reliably with 'truncate-lines nil, but 'truncate-lines nil is the default and for long lines, it is a pain to not be able to read all text without horizontal scrolling, so it would be desirable if it worked out-of-the-box.

Here http://www.emacswiki.org/emacs/FillColumnIndicator there is a work-around:

(setq-default fci-rule-column 80)
(setq fci-handle-truncate-lines nil)
(add-hook 'after-change-major-mode-hook 'auto-fci-mode)
(add-hook 'window-size-change-functions 'auto-fci-mode)

(defun auto-fci-mode (&optional unused)
  (if (> (frame-width) 80)
      (fci-mode 1)
    (fci-mode 0))
)

The above hack works fairly well, but it fails if I open two files at the same time: emacs test.c test2.c then, the first buffer will have the fill-column-marker, even if the size of the window is less than 80 columns.

Would you accept patches adding this feature?

Owner

alpaker commented Oct 23, 2012

Hi. It's a little unclear to me what you're suggesting. Is the idea this? You'd like to be able to use fci-mode with truncate-lines set to nil, and have fci-mode respect the following conditions: (a) When the window width is greater than the fill column (or the value of fci-rule-column, if that's set), the fill-column indicator should be shown; (b) when the window width is less than that, the indicator should not be shown; (c) this state should update automatically in response to changes in the window width.

That might be possible. Some decisions would need to be made about the desired behavior in various special cases. For example, what if a buffer is shown in two different windows, one of which is wider than the trigger value and one of which is narrower?

Implementation-wise, I wouldn't want to use a method like that on the wiki page. For one, the frame width is the wrong value to check; window width is what's wanted. For another, window-size-change-functions seems like the wrong hook to use (this is, I suspect, part of the reason why you're having problems getting what you want to work); window-configuration-change-hook is probably a better choice. More generally, that method seems to me to run together two different kinds of functionality: (a) turning on fci-mode automatically in every buffer, and (b) hiding/showing the fill-column indicator in a buffer in response to changes in window width. What if you want the window width-aware indicator in some buffers but not all?

I'll start tinkering with this and see if I can come up with something robust. I'm happy to accept patches, although as mentioned I don't think the approach on the wiki page is the right way to go about it.

On 23 October 2012 21:59, Alp Aker notifications@github.com wrote:

That might be possible. Some decisions would need to be made about the desired behavior in various special cases. For example, what if a buffer is shown in two different windows, one of which is wider than the trigger value and one of which is narrower?

I updated the hack with your suggestion and all my previous issues are fixed. But I also get the issue that you mention above. How to reproduce:

  1. emacs .emacs .emacs
  2. Make the window just wider enough so the fci is visible
  3. Now split the lower window vertically C-x 3
  4. Now when on the top window, do M-x iswitch-buffer
  5. The fci will appear in the lower windows even thought their width is less than 80 columns.

It is a bit annoying, but much less an improvement over the previous hack, so I updated the emacs wiki.

(Does the reply-by-email feature of github works? It seems my emails do not get here)

On 23 October 2012 21:59, Alp Aker notifications@github.com wrote:

Hi. It's a little unclear to me what you're suggesting. Is the idea this? You'd like to be able to use fci-mode with truncate-lines set to nil, and have fci-mode respect the following conditions: (a) When the window width is greater than the fill column (or the value of fci-rule-column, if that's set), the fill-column indicator should be shown; (b) when the window width is less than that, the indicator should not be shown; (c) this state should update automatically in response to changes in the window width.

That might be possible. Some decisions would need to be made about the desired behavior in various special cases. For example, what if a buffer is shown in two different windows, one of which is wider than the trigger value and one of which is narrower?

Hum, so the implementation is actually writing something on the buffer, not on the window? I was assuming it was drawn like the fringe indicators, that is, independently of the buffer (on top of it). Are these overlay properties of the window category? http://www.gnu.org/software/emacs/manual/html_node/elisp/Overlay-Properties.html

Implementation-wise, I wouldn't want to use a method like that on the wiki page. For one, the frame width is the wrong value to check; window width is what's wanted. For another, window-size-change-functions seems like the wrong hook to use (this is, I suspect, part of the reason why you're having problems getting what you want to work); window-configuration-change-hook is probably a better choice. More generally, that method seems to me to run together two different kinds of functionality: (a) turning on fci-mode automatically in every buffer, and (b) hiding/showing the fill-column indicator in a buffer in response to changes in window width. What if you want the window width-aware indicator in some buffers but not all?

I think your proposal makes much more sense. In fact, I would assume we want the code to do whatever is done for drawing the fringe indicators, which appear/disappear correctly when I resize/split the window. In fact, I don't think it makes much sense to have the fill-column-indicator in special buffers like Buffers Completions and Dired buffers.

I'll start tinkering with this and see if I can come up with something robust. I'm happy to accept patches, although as mentioned I don't think the approach on the wiki page is the right way to go about it.

Me neither. You convinced me. I don't have so much knowledge about Emacs internals, so it may take me quite a lot time to come up with something sensible. But knowing that you are not opposed to the idea, I may try to see how the fringe indicators are implemented and copy from there.

BTW, have you tried to submit this to emacs-devel? It seems so useful that it should included by default even if some people do not want it enabled by default. In the worst case, you may get some useful comments.

The following patch seems to be working quite fine. I think I could avoid the function duplication by using an optional argument, but I don't seem to manage to make it work. Probably I am also forgetting some edge cases?

--- /home/manu/fill-column-indicator.el 2012-10-24 18:19:08.151067467 +0200
+++ /home/manu/.emacs.d/fill-column-indicator.el    2012-10-24 19:36:15.442917444 +0200
@@ -742,6 +742,12 @@
   (mapc #'(lambda (o) (if (overlay-get o 'fci) (delete-overlay o)))
         (overlays-in start end)))

+(defun fci-delete-overlays-region-win (start end win)
+  "Delete overlays displaying the fill-column rule between START and END."
+  (mapc #'(lambda (o) (if (and (overlay-get o 'fci) (equal win (overlay-get o 'fci-win)))
+                          (delete-overlay o)))
+        (overlays-in start end)))
+
 (defun fci-delete-overlays-buffer ()
   "Delete all overlays displaying the fill-column rule in the current buffer."
   (save-restriction
@@ -771,7 +777,7 @@
 ;; only if we maintained the overlay center at an early position in the
 ;; buffer.  Since other packages that use overlays typically place them while
 ;; traversing the buffer in a forward direction, that would be a bad idea.
-(defun fci-put-overlays-region (start end)
+(defun fci-put-overlays-region (start end win)
   "Place overlays displaying the fill-column rule between START and END."
   (goto-char start)
   (let (o cc)
@@ -780,6 +786,8 @@
       (setq cc (current-column)
             o (make-overlay (match-beginning 0) (match-beginning 0)))
       (overlay-put o 'fci t)
+      (overlay-put o 'fci-win win)
+      (overlay-put o 'window win)
       (cond
        ((< cc fci-limit)
         (overlay-put o 'after-string fci-pre-limit-string))
@@ -789,6 +797,17 @@
         (overlay-put o 'after-string fci-at-limit-string)))
       (goto-char (match-end 0)))))

+(defun fci-redraw-region-win (start end _ignored win)
+  "Erase and redraw the fill-column rule between START and END."
+  (save-match-data
+    (save-excursion
+      (let ((inhibit-point-motion-hooks t))
+        (goto-char end)
+        (setq end (line-beginning-position 2))
+        (fci-delete-overlays-region-win start end win)
+        (if (> (window-width win) fci-rule-column)
+            (fci-put-overlays-region start end win))))))
+
 (defun fci-redraw-region (start end _ignored)
   "Erase and redraw the fill-column rule between START and END."
   (save-match-data
@@ -796,12 +815,13 @@
       (let ((inhibit-point-motion-hooks t))
         (goto-char end)
         (setq end (line-beginning-position 2))
-        (fci-delete-overlays-region start end)
-        (fci-put-overlays-region start end))))) 
+        (fci-delete-overlays-region-win start end (selected-window))
+        (if (> (window-width (selected-window)) fci-rule-column)
+            (fci-put-overlays-region start end (selected-window)))))))

 (defun fci-redraw-window (win &optional start)
   "Redraw the fill-column rule in WIN starting from START."
-  (fci-redraw-region (or start (window-start win)) (window-end win t) 'ignored))
+  (fci-redraw-region-win (or start (window-start win)) (window-end win t) 'ignored win))

 ;; This doesn't determine the strictly minimum amount by which the rule needs
 ;; to be extended, but the amount used is always sufficient, and determining

A more complete version. The handling of truncate-lines is not necessary anymore, so the patch removes it. I use this with the following in my .emacs:

(setq-default fci-rule-column 80)
(define-globalized-minor-mode global-fci-mode fci-mode (lambda () (fci-mode 1)))
(global-fci-mode 1)

And that is it!

--- /home/manu/fill-column-indicator.el 2012-10-24 18:19:08.151067467 +0200
+++ /home/manu/.emacs.d/fill-column-indicator.el    2012-10-25 17:59:13.525141442 +0200
@@ -83,15 +83,6 @@
 ;; Other Options
 ;; =============

-;; When `truncate-lines' is nil, the effect of drawing a fill-column rule is
-;; very odd looking. Indeed, it makes little sense to use a rule to indicate
-;; the position of the fill column in that case (the positions at which the
-;; fill column falls in the visual display space won't, in general, be
-;; collinear).  For this reason, fci-mode sets truncate-lines to t in buffers
-;; in which it is enabled and restores it to its previous value when
-;; disabled.  You can turn this feature off by setting
-;; `fci-handle-truncate-lines' to nil.
-
 ;; If `line-move-visual' is t, then vertical navigation can behave oddly in
 ;; several edge cases while fci-mode is enabled (this is due to a bug in
 ;; Emacs's C code).  Accordingly, fci-mode sets line-move-visual to nil in
@@ -293,17 +284,6 @@
   :group 'fill-column-indicator
   :type 'boolean)

-(defcustom fci-handle-truncate-lines t
-  "Whether fci-mode should set truncate-lines to t while enabled.
-If non-nil, fci-mode will set truncate-lines to t in buffers in
-which it is enabled, and restore it to its previous value when
-disabled.
-
-Leaving this option set to the default value is recommended."
-  :group 'fill-column-indicator
-  :tag "Locally set truncate-lines to t during fci-mode"
-  :type 'boolean)
-
 (defcustom fci-handle-line-move-visual (version<= "23" emacs-version)
   "Whether fci-mode should set line-move-visual to nil while enabled.
 If non-nil, fci-mode will set line-move-visual to nil in buffers
@@ -340,7 +320,6 @@
 ;; Record prior state of buffer.
 (defvar fci-saved-line-move-visual)
 (defvar fci-line-move-visual-was-buffer-local)
-(defvar fci-saved-truncate-lines)
 (defvar fci-saved-eol)
 (defvar fci-made-display-table)

@@ -366,7 +345,6 @@
 ;; the mode is disabled.
 (defconst fci-internal-vars '(fci-saved-line-move-visual
                               fci-line-move-visual-was-buffer-local
-                              fci-saved-truncate-lines
                               fci-saved-eol
                               fci-made-display-table
                               fci-display-table-processed
@@ -579,9 +557,6 @@
                 fci-saved-line-move-visual line-move-visual
                 line-move-visual nil)
         (set (make-local-variable 'line-move-visual) nil)))
-    (when fci-handle-truncate-lines
-      (setq fci-saved-truncate-lines truncate-lines
-            truncate-lines t))
     (setq fci-local-vars-set t)))

 (defun fci-make-rule-string ()
@@ -714,8 +689,7 @@
       (if fci-line-move-visual-was-buffer-local
           (setq line-move-visual fci-saved-line-move-visual)
         (kill-local-variable 'line-move-visual)))
-    (when fci-handle-truncate-lines
-      (setq truncate-lines fci-saved-truncate-lines))))
+    ))

 (defun fci-restore-display-table ()
   "Restore the buffer display table when fci-mode is disabled."
@@ -742,6 +716,12 @@
   (mapc #'(lambda (o) (if (overlay-get o 'fci) (delete-overlay o)))
         (overlays-in start end)))

+(defun fci-delete-overlays-region-win (start end win)
+  "Delete overlays displaying the fill-column rule between START and END."
+  (mapc #'(lambda (o) (if (and (overlay-get o 'fci) (equal win (overlay-get o 'fci-win)))
+                          (delete-overlay o)))
+        (overlays-in start end)))
+
 (defun fci-delete-overlays-buffer ()
   "Delete all overlays displaying the fill-column rule in the current buffer."
   (save-restriction
@@ -771,7 +751,7 @@
 ;; only if we maintained the overlay center at an early position in the
 ;; buffer.  Since other packages that use overlays typically place them while
 ;; traversing the buffer in a forward direction, that would be a bad idea.
-(defun fci-put-overlays-region (start end)
+(defun fci-put-overlays-region (start end win)
   "Place overlays displaying the fill-column rule between START and END."
   (goto-char start)
   (let (o cc)
@@ -780,6 +760,8 @@
       (setq cc (current-column)
             o (make-overlay (match-beginning 0) (match-beginning 0)))
       (overlay-put o 'fci t)
+      (overlay-put o 'fci-win win)
+      (overlay-put o 'window win)
       (cond
        ((< cc fci-limit)
         (overlay-put o 'after-string fci-pre-limit-string))
@@ -789,6 +771,17 @@
         (overlay-put o 'after-string fci-at-limit-string)))
       (goto-char (match-end 0)))))

+(defun fci-redraw-region-win (start end _ignored win)
+  "Erase and redraw the fill-column rule between START and END."
+  (save-match-data
+    (save-excursion
+      (let ((inhibit-point-motion-hooks t))
+        (goto-char end)
+        (setq end (line-beginning-position 2))
+        (fci-delete-overlays-region-win start end win)
+        (if (> (window-width win) fci-rule-column)
+            (fci-put-overlays-region start end win))))))
+
 (defun fci-redraw-region (start end _ignored)
   "Erase and redraw the fill-column rule between START and END."
   (save-match-data
@@ -796,12 +789,13 @@
       (let ((inhibit-point-motion-hooks t))
         (goto-char end)
         (setq end (line-beginning-position 2))
-        (fci-delete-overlays-region start end)
-        (fci-put-overlays-region start end))))) 
+        (fci-delete-overlays-region-win start end (selected-window))
+        (if (> (window-width (selected-window)) fci-rule-column)
+            (fci-put-overlays-region start end (selected-window)))))))

 (defun fci-redraw-window (win &optional start)
   "Redraw the fill-column rule in WIN starting from START."
-  (fci-redraw-region (or start (window-start win)) (window-end win t) 'ignored))
+  (fci-redraw-region-win (or start (window-start win)) (window-end win t) 'ignored win))

 ;; This doesn't determine the strictly minimum amount by which the rule needs
 ;; to be extended, but the amount used is always sufficient, and determining
Owner

alpaker commented Oct 25, 2012

Thanks for these suggestions. I'll take a look at the code this weekend (work is going to interfere until then).

Unfortunately, I found a bug.

cat > test<<EOF

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vitae orci nulla, ut adipiscing diam. In hac habitasse platea dictumst. Proin fermentum eros id elit imperdiet aliquam. Donec mollis felis quis odio sodales sit amet varius nibh sollicitudin. Quisque vehicula consectetur interdum. Aliquam erat volutpat. In vehicula volutpat tellus in auctor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Pellentesque cursus, turpis ac convallis mattis, nulla orci blandit ligula, lobortis scelerisque mi orci vitae nulla. Duis vestibulum, elit nec vulputate ullamcorper, erat tellus viverra purus, vel facilisis sem risus eu augue. Morbi ullamcorper venenatis odio, a blandit est ultrices ac. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
EOF
emacs test test&

Now, make the window wider enough such that the fill-column-indicator appears. Type in the first line "first line". In the other buffer the text appears just after the fill-column-indicator. It is a bit annoying but when the buffer is saved, everything is ok. Do you have any idea what can be wrong with my patch to produce such behaviour?

Hi, I am still learning how the code works. I still don't understand why do you need different after-string properties depending on the current-position. In fact, if I don't use fci-post-limit-string, everything seems to work fine. Moreover, if I define fci-at-limit-string as at-rule, there is no noticeable difference.

Owner

alpaker commented Nov 1, 2012

It's primarily in order to achieve compatibility with things like
whitespace mode. Changes to the display table entry for the newline
character are intercepted by fci-mode and displayed through its own
mechanism (otherwise the visible newline will appear the fill column on
every line). But the workaround mechanism fci-mode uses requires that it
put an extra character in an overlay on every line. (It could have been
done in such way that the extra character would only be inserted when the
display table entry for the newline, but I found that the code was simpler
using the current method.)

I haven't had a chance to examine your patch, yet; sorry. I do intend to
have a look at it, though.

On Wed, Oct 31, 2012 at 8:08 PM, MLopez-Ibanez notifications@github.comwrote:

Hi, I am still learning how the code works. I still don't understand why
do you need different after-string properties depending on the
current-position. In fact, if I don't use fci-post-limit-string, everything
seems to work fine. Moreover, if I define fci-at-limit-string as at-rule,
there is no noticeable difference.


Reply to this email directly or view it on GitHubhttps://github.com/alpaker/Fill-Column-Indicator/issues/26#issuecomment-9966913.

Owner

alpaker commented Nov 14, 2012

Just wanted to leave a note that I haven't forgotten this issue. I've got an idea for a what I hope is a simple fix, but have only done a proof-of-concept as yet.

No problem. I am happily using the patched fci and the only issue I found is the bug I reported above.

jaalto commented Sep 4, 2013

Hi, Any progress about this?

I am still using my patched version and this is the only issue I have
found. I haven't found a way to solve it but it is so rare and easy to
avoid that I haven't tried that hard.

I have updated my patch to the latest git version:

diff --git a/fill-column-indicator.el b/fill-column-indicator.el
index f644ae7..ec5d390 100644
--- a/fill-column-indicator.el
+++ b/fill-column-indicator.el
@@ -89,15 +89,6 @@
 ;; Other Options
 ;; =============

-;; When `truncate-lines' is nil, the effect of drawing a fill-column rule is
-;; very odd looking. Indeed, it makes little sense to use a rule to indicate
-;; the position of the fill column in that case (the positions at which the
-;; fill column falls in the visual display space won't, in general, be
-;; collinear).  For this reason, fci-mode sets truncate-lines to t in buffers
-;; in which it is enabled and restores it to its previous value when
-;; disabled.  You can turn this feature off by setting
-;; `fci-handle-truncate-lines' to nil.
-
 ;; If `line-move-visual' is t, then vertical navigation can behave oddly in
 ;; several edge cases while fci-mode is enabled (this is due to a bug in
 ;; Emacs's C code).  Accordingly, fci-mode sets line-move-visual to nil in
@@ -109,7 +100,7 @@

 ;; Fci-mode needs free use of two characters (specifically, it needs the use
 ;; of two characters whose display table entries it can change
-;; arbitrarily).  Its defualt is to use the first two characters of the
+;; arbitrarily).  Its default is to use the first two characters of the
 ;; Private Use Area of the Unicode BMP, viz. U+E000 and U+E001.  If you need
 ;; to use those characters for some other purpose, set `fci-eol-char' and
 ;; `fci-blank-char' to different values.
@@ -297,17 +288,6 @@ function `fci-mode' is run."
   :group 'fill-column-indicator
   :type 'boolean)

-(defcustom fci-handle-truncate-lines t
-  "Whether fci-mode should set truncate-lines to t while enabled.
-If non-nil, fci-mode will set truncate-lines to t in buffers in
-which it is enabled, and restore it to its previous value when
-disabled.
-
-Leaving this option set to the default value is recommended."
-  :group 'fill-column-indicator
-  :tag "Locally set truncate-lines to t during fci-mode"
-  :type 'boolean)
-
 (defcustom fci-handle-line-move-visual (version<= "23" emacs-version)
   "Whether fci-mode should set line-move-visual to nil while enabled.
 If non-nil, fci-mode will set line-move-visual to nil in buffers
@@ -344,7 +324,6 @@ U+E000-U+F8FF, inclusive)."
 ;; Record prior state of buffer.
 (defvar fci-saved-line-move-visual)
 (defvar fci-line-move-visual-was-buffer-local)
-(defvar fci-saved-truncate-lines)
 (defvar fci-saved-eol)
 (defvar fci-made-display-table)

@@ -370,7 +349,6 @@ U+E000-U+F8FF, inclusive)."
 ;; the mode is disabled.
 (defconst fci-internal-vars '(fci-saved-line-move-visual
                               fci-line-move-visual-was-buffer-local
-                              fci-saved-truncate-lines
                               fci-saved-eol
                               fci-made-display-table
                               fci-display-table-processed
@@ -591,9 +569,6 @@ on troubleshooting.)"
                 fci-saved-line-move-visual line-move-visual
                 line-move-visual nil)
         (set (make-local-variable 'line-move-visual) nil)))
-    (when fci-handle-truncate-lines
-      (setq fci-saved-truncate-lines truncate-lines
-            truncate-lines t))
     (setq fci-local-vars-set t)))

 (defun fci-make-rule-string ()
@@ -726,8 +701,7 @@ rough heuristic.)"
       (if fci-line-move-visual-was-buffer-local
           (setq line-move-visual fci-saved-line-move-visual)
         (kill-local-variable 'line-move-visual)))
-    (when fci-handle-truncate-lines
-      (setq truncate-lines fci-saved-truncate-lines))))
+    ))

 (defun fci-restore-display-table ()
   "Restore the buffer display table when fci-mode is disabled."
@@ -754,6 +728,12 @@ rough heuristic.)"
   (mapc #'(lambda (o) (if (overlay-get o 'fci) (delete-overlay o)))
         (overlays-in start end)))

+(defun fci-delete-overlays-region-win (start end win)
+  "Delete overlays displaying the fill-column rule between START and END."
+  (mapc #'(lambda (o) (if (and (overlay-get o 'fci) (equal win (overlay-get o 'fci-win)))
+                          (delete-overlay o)))
+        (overlays-in start end)))
+
 (defun fci-delete-overlays-buffer ()
   "Delete all overlays displaying the fill-column rule in the current buffer."
   (save-restriction
@@ -783,7 +763,7 @@ rough heuristic.)"
 ;; only if we maintained the overlay center at an early position in the
 ;; buffer.  Since other packages that use overlays typically place them while
 ;; traversing the buffer in a forward direction, that would be a bad idea.
-(defun fci-put-overlays-region (start end)
+(defun fci-put-overlays-region (start end win)
   "Place overlays displaying the fill-column rule between START and END."
   (goto-char start)
   (let (o cc)
@@ -792,6 +772,8 @@ rough heuristic.)"
       (setq cc (current-column)
             o (make-overlay (match-beginning 0) (match-beginning 0)))
       (overlay-put o 'fci t)
+      (overlay-put o 'fci-win win)
+      (overlay-put o 'window win)
       (cond
        ((< cc fci-limit)
         (overlay-put o 'after-string fci-pre-limit-string))
@@ -801,6 +783,17 @@ rough heuristic.)"
         (overlay-put o 'after-string fci-at-limit-string)))
       (goto-char (match-end 0)))))

+(defun fci-redraw-region-win (start end _ignored win)
+  "Erase and redraw the fill-column rule between START and END."
+  (save-match-data
+    (save-excursion
+      (let ((inhibit-point-motion-hooks t))
+        (goto-char end)
+        (setq end (line-beginning-position 2))
+        (fci-delete-overlays-region-win start end win)
+        (if (> (window-width win) fci-rule-column)
+            (fci-put-overlays-region start end win))))))
+
 (defun fci-redraw-region (start end _ignored)
   "Erase and redraw the fill-column rule between START and END."
   (save-match-data
@@ -808,12 +801,13 @@ rough heuristic.)"
       (let ((inhibit-point-motion-hooks t))
         (goto-char end)
         (setq end (line-beginning-position 2))
-        (fci-delete-overlays-region start end)
-        (fci-put-overlays-region start end))))) 
+        (fci-delete-overlays-region-win start end (selected-window))
+        (if (> (window-width (selected-window)) fci-rule-column)
+            (fci-put-overlays-region start end (selected-window)))))))

 (defun fci-redraw-window (win &optional start)
   "Redraw the fill-column rule in WIN starting from START."
-  (fci-redraw-region (or start (window-start win)) (window-end win t) 'ignored))
+  (fci-redraw-region-win (or start (window-start win)) (window-end win t) 'ignored win))

 ;; This doesn't determine the strictly minimum amount by which the rule needs
 ;; to be extended, but the amount used is always sufficient, and determining

The bug I mentioned above still exists. I noticed also that if there is no blank line and I add one, then the other window (which contains the same buffer) does not add a fill-column-indicator for that line, unlike in the current window. Then, when I switch buffer and type, it adds the fci but prints what I type after it. Saving the buffer, or switching back and forth fixes things (thus it is a display issue, the characters are still in the correct place).

aspiers commented Apr 18, 2016

@MLopez-Ibanez Please can you submit your patch as a pull request? It's exactly what pull requests were designed for, whereas pasting patches as comments a) makes the issues unnecessarily long and b) makes it very hard to test or review or rebase or keep track of the patches. Thanks.

aspiers commented Apr 18, 2016

@MLopez-Ibanez I just tried your patch and it does seem to work and get rid of the fringe indicators. But as mentioned it's unusable for a lot of people when provided as a patch in a comment.

aspiers commented Apr 18, 2016

@MLopez-Ibanez The info is in the link I already sent you. There are lots of other guides too if you google for "github pull request".

MLopez-Ibanez pushed a commit to MLopez-Ibanez/Fill-Column-Indicator that referenced this issue Apr 19, 2016

Issues with 'truncate-lines nil (Wrap at window edge) #26
(setq-default fci-rule-column 80)
(define-globalized-minor-mode global-fci-mode fci-mode (lambda () (fci-mode 1)))
(global-fci-mode 1)

Done. I hope it is useful.

Owner

alpaker commented Apr 20, 2016

Thanks very much @MLopez-Ibanez. I'll have a look in the morning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment