unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: completing-read & emacsql
       [not found] <871qacrubf.fsf@thanosapollo.org>
@ 2024-01-20 14:36 ` Philip Kaludercic
  2024-01-20 20:15   ` Stefan Kangas
  0 siblings, 1 reply; 2+ messages in thread
From: Philip Kaludercic @ 2024-01-20 14:36 UTC (permalink / raw)
  To: Thanos Apollo; +Cc: emacs-devel, Stefan Kangas

Thanos Apollo <public@thanosapollo.org> writes:

> Hello Philip,

You seemed to have dropped emacs-devel, so I added it again.

> Is using a defcustom like this a valiable solution, for completing-read
> interactions?
>
> (defcustom gnosis-completing-read-function
>   (cond ((or (and (featurep 'vertico)
> 		  vertico-mode)
> 	     (and (featurep 'helm)
> 		  helm-mode))
> 	 'completing-read)
>         ((and (featurep 'ivy)
> 	      ivy-mode)
> 	 'ivy-completing-read)
>         (t 'ido-completing-read))
>   "Preferred `completing-read' function to use.
>
> Defaults to Vertico, Ivy or Helm if available and enabled,
> otherwise defaults to `ido-completing-read'."
>   :type 'function
>   :group 'gnosis)

I wouldn't say so, at least for people like me who want to avoid visual
noise (as Emacs does by default), all of the above are wrong.  I /want/
to use the default completion interface.

There is sadly a common mistake, in believing that `completing-read'
provides an interface for selecting strings, while the default interface
distinguishes between expansion of partial input and selecting from a
list of completion options.  To me, that is the reason why

  (completing-read "Select: " '(foo bar baz))

returns a string, and not a symbol.  The interface is reading textual
input while providing completion -- which by default doesn't have to be
any of the completion options!

There is no canonical interface I know of to select an s-expression from
a collection, but perhaps there should be, to avoid the need of misusing
`completing-read'.

>
> AFAIK ido-completing-read is built-in with Emacs, this should make the
> user intractions with gnosis more convenient with the default emacs
> behavior.
>
>
> Where can I look for the discussions that took place for emacsql
> inclusion in nongnu ELPA? I can see a github issue on emacsql repo, but
> searching for "Jonas Bernoulli emacsql" on the emacs-devel archive
> doesn't return anything.

Stefan Kangas (CC'ed) added the packages a little over a year ago,
perhaps he remembers?

> I could use the built-in sqlite implementation, but it would mean that I
> (might) have to change much of the current values of my current database
> or at least how they are outputted.
>
> If you were developing a package that was already built using emacsql,
> would you consider it worth the work to change it to the built in sqlite?

I don't know what the current emacsql situation is, so it would be worth
looking into to resolve why the package is currently only on -devel, at
least before you start rewriting stuff.



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

* Re: completing-read & emacsql
  2024-01-20 14:36 ` completing-read & emacsql Philip Kaludercic
@ 2024-01-20 20:15   ` Stefan Kangas
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Kangas @ 2024-01-20 20:15 UTC (permalink / raw)
  To: Philip Kaludercic, Thanos Apollo; +Cc: emacs-devel

Philip Kaludercic <philipk@posteo.net> writes:

>> Where can I look for the discussions that took place for emacsql
>> inclusion in nongnu ELPA? I can see a github issue on emacsql repo, but
>> searching for "Jonas Bernoulli emacsql" on the emacs-devel archive
>> doesn't return anything.
>
> Stefan Kangas (CC'ed) added the packages a little over a year ago,
> perhaps he remembers?

We discussed it here:

https://lists.gnu.org/archive/html/emacs-devel/2022-12/msg00525.html



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

end of thread, other threads:[~2024-01-20 20:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <871qacrubf.fsf@thanosapollo.org>
2024-01-20 14:36 ` completing-read & emacsql Philip Kaludercic
2024-01-20 20:15   ` Stefan Kangas

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