all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#23852: 25.0.95; lazy-completion-table discards metadata
@ 2016-06-27  2:21 Michael Heerdegen
  2016-06-27  2:42 ` Noam Postavsky
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Heerdegen @ 2016-06-27  2:21 UTC (permalink / raw)
  To: 23852


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






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#23852: 25.0.95; lazy-completion-table discards metadata
  2016-06-27  2:21 bug#23852: 25.0.95; lazy-completion-table discards metadata Michael Heerdegen
@ 2016-06-27  2:42 ` Noam Postavsky
  2016-06-27  2:47   ` Michael Heerdegen
  0 siblings, 1 reply; 3+ messages in thread
From: Noam Postavsky @ 2016-06-27  2:42 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 23852

On Sun, Jun 26, 2016 at 10:21 PM, Michael Heerdegen
<michael_heerdegen@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 ...))))))))
[...]





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#23852: 25.0.95; lazy-completion-table discards metadata
  2016-06-27  2:42 ` Noam Postavsky
@ 2016-06-27  2:47   ` Michael Heerdegen
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Heerdegen @ 2016-06-27  2:47 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 23852

Noam Postavsky <npostavs@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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-27  2:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-27  2:21 bug#23852: 25.0.95; lazy-completion-table discards metadata Michael Heerdegen
2016-06-27  2:42 ` Noam Postavsky
2016-06-27  2:47   ` Michael Heerdegen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.