unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Thanos Apollo <public@thanosapollo.org>
Cc: emacs-devel@gnu.org, Stefan Kangas <stefankangas@gmail.com>
Subject: Re: completing-read & emacsql
Date: Sat, 20 Jan 2024 14:36:46 +0000	[thread overview]
Message-ID: <87bk9g841t.fsf@posteo.net> (raw)
In-Reply-To: <871qacrubf.fsf@thanosapollo.org> (Thanos Apollo's message of "Sat, 20 Jan 2024 15:23:48 +0200")

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.



       reply	other threads:[~2024-01-20 14:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <871qacrubf.fsf@thanosapollo.org>
2024-01-20 14:36 ` Philip Kaludercic [this message]
2024-01-20 20:15   ` completing-read & emacsql Stefan Kangas

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=87bk9g841t.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=public@thanosapollo.org \
    --cc=stefankangas@gmail.com \
    /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).