all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 31067@debbugs.gnu.org
Subject: bug#31067: 27.0.50; After-string hidden by subsequent invisible text
Date: Thu, 05 Apr 2018 12:49:20 +0300	[thread overview]
Message-ID: <8360562db3.fsf@gnu.org> (raw)
In-Reply-To: <jwvmuyi9yj8.fsf@iro.umontreal.ca> (message from Stefan Monnier on Wed, 04 Apr 2018 22:28:59 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Wed, 04 Apr 2018 22:28:59 -0400
> 
>     (defun foo ()
>       (interactive)
>       (with-current-buffer "*scratch*"
>         (add-to-invisibility-spec '(foo . t))
>         (let ((beg (point)))
>           (insert "text")
>           (let ((ol1 (make-overlay beg (point))))
>             (overlay-put ol1 'after-string "!after!")
>             (overlay-put ol1 'evaporate t)))
>         (let ((beg (point)))
>           (insert "\nhidden")
>           (let ((ol1 (make-overlay beg (point))))
>             (overlay-put ol1 'invisible 'foo)
>             (overlay-put ol1 'evaporate t)))))
> 
> and then try it with `M-x foo`.
> The result for me is to display "text...", whereas I would have expected
> "text!after!...".
> 
> I.e. the after-string which I placed over "text" gets hidden by
> `invisible` property of the overlay placed on the immediately following
> "\nhidden".
> 
> I know these kinds of interactions are pretty delicate and often
> somewhat arbitrary (several behaviors are valid and we just have to pick
> one), but I think in this case it is clearly an error.

Would you expect the after-string to be shown in the variant below?

(defun foo ()
  (interactive)
  (with-current-buffer "*scratch*"
    (add-to-invisibility-spec '(foo . t))
    (let ((beg (point))
	  end)
      (insert "hidden")
      (setq end (point))
      (insert "text")
      (let ((ol1 (make-overlay beg end)))
        (overlay-put ol1 'after-string "!after!")
        (overlay-put ol1 'evaporate t))
      (let ((ol2 (make-overlay (1+ beg) (point))))
        (overlay-put ol2 'invisible 'foo)
        (overlay-put ol2 'evaporate t)))))

IOW, the question is what should happen when the end-point of the
overlay with after-string is in invisible text?





  reply	other threads:[~2018-04-05  9:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05  2:28 bug#31067: 27.0.50; After-string hidden by subsequent invisible text Stefan Monnier
2018-04-05  9:49 ` Eli Zaretskii [this message]
2018-04-05 12:23   ` Stefan Monnier
2018-04-05 13:38     ` Eli Zaretskii
2018-04-05 15:55       ` Stefan Monnier
2018-04-05 18:00         ` Eli Zaretskii
2018-04-05 19:15           ` Stefan Monnier
2018-04-06  8:24             ` Eli Zaretskii
2018-04-06 12:28               ` Stefan Monnier
2018-04-06 13:11                 ` Eli Zaretskii
     [not found]             ` <<83k1tk214a.fsf@gnu.org>
2018-04-06 15:39               ` Drew Adams
2018-04-06 17:10                 ` Eli Zaretskii
     [not found] <<jwvmuyi9yj8.fsf@iro.umontreal.ca>

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=8360562db3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=31067@debbugs.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.