From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs Subject: bug#47860: 28.0.50; Mini buffer resize when lines are truncated regression Date: Mon, 19 Apr 2021 10:13:51 -0500 Message-ID: References: <835z0kulkq.fsf@gnu.org> <83blabtqqz.fsf@gnu.org> <83wnsys9ml.fsf@gnu.org> <83k0oys52v.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40690"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47860@debbugs.gnu.org, Gregory Heytings To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 19 17:16:15 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lYVdH-000AQn-5t for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Apr 2021 17:16:15 +0200 Original-Received: from localhost ([::1]:56320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYVdG-0005WJ-1U for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Apr 2021 11:16:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYVc6-0003m5-8x for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 11:15:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40081) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYVc5-0000q6-Tm for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 11:15:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lYVc5-0000je-PL for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 11:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Apr 2021 15:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47860 X-GNU-PR-Package: emacs Original-Received: via spool by 47860-submit@debbugs.gnu.org id=B47860.16188452532750 (code B ref 47860); Mon, 19 Apr 2021 15:15:01 +0000 Original-Received: (at 47860) by debbugs.gnu.org; 19 Apr 2021 15:14:13 +0000 Original-Received: from localhost ([127.0.0.1]:51627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYVbI-0000iH-Kh for submit@debbugs.gnu.org; Mon, 19 Apr 2021 11:14:13 -0400 Original-Received: from mail-yb1-f171.google.com ([209.85.219.171]:39583) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYVbF-0000i2-8y for 47860@debbugs.gnu.org; Mon, 19 Apr 2021 11:14:11 -0400 Original-Received: by mail-yb1-f171.google.com with SMTP id z1so39137858ybf.6 for <47860@debbugs.gnu.org>; Mon, 19 Apr 2021 08:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IYzmOGBgkylOED6VvuZFqbB73oy3VX9MF2rvVndXLXs=; b=qJ9Uiicnf9t9Zm2W9N4VEa8QEQqRvPuybb8ji5Wr3vEjjB75+NHp+7bOgLvI6QMqRt nytgmt7lJe2HcShsg7xF0Q5vPOREmoUN/lhR1b2Q6Vws+ebP6dHqwNAUSTDnUTQFMxHp GA/zRLMs0RYAFDDykDr31h9vLJpnYXtpiF99y+Y8uuOIIsMzLl8iVjY0A6XOPtX+Muvb kOD2kMGw9TiuM6PwRr6qhLoKHjag86UcJWClg2tIqGhPWC9nG9U53OWBi5LlZJH1+E/o Vpnndsdtsk7JxBRosIjc6aAAslumOgrUuOToeunIM67LfqcIbXc0aTteVswAFnZEhpkk alxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IYzmOGBgkylOED6VvuZFqbB73oy3VX9MF2rvVndXLXs=; b=t0H7eMIvTYt9cWr3gM5roracre5355HSh/ofouuTI6ZHunyUPxu+ogNJU9Lwk9IWh5 rqXEY99h695tH1ZK2E0H4VR4W6O5wWPH9mghvyxx5EJajSvqBkNNlpv3MVac6OvUSyus H1pyMKlyrhbuPiswGQWUQCNlCtN5N1H7KvSMgJDerXAEUpdAzrA9LkpAkpbbD0PlyKUz WVYRc+orzDtXoJ37v4lEBLT/oi68XZCAV+ILDZyg7Wk9T5bVB/bahWBvJsmH1BcqUYbX IWW9ZEshMq7gjMrB3mLZDkxijTi/YPNjnZ1YKun/m+Nx1rPzXPoNlCid+zqU8a83sTmF 1r6A== X-Gm-Message-State: AOAM531SPoKpGjW0BiPg9VUHbgUdsI5R2QnA2IhoncHx0VwDkjGKOHD5 Kzj8XQ2T9BV9Jg0dEuyzQyS1t2NM+Js2gntlkUu2Qu4zk498/A== X-Google-Smtp-Source: ABdhPJyJmcvC3L9Tvx7TGgnznl5kPORrvUHp343yTdILMUli6H8foiwZga/28zmpmXKLV4u/xccpVgwFebHxLdJRt8Q= X-Received: by 2002:a25:7157:: with SMTP id m84mr17841294ybc.175.1618845243537; Mon, 19 Apr 2021 08:14:03 -0700 (PDT) In-Reply-To: <83k0oys52v.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:204471 Archived-At: On Mon, Apr 19, 2021 at 9:48 AM Eli Zaretskii wrote: > So you have a package (or two?) that work(s) only with an unreleased > codebase of Emacs 28 before those two commits were installed? How > do those packages work in Emacs 27 and previous versions? No, they work in Emacs 27 and 28 before 56c42bd28d was installed. As I said, selectrum must be doing something else on top of what I narrowed my repro down that triggers the appropriate resize. > > > This is what it looks like when using selectrum in Emacs 27: > > > > https://user-images.githubusercontent.com/8199224/114367956-3f4a8e00-9b7d-11eb-8307-5372fb48de63.png > > > > and Emacs 28: > > > > https://user-images.githubusercontent.com/8588/114411541-e1fd0f80-9b71-11eb-8ba3-5bf1437a7806.png > > That looks like an entirely different phenomenon than the one > presented by the minimal reproducer. Are you sure that the reproducer > actually shows the same problem? Both show a failure to resize properly in correlation with a truncated line. I now believe it's unlikely to be the exact same issue given the behavior on Emacs 27 w/ my repro. Until I've successfully narrowed down something that reproduces on Emacs 27, I can't say for certain that they're related. > Bottom line, I'm now even more confused regarding the problem and the > effect of the 2 commits you reverted. Yeah, well, I'm confused as well. I'm trying to narrow down a repro in multiple codebases I don't fully understand that points to a commit that I do not understand at all. I'm feeling my way through the dark here so I appreciate your patience. > Reverting them should get you > back to what we had in Emacs 27 and before, but you say it doesn't? That's right, it does not, however resetting to 56c42bd28d^ does. Said plainly: there's a difference in my repro between 56c42bd28d^ and master + a revert of 56c42bd28d (and the section associated commit that affected that same area of the code). > And the effect on selectrum is very different than the effect on the > reproducer you posted. In my naivete they looked the same: a failure to resize the minibuffer vertically to the appropriate size. There's more nuance to this though and I'll work on a clarifying repro. If you're willing to install selectrum, it would be helpful if you could at least verify the behavior I'm seeing so that I do not think I've gone mad. This reproduces the problem for me on master, but not on emacs-27. Specifically, on emacs-27, I see both aaaa... and bbbb... visible in the minibuffer, but on master, I only see aaa.... (require 'selectrum) (let ((prompt "test: ") (candidates '("aaa" "bbb")) (candidates '("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"))) (let* ((buf (current-buffer)) default (res (let ((hook (make-symbol "selectrum--minibuffer-setup"))) (fset hook (lambda nil (remove-hook 'minibuffer-setup-hook hook) (setq-local selectrum--last-buffer buf) ;; Track globally and in last buffer. (setq-default selectrum--last-command this-command) (setq-default selectrum--last-prefix-arg current-prefix-arg) (when (buffer-live-p selectrum--last-buffer) (with-current-buffer selectrum--last-buffer (setq-local selectrum--last-command this-command) (setq-local selectrum--last-prefix-arg current-prefix-arg))) (setq-local auto-hscroll-mode nil) (setq-local selectrum--is-initializing t) (setq-local selectrum--candidates-overlay (make-overlay (point) (point) nil 'front-advance 'rear-advance)) (setq-local selectrum--count-overlay (make-overlay (point-min) (point-min))) ;; If metadata specifies a custom sort function use it as ;; `selectrum-preprocess-candidates-function' for this session. (when-let ((sortf (selectrum--get-meta 'display-sort-function))) (setq-local selectrum-preprocess-candidates-function sortf)) (if (not (functionp candidates)) (selectrum--preprocess candidates) (setq-local selectrum--preprocessed-candidates nil) (setq-local selectrum--dynamic-candidates-function candidates)) (let ((default (or (car-safe default) default))) (setq-local selectrum--default-candidate (if (and default (symbolp default)) (symbol-name default) default))) (setq-default selectrum--default-candidate selectrum--default-candidate) ;; Make sure to trigger an "user input changed" event, so that ;; candidate refinement happens in `post-command-hook' and an index ;; is assigned. (setq-local selectrum--previous-input-string nil) (setq-local selectrum--line-height (line-pixel-height)) (add-hook 'post-command-hook #'selectrum--update nil 'local))) (unwind-protect (progn (add-hook 'minibuffer-setup-hook hook t) (read-from-minibuffer prompt)) (remove-hook 'minibuffer-setup-hook hook)))))))