unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Andrea Corallo <akrl@sdf.org>
Cc: 47868@debbugs.gnu.org, mail@daniel-mendler.de
Subject: bug#47868: 28.0.50; [native-comp] vertico package doesn't work when loading the corresponding eln file
Date: Sun, 18 Apr 2021 20:49:13 +0200	[thread overview]
Message-ID: <87tuo3v2i9.fsf@gnu.org> (raw)
In-Reply-To: <xjfr1j7a1fp.fsf@sdf.org>

Andrea Corallo <akrl@sdf.org> writes:

Hi Andrea,

> I think it would be very helpful to know which one is the Emacs
> function that once gets called misbehaves.

That's a bit hard to pinpoint.  It happens during `completing-read'
where the two vertico functions below are called from a
`post-command-hook' in order to display vertico's two overlays, the
"count overlay" before the minibuffer prompt, and the "candidates
overlay" starting after the input string.  Here's a "screenshot" of how
it is supposed to look like, | representing the usual position of point.

[1/3]   Find file: input|
input-candidate1
input-candidate2
input-candidate3

And here are the functions:

--8<---------------cut here---------------start------------->8---
(defun vertico--display-candidates (lines)
  "Update candidates overlay `vertico--candidates-ov' with LINES."
  (move-overlay vertico--candidates-ov (point-max) (point-max))
  (overlay-put vertico--candidates-ov 'after-string
               (apply #'concat #(" " 0 1 (cursor t)) (and lines "\n") lines))
  (let* ((lh (default-line-height))
         (resize (default-value 'resize-mini-windows))
         (dp (- (max (cdr (window-text-pixel-size))
                     (* lh (1+ (if resize (length lines) vertico-count))))
                (window-pixel-height)))
         (dl (ceiling dp lh)))
    (when (or (> dl 0) (eq resize t)) (window-resize nil dl))))

(defun vertico--display-count ()
  "Update count overlay `vertico--count-ov'."
  (when vertico-count-format
    (move-overlay vertico--count-ov (point-min) (point-min))
    (overlay-put vertico--count-ov 'before-string
                 (format (car vertico-count-format)
                         (format (cdr vertico-count-format)
                                 (cond ((>= vertico--index 0) (1+ vertico--index))
                                       ((vertico--allow-prompt-selection-p) "*")
                                       (t "!"))
                                 vertico--total)))))
--8<---------------cut here---------------end--------------->8---

> PS one should just load the .elc file to obtain the corresponding .eln
> loaded.

Ah, ok.

Bye,
Tassilo





  reply	other threads:[~2021-04-18 18:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-18 11:16 bug#47868: 28.0.50; [native-comp] vertico package doesn't work when loading the corresponding eln file Tassilo Horn
2021-04-18 11:38 ` Daniel Mendler
2021-04-18 12:10 ` Eli Zaretskii
2021-04-18 18:32 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-18 18:49   ` Tassilo Horn [this message]
2021-04-19 19:28     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-20 20:13       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-20 22:19         ` jakanakaevangeli
2021-04-21  7:58           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-21  8:05             ` Daniel Mendler
2021-04-21  8:31               ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-21 11:32                 ` Daniel Mendler
2021-04-21 15:42                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-21 16:11                     ` Doug Davis
2021-04-22  7:47                       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-21  9:17               ` Eli Zaretskii
2021-04-21 10:11                 ` Tassilo Horn

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=87tuo3v2i9.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=47868@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=mail@daniel-mendler.de \
    /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).