From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: feature/icomplete-vertical Date: Mon, 05 Oct 2020 14:07:05 +0100 Message-ID: <875z7og6ti.fsf@gmail.com> References: <20200920130435.heye7bk73pm252km@Ergus> <83sgbczj0i.fsf@gnu.org> <83lfh4zfml.fsf@gnu.org> <838sd4z6lz.fsf@gnu.org> <20201001164804.mqqyxtet4ttweuyv@Ergus> <83blhhdy3w.fsf@gnu.org> <87d01xghmt.fsf@gmail.com> <83sgatc8er.fsf@gnu.org> <83mu11c78j.fsf@gnu.org> <87tuv9eygk.fsf@gmail.com> <83k0w5c4yt.fsf@gnu.org> <87mu10gbjs.fsf@gmail.com> <83h7r8dhfv.fsf@gnu.org> <87a6x0ga5v.fsf@gmail.com> <83ft6sdgjq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4076"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: ghe@sdf.org, spacibba@aol.com, juri@linkov.net, casouri@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 05 15:07:56 2020 Return-path: 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 ) id 1kPQDc-0000yX-Ip for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Oct 2020 15:07:56 +0200 Original-Received: from localhost ([::1]:47250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPQDb-0004u9-L1 for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Oct 2020 09:07:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPQCt-0004U9-Pv for emacs-devel@gnu.org; Mon, 05 Oct 2020 09:07:11 -0400 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:50476) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPQCr-0002Nv-NK; Mon, 05 Oct 2020 09:07:11 -0400 Original-Received: by mail-wm1-x334.google.com with SMTP id 13so8550098wmf.0; Mon, 05 Oct 2020 06:07:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=nXZiS8ZsaRT5GINf64G+K/aU67HsGML6+H3KhwHLBLs=; b=mSS3GeoRhBi1p07IkCBszGPVeWP5esD6OxCR6U6QHBOreUln3gtW2aoGTYzDNoixCm iD3MCy8XnQ7t5ElAfHhRupd2J3CVrPeRu6UQ9pge4naeyEMELKQspmhOHmRs5s9UQywi bZKB1rOlki69OJZPH52WsZYsUgdWWHCD4eEf2qeddKEM3w8Pahsf0psGK9/GJm4Pgjva m+i/Y8Pur94pkzCLo42jvznDEqnxBW5xLSqRJBpKfa5aHYy7LVNtw81+AkV2tsi/KKxc 3Wqx3udNDe2rrVu4zZpxMkQPR/HWEjua8Gdr/VuksJwhxo02TlYPNbS2CMpHN7ToHwpC xceQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=nXZiS8ZsaRT5GINf64G+K/aU67HsGML6+H3KhwHLBLs=; b=YS29WBdoCOHB59fe3CQRZhWF2hVd0QnbHfJsogotiNIhWc/KFHyqKH0zz4rNcgTo9g 2MqeARcxqDIFLmrZsLmsR7jpa5p65jPl0Y0PThJvImQDJyKG9ekHyODrEf8VYp9f+IF0 JSz47OqUqyCxGDdOEzj3xYcqxdFbLsB1hCQnvKP2l+O+XiknhoaflDF9iuAuNF0Dtxpa xw9ocGVERWtQ1ZhDJzlXEAK45r13nTFw+P3W2CrQd2sujr0KHmojekxV0TUUxWRsEjl8 SnG36Wns+xhIaU4CP7C4+yR0MfWibXuSwCdNgiXLs2v0b7BFKd92llrXVkQwieRowFIv az6A== X-Gm-Message-State: AOAM531KkCW+CB5pGraIdKTa03fQuGEXN52cKmbnYAXUHHmXk/ftaqWK OSvoe+ddWcMsR/Wr+mmpFE4= X-Google-Smtp-Source: ABdhPJyI+GhQp6LQEn39WEb6QOEElthIZ6GZmOM3s3ujJoR9LEudZmwGPaSNqQK/aQSJYaiXeHZcIg== X-Received: by 2002:a1c:a513:: with SMTP id o19mr16682310wme.130.1601903227306; Mon, 05 Oct 2020 06:07:07 -0700 (PDT) Original-Received: from krug (89-180-147-115.net.novis.pt. [89.180.147.115]) by smtp.gmail.com with ESMTPSA id p67sm13521617wmp.11.2020.10.05.06.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Oct 2020 06:07:06 -0700 (PDT) In-Reply-To: <83ft6sdgjq.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 05 Oct 2020 15:05:13 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=joaotavora@gmail.com; helo=mail-wm1-x334.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:257123 Archived-At: Eli Zaretskii writes: >> From: Jo=C3=A3o T=C3=A1vora >> Date: Mon, 05 Oct 2020 12:54:52 +0100 >> Cc: ghe@sdf.org, spacibba@aol.com, emacs-devel@gnu.org, casouri@gmail.co= m, >> juri@linkov.net >>=20 >> > We could write a similar function to do what you want, but please note >> > that such a function will not understand the semantics of the text, so >> > it could suggest truncating it at some place which makes no sense. >> > If the caller would like a smarter 'service", we will have to come up >> > with some method of telling the function where it makes sense to >> > truncate the text. >>=20 >> Right. My idea is that a "dumb" service gives us a text position and the >> application, which does know the semantics of the things being >> displayed, decides based on that. >>=20 >> For example, icomplete would remove the candidate where the truncation >> happened and replace it with an elipsis, whereas eldoc would remove the >> piece of documentation entirely and maybe replace it with a hint to >> visit the *eldoc* buffer. > > In use cases that are not the most trivial ones, knowing what to > remove could not be easy. For example, what if the part that exceeds > the window dimensions comes from display or overlay string? Also, > does the application tolerate partially-visible lines? So some > additional information will need to be made available to the function, > I think. I think the easiest way to make this function is to give it a buffer where text exists as buffer text and truncate-lines is what it it. Then it can say exactly where it _would_ cut off. The application can then use that data to inform the display of text and/or overlay strings, and potentially remove "semantic elements" accordingly. Jo=C3=A3o