GNU bug report logs - #23852
25.0.95; lazy-completion-table discards metadata

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Mon, 27 Jun 2016 02:22:02 UTC

Severity: normal

Found in version 25.0.95

To reply to this bug, email your comments to 23852 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#23852; Package emacs. (Mon, 27 Jun 2016 02:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 27 Jun 2016 02:22:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.95; lazy-completion-table discards metadata
Date: Mon, 27 Jun 2016 04:21:24 +0200
Hello,

for example:

(completing-read
 "Input: "
 (letrec ((table (lazy-completion-table
                  table (lambda () (let ((cands '("1" "2")))
                                (lambda (string pred action)
                                  (if (eq action 'metadata)
                                      `(metadata
                                        (annotation-function . ,(lambda (_) " ---")))
                                    (complete-with-action
                                     action cands string pred))))))))
   table))


No annotations.

AFAICT this happens because lazy-completion-table is based on
completion-table-dynamic whose current implementation always returns
tables returning nil metadata.

There are workarounds, but it would be nicer if it just worked that
way...when the candidates are computed dynamically, an
annotation-function will ideally be computed along with them.


TIA,

Michael.



In GNU Emacs 25.0.95.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6)
 of 2016-06-21 built on drachen
Repository revision: 6cdd8f7153b553c6dc02be47e04a2e75117b6fe4
Windowing system distributor 'The X.Org Foundation', version 11.0.11803000
System Description:	Debian GNU/Linux testing (stretch)

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY
LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23852; Package emacs. (Mon, 27 Jun 2016 02:43:01 GMT) Full text and rfc822 format available.

Message #8 received at 23852 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 23852 <at> debbugs.gnu.org
Subject: Re: bug#23852: 25.0.95; lazy-completion-table discards metadata
Date: Sun, 26 Jun 2016 22:42:09 -0400
On Sun, Jun 26, 2016 at 10:21 PM, Michael Heerdegen
<michael_heerdegen <at> web.de> wrote:
> for example:
>
> (completing-read
>  "Input: "
>  (letrec ((table (lazy-completion-table
>                   table (lambda () (let ((cands '("1" "2")))
>                                 (lambda (string pred action)
>                                   (if (eq action 'metadata)
>                                       `(metadata
>                                         (annotation-function . ,(lambda (_) " ---")))
>                                     (complete-with-action
>                                      action cands string pred))))))))
>    table))

When trying to evaluate this, I get an error after hitting TAB at the prompt:

Debugger entered--Lisp error: (void-variable table)
  (functionp table)
  (if (functionp table) (progn (setq table (funcall (function (lambda
nil (let (...) (function ...))))))))
[...]




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23852; Package emacs. (Mon, 27 Jun 2016 02:49:01 GMT) Full text and rfc822 format available.

Message #11 received at 23852 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 23852 <at> debbugs.gnu.org
Subject: Re: bug#23852: 25.0.95; lazy-completion-table discards metadata
Date: Mon, 27 Jun 2016 04:47:39 +0200
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> When trying to evaluate this, I get an error after hitting TAB at the prompt:
>
> Debugger entered--Lisp error: (void-variable table)

Sorry, forgot to mention: you need to evaluate with lexical-binding
non-nil.


Michael.




This bug report was last modified 8 years and 354 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.