unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master e21a1da: Allow completion styles to adjust completion metadata
       [not found] ` <20191026132224.B05E120664@vcs0.savannah.gnu.org>
@ 2019-10-26 20:52   ` Stefan Monnier
  2019-10-26 22:03     ` João Távora
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2019-10-26 20:52 UTC (permalink / raw)
  To: emacs-devel; +Cc: João Távora

> +    (when adjust-fn
> +      (setcdr metadata (cdr (funcall adjust-fn metadata))))

Do we know that the `metadata` argument we received is always a cons cells?

BTW, I just changed the bootstrap so that cl-defgeneric should now be
usable in minibuffer.el.


        Stefan




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

* Re: master e21a1da: Allow completion styles to adjust completion metadata
  2019-10-26 20:52   ` master e21a1da: Allow completion styles to adjust completion metadata Stefan Monnier
@ 2019-10-26 22:03     ` João Távora
  2019-10-27  2:04       ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: João Távora @ 2019-10-26 22:03 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> +    (when adjust-fn
>> +      (setcdr metadata (cdr (funcall adjust-fn metadata))))
>
> Do we know that the `metadata` argument we received is always a cons
> cells?

I assumed it is.  Do you know that it isn't?  nil?  BTW I hate this
metadata object, I with there were proper writers/constructors that
didn't assume anything about its cons-implementation.  Perhaps I missed
something.

> BTW, I just changed the bootstrap so that cl-defgeneric should now be
> usable in minibuffer.el.

Out of energy right now.  Be my guest, the switch to cl-generic is
trivally outlined in the now-revert commit.

João




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

* Re: master e21a1da: Allow completion styles to adjust completion metadata
  2019-10-26 22:03     ` João Távora
@ 2019-10-27  2:04       ` Stefan Monnier
  2019-10-27 12:20         ` João Távora
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2019-10-27  2:04 UTC (permalink / raw)
  To: João Távora; +Cc: emacs-devel

> I assumed it is.  Do you know that it isn't?  nil?

I think it can be nil, yes.

> BTW I hate this metadata object, I with there were proper
> writers/constructors that didn't assume anything about its
> cons-implementation.  Perhaps I missed something.

No, you didn't miss anything.

>> BTW, I just changed the bootstrap so that cl-defgeneric should now be
>> usable in minibuffer.el.
>
> Out of energy right now.  Be my guest, the switch to cl-generic is
> trivally outlined in the now-revert commit.

I was about to do that when I saw the issue with `metadata` being
potentially nil.


        Stefan




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

* Re: master e21a1da: Allow completion styles to adjust completion metadata
  2019-10-27  2:04       ` Stefan Monnier
@ 2019-10-27 12:20         ` João Távora
  0 siblings, 0 replies; 4+ messages in thread
From: João Távora @ 2019-10-27 12:20 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I assumed it is.  Do you know that it isn't?  nil?
> I think it can be nil, yes.

I just discovered this in the beginning of completion--nth-completion.
Doesn't it quash your concerns?

(defun completion--nth-completion (n string table pred point metadata)
  "Call the Nth method of completion styles."
  (unless metadata
    (setq metadata
          (completion-metadata (substring string 0 point) table pred)))

          
>>> BTW, I just changed the bootstrap so that cl-defgeneric should now be
>>> usable in minibuffer.el.
>> Out of energy right now.  Be my guest, the switch to cl-generic is
>> trivally outlined in the now-revert commit.
> I was about to do that when I saw the issue with `metadata` being
> potentially nil.

See above.  Also, I don't see the change to the bootstrap. Maybe you
forgot to push?

João



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

end of thread, other threads:[~2019-10-27 12:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20191026132223.21074.15227@vcs0.savannah.gnu.org>
     [not found] ` <20191026132224.B05E120664@vcs0.savannah.gnu.org>
2019-10-26 20:52   ` master e21a1da: Allow completion styles to adjust completion metadata Stefan Monnier
2019-10-26 22:03     ` João Távora
2019-10-27  2:04       ` Stefan Monnier
2019-10-27 12:20         ` João Távora

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).