Make fci-mode coexist better with line-move-visual
Closed this issue · 4 comments
I'm interested in isolating and fixing whatever prevents line-move-visual
from behaving as expected when fci-mode
is on. Do you have more information on what part of the C implementation behaves badly with fci-mode
and line-move-visual
?
Background:
The README says:
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 buffers in which it is enabled and restores it to its previous value when disabled. This can be suppressed by setting fci-handle-line-move-visual to nil. (But you shouldn't want to do this. There's no reason to use line-move-visual if truncate-lines is t, and it doesn't make sense to use something like fci-mode when truncate-lines is nil.)
This is a small test case that shows the unexpected behavior:
$ open -n -a Emacs --args -Q --no-site-file --eval '(progn (load-file "fill-column-indicator.el") (fci-mode) (set-variable (quote line-move-visual) t) (insert "\n\n \n") (goto-line 2) (move-beginning-of-line nil) (next-line) (what-cursor-position))'
Observe that the point lands in column 2 in the above example, whereas without line-move-visual
, it lands in column 0 as expected:
$ open -n -a Emacs --args -Q --no-site-file --eval '(progn (load-file "fill-column-indicator.el") (fci-mode) (insert "\n\n \n") (goto-line 2) (move-beginning-of-line nil) (next-line) (what-cursor-position))'
There's some conversation that I started with the same message on the Emacs developers mailing list.
I wrote that a comment a while ago, and to be honest I'm having trouble
remembering exactly what bit of C-level navigation code I was thinking of
at the time. I'll try to look into some this weekend; I'll also follow the
emacs-devel thread and participate as appropriate (although with Eli on the
case I'm likely superfluous).
On Fri, Jul 12, 2013 at 5:36 PM, matthewlmcclure
notifications@github.comwrote:
There's some conversationhttp://thread.gmane.org/gmane.emacs.devel/161840that I started with the same message on the Emacs developers mailing list.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-20905708
.
Just FYI, I'm abandoning this package and welcoming requests to be take over as maintainer.
The functionality provided by this package has now been implemented natively in Emacs as display-fill-column-indicator-mode
, available as of version 27.0.90. Unless you are forced to use an older Emacs, you should use the native implementation instead of fci-mode
. The former is unaffected by most of the compatibility issues that this add-on has.