unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron <me@eshelyaron.com>
To: "Rudolf Adamkovič" <salutis@me.com>
Cc: emacs-devel@gnu.org,  Philip Kaludercic <philipk@posteo.net>,
	 Eli Zaretskii <eliz@gnu.org>
Subject: Re: [ELPA] New package: dict
Date: Fri, 26 May 2023 15:26:19 +0300	[thread overview]
Message-ID: <m1ilcfxor8.fsf@eshelyaron.com> (raw)
In-Reply-To: <m2pm6nz5n0.fsf@me.com> ("Rudolf Adamkovič"'s message of "Fri, 26 May 2023 13:36:19 +0200")

Hi,

Rudolf Adamkovič <salutis@me.com> writes:

> QUESTION 1.
>
> Is it expected that 'dictionary-lookup-definition' still uses the old
> interface, even thought I set
>
> (with-eval-after-load 'dictionary
>   (setopt dictionary-search-interface 'help))

Yes, `dictionary-search-interface` only affects `dictionary-search`.

It shouldn't be too hard to have it also affect
`dictionary-lookup-definition` though, would that be helpful?

Note that now you can also have `dictionary-search` use the word at
point without prompting, as `dictionary-lookup-definition` does, by
setting `dictionary-read-word-function` to something like:

--8<---------------cut here---------------start------------->8---
(lambda (&rest _) (thing-at-point 'word))
--8<---------------cut here---------------end--------------->8---

> QUESTION 2.
>
> With
>
> (with-eval-after-load 'dictionary
>   (setopt dictionary-server "dict.org"))
>
> when I have
>
> dictionary<POINT>
>
> and type 'M-x dictionary-search RET', I get
>
> Search word (default Ditionary): <POINT>
>
> Notice the default word "Ditionary" [sic].
>
> Further, when I continue by manually typing 'dictionary M-RET' (in
> Vertico), Emacs says "[Match required]" and does nothing.

That's interesting, AFAICT this is essentially a problem with the
defaults of the dict.org server: when using its default matching
strategy, the only match it provides for "dictionary" is "ditionary",
and vice versa.  The main problem is that in this case the word we're
matching ("dictionary") is not returned as a match, although it is
defined.

If you set `dictionary-default-strategy` to something other than the
default "." (which means "let the server choose"), maybe something like
"prefix", then this oddity is avoided.

But since this is currently the default setting I wonder what'd be the
best way to address this issue.  We can change the call to
`completing-read` such that it doesn't require a match, so you could
always input a word regardless of the completion candidates.  Another
option would be to change the default for `dictionary-default-strategy`
to something more useful.  Any other ideas?

-- 
Thanks,

Eshel



  reply	other threads:[~2023-05-26 12:26 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-11 13:22 [ELPA] New package: dict Eshel Yaron
2023-05-11 13:59 ` Eli Zaretskii
2023-05-11 14:14   ` Philip Kaludercic
2023-05-11 17:56     ` Eshel Yaron
2023-05-11 18:16       ` Eli Zaretskii
2023-05-11 18:29       ` Philip Kaludercic
2023-05-12 13:17         ` Eshel Yaron
2023-05-12 13:44           ` Eli Zaretskii
2023-05-14  6:41             ` Eshel Yaron
2023-05-14  9:14               ` Eli Zaretskii
2023-05-15 18:50                 ` Eshel Yaron
2023-05-18  7:57                   ` Eshel Yaron
2023-05-18  8:32                     ` Eli Zaretskii
2023-05-18 10:59                   ` Eli Zaretskii
2023-05-18 12:21                     ` Eshel Yaron
2023-05-18 14:09                       ` Eli Zaretskii
2023-05-18 15:51                         ` Eshel Yaron
2023-05-18 15:58                           ` Eli Zaretskii
2023-05-19  8:34                             ` Eshel Yaron
2023-05-20 14:19                               ` Eli Zaretskii
2023-05-20 16:49                               ` Philip Kaludercic
2023-05-20 18:27                                 ` Eshel Yaron
2023-05-20 19:11                                   ` Philip Kaludercic
2023-05-21  6:52                                     ` Eshel Yaron
2023-05-25  9:52                                       ` Eshel Yaron
2023-05-25 19:10                                         ` Philip Kaludercic
2023-05-26  9:16                                         ` Eli Zaretskii
2023-05-26 11:36                                         ` Rudolf Adamkovič
2023-05-26 12:26                                           ` Eshel Yaron [this message]
2023-05-18 12:59                   ` Philip Kaludercic
2023-05-18 15:37                     ` Eshel Yaron
2023-05-18 15:58                       ` Philip Kaludercic
2023-05-14 16:06               ` Stephen Leake
2023-05-15 18:58                 ` Eshel Yaron
2023-05-11 14:18 ` Philip Kaludercic
2023-05-11 18:00   ` Eshel Yaron
2023-05-11 18:31     ` Philip Kaludercic
2023-05-12 13:32       ` Eshel Yaron
2023-05-16 19:38         ` Philip Kaludercic
2023-05-17  2:25           ` Eli Zaretskii
2023-05-13 22:30     ` Richard Stallman
2023-05-14  6:48       ` Eshel Yaron

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=m1ilcfxor8.fsf@eshelyaron.com \
    --to=me@eshelyaron.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=philipk@posteo.net \
    --cc=salutis@me.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).