From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matthias Meulien Newsgroups: gmane.emacs.devel Subject: Re: Integration of dictionary package Date: Sun, 08 Nov 2020 16:16:12 +0100 Message-ID: <87o8k7zxoj.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2002"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Torsten Hilbrich Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 08 16:17:29 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kbmRd-0000Q8-D4 for ged-emacs-devel@m.gmane-mx.org; Sun, 08 Nov 2020 16:17:29 +0100 Original-Received: from localhost ([::1]:50848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbmRc-0005ot-Fx for ged-emacs-devel@m.gmane-mx.org; Sun, 08 Nov 2020 10:17:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbmQU-00053E-Mx for emacs-devel@gnu.org; Sun, 08 Nov 2020 10:16:18 -0500 Original-Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:35418) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbmQS-0005PC-OC for emacs-devel@gnu.org; Sun, 08 Nov 2020 10:16:18 -0500 Original-Received: by mail-wm1-x32f.google.com with SMTP id w24so3185330wmi.0 for ; Sun, 08 Nov 2020 07:16:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=UC8F/QELWtQrS6RlIyLQlzzbRqCYcqon+X2OykzY+8g=; b=bfUv/oBfkWnjoueV79XY4VNp23HdtBOBs54xKq2Z89ZH5mcc6GJi+dz5JNewafP5il Bnbjo1XhphTi+q4l55ejzDnS1VR5Lx4tfhlA9mIQM8JHTkqBBlhfHFQyIXaTUVbf5y9B ABdc2XFskLunwGxBzIMu+F+ATTNC34xr8yajfrlN8Zg0f/I9TSs43vdlNjskXkfd0/Zv KgnP0f4eGNvla9U3BP8SIQa6B/KAnCJStlgwf6/OJ2eWuQ/KIn0ZIDJE0mgIzG2BP9BS VV9bI8CW+164+Xw5H3ff2xqitS3Q9WLOiKHcA5U/7+SCuPeP+kopkWDBm0Gg9OYLe2LI vYPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=UC8F/QELWtQrS6RlIyLQlzzbRqCYcqon+X2OykzY+8g=; b=I+xJEDgBKUBgXIBqBxVKVoOltxATCgzyXxyQXOzp0kCojucoFsQe2gMX+TcbNFNXRD B0GRYQGQWagoXvAYcqLXA1z66oXVY4JbkLW1TM6kmn02nE4m3lMf0i7EfPYGqj5xxXg8 OvDdbmhkU5PaWRAP0h89uH7UBM1EAFfVAEe9AVJNOfKSalxqWqGmxpryK4fallKmtrjI e1j03E1JOjG8Va6ICqnrvWntXPe5puluTw1U7hoYda4vgHv41QxVMWKWT3FxGPpTEUE4 PQcKT8fzFJ7s4oJjMXk+W2yp+ziaSOKwkZF/UA3swdyo0QnOIc7OJHGbUNSsiw97W9QO aVoQ== X-Gm-Message-State: AOAM531hHLx8WBHBxPkj6KWYsGFK9cuQF9/81oEjqeVFFatWlMLVGaPi +EDn7Vo/j+o4YW4lnaEafv5NcgjSOOA= X-Google-Smtp-Source: ABdhPJwug7TcLDig5iNX+Aj2Ics4nlmrO1T1C9/2EQy7R8U1eN3YkWv4Gjl2fjytXYX24MjP/elk3A== X-Received: by 2002:a1c:4646:: with SMTP id t67mr10356446wma.40.1604848574164; Sun, 08 Nov 2020 07:16:14 -0800 (PST) Original-Received: from carbon.localdomain ([2a01:e0a:245:c850:98f5:429a:aa8e:95bb]) by smtp.gmail.com with ESMTPSA id c64sm9587392wmd.41.2020.11.08.07.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Nov 2020 07:16:12 -0800 (PST) In-Reply-To: (Torsten Hilbrich's message of "Thu, 8 Oct 2020 18:01:11 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=orontee@gmail.com; helo=mail-wm1-x32f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:258904 Archived-At: --=-=-= Content-Type: text/plain; format=flowed Torsten Hilbrich 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Remove-text-property-from-empty-line.patch >From 7453384d19e5f662f3623ff998656797ed325f3d Mon Sep 17 00:00:00 2001 From: Matthias Meulien 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-Add-history-of-search-words-to-read-string.patch >From f4375c800669b1422d2a7aabf729ab04d8a362cf Mon Sep 17 00:00:00 2001 From: Matthias Meulien 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 --=-=-= Content-Type: text/plain; format=flowed -- Matthias --=-=-=--