unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Gregory Heytings <ghe@sdf.org>
Cc: monnier@iro.umontreal.ca, 43519@debbugs.gnu.org
Subject: bug#43519: 28.0.50; Overlay at end of minibuf hides minibuf's real content
Date: Mon, 21 Sep 2020 20:30:40 +0300	[thread overview]
Message-ID: <83ft7bxcjj.fsf@gnu.org> (raw)
In-Reply-To: <alpine.NEB.2.22.394.2009211811480453.18585@sdf.lonestar.org> (message from Gregory Heytings on Mon, 21 Sep 2020 16:27:51 +0000)

> Date: Mon, 21 Sep 2020 16:27:51 +0000
> From: Gregory Heytings <ghe@sdf.org>
> cc: monnier@iro.umontreal.ca, 43519@debbugs.gnu.org
> 
> > This bug was filed to request that Emacs behaves with overlay-string in 
> > the minibuffer prompt the same as with regular buffer text.
> 
> Hmmm...  no, this bug was filed after a discussion on emacs-devel (about 
> implementing vertical icomplete), and the problem is clearly stated by 
> Stefan: the prompt and user input so far disappear.

That's not my reading of the main argument, posted by Stefan in

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43519#17

Some quotes:

  I used `icomplete-mode` only as a vehicle to show the underlying
  behavior with a short recipe which exhibits a real-life problem.
  [...]
  This performs "display of text after point" in 2 different ways:
  - first by `insert`.
  - then with an overlay.
  The visual rendering of the text is the same, with the cursor at the
  same place.  When we do it with `insert` there is no horizontal
  scrolling, but when we do it with an overlay the text gets scrolled so
  the cursor is at `window-start`.

  `icomplete` needs the behavior to be the same as with `insert`, but it
  prefers to use an overlay to avoid some undesirable side-effects of
  modifying the actual text.

  So the question is: how to get the same behavior as what we'd get with
  `insert` but without actually modifying the buffer's contents?

My summary of the problem raised by Stefan:

  . icomplete is just an example that exhibits a more general issue
  . the more general issue is that the display after resizing the
    mini-window is different depending on whether it uses plain buffer
    text or an after-string overlay at EOB

