unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Stephen.Berman@gmx.net, rms@gnu.org, emacs-devel@gnu.org
Subject: Re: invisible
Date: Sun, 02 Dec 2007 10:47:21 +0100	[thread overview]
Message-ID: <47527F29.5030204@gmx.at> (raw)
In-Reply-To: <jwvmysutb83.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1857 bytes --]

 > Obviously conflating the two variables into one is a change visible to
 > the user.  I'm just saying that it would fix your bug as well.

It's not my bug.  Which means, I don't have a user perspective here and
everything I say is purely speculative in this regard.

 > And I think it's a choice that might make a lot of sense.

Maybe. Just that people have to be aware that any character they insert
after rear-sticky invisible text will become invisible too.

 >>Because I'm not allowed to disable point-adjustment for the normal
 >>`line-move-ignore-invisible' t case.
 >
 >
 > AFAICT the reason is not that you're not allowed but that you haven't
 > needed to do it.  If you needed to do it, I don't think it'd be a big
 > problem since line-move already tries to avoid invisible text (so
 > point-adjustment shouldn't make much difference if any).

`line-move-ignore-invisible' is about _invisibility_ only.  Adjusting
point is about invisibility, composition, intangibility, fields ...
Now, if I set `line-move-ignore-invisible' to nil I might want to stop
at the next invisible newline but still respect the remaining
properties.  I understand that's what "conflating" is all about and I
agree that there's no peculiar reason why we should just consider
invisibility and not the rest.  Moreover `line-move-ignore-invisible'
seems broken anyway and hard to get right.

 > So I now think that setting disable-point-adjustment only in the
 > interactive case is actually incorrect: it should also be set in the
 > non-interactive case.

Currently point-adjustment affects point-setting only _after_ a command
is executed.  `line-move-ignore-invisible' affects point-setting for
every single line move, regardless of whether this happens in a command
or how often this happens in a command.

Anyway.  Is the attached patch about what you have in mind?

[-- Attachment #2: simple.patch --]
[-- Type: text/plain, Size: 3422 bytes --]

*** simple.el.~1.888.~	Sat Nov 10 09:23:20 2007
--- simple.el	Sun Dec  2 10:40:22 2007
***************
*** 3593,3603 ****
  	    (end-of-line)
  	    (insert (if use-hard-newlines hard-newline "\n")))
  	(line-move arg nil nil try-vscroll))
!     (if (interactive-p)
! 	(condition-case nil
! 	    (line-move arg nil nil try-vscroll)
! 	  ((beginning-of-buffer end-of-buffer) (ding)))
!       (line-move arg nil nil try-vscroll)))
    nil)

  (defun previous-line (&optional arg try-vscroll)
--- 3593,3602 ----
  	    (end-of-line)
  	    (insert (if use-hard-newlines hard-newline "\n")))
  	(line-move arg nil nil try-vscroll))
!     ;; Disable point-adjustment with `line-move-ignore-invisible' nil.
!     (unless line-move-ignore-invisible
!       (setq disable-point-adjustment t))
!     (line-move arg nil nil try-vscroll))
    nil)

  (defun previous-line (&optional arg try-vscroll)
***************
*** 3619,3629 ****
  to use and more reliable (no dependence on goal column, etc.)."
    (interactive "p\np")
    (or arg (setq arg 1))
!   (if (interactive-p)
!       (condition-case nil
! 	  (line-move (- arg) nil nil try-vscroll)
! 	((beginning-of-buffer end-of-buffer) (ding)))
!     (line-move (- arg) nil nil try-vscroll))
    nil)

  (defcustom track-eol nil
--- 3618,3627 ----
  to use and more reliable (no dependence on goal column, etc.)."
    (interactive "p\np")
    (or arg (setq arg 1))
!   ;; Disable point-adjustment with `line-move-ignore-invisible' nil.
!   (unless line-move-ignore-invisible
!     (setq disable-point-adjustment t))
!   (line-move (- arg) nil nil try-vscroll)
    nil)

  (defcustom track-eol nil
***************
*** 3746,3753 ****
  			most-positive-fixnum
  		      (current-column))))

! 	  (if (not (or (integerp selective-display)
!                        line-move-ignore-invisible))
  	      ;; Use just newline characters.
  	      ;; Set ARG to 0 if we move as many lines as requested.
  	      (or (if (> arg 0)
--- 3744,3751 ----
  			most-positive-fixnum
  		      (current-column))))

! 	  (if (and (not (integerp selective-display))
!                    disable-point-adjustment)
  	      ;; Use just newline characters.
  	      ;; Set ARG to 0 if we move as many lines as requested.
  	      (or (if (> arg 0)
***************
*** 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))))
--- 3860,3867 ----
  	     (save-excursion
  	       ;; Like end-of-line but ignores fields.
  	       (skip-chars-forward "^\n")
! 	       (while (and (not disable-point-adjustment)
! 			   (not (eobp)) (invisible-p (point)))
  		 (goto-char (next-char-property-change (point)))
  		 (skip-chars-forward "^\n"))
  	       (point))))
***************
*** 3944,3950 ****
        (beginning-of-line)
      (move-to-column col))

!   (when (and line-move-ignore-invisible
  	     (not (bolp)) (invisible-p (1- (point))))
      (let ((normal-location (point))
  	  (normal-column (current-column)))
--- 3943,3949 ----
        (beginning-of-line)
      (move-to-column col))

!   (when (and (not disable-point-adjustment)
  	     (not (bolp)) (invisible-p (1- (point))))
      (let ((normal-location (point))
  	  (normal-column (current-column)))

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  parent reply	other threads:[~2007-12-02  9:47 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                               ` invisible martin rudalics
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                                                           ` martin rudalics [this message]
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47527F29.5030204@gmx.at \
    --to=rudalics@gmx.at \
    --cc=Stephen.Berman@gmx.net \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).