all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Matthias Meulien <orontee@gmail.com>
To: Torsten Hilbrich <emacs.nolkaf@hilbrich.tk>
Cc: emacs-devel@gnu.org
Subject: Re: Integration of dictionary package
Date: Sun, 08 Nov 2020 16:16:12 +0100	[thread overview]
Message-ID: <87o8k7zxoj.fsf@gmail.com> (raw)
In-Reply-To: <f10d594a-0c61-111a-1247-be5d9f5b70b7@hilbrich.tk> (Torsten Hilbrich's message of "Thu, 8 Oct 2020 18:01:11 +0200")

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

Torsten Hilbrich <emacs.nolkaf@hilbrich.tk> writes:

> by suggestion of Jean Louis I have started integrating the 
> dictionary package (found on 
> https://github.com/myrkr/dictionary-el/). 

Thanks for working on this.

Here are two minor improvments:
- Remove text property from on empty lines
- Add history to read-string


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Remove-text-property-from-empty-line.patch --]
[-- Type: text/x-diff, Size: 1097 bytes --]

From 7453384d19e5f662f3623ff998656797ed325f3d Mon Sep 17 00:00:00 2001
From: Matthias Meulien <orontee@gmail.com>
Date: Sun, 8 Nov 2020 16:06:02 +0100
Subject: [PATCH 1/2] Remove text property from empty line

---
 lisp/net/dictionary.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 8d7d97afe0..6fa1ea408e 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -762,9 +762,9 @@ dictionary-display-word-entry
 	    dictionary-description-open-delimiter
 	    (dictionary-decode-charset description dictionary)
 	    dictionary-description-close-delimiter
-	    " [" (dictionary-decode-charset dictionary dictionary) "]:"
-	    "\n\n")
-    (put-text-property start (point) 'face 'dictionary-word-entry-face)))
+	    " [" (dictionary-decode-charset dictionary dictionary) "]:")
+    (put-text-property start (point) 'face 'dictionary-word-entry-face)
+    (insert "\n\n")))
 
 (defun dictionary-display-word-definition (reply word dictionary)
   "Insert the definition for the current word"
-- 
2.20.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Add-history-of-search-words-to-read-string.patch --]
[-- Type: text/x-diff, Size: 2015 bytes --]

From f4375c800669b1422d2a7aabf729ab04d8a362cf Mon Sep 17 00:00:00 2001
From: Matthias Meulien <orontee@gmail.com>
Date: Sun, 8 Nov 2020 16:08:07 +0100
Subject: [PATCH 2/2] Add history of search words to read-string

---
 lisp/net/dictionary.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 6fa1ea408e..849b2f35d0 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -333,6 +333,10 @@ dictionary-color-support
     (error nil))
   "Determines if the Emacs has support to display color")
 
+(defvar dictionary-word-history
+  '()
+  "History list of searched word")
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Basic function providing startup actions
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1092,7 +1096,7 @@ dictionary-search
            (read-string (if default
                             (format "Search word (%s): " default)
                           "Search word: ")
-                        nil nil default))
+                        nil 'dictionary-word-history default))
 	 (if current-prefix-arg
 	     (read-string (if dictionary-default-dictionary
 			      (format "Dictionary (%s): " dictionary-default-dictionary)
@@ -1102,7 +1106,7 @@ dictionary-search
 
   ;; if called by pressing the button
   (unless word
-    (setq word (read-string "Search word: ")))
+    (setq word (read-string "Search word: " nil 'dictionary-word-history)))
   ;; just in case non-interactivly called
   (unless dictionary
     (setq dictionary dictionary-default-dictionary))
@@ -1132,7 +1136,8 @@ dictionary-match-words
   (interactive)
   ;; can't use interactive because of mouse events
   (or pattern
-      (setq pattern (read-string "Search pattern: ")))
+      (setq pattern (read-string "Search pattern: "
+                                 nil 'dictionary-word-history)))
   (dictionary-new-matching pattern))
 
 ;;;###autoload
-- 
2.20.1


[-- Attachment #4: Type: text/plain, Size: 14 bytes --]


-- 
Matthias

  parent reply	other threads:[~2020-11-08 15:16 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08 16:01 Integration of dictionary package Torsten Hilbrich
2020-10-08 17:25 ` Robert Pluim
2020-10-08 17:33 ` Philip K.
2020-10-08 17:37   ` Eli Zaretskii
2020-10-09 17:17     ` Jean Louis
2020-10-08 17:45   ` Torsten Hilbrich
2020-10-09 17:19     ` Integration of dictionary package - match strategy Jean Louis
2020-10-08 17:49   ` Integration of dictionary package Torsten Hilbrich
2020-11-08 15:16 ` Matthias Meulien [this message]
2020-11-19  7:40   ` Torsten Hilbrich
2020-11-19 11:51     ` Jean Louis
2020-11-19 14:40     ` Eli Zaretskii
2020-11-19 15:22     ` Stefan Kangas
2020-11-19 17:35     ` Jean Louis
2020-11-19 17:53       ` Eli Zaretskii
2020-11-19 19:18         ` Jean Louis
2020-11-19 20:32           ` Eli Zaretskii
2020-11-19 19:06       ` Torsten Hilbrich
2020-11-19 19:27         ` Jean Louis
2020-11-19 20:29           ` Stefan Kangas
2020-11-19 20:30           ` Eli Zaretskii
2020-11-19 20:39             ` Jean Louis
2020-11-19 20:46               ` Eli Zaretskii
2020-11-20  1:41                 ` Jean Louis
2020-11-20  2:14         ` Jean Louis
2020-11-20  2:22     ` Jean Louis
2020-11-20  2:27     ` Jean Louis
2020-11-20  2:32     ` Jean Louis
2020-11-20  5:29       ` Torsten Hilbrich
2020-11-20  5:36         ` Jean Louis
2020-11-20  6:44           ` Torsten Hilbrich
2020-11-20  8:02       ` Eli Zaretskii
2020-11-20  8:44         ` Jean Louis
2020-11-20  3:11     ` Jean Louis
2020-11-20  5:57       ` Torsten Hilbrich
2020-11-20  6:50         ` Jean Louis
2020-11-21  8:59     ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87o8k7zxoj.fsf@gmail.com \
    --to=orontee@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=emacs.nolkaf@hilbrich.tk \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.