GNU bug report logs -
#69312
30.0.50; [WISHLIST] dicitionary buffer should retain search information
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69312 in the body.
You can then email your comments to 69312 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Thu, 22 Feb 2024 18:40:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
No Wayman <iarchivedmywholelife <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 22 Feb 2024 18:40:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Currently when searching with dictionary.el, the query is
messaged.
e.g. in dictionary-do-search:
```emacs-lisp
(message "Searching for %s in %s" word dictionary)
```
It would be better to display this information in the resultant
buffer somehow (inline, via the header-line, etc).
Especially for the case of `dictionary-match-words`, which matches
against a PATTERN argument.
I'd like to not have to remember what my query was if I come back
to that buffer at a later time.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Fri, 23 Feb 2024 07:14:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 69312 <at> debbugs.gnu.org (full text, mbox):
> Currently when searching with dictionary.el, the query is
> messaged.
> e.g. in dictionary-do-search:
>
> ```emacs-lisp
> (message "Searching for %s in %s" word dictionary)
> ```
>
> It would be better to display this information in the resultant
> buffer somehow (inline, via the header-line, etc).
> Especially for the case of `dictionary-match-words`, which matches
> against a PATTERN argument.
> I'd like to not have to remember what my query was if I come back
> to that buffer at a later time.
Like this?
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 1981b757017..ccce0b541df 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -787,7 +787,7 @@ dictionary-do-search
Optional argument NOMATCHING controls whether to suppress the display
of matching words."
- (message "Searching for %s in %s" word dictionary)
+ (insert (format "Searching for %s in %s\n" word dictionary))
(dictionary-send-command (concat "define "
(dictionary-encode-charset dictionary "")
" \""
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Fri, 23 Feb 2024 15:41:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 69312 <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> linkov.net> writes:
>
> Like this?
>
> diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
> index 1981b757017..ccce0b541df 100644
> --- a/lisp/net/dictionary.el
> +++ b/lisp/net/dictionary.el
> @@ -787,7 +787,7 @@ dictionary-do-search
> Optional argument NOMATCHING controls whether to suppress the
> display
> of matching words."
>
> - (message "Searching for %s in %s" word dictionary)
> + (insert (format "Searching for %s in %s\n" word dictionary))
> (dictionary-send-command (concat "define "
> (dictionary-encode-charset dictionary "")
> " \""
Thanks, Juri. This takes care of dictionary-do-search, but
dictionary-do-matching indirectly calls the function responsible
for displaying the results and does not pass the query along.
So a similar modification will not work there.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Sat, 24 Feb 2024 18:11:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 69312 <at> debbugs.gnu.org (full text, mbox):
>> diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
>> index 1981b757017..ccce0b541df 100644
>> --- a/lisp/net/dictionary.el
>> +++ b/lisp/net/dictionary.el
>> @@ -787,7 +787,7 @@ dictionary-do-search
>> Optional argument NOMATCHING controls whether to suppress the display
>> of matching words."
>> - (message "Searching for %s in %s" word dictionary)
>> + (insert (format "Searching for %s in %s\n" word dictionary))
>> (dictionary-send-command (concat "define "
>> (dictionary-encode-charset dictionary "")
>> " \""
>
> Thanks, Juri. This takes care of dictionary-do-search, but
> dictionary-do-matching indirectly calls the function responsible for
> displaying the results and does not pass the query along. So a similar
> modification will not work there.
Sorry, I didn't notice there is another place:
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 1981b757017..e2fc2d823fd 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -787,7 +787,7 @@ dictionary-do-search
Optional argument NOMATCHING controls whether to suppress the display
of matching words."
- (message "Searching for %s in %s" word dictionary)
+ (insert (format-message "Searching for %s in %s\n" word dictionary))
(dictionary-send-command (concat "define "
(dictionary-encode-charset dictionary "")
" \""
@@ -799,7 +799,7 @@ dictionary-do-search
(if (dictionary-check-reply reply 552)
(progn
(unless nomatching
- (insert "Word not found")
+ (insert (format-message "Word not found: %s\n" word))
(dictionary-do-matching
word
dictionary
@@ -1128,8 +1128,8 @@ dictionary-new-matching
(defun dictionary-do-matching (word dictionary strategy function)
"Search for WORD with STRATEGY in DICTIONARY and display them with FUNCTION."
- (message "Lookup matching words for %s in %s using %s"
- word dictionary strategy)
+ (insert (format-message "Lookup matching words for %s in %s using %s\n"
+ word dictionary strategy))
(dictionary-send-command
(concat "match " (dictionary-encode-charset dictionary "") " "
(dictionary-encode-charset strategy "") " \""
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Sun, 25 Feb 2024 04:14:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 69312 <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> linkov.net> writes:
> Sorry, I didn't notice there is another place:
> @@ -787,7 +787,7 @@ dictionary-do-search
Thanks again.
The changes to dictionary-do-search look fine.
> @@ -1128,8 +1128,8 @@ dictionary-new-matching
>
> (defun dictionary-do-matching (word dictionary strategy
> function)
> "Search for WORD with STRATEGY in DICTIONARY and display them
> with FUNCTION."
> - (message "Lookup matching words for %s in %s using %s"
> - word dictionary strategy)
> + (insert (format-message "Lookup matching words for %s in %s
> using %s\n"
> + word dictionary strategy))
> (dictionary-send-command
> (concat "match " (dictionary-encode-charset dictionary "") "
> "
> (dictionary-encode-charset strategy "") " \""
This won't work. The buffer is in read-only mode, but even if that
is inhibited, the string is overwritten by the call to the display
function at the end:
> (funcall function reply)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Sun, 25 Feb 2024 07:35:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 69312 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
>> @@ -1128,8 +1128,8 @@ dictionary-new-matching
>> (defun dictionary-do-matching (word dictionary strategy function)
>> "Search for WORD with STRATEGY in DICTIONARY and display them with
>> FUNCTION."
>> - (message "Lookup matching words for %s in %s using %s"
>> - word dictionary strategy)
>> + (insert (format-message "Lookup matching words for %s in %s using
>> %s\n"
>> + word dictionary strategy))
>> (dictionary-send-command
>> (concat "match " (dictionary-encode-charset dictionary "") " "
>> (dictionary-encode-charset strategy "") " \""
>
> This won't work. The buffer is in read-only mode, but even if that is
> inhibited, the string is overwritten by the call to the display function at
> the end:
>
>> (funcall function reply)
This means that we need more reformatting of error messages:
[dictionary-messages.patch (text/x-diff, inline)]
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 1981b757017..e8ac9b679a0 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -787,7 +787,7 @@ dictionary-do-search
Optional argument NOMATCHING controls whether to suppress the display
of matching words."
- (message "Searching for %s in %s" word dictionary)
+ (insert (format-message "Searching for `%s' in `%s'\n" word dictionary))
(dictionary-send-command (concat "define "
(dictionary-encode-charset dictionary "")
" \""
@@ -799,13 +799,13 @@ dictionary-do-search
(if (dictionary-check-reply reply 552)
(progn
(unless nomatching
- (insert "Word not found")
+ (insert (format-message "Word `%s' not found\n" word))
(dictionary-do-matching
word
dictionary
"."
(lambda (reply)
- (insert ", maybe you are looking for one of these words\n\n")
+ (insert "Maybe you are looking for one of these words\n")
(dictionary-display-only-match-result reply)))
(dictionary-post-buffer)))
(if (dictionary-check-reply reply 550)
@@ -1128,8 +1128,8 @@ dictionary-new-matching
(defun dictionary-do-matching (word dictionary strategy function)
"Search for WORD with STRATEGY in DICTIONARY and display them with FUNCTION."
- (message "Lookup matching words for %s in %s using %s"
- word dictionary strategy)
+ (insert (format-message "Lookup matching words for `%s' in `%s' using `%s'\n"
+ word dictionary strategy))
(dictionary-send-command
(concat "match " (dictionary-encode-charset dictionary "") " "
(dictionary-encode-charset strategy "") " \""
@@ -1141,10 +1141,13 @@ dictionary-do-matching
(if (dictionary-check-reply reply 551)
(error "Strategy \"%s\" is invalid" strategy))
(if (dictionary-check-reply reply 552)
- (error (concat
- "No match for \"%s\" with strategy \"%s\" in "
- "dictionary \"%s\".")
- word strategy dictionary))
+ (let ((errmsg (format-message
+ (concat
+ "No match for `%s' with strategy `%s' in "
+ "dictionary `%s'.")
+ word strategy dictionary)))
+ (insert errmsg "\n")
+ (user-error errmsg)))
(unless (dictionary-check-reply reply 152)
(error "Unknown server answer: %s" (dictionary-reply reply)))
(funcall function reply)))
@@ -1271,7 +1274,7 @@ dictionary-lookup-definition
(interactive)
(let ((word (current-word)))
(unless word
- (error "No word at point"))
+ (user-error "No word at point"))
(dictionary-new-search (cons word dictionary-default-dictionary))))
(defun dictionary-previous ()
@@ -1311,7 +1314,8 @@ dictionary-mouse-popup-matching-words
(defun dictionary-popup-matching-words (&optional word)
"Display entries matching WORD or the current word if not given."
(interactive)
- (dictionary-do-matching (or word (current-word) (error "Nothing to search for"))
+ (dictionary-do-matching (or word (current-word)
+ (user-error "Nothing to search for"))
dictionary-default-dictionary
dictionary-default-popup-strategy
'dictionary-process-popup-replies))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Sat, 02 Mar 2024 17:34:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 69312 <at> debbugs.gnu.org (full text, mbox):
close 69312 30.0.50
thanks
> This means that we need more reformatting of error messages:
So now the patch is pushed to master.
bug marked as fixed in version 30.0.50, send any further explanations to
69312 <at> debbugs.gnu.org and No Wayman <iarchivedmywholelife <at> gmail.com>
Request was from
Juri Linkov <juri <at> linkov.net>
to
control <at> debbugs.gnu.org
.
(Sat, 02 Mar 2024 17:34:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Sun, 03 Mar 2024 01:48:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 69312 <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> linkov.net> writes:
> close 69312 30.0.50
> thanks
>
>> This means that we need more reformatting of error messages:
>
> So now the patch is pushed to master.
This bug should be re-opened.
The patch did not address what I mentioned here:
> This won't work. The buffer is in read-only mode, but even if
> that is inhibited,
> the string is overwritten by the call to the display function at
> the end:
> (funcall function reply)
With it installed, the dictionary-do-matching command is broken.
It results in:
dictionary-do-matching: Buffer is read-only: #<buffer
*Dictionary*>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Sun, 03 Mar 2024 08:20:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 69312 <at> debbugs.gnu.org (full text, mbox):
reopen 69312
thanks
> This bug should be re-opened. The patch did not address what I mentioned
> here:
>
>> This won't work. The buffer is in read-only mode, but even if that is
>> inhibited,
>> the string is overwritten by the call to the display function at the end:
>
>> (funcall function reply)
>
> With it installed, the dictionary-do-matching command is broken.
> It results in:
>
> dictionary-do-matching: Buffer is read-only: #<buffer *Dictionary*>
Please provide a test case to reproduce the issue that you see.
bug No longer marked as fixed in versions 30.0.50 and reopened.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 03 Mar 2024 08:20:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Sun, 03 Mar 2024 17:02:01 GMT)
Full text and
rfc822 format available.
Message #36 received at 69312 <at> debbugs.gnu.org (full text, mbox):
close 69312 30.0.50
thanks
>>> This won't work. The buffer is in read-only mode, but even if that is
>>> inhibited,
>>> the string is overwritten by the call to the display function at the end:
>>
>>> (funcall function reply)
>>
>> With it installed, the dictionary-do-matching command is broken.
>> It results in:
>>
>> dictionary-do-matching: Buffer is read-only: #<buffer *Dictionary*>
>
> Please provide a test case to reproduce the issue that you see.
Never mind, I see now what is missing. So this is fixed now.
Thanks for the bug report.
bug marked as fixed in version 30.0.50, send any further explanations to
69312 <at> debbugs.gnu.org and No Wayman <iarchivedmywholelife <at> gmail.com>
Request was from
Juri Linkov <juri <at> linkov.net>
to
control <at> debbugs.gnu.org
.
(Sun, 03 Mar 2024 17:02:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Sun, 03 Mar 2024 17:18:01 GMT)
Full text and
rfc822 format available.
Message #41 received at 69312 <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> linkov.net> writes:
> close 69312 30.0.50
> thanks
>
>>>> This won't work. The buffer is in read-only mode, but even if
>>>> that is
>>>> inhibited,
>>>> the string is overwritten by the call to the display function
>>>> at the end:
>>>
>>>> (funcall function reply)
>>>
>>> With it installed, the dictionary-do-matching command is
>>> broken.
>>> It results in:
>>>
>>> dictionary-do-matching: Buffer is read-only: #<buffer
>>> *Dictionary*>
>>
>> Please provide a test case to reproduce the issue that you see.
>
> Never mind, I see now what is missing. So this is fixed now.
> Thanks for the bug report.
To clarify the issue:
(defun dictionary-do-matching (word dictionary strategy function)
"Search for WORD with STRATEGY in DICTIONARY and display them
with FUNCTION."
;;This insertion is thrown away...
(insert (format-message "Lookup matching words for `%s' in `%s'
using `%s'\n"
word dictionary strategy))
;; [OMITTED FUNCTION BODY]
;; ...when this display function is called
(funcall function reply)))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Sun, 03 Mar 2024 17:53:02 GMT)
Full text and
rfc822 format available.
Message #44 received at 69312 <at> debbugs.gnu.org (full text, mbox):
> To clarify the issue:
>
> (defun dictionary-do-matching (word dictionary strategy function)
> "Search for WORD with STRATEGY in DICTIONARY and display them with
> FUNCTION."
>
> ;;This insertion is thrown away...
>
> (insert (format-message "Lookup matching words for `%s' in `%s' using
> `%s'\n"
> word dictionary strategy))
>
> ;; [OMITTED FUNCTION BODY]
>
> ;; ...when this display function is called
> (funcall function reply)))
Thanks for the detailed explanation.
Hopefully this is now fixed as well.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Sun, 03 Mar 2024 21:01:01 GMT)
Full text and
rfc822 format available.
Message #47 received at 69312 <at> debbugs.gnu.org (full text, mbox):
Juri Linkov <juri <at> linkov.net> writes:
> Thanks for the detailed explanation.
> Hopefully this is now fixed as well.
Confirmed that it does work.
Thanks again, Juri.
I've found another, separate bug while testing.
I'll open a separate thread for that.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#69312
; Package
emacs
.
(Tue, 05 Mar 2024 16:46:01 GMT)
Full text and
rfc822 format available.
Message #50 received at 69312 <at> debbugs.gnu.org (full text, mbox):
>> Thanks for the detailed explanation.
>> Hopefully this is now fixed as well.
>
> Confirmed that it does work.
Oh, it turned out this is not the whole story. Using
dictionary-select-dictionary immediately after
dictionary-new-matching failed because it stored a state
that didn't disable read-only.
The problem is that dictionary-new-matching was out of sync from
dictionary-new-search, therefore it falls apart. That required adding
dictionary-new-matching-internal like the existing
dictionary-new-search-internal, which is now done.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 03 Apr 2024 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 80 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.