[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ELPA] New package: dict
From: |
Eli Zaretskii |
Subject: |
Re: [ELPA] New package: dict |
Date: |
Thu, 18 May 2023 13:59:25 +0300 |
> 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.
> 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*?
- Re: [ELPA] New package: dict, (continued)
- Re: [ELPA] New package: dict, Eshel Yaron, 2023/05/11
- Re: [ELPA] New package: dict, Eli Zaretskii, 2023/05/11
- Re: [ELPA] New package: dict, Philip Kaludercic, 2023/05/11
- Re: [ELPA] New package: dict, Eshel Yaron, 2023/05/12
- Re: [ELPA] New package: dict, Eli Zaretskii, 2023/05/12
- Re: [ELPA] New package: dict, Eshel Yaron, 2023/05/14
- Re: [ELPA] New package: dict, Eli Zaretskii, 2023/05/14
- Re: [ELPA] New package: dict, Eshel Yaron, 2023/05/15
- Re: [ELPA] New package: dict, Eshel Yaron, 2023/05/18
- Re: [ELPA] New package: dict, Eli Zaretskii, 2023/05/18
- Re: [ELPA] New package: dict,
Eli Zaretskii <=
- Re: [ELPA] New package: dict, Eshel Yaron, 2023/05/18
- Re: [ELPA] New package: dict, Eli Zaretskii, 2023/05/18
- Re: [ELPA] New package: dict, Eshel Yaron, 2023/05/18
- Re: [ELPA] New package: dict, Eli Zaretskii, 2023/05/18
- Re: [ELPA] New package: dict, Eshel Yaron, 2023/05/19
- Re: [ELPA] New package: dict, Eli Zaretskii, 2023/05/20
- Re: [ELPA] New package: dict, Philip Kaludercic, 2023/05/20
- Re: [ELPA] New package: dict, Eshel Yaron, 2023/05/20
- Re: [ELPA] New package: dict, Philip Kaludercic, 2023/05/20
- Re: [ELPA] New package: dict, Eshel Yaron, 2023/05/21