From: martin rudalics <rudalics@gmx.at>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-pretest-bug@gnu.org,
Stephen Berman <Stephen.Berman@gmx.net>,
emacs-devel@gnu.org
Subject: Re: invisible
Date: Mon, 26 Nov 2007 08:59:50 +0100 [thread overview]
Message-ID: <474A7CF6.8030802@gmx.at> (raw)
In-Reply-To: <jwv8x4lr9l6.fsf-monnier+emacs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2812 bytes --]
> If you have a conrete situation where the current behavior is
> problematic, firsyt you need to understand how those things work:
> there are 2 places where invisibility impacts movement:
> - when combined with `intangible', it impacts every single movement of
> `point', including within elisp functions. This may "do the right
> thing" in some sense, but it tends to break a lot of code, and
> it can be terribly difficult to write code that works in the face of
> intangible properties. So I highly recommend against the use of
> `intangible' except for those rare cases where it's *really*
> absolutely needed.
Intangible text was never mentioned in this thread.
> - when not combined with `intangible', invisible properties have the
> effect (just like composition and display properties) that after each
> *command* (i..e more or less just after running post-command-hook)
> point is moved outside of the invisible text. Now since it's done at
> the end of a command (which may have moved point many times in
> arbitrarily complex ways), you can't do it right 100% of the time.
> OTOH this interacts fine with pretty much any elisp code.
>
> Many of the problems you point out have to do with interactions with C-n
> and C-p which are surprisingly complex functions. The interaction
> between all three is even worse.
>
> So if you can try and reproduce the problem with only C-n/C-p (i.e. no
> intangible text and with non-nil disable-point-adjustement) or with
> only intangible text or with only invisible text, that makes it more
> likely we can try and fix it.
This thread is about `line-move-ignore-invisible' - an option defined in
simple.el with the following doc-string:
*Non-nil means C-n and C-p ignore invisible lines.
Outline mode sets this.
Either this option makes sense - then we have to talk about C-n/C-p
_and_ invisible text - or it doesn't. In the latter case let's remove
the option and the problem is resolved.
> Also the interaction with those things is sufficiently bad, that there
> are many problematic cases. So if the problem only appears when you mix
> those, to have a better chance of seeing your bug fixed, try to make
> sure the symptom is really serious: e.g. C-n does move at all (or moves
> backward).
I never use "those things" hence I don't care about whether these
qualify as "serious symptoms". I just reacted to a couple of problems
reported by others. One of these was
"the cursor stays put, i.e., C-p is a no-op here"
reported in 2004. Apparently, it didn't have much chance getting fixed
then.
> And focus on *1* problem at a time.
I focused on *1* solution at a time.
>>Meanwhile could you please check my patch for simple.el too?
>
>
> Please post it again,
Attached.
[-- Attachment #2: simple.patch --]
[-- Type: text/plain, Size: 1633 bytes --]
*** simple.el.~1.888.~ Sat Nov 10 09:23:20 2007
--- simple.el Sun Nov 18 16:02:42 2007
***************
*** 3862,3868 ****
(save-excursion
;; Like end-of-line but ignores fields.
(skip-chars-forward "^\n")
! (while (and (not (eobp)) (invisible-p (point)))
(goto-char (next-char-property-change (point)))
(skip-chars-forward "^\n"))
(point))))
--- 3862,3869 ----
(save-excursion
;; Like end-of-line but ignores fields.
(skip-chars-forward "^\n")
! (while (and line-move-ignore-invisible
! (not (eobp)) (invisible-p (point)))
(goto-char (next-char-property-change (point)))
(skip-chars-forward "^\n"))
(point))))
***************
*** 3940,3948 ****
This function works only in certain cases,
because what we really need is for `move-to-column'
and `current-column' to be able to ignore invisible text."
! (if (zerop col)
! (beginning-of-line)
(move-to-column col))
(when (and line-move-ignore-invisible
(not (bolp)) (invisible-p (1- (point))))
--- 3941,3956 ----
This function works only in certain cases,
because what we really need is for `move-to-column'
and `current-column' to be able to ignore invisible text."
! (cond
! ((zerop col)
! (beginning-of-line))
! (line-move-ignore-invisible
(move-to-column col))
+ (t
+ ;; Tedious.
+ (save-restriction
+ (narrow-to-region (line-beginning-position) (line-end-position))
+ (move-to-column col))))
(when (and line-move-ignore-invisible
(not (bolp)) (invisible-p (1- (point))))
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next prev parent reply other threads:[~2007-11-26 7:59 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040225.150142.12214540.kazu@iijlab.net>
[not found] ` <q5gvfluxljk.fsf@lucent.com>
[not found] ` <200402282128.i1SLSuY15359@raven.dms.auburn.edu>
[not found] ` <200402290224.i1T2Oip15705@raven.dms.auburn.edu>
2007-11-09 21:59 ` invisible Stephen Berman
2007-11-18 0:35 ` invisible Stephen Berman
2007-11-18 15:27 ` invisible martin rudalics
2007-11-23 12:24 ` invisible Stephen Berman
2007-11-23 14:25 ` invisible martin rudalics
2007-11-23 18:19 ` invisible Stephen Berman
2007-11-23 19:59 ` invisible martin rudalics
2007-11-23 20:31 ` invisible Stephen Berman
2007-11-23 21:52 ` invisible martin rudalics
2007-11-23 23:04 ` invisible Stephen Berman
2007-11-24 9:33 ` invisible martin rudalics
2007-11-24 10:11 ` invisible Johan Bockgård
2007-11-24 10:30 ` invisible martin rudalics
2007-11-24 10:34 ` invisible martin rudalics
2007-11-24 19:50 ` invisible Stephen Berman
2007-11-24 22:26 ` invisible martin rudalics
2007-11-26 3:25 ` invisible Stefan Monnier
2007-11-26 8:02 ` invisible martin rudalics
2007-11-26 15:17 ` invisible Stefan Monnier
2007-11-26 19:10 ` invisible martin rudalics
2007-11-26 20:19 ` invisible Stefan Monnier
2007-11-26 3:20 ` invisible Stefan Monnier
2007-11-26 7:59 ` martin rudalics [this message]
2007-11-26 15:29 ` invisible Stefan Monnier
2007-11-26 19:09 ` invisible martin rudalics
2007-11-26 20:16 ` invisible Stefan Monnier
2007-11-27 13:11 ` invisible martin rudalics
2007-11-27 18:46 ` invisible martin rudalics
2007-11-27 22:44 ` invisible Stefan Monnier
2007-11-28 9:16 ` invisible martin rudalics
2007-11-28 19:20 ` invisible Stefan Monnier
2007-11-28 22:41 ` invisible martin rudalics
2007-11-28 23:23 ` invisible Stephen Berman
2007-11-29 10:15 ` invisible martin rudalics
2007-11-29 16:13 ` invisible Stefan Monnier
2007-11-29 1:04 ` invisible Richard Stallman
2007-11-29 10:26 ` invisible martin rudalics
2007-11-29 15:57 ` invisible Stefan Monnier
2007-11-29 16:36 ` invisible martin rudalics
2007-11-29 18:53 ` invisible Stefan Monnier
2007-11-29 19:55 ` invisible martin rudalics
2007-11-30 17:19 ` invisible martin rudalics
2007-11-30 18:59 ` invisible Stefan Monnier
2007-11-30 22:09 ` invisible martin rudalics
2007-12-01 3:11 ` invisible Stefan Monnier
2007-12-01 9:44 ` invisible martin rudalics
2007-12-01 20:41 ` invisible Stefan Monnier
2007-12-02 1:15 ` invisible Johan Bockgård
2007-12-02 9:47 ` invisible martin rudalics
2007-11-23 14:37 ` invisible martin rudalics
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=474A7CF6.8030802@gmx.at \
--to=rudalics@gmx.at \
--cc=Stephen.Berman@gmx.net \
--cc=emacs-devel@gnu.org \
--cc=emacs-pretest-bug@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.