From unknown Mon Jun 16 23:51:33 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#45262 <45262@debbugs.gnu.org> To: bug#45262 <45262@debbugs.gnu.org> Subject: Status: Dictionary improvements Reply-To: bug#45262 <45262@debbugs.gnu.org> Date: Tue, 17 Jun 2025 06:51:33 +0000 retitle 45262 Dictionary improvements reassign 45262 emacs submitter 45262 Juri Linkov severity 45262 minor tag 45262 patch fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 15 15:23:58 2020 Received: (at submit) by debbugs.gnu.org; 15 Dec 2020 20:23:58 +0000 Received: from localhost ([127.0.0.1]:59231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpGrV-0005X2-ML for submit@debbugs.gnu.org; Tue, 15 Dec 2020 15:23:58 -0500 Received: from lists.gnu.org ([209.51.188.17]:39334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kpGrR-0005Wg-00 for submit@debbugs.gnu.org; Tue, 15 Dec 2020 15:23:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpGrQ-0004Ru-QX for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2020 15:23:52 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:38075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpGrL-0003wz-UL for bug-gnu-emacs@gnu.org; Tue, 15 Dec 2020 15:23:52 -0500 X-Originating-IP: 91.129.99.98 Received: from mail.gandi.net (m91-129-99-98.cust.tele2.ee [91.129.99.98]) (Authenticated sender: juri@linkov.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 19EAA60006 for ; Tue, 15 Dec 2020 20:23:44 +0000 (UTC) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: Dictionary improvements Organization: LINKOV.NET Date: Tue, 15 Dec 2020 22:05:27 +0200 Message-ID: <87y2hyygf5.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.183.195; envelope-from=juri@linkov.net; helo=relay3-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit 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.6 (--) X-Debbugs-CC: Torsten Hilbrich Thanks for merging dictionary to master! I tried to use it, and encountered several minor issues that I propose to improve: 1. For scrolling most other modes use scroll-up-command, and also bind S-SPC to scroll-down-command like this: diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 0df9d8b142..24e2b8d2ee 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -323,8 +323,9 @@ dictionary-mode-map (define-key map "l" 'dictionary-previous) (define-key map "n" 'forward-button) (define-key map "p" 'backward-button) - (define-key map " " 'scroll-up) - (define-key map (read-kbd-macro "M-SPC") 'scroll-down) + (define-key map " " 'scroll-up-command) + (define-key map [?\S-\ ] 'scroll-down-command) + (define-key map (read-kbd-macro "M-SPC") 'scroll-down-command) map) "Keymap for the dictionary mode.") 2. When point is on a multi-word link in the *Dictionary* buffer then the command 'M-x dictionary-search' fetches only one word from the buffer. Instead of this, it could fetch the whole link for possible editing in the minibuffer before searching again: diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 0df9d8b142..24e2b8d2ee 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -1119,9 +1120,11 @@ dictionary-display-match-lines ;; - if region is active returns its contents ;; - otherwise return the word near the point (defun dictionary-search-default () - (if (use-region-p) - (buffer-substring-no-properties (region-beginning) (region-end)) - (current-word t))) + (cond + ((use-region-p) + (buffer-substring-no-properties (region-beginning) (region-end))) + ((car (get-char-property (point) 'data))) + (t (current-word t)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; User callable commands 3. There is the hook dictionary-mode-hook, and I use it to enable outline-minor-mode in the *Dictionary* buffer (using word entry lines are outline-regexp headings). But there is a need to hide subheadings every time when the *Dictionary* buffer is updated, but there is no such hook. Maybe better to add a hook with a name like dictionary-search-post-hook to be called from dictionary-post-buffer. 4. 'dictionary' uses switch-to-buffer-other-window to force the output buffer in another window. Other commands use pop-to-buffer that requires just such customization to display it in the same window: (push '("\\`\\*Dictionary\\*\\(?:<[^>]+>\\)?\\'" display-buffer-same-window) display-buffer-alist) But since switch-to-buffer-other-window calls pop-to-buffer with 't' for its arg 'action', this means that this requires more complex customization: (push '("\\`\\*Dictionary\\*\\(?:<[^>]+>\\)?\\'" display-buffer-same-window (inhibit-same-window . nil)) display-buffer-alist) The difference is in the need to add '(inhibit-same-window . nil)'. 5. When clicking on a word link in the *Dictionary* buffer, it displays the word definition only in the same dictionary, while it would be better to search it in all dictionaries for more coverage. This is not a patch, but demonstrates the problem. Maybe this should be customizable? diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 0df9d8b142..24e2b8d2ee 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -848,7 +849,7 @@ dictionary-mark-reference (unless (equal word displayed-word) (make-button start end :type 'dictionary-link 'callback call - 'data (cons word dictionary) + 'data (cons word "*") 'help-echo (concat "Press Mouse-2 to lookup \"" word "\" in \"" dictionary "\""))))) From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 09 13:31:48 2021 Received: (at 45262) by debbugs.gnu.org; 9 Feb 2021 18:31:48 +0000 Received: from localhost ([127.0.0.1]:54572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9Xnf-0007yD-K0 for submit@debbugs.gnu.org; Tue, 09 Feb 2021 13:31:47 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:56851) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9Xnd-0007xw-Vf; Tue, 09 Feb 2021 13:31:46 -0500 X-Originating-IP: 91.129.108.204 Received: from mail.gandi.net (m91-129-108-204.cust.tele2.ee [91.129.108.204]) (Authenticated sender: juri@linkov.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 7419E60003; Tue, 9 Feb 2021 18:31:37 +0000 (UTC) From: Juri Linkov To: 45262@debbugs.gnu.org Subject: Re: bug#45262: Dictionary improvements Organization: LINKOV.NET References: <87y2hyygf5.fsf@mail.linkov.net> Date: Tue, 09 Feb 2021 20:31:11 +0200 In-Reply-To: <87y2hyygf5.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 15 Dec 2020 22:05:27 +0200") Message-ID: <87im712ivk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 45262 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.7 (-) tags 45262 fixed close 45262 28.0.50 quit > Thanks for merging dictionary to master! I tried to use it, > and encountered several minor issues that I propose to improve: I guess it's time now to close this request. > 1. For scrolling most other modes use scroll-up-command, > and also bind S-SPC to scroll-down-command like this: > > diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el > index 0df9d8b142..24e2b8d2ee 100644 > --- a/lisp/net/dictionary.el > +++ b/lisp/net/dictionary.el > @@ -323,8 +323,9 @@ dictionary-mode-map > (define-key map "l" 'dictionary-previous) > (define-key map "n" 'forward-button) > (define-key map "p" 'backward-button) > - (define-key map " " 'scroll-up) > - (define-key map (read-kbd-macro "M-SPC") 'scroll-down) > + (define-key map " " 'scroll-up-command) > + (define-key map [?\S-\ ] 'scroll-down-command) > + (define-key map (read-kbd-macro "M-SPC") 'scroll-down-command) > map) > "Keymap for the dictionary mode.") Now pushed to master in 552d2b9083. > 2. When point is on a multi-word link in the *Dictionary* buffer > then the command 'M-x dictionary-search' fetches only one word > from the buffer. Instead of this, it could fetch the whole link > for possible editing in the minibuffer before searching again: > > diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el > index 0df9d8b142..24e2b8d2ee 100644 > --- a/lisp/net/dictionary.el > +++ b/lisp/net/dictionary.el > @@ -1119,9 +1120,11 @@ dictionary-display-match-lines > ;; - if region is active returns its contents > ;; - otherwise return the word near the point > (defun dictionary-search-default () > - (if (use-region-p) > - (buffer-substring-no-properties (region-beginning) (region-end)) > - (current-word t))) > + (cond > + ((use-region-p) > + (buffer-substring-no-properties (region-beginning) (region-end))) > + ((car (get-char-property (point) 'data))) > + (t (current-word t)))) Pushed to master in the same commit. > 3. There is the hook dictionary-mode-hook, and I use it to enable > outline-minor-mode in the *Dictionary* buffer (using word entry lines > are outline-regexp headings). But there is a need to hide subheadings > every time when the *Dictionary* buffer is updated, but there is no such hook. > Maybe better to add a hook with a name like dictionary-search-post-hook > to be called from dictionary-post-buffer. Added a new hook 'dictionary-post-buffer-hook'. > 4. 'dictionary' uses switch-to-buffer-other-window to force the output buffer > in another window. Other commands use pop-to-buffer that requires just > such customization to display it in the same window: > > (push '("\\`\\*Dictionary\\*\\(?:<[^>]+>\\)?\\'" display-buffer-same-window) > display-buffer-alist) > > But since switch-to-buffer-other-window calls pop-to-buffer with 't' > for its arg 'action', this means that this requires more complex customization: > > (push '("\\`\\*Dictionary\\*\\(?:<[^>]+>\\)?\\'" > display-buffer-same-window > (inhibit-same-window . nil)) > display-buffer-alist) > > The difference is in the need to add '(inhibit-same-window . nil)'. Not changed since there are many commands that use switch-to-buffer-other-window, so it looks like a legitimate use. > 5. When clicking on a word link in the *Dictionary* buffer, > it displays the word definition only in the same dictionary, > while it would be better to search it in all dictionaries > for more coverage. > > This is not a patch, but demonstrates the problem. > Maybe this should be customizable? Added a new customizable option 'dictionary-link-dictionary'. From unknown Mon Jun 16 23:51:33 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 10 Mar 2021 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator