From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Gregory Heytings via "Emacs development discussions." <emacs-devel@gnu.org>
Newsgroups: gmane.emacs.devel
Subject: Re: [PATCH] Support "\n" in icomplete-separator
Date: Tue, 10 Nov 2020 20:00:58 +0000
Message-ID: <alpine.NEB.2.22.394.2011102053020453.9535@sdf.lonestar.org>
References: <m2a6vv8ko3.fsf@gmail.com> <20201105235735.oxouuek66ehu5o45@Ergus>
 <m2y2je7jcx.fsf@gmail.com> <20201106151541.dpgep7borlja25su@Ergus>
 <m2d00n7gj4.fsf@gmail.com> <837dqv5huk.fsf@gnu.org>
 <m24klys0n2.fsf@gmail.com> <83mtzp2qj0.fsf@gnu.org>
 <m2imad6sh1.fsf@gmail.com> <83r1p11369.fsf@gnu.org>
 <alpine.NEB.2.22.394.2011102014110453.7695@sdf.lonestar.org>
 <83lff9107k.fsf@gnu.org>
Reply-To: Gregory Heytings <ghe@sdf.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="40616"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Alpine 2.22 (NEB 394 2020-01-19)
Cc: spacibba@aol.com, monnier@iro.umontreal.ca, andreyk.mad@gmail.com,
 emacs-devel@gnu.org
To: Eli Zaretskii <eliz@gnu.org>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 10 21:03:46 2020
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Envelope-to: ged-emacs-devel@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1kcZrm-000ASY-4P
	for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Nov 2020 21:03:46 +0100
Original-Received: from localhost ([::1]:54232 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1kcZrl-00068A-25
	for ged-emacs-devel@m.gmane-mx.org; Tue, 10 Nov 2020 15:03:45 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59322)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ghe@sdf.org>) id 1kcZpK-0005SU-3g
 for emacs-devel@gnu.org; Tue, 10 Nov 2020 15:01:14 -0500
Original-Received: from mx.sdf.org ([205.166.94.24]:57859)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ghe@sdf.org>)
 id 1kcZpH-0004Cm-OG; Tue, 10 Nov 2020 15:01:13 -0500
Original-Received: from sdf.org (IDENT:ghe@faeroes.freeshell.org [205.166.94.9])
 by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 0AAK13Zr013627
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO);
 Tue, 10 Nov 2020 20:01:04 GMT
Original-Received: (from ghe@localhost)
 by sdf.org (8.15.2/8.12.8/Submit) id 0AAK1X5E016635;
 Tue, 10 Nov 2020 20:01:33 GMT
In-Reply-To: <83lff9107k.fsf@gnu.org>
Received-SPF: pass client-ip=205.166.94.24; envelope-from=ghe@sdf.org;
 helo=mx.sdf.org
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/10 13:18:46
X-ACL-Warn: Detected OS   = ???
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=subscribe>
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org
Original-Sender: "Emacs-devel"
 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Xref: news.gmane.io gmane.emacs.devel:258991
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/258991>


>>>> (defvar o (make-overlay 0 0 nil t t))
>>>> (minibuffer-with-setup-hook
>>>>     (lambda ()
>>>>       (set (make-local-variable 'face-remapping-alist)
>>>>            '((default :height 1.3)))
>>>>       (move-overlay o (point) (point) (current-buffer))
>>>>       (let ((text (mapconcat
>>>>                    #'identity
>>>>                    '("Some" "text" "that" "will" "not" "fit"
>>>>                      "the" "minibuffer" "window")
>>>>                    "\n")))
>>>>         (put-text-property 0 1 'cursor t text)
>>>>         (overlay-put o 'after-string text)))
>>>>   (read-string "Multiline\nprompt: "))
>>>>
>>>> Is it possible to make the prompt visible?  Should I file bug report 
>>>> for this?
>>>
>>> What is the bug here?
>>
>> The "bug" is that the word "Multiline" is not visible, only the word 
>> "prompt:" is.  This has been discussed again and again, I don't 
>> understand why it is not yet clear for you.
>
> I asked Andrii.  I'm not sure if he thinks the same as you
>

It's obvious he does, given the recipe.

>
> but in case he does: the text inserted into the minibuffer doesn't fit. 
> So in this situation, Emacs can either (a) start display from the 
> prompt's beginning, or (b) end the display at the end of the text
>

AFAIU (b) is not possible in this case, because the text that doesn't fit 
is in an overlay.

>
> or (c) start display somewhere in the middle, to show the end of the 
> prompt and some of the text after it.  Whatever Emacs does, some of the 
> text will not be visible.  How should Emacs know which of the 
> possibilities is the correct one in this case?
>

Emacs can't know.  As I already said, this should be decided by the 
application programmer, which isn't possible ATM, except with my solution.

>
> A "bug" is when there's an obvious choice between the possible outcomes, 
> but Emacs behaves not in the obvious way.  I don't think this is the 
> situation here.  Thus my question.
>

Note that I have put the word "bug" between quotes, I do not think this is 
a bug.  It's a missing feature.