unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eshel Yaron <me@eshelyaron.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: philipk@posteo.net,  emacs-devel@gnu.org
Subject: Re: [ELPA] New package: dict
Date: Thu, 18 May 2023 15:21:31 +0300	[thread overview]
Message-ID: <m1r0rdzv78.fsf@eshelyaron.com> (raw)
In-Reply-To: <837ct5x5v6.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 18 May 2023 13:59:25 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Eshel Yaron <me@eshelyaron.com>
>> Cc: philipk@posteo.net,  emacs-devel@gnu.org
>> Date: Mon, 15 May 2023 21:50:57 +0300
>> 
>> >> In short, we need two things: a way to obtain a word's definition and a
>> >> way to obtain dictionary matches given some input (for completion).
>> >> dictionary.el does these things already, but in way that's too coupled
>> >> with its user interface to admit reuse for my purposes.  So the question
>> >> is whether to add the needed stuff from Dict to dictionary.el and accept
>> >> some code duplication, or try to refactor the parts of dictionary.el
>> >> that communicate with the dictionary server to provide a cleaner API.
>> >
>> > I'd say try the latter if it's reasonably easy; otherwise try the
>> > former.
>> 
>> Alright, I'm attaching a patch that extends dictionary.el with new user
>> options that modify the behavior of `dictionary-search`.
>
> Looks reasonable, thanks.
>

Thank you for the review.

>> With this patch, `dictionary-search` behaves like my
>> `dict-describe-word` after applying the following customizations:
>> 
>> --8<---------------cut here---------------start------------->8---
>> (setq dictionary-read-dictionary-function
>>       #'dictionary-completing-read-dictionary)
>> (setq dictionary-read-word-function
>>       #'dictionary-completing-read-word)
>> (setq dictionary-display-definition-function
>>       #'dictionary-display-definition-in-help-buffer)
>> --8<---------------cut here---------------end--------------->8---
>
> This looks excessive.  How about adding yet another defcustom, with a
> :set function, which will make all these adjustments for users who
> want the words displayed in *Help*?

I agree setting three options may be a bit much for casual users, but
note that in order to display word definitions in *Help* you only need
to customize the last option, `dictionary-display-definition-function`.
The other two only affect the interactive word and dictionary selection
(mostly adding completion), so I'm not sure it's necessary to couple
them with how the definition ends up being presented.

-- 
Best

Eshel



  reply	other threads:[~2023-05-18 12:21 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 [this message]
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
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=m1r0rdzv78.fsf@eshelyaron.com \
    --to=me@eshelyaron.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=philipk@posteo.net \
    /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).