emacs-devel
[Top][All Lists]
Advanced

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

Re: invisible


From: martin rudalics
Subject: Re: invisible
Date: Tue, 27 Nov 2007 14:11:38 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> AFAIK in all circumstances where you want line-move-ignore-invisible to
> be non-nil, you'll also want disable-point-adjustment to be nil.
> And vice-versa.

I never set them hence I conclude you're right.

> You're saying that line-move-to-column would like current-column and
> friends should to treat invisible text as if it were visible?

For `line-move-ignore-invisible' nil at least, yes.

> In Emacs-21, I changed it so that text that's
> replaced by an ellipsis is counted as if it were visible: I needed this
> to be able to re-indent blocks of code while hidden by outline-minor-mode.
> I didn't change it for non-ellipsis invisible text to reduce the
> backward compatibility problems.
>
> It turns out that it's also a good behavior in the sense that you can
> get the other two behaviors (ignore all invisible text properties and
> obey all invisible text properties) in the following way:
>
>    (let ((buffer-invisibility-spec nil)) (current-column))
> and
>    (let ((buffer-invisibility-spec t)) (current-column))

Neat.  Indeed, writing

  (cond
   ((zerop col)
    (beginning-of-line))
   (line-move-ignore-invisible
    (move-to-column col))
   (t
    (let ((buffer-invisibility-spec nil))
      ;; Don't ignore invisible text when moving to the end of an
      ;; invisible line.
      (move-to-column col))))

seems to work perfectly.





reply via email to

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