If you use Stefan's recipe, but make the prompt much longer, like
this:

    (minibuffer-with-setup-hook
        (lambda ()
          (insert "hello")
          (let ((ol (make-overlay (point) (point)))
                (max-mini-window-height 1)
                (text "askdjfhaklsjdfhlkasjdfhklasdhflkasdhflkajsdhflkashdfkljahsdlfkjahsdlfkjhasldkfhalskdjfhalskdfhlaksdhfklasdhflkasdhflkasdhflkajsdhklajsdgh"))
            (save-excursion (insert text))
            (sit-for 2)
            (delete-region (point) (point-max))
            (put-text-property 0 1 'cursor t text)
            (overlay-put ol 'after-string text)
            (sit-for 2)
            (delete-overlay ol)))
      (read-string "totototototototototototototototototototototototototototototototototototototototototototototototototototo: "))

then in the 1st ("insert text") part of the recipe you will see only
the last part of the prompt.  Which is the long-standing behavior of
resizing mini-windows: if the mini-window cannot be enlarged enough to
show the entire text in it, we show its last part.

Stefan asked for the same behavior when an overlay with after-string
is used.  My suggestion (I hope) will do what he asks, or approximate
that as well as I think is possible under the current design of the
display code.

> Which is why my proposal is to not break anything, but only to give 
> applications the control of how what they insert in the minibuffer is 
> displayed.  A start_display_at_beginning_of_minibuffer variable that would 
> be reset in read_minibuf() and that an application could set in 
> minibuffer-setup-hook.  I don't understand why you would be opposed to 
> such a change.

Because it changes a long-standing behavior with inserting normal text
into the minibuffer.

> > That may or may not be a good idea, but it's a separate issue, so should 
> > be discussed separately
> 
> It's _not_ a separate issue, it's the issue at hand.

I disagree, and I explained above why.

> > (and in that separate discussion I will generally be opposed to the 
> > change you are proposing, because we had the current behavior for many 
> > years, and so changes like the one you propose run serious risk of 
> > breaking expectations of some package out there).
> >
> 
> Why would a change that does not change Emacs' behavior in any way except 
> if the user requests it "run serious risk of breaking expectations of some 
> package out there"?

This is not the user, this is a Lisp program that will do it.  The
behavior will change in that the user will be shown only the first
part of the text, as opposed to the last part we were showing until
now.  Maybe such a change in behavior is desirable (I'm not sure, and
I don't yet have a clear idea how will Lisp programs decide which
behavior to request), but it's a separate issue.





  reply	other threads:[~2020-09-21 17:30 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-19 17:54 bug#43519: 28.0.50; Overlay at end of minibuf hides minibuf's real content Stefan Monnier
2020-09-19 18:52 ` Eli Zaretskii
2020-09-19 19:42   ` Stefan Monnier
2020-09-19 20:10     ` Eli Zaretskii
2020-09-19 22:06       ` Stefan Monnier
2020-09-20  8:52         ` Eli Zaretskii
2020-09-20 21:04           ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-20 21:31             ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21  6:50               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 14:17                 ` Eli Zaretskii
2020-09-21 15:02                   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 15:33                     ` Eli Zaretskii
2020-09-21 15:44                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 16:10                         ` Eli Zaretskii
2020-09-21 16:27                           ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 17:30                             ` Eli Zaretskii [this message]
2020-09-21 18:42                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 19:37                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 19:37                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22  6:57                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22  6:57                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 14:11                                 ` Eli Zaretskii
2020-09-22 15:52                                   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 16:10                                     ` Eli Zaretskii
2020-09-22 21:01                                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 17:28                   ` Stefan Monnier
2020-09-21 17:47                     ` Eli Zaretskii
2020-09-21 18:45                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 19:37                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22  6:58                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 14:14                         ` Eli Zaretskii
2020-09-21 14:04               ` Eli Zaretskii
2020-09-21 14:31                 ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 14:47                   ` Eli Zaretskii
2020-09-21 14:02             ` Eli Zaretskii
2020-09-21 14:18               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 14:45                 ` Eli Zaretskii
2020-09-21 15:26                   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 15:39                     ` Eli Zaretskii
2020-09-21 16:00                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-20 22:40           ` Stefan Monnier
2020-09-21  7:04             ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 14:05             ` Eli Zaretskii
2020-09-21 17:25               ` Stefan Monnier
2020-09-21 17:45                 ` Eli Zaretskii
2020-09-21 19:17                   ` Stefan Monnier
2020-09-21 19:47                     ` Eli Zaretskii
2020-09-22  5:26                       ` Eli Zaretskii
2020-09-22 14:00                         ` Stefan Monnier
2020-09-22 14:02                         ` Eli Zaretskii
2020-09-22 15:51                           ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 16:06                             ` Eli Zaretskii
2020-09-22 16:17                               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22 16:47                                 ` Eli Zaretskii
2020-09-22 16:49                                 ` Eli Zaretskii
2020-09-22 20:06                                   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-23  2:40                                     ` Eli Zaretskii
2020-09-23  7:15                                       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-23 14:34                                         ` Eli Zaretskii
2020-09-21 20:05                     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-21 20:49                     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-23 18:35                       ` Stefan Monnier
2020-09-22  6:58                     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-22  6:58                     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-20  1:00 ` bug#43519: (no subject) Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-20  6:08   ` Eli Zaretskii
2020-09-20  8:27 ` bug#43519: 28.0.50; Overlay at end of minibuf hides minibuf's real content Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-20  9:03   ` Eli Zaretskii
2020-09-20 10:12     ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-09-20 10:52       ` Eli Zaretskii
2020-09-20 19:50 ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] <<jwvft7dveii.fsf@iro.umontreal.ca>
     [not found] ` <<83wo0p1twr.fsf@gnu.org>
     [not found]   ` <<jwvh7rta7et.fsf-monnier+emacs@gnu.org>
     [not found]     ` <<83r1qx1q9v.fsf@gnu.org>
     [not found]       ` <<jwvzh5l8med.fsf-monnier+emacs@gnu.org>
     [not found]         ` <<838sd425l2.fsf@gnu.org>
     [not found]           ` <<jwvd02g5bnp.fsf-monnier+emacs@gnu.org>
     [not found]             ` <<83y2l3xm15.fsf@gnu.org>
     [not found]               ` <<jwvwo0n2hgh.fsf-monnier+emacs@gnu.org>
     [not found]                 ` <<83eemvxbvg.fsf@gnu.org>
     [not found]                   ` <<jwv363b2b48.fsf@iro.umontreal.ca>
     [not found]                     ` <<837dsmykrn.fsf@gnu.org>
     [not found]                       ` <<E1kKapF-0007yc-Mb@fencepost.gnu.org>
     [not found]                         ` <<831ritykni.fsf@gnu.org>
     [not found]                           ` <<alpine.NEB.2.22.394.2009221712130453.10035@sdf.lonestar.org>
     [not found]                             ` <<83k0wlx0cz.fsf@gnu.org>
     [not found]                               ` <<alpine.NEB.2.22.394.2009221808130453.16638@sdf.lonestar.org>
     [not found]                                 ` <<83d02dwyfa.fsf@gnu.org>
2020-09-22 20:03                                   ` Drew Adams

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=83ft7bxcjj.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=43519@debbugs.gnu.org \
    --cc=ghe@sdf.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 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).