From unknown Sun Jun 15 13:02:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43688: Proposal to add dictionary lookups Resent-From: Jean Louis Original-Sender: "Debbugs-submit" Resent-CC: bug-hyperbole@gnu.org Resent-Date: Tue, 29 Sep 2020 05:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43688 X-GNU-PR-Package: hyperbole X-GNU-PR-Keywords: To: 43688@debbugs.gnu.org X-Debbugs-Original-To: bug-hyperbole@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160135711831250 (code B ref -1); Tue, 29 Sep 2020 05:26:01 +0000 Received: (at submit) by debbugs.gnu.org; 29 Sep 2020 05:25:18 +0000 Received: from localhost ([127.0.0.1]:54601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kN88c-00087x-A4 for submit@debbugs.gnu.org; Tue, 29 Sep 2020 01:25:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:47334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kN88a-00087n-5m for submit@debbugs.gnu.org; Tue, 29 Sep 2020 01:25:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kN88Z-0002w5-Vo for bug-hyperbole@gnu.org; Tue, 29 Sep 2020 01:25:16 -0400 Received: from stw1.rcdrun.com ([217.170.207.13]:50375) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kN88Y-0001FN-9n for bug-hyperbole@gnu.org; Tue, 29 Sep 2020 01:25:15 -0400 Received: from protected.rcdrun.com ([::ffff:41.210.141.134]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_CBC_SHA1) by stw1.rcdrun.com with UTF8ESMTPSA id 000000000007E025.000000005F72C536.00004027; Mon, 28 Sep 2020 22:25:09 -0700 Received: from localhost (localhost [127.0.0.1]) (uid 1001) by protected.rcdrun.com with local id 00000000000C2378.000000005F72C532.00005AC1; Tue, 29 Sep 2020 07:25:06 +0200 From: Jean Louis Message-ID: Date: Tue, 29 Sep 2020 07:25:06 +0200 Received-SPF: pass client-ip=217.170.207.13; envelope-from=admin@protected.rcdrun.com; helo=stw1.rcdrun.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/29 00:16:20 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.199, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.2 (--) I know there is {C-c /} in Hyperbole to search online Internet and also dictionaries. Now imagine, I am reading the epub file within Emacs, and it is shown in Emacs buffers, or I am reading .txt file like Tom Sawyer book, or reading email, and there is some word like "conflate", I would like to quickly look up the word in dictionaries. It would be good that Hyperbole contains some kind of {C-h h DICTIONARY-KEY-HERE} so that current word may be looked up straight in dictionary servers. My quick way of looking up words is to use either offline or online dictionary servers. The wordnut package on Elpa is using Wordnet and when definition opens in new buffer, I can again click Enter on any other word, and get definition for those other words, I can come back with "l" to previous definitions or quit the dictionary buffer with "q". Then I made my own "dict" client client, that I can "s-d" on any word, and I will be faced with dictionary list and can fetch the definition, if my local dict server is available, I can fetch it from local, otherwise from online dictionary server. dict is usually automatically searching first local servers available, then remote server as configured. I am using myself this below to quickly look up words in dictionaries and also wordnut-search function, it looks up the word under cursor normally. If Hyperbole has similar feature built-in, I would not need to install this type of function on new computers and servers I am accessing and where I am using Emacs. (setq dict/buffer "*Dict*") (defun tmpbuf (buf) (switch-to-buffer (get-buffer-create (concat "*" buf "*")))) (defun dict/kill-dict () (interactive) (kill-buffer dict/buffer)) (defun dictd-dictionaries (&optional host) "Returns the list of dictionaries and their names" (let* ((command (if host (format "dict -D -h %s" host) "dict -D")) (dictionaries (shell-command-to-string command)) (dictionaries (split-string dictionaries "\n"))) (pop dictionaries) (mapcar 'string-trim dictionaries))) (defun dict/query () (interactive) (let* ((word (current-word 1)) (dictionary (completing-read "Dictionary: " (dictd-dictionaries))) (dictionary (first (split-string dictionary))) (dict (format "dict -d %s \"%s\"" dictionary word)) (statement (shell-command-to-string dict))) (get-buffer-create dict/buffer) (switch-to-buffer dict/buffer) (erase-buffer) (local-set-key (kbd "q") 'dict/kill-dict) (local-set-key (kbd "") 'dict/query) (insert statement) (goto-char 1))) (global-set-key (kbd "s-d") 'dict/query) I use: Editor: GNU Emacs 28.0.50 (build 15, x86_64-pc-linux-gnu, X toolkit, cairo version 1.14.8, Xaw3d scroll bars) Hyperbole: 7.1.2 Sys Type: x86_64-pc-linux-gnu OS Type: gnu/linux Window Sys: x News Reader: Gnus v5.13 From unknown Sun Jun 15 13:02:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43688: Proposal to add dictionary lookups Resent-From: Robert Weiner Original-Sender: "Debbugs-submit" Resent-CC: bug-hyperbole@gnu.org Resent-Date: Wed, 30 Sep 2020 04:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43688 X-GNU-PR-Package: hyperbole X-GNU-PR-Keywords: To: Jean Louis Cc: 43688@debbugs.gnu.org Reply-To: rswgnu@gmail.com Received: via spool by 43688-submit@debbugs.gnu.org id=B43688.160143855325369 (code B ref 43688); Wed, 30 Sep 2020 04:03:01 +0000 Received: (at 43688) by debbugs.gnu.org; 30 Sep 2020 04:02:33 +0000 Received: from localhost ([127.0.0.1]:57785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNTK4-0006aj-NT for submit@debbugs.gnu.org; Wed, 30 Sep 2020 00:02:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNTK1-0006Uz-NX for 43688@debbugs.gnu.org; Wed, 30 Sep 2020 00:02:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54445) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNTJw-0007Fh-Ct for 43688@debbugs.gnu.org; Wed, 30 Sep 2020 00:02:24 -0400 Received: from mail-lf1-f54.google.com ([209.85.167.54]:41513) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1kNTJv-0006Fx-NV for 43688@debbugs.gnu.org; Wed, 30 Sep 2020 00:02:24 -0400 Received: by mail-lf1-f54.google.com with SMTP id y17so419514lfa.8 for <43688@debbugs.gnu.org>; Tue, 29 Sep 2020 21:02:23 -0700 (PDT) X-Gm-Message-State: AOAM533Nlbfp7Pc04pChEAc9TelpIjH41PK24NQRfdtzkQAQBF/FueYz wKtpT7ZQmWSmDVI9/zp9ZhNSrSYsF838vX6txvw= X-Google-Smtp-Source: ABdhPJymxDf7CE6x0TcyplN1hmYnThCL1aKgftlLyBvQP6aZkMpQrdthh5BrX2XYftSlGxJ2xrVmLu96SR5BkyKGC/E= X-Received: by 2002:a19:89d7:: with SMTP id l206mr190524lfd.110.1601438541627; Tue, 29 Sep 2020 21:02:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Robert Weiner Date: Wed, 30 Sep 2020 00:01:55 -0400 X-Gmail-Original-Message-ID: Message-ID: Content-Type: multipart/alternative; boundary="00000000000067462205b07ff7e1" X-Spam-Score: 0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --00000000000067462205b07ff7e1 Content-Type: text/plain; charset="UTF-8" As you noted, Hyperbole has the web-based Dictionary option on this menu but it sounds like you want a more flexible dictionary lookup solution. It would be good if it defaulted to the word at point as well, so we'll consider that and look at your setup. -- Bob On Tue, Sep 29, 2020 at 1:26 AM Jean Louis wrote: > I know there is {C-c /} in Hyperbole to search online Internet and > also dictionaries. > > Now imagine, I am reading the epub file within Emacs, and it is shown > in Emacs buffers, or I am reading .txt file like Tom Sawyer book, or > reading email, and there is some word like "conflate", I would like to > quickly look up the word in dictionaries. It would be good that > Hyperbole contains some kind of {C-h h DICTIONARY-KEY-HERE} so that > current word may be looked up straight in dictionary servers. > > My quick way of looking up words is to use either offline or online > dictionary servers. > > The wordnut package on Elpa is using Wordnet and when definition opens > in new buffer, I can again click Enter on any other word, and get > definition for those other words, I can come back with "l" to previous > definitions or quit the dictionary buffer with "q". Then I made my own > "dict" client client, that I can "s-d" on any word, and I will be > faced with dictionary list and can fetch the definition, if my local > dict server is available, I can fetch it from local, otherwise from > online dictionary server. > > dict is usually automatically searching first local servers available, > then remote server as configured. > > I am using myself this below to quickly look up words in dictionaries > and also wordnut-search function, it looks up the word under cursor > normally. > > If Hyperbole has similar feature built-in, I would not need to install > this type of function on new computers and servers I am accessing and > where I am using Emacs. > > (setq dict/buffer "*Dict*") > > (defun tmpbuf (buf) > (switch-to-buffer > (get-buffer-create (concat "*" buf "*")))) > > (defun dict/kill-dict () > (interactive) > (kill-buffer dict/buffer)) > > (defun dictd-dictionaries (&optional host) > "Returns the list of dictionaries and their names" > (let* ((command (if host (format "dict -D -h %s" host) "dict -D")) > (dictionaries (shell-command-to-string command)) > (dictionaries (split-string dictionaries "\n"))) > (pop dictionaries) > (mapcar 'string-trim dictionaries))) > > (defun dict/query () > (interactive) > (let* ((word (current-word 1)) > (dictionary (completing-read "Dictionary: " > (dictd-dictionaries))) > (dictionary (first (split-string dictionary))) > (dict (format "dict -d %s \"%s\"" dictionary word)) > (statement (shell-command-to-string dict))) > (get-buffer-create dict/buffer) > (switch-to-buffer dict/buffer) > (erase-buffer) > (local-set-key (kbd "q") 'dict/kill-dict) > (local-set-key (kbd "") 'dict/query) > (insert statement) > (goto-char 1))) > > (global-set-key (kbd "s-d") 'dict/query) > > > > > > I use: Editor: GNU Emacs 28.0.50 (build 15, x86_64-pc-linux-gnu, X > toolkit, cairo version 1.14.8, Xaw3d scroll bars) > > Hyperbole: 7.1.2 > Sys Type: x86_64-pc-linux-gnu > OS Type: gnu/linux > Window Sys: x > News Reader: Gnus v5.13 > > > > _______________________________________________ > Bug-hyperbole mailing list > Bug-hyperbole@gnu.org > https://lists.gnu.org/mailman/listinfo/bug-hyperbole > --00000000000067462205b07ff7e1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
As you noted, Hyperbole has the web-based Dictionary option on= this menu but it sounds like you want a more flexible dictionary lookup so= lution.
It would be good if it defaulted to the word at point as well, so = we'll consider that and look at your setup.=C2=A0 -- Bob
On Tue, S= ep 29, 2020 at 1:26 AM Jean Louis <bugs@gnu.support> wrote:
=
I know there is {C-c /} i= n Hyperbole to search online Internet and
also dictionaries.

Now imagine, I am reading the epub file within Emacs, and it is shown
in Emacs buffers, or I am reading .txt file like Tom Sawyer book, or
reading email, and there is some word like "conflate", I would li= ke to
quickly look up the word in dictionaries. It would be good that
Hyperbole contains some kind of {C-h h DICTIONARY-KEY-HERE} so that
current word may be looked up straight in dictionary servers.

My quick way of looking up words is to use either offline or online
dictionary servers.

The wordnut package on Elpa is using Wordnet and when definition opens
in new buffer, I can again click Enter on any other word, and get
definition for those other words, I can come back with "l" to pre= vious
definitions or quit the dictionary buffer with "q". Then I made m= y own
"dict" client client, that I can "s-d" on any word, and= I will be
faced with dictionary list and can fetch the definition, if my local
dict server is available, I can fetch it from local, otherwise from
online dictionary server.

dict is usually automatically searching first local servers available,
then remote server as configured.

I am using myself this below to quickly look up words in dictionaries
and also wordnut-search function, it looks up the word under cursor
normally.

If Hyperbole has similar feature built-in, I would not need to install
this type of function on new computers and servers I am accessing and
where I am using Emacs.

(setq dict/buffer "*Dict*")

(defun tmpbuf (buf)
=C2=A0 (switch-to-buffer
=C2=A0 =C2=A0(get-buffer-create (concat "*" buf "*"))))=

(defun dict/kill-dict ()
=C2=A0 (interactive)
=C2=A0 (kill-buffer dict/buffer))

(defun dictd-dictionaries (&optional host)
=C2=A0 "Returns the list of dictionaries and their names"
=C2=A0 (let* ((command (if host (format "dict -D -h %s" host) &qu= ot;dict -D"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(dictionaries (shell-command-to-string co= mmand))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(dictionaries (split-string dictionaries = "\n")))
=C2=A0 =C2=A0 (pop dictionaries)
=C2=A0 =C2=A0 (mapcar 'string-trim dictionaries)))

(defun dict/query ()
=C2=A0 (interactive)
=C2=A0 (let* ((word (current-word 1))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(dictionary (completing-read=C2=A0 "= Dictionary: " (dictd-dictionaries)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(dictionary (first (split-string dictiona= ry)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(dict (format "dict -d %s \"%s\= "" dictionary word))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(statement (shell-command-to-string dict)= ))
=C2=A0 =C2=A0 (get-buffer-create dict/buffer)
=C2=A0 =C2=A0 (switch-to-buffer dict/buffer)
=C2=A0 =C2=A0 (erase-buffer)
=C2=A0 =C2=A0 (local-set-key (kbd "q") 'dict/kill-dict)
=C2=A0 =C2=A0 (local-set-key (kbd "<return>") 'dict/que= ry)
=C2=A0 =C2=A0 (insert statement)
=C2=A0 =C2=A0 (goto-char 1)))

(global-set-key (kbd "s-d") 'dict/query)





I use:=C2=A0 Editor:=C2=A0 =C2=A0 =C2=A0 GNU Emacs 28.0.50 (build 15, x86_6= 4-pc-linux-gnu, X toolkit, cairo version 1.14.8, Xaw3d scroll bars)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 Hyperbole:=C2=A0 =C2=A07.1.2
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Sys Type:=C2=A0 =C2=A0 x86_64-pc-linux-gnu
=C2=A0 =C2=A0 =C2=A0 =C2=A0 OS Type:=C2=A0 =C2=A0 =C2=A0gnu/linux
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Window Sys:=C2=A0 x
=C2=A0 =C2=A0 =C2=A0 =C2=A0 News Reader: Gnus v5.13



_______________________________________________
Bug-hyperbole mailing list
Bug-hyperbole@gn= u.org
https://lists.gnu.org/mailman/listinfo/bug-hyper= bole
--00000000000067462205b07ff7e1-- From unknown Sun Jun 15 13:02:41 2025 X-Loop: help-debbugs@gnu.org Subject: bug#43688: Proposal to add dictionary lookups Resent-From: Jean Louis Original-Sender: "Debbugs-submit" Resent-CC: bug-hyperbole@gnu.org Resent-Date: Wed, 30 Sep 2020 08:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43688 X-GNU-PR-Package: hyperbole X-GNU-PR-Keywords: To: rswgnu@gmail.com Cc: 43688@debbugs.gnu.org Received: via spool by 43688-submit@debbugs.gnu.org id=B43688.160145509219481 (code B ref 43688); Wed, 30 Sep 2020 08:39:02 +0000 Received: (at 43688) by debbugs.gnu.org; 30 Sep 2020 08:38:12 +0000 Received: from localhost ([127.0.0.1]:58067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNXcp-000549-Pb for submit@debbugs.gnu.org; Wed, 30 Sep 2020 04:38:12 -0400 Received: from stw1.rcdrun.com ([217.170.207.13]:36991) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNXcl-00053b-BI for 43688@debbugs.gnu.org; Wed, 30 Sep 2020 04:38:10 -0400 Received: from localhost ([::ffff:197.157.34.183]) (AUTH: PLAIN securesender, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000EFC98.000000005F7443E6.00001284; Wed, 30 Sep 2020 01:37:57 -0700 Date: Wed, 30 Sep 2020 11:37:54 +0300 From: Jean Louis Message-ID: <20200930083754.GE18070@protected.rcdrun.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.0 (2020-05-02) X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * Robert Weiner [2020-09-30 07:02]: > As you noted, Hyperbole has the web-based Dictionary option on this menu > but it sounds like you want a more flexible dictionary lookup solution. > It would be good if it defaulted to the word at point as well, so we'll > consider that and look at your setup. -- Bob The "look up" function should in my opinion work as follows: - not only word at point, but if there is region, it should look for region, because there is difference between definition of the word "going" and the term "going under" and "going ashore" and "going to jerusalem". I hope you get the point. - it should search for local command dico as it is part of GNU system - if dico does not exist, it should look for dict, local system command - in any case the local command should be customizable as well - dico and dict, can be then configured which dictionaries to use, by default, it should look into local dictionary, then for online dictionary, yet that would be outside of Hyperbole - now when buffer opens with the definition, any word in that buffer should be followed with RET for example, while action key should be doing what it is doing. RETURN/ENTER would then invoke definition for the word at point or region at point. L would come back similarly as in Info. Q would quit. I suggest that you see how wordnut package works, it uses Wordnet and it works exactly as explained. But dico/dict commands can include Wordnet as well, so that is only example. - now if local command does not exist, neither dico, as first being from GNU, neither dict, then Hyperbole shall open "!definition WORD" in browser on Duckduckcom.go and not just one dictionary. See example: https://duckduckgo.com/?q=!definition+hyperbole&atb=v154-3am&ia=definition as that looks better search for the word then if we use only: "!define hyperbole" in this link: https://duckduckgo.com/?q=!define+hyperbole&atb=v154-3am - the buffer with definitions shall include Hyperbole button on the bottom, to look up definitions on Internet as well. Please include the "Clear Word" function or similar in Hyperbole that will empower users.