aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorsten Hilbrich2020-11-19 21:39:10 +0100
committerTorsten Hilbrich2020-12-14 11:45:24 +0100
commitcc5f2803785c5dc785f09a292313cf799e8d29bb (patch)
treef5f4920d5e6a42fea1105844d2c753647d8d4ff1
parentd5a4da25b03d9af850077cf803b8099a4056152c (diff)
downloademacs-cc5f2803785c5dc785f09a292313cf799e8d29bb.tar.gz
emacs-cc5f2803785c5dc785f09a292313cf799e8d29bb.zip
* lisp/net/dictionary.el: Add lexical-binding:t
Fixing all the issues found by this. A number of unused variables were reported here.
-rw-r--r--lisp/net/dictionary.el39
1 files changed, 18 insertions, 21 deletions
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 6eb8475f55d..65ed7d2b1e2 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -1,4 +1,4 @@
1;;; dictionary.el --- Client for rfc2229 dictionary servers 1;;; dictionary.el --- Client for rfc2229 dictionary servers -*- lexical-binding:t -*-
2 2
3;; Author: Torsten Hilbrich <torsten.hilbrich@gmx.net> 3;; Author: Torsten Hilbrich <torsten.hilbrich@gmx.net>
4;; Keywords: interface, dictionary 4;; Keywords: interface, dictionary
@@ -416,7 +416,7 @@ is utf-8"
416 (dictionary-store-positions) 416 (dictionary-store-positions)
417 (dictionary-store-state 'dictionary-new-buffer nil))) 417 (dictionary-store-state 'dictionary-new-buffer nil)))
418 418
419(defun dictionary-new-buffer (&rest ignore) 419(defun dictionary-new-buffer ()
420 "Create a new and clean buffer" 420 "Create a new and clean buffer"
421 421
422 (dictionary-pre-buffer) 422 (dictionary-pre-buffer)
@@ -513,7 +513,7 @@ is utf-8"
513;; Dealing with closing the buffer 513;; Dealing with closing the buffer
514;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 514;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
515 515
516(defun dictionary-close (&rest ignore) 516(defun dictionary-close ()
517 "Close the current dictionary buffer and its connection" 517 "Close the current dictionary buffer and its connection"
518 (interactive) 518 (interactive)
519 (if (eq major-mode 'dictionary-mode) 519 (if (eq major-mode 'dictionary-mode)
@@ -777,13 +777,13 @@ This function knows about the special meaning of quotes (\")"
777 (dictionary (nth 2 reply-list)) 777 (dictionary (nth 2 reply-list))
778 (description (nth 3 reply-list)) 778 (description (nth 3 reply-list))
779 (word (nth 1 reply-list))) 779 (word (nth 1 reply-list)))
780 (dictionary-display-word-entry word dictionary description) 780 (dictionary-display-word-entry dictionary description)
781 (setq reply (dictionary-read-answer)) 781 (setq reply (dictionary-read-answer))
782 (dictionary-display-word-definition reply word dictionary) 782 (dictionary-display-word-definition reply word dictionary)
783 (setq reply (dictionary-read-reply-and-split)))) 783 (setq reply (dictionary-read-reply-and-split))))
784 (dictionary-post-buffer))) 784 (dictionary-post-buffer)))
785 785
786(defun dictionary-display-word-entry (word dictionary description) 786(defun dictionary-display-word-entry (dictionary description)
787 "Insert an explanation for the current definition." 787 "Insert an explanation for the current definition."
788 (let ((start (point))) 788 (let ((start (point)))
789 (insert "From " 789 (insert "From "
@@ -857,7 +857,7 @@ The word is taken from the buffer, the `dictionary' is given as argument."
857 (unless (dictionary-check-reply reply 110) 857 (unless (dictionary-check-reply reply 110)
858 (error "Unknown server answer: %s" 858 (error "Unknown server answer: %s"
859 (dictionary-reply reply))) 859 (dictionary-reply reply)))
860 (dictionary-display-dictionarys reply)))) 860 (dictionary-display-dictionarys))))
861 861
862(defun dictionary-simple-split-string (string &optional pattern) 862(defun dictionary-simple-split-string (string &optional pattern)
863 "Return a list of substrings of STRING which are separated by PATTERN. 863 "Return a list of substrings of STRING which are separated by PATTERN.
@@ -872,7 +872,7 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
872 start (match-end 0))) 872 start (match-end 0)))
873 (nreverse (cons (substring string start) parts)))) 873 (nreverse (cons (substring string start) parts))))
874 874
875(defun dictionary-display-dictionarys (reply) 875(defun dictionary-display-dictionarys ()
876 "Handle the display of all dictionaries existing on the server" 876 "Handle the display of all dictionaries existing on the server"
877 (dictionary-pre-buffer) 877 (dictionary-pre-buffer)
878 (insert "Please select your default dictionary:\n\n") 878 (insert "Please select your default dictionary:\n\n")
@@ -969,9 +969,9 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
969 (unless (dictionary-check-reply reply 111) 969 (unless (dictionary-check-reply reply 111)
970 (error "Unknown server answer: %s" 970 (error "Unknown server answer: %s"
971 (dictionary-reply reply))) 971 (dictionary-reply reply)))
972 (dictionary-display-strategies reply)))) 972 (dictionary-display-strategies))))
973 973
974(defun dictionary-display-strategies (reply) 974(defun dictionary-display-strategies ()
975 "Handle the display of all strategies existing on the server" 975 "Handle the display of all strategies existing on the server"
976 (dictionary-pre-buffer) 976 (dictionary-pre-buffer)
977 (insert "Please select your default search strategy:\n\n") 977 (insert "Please select your default search strategy:\n\n")
@@ -1186,9 +1186,8 @@ It presents the word at point as default input and allows editing it."
1186 dictionary-default-popup-strategy 1186 dictionary-default-popup-strategy
1187 'dictionary-process-popup-replies)) 1187 'dictionary-process-popup-replies))
1188 1188
1189(defun dictionary-process-popup-replies (reply) 1189(defun dictionary-process-popup-replies (&ignore)
1190 (let ((number (nth 1 (dictionary-reply-list reply))) 1190 (let ((list (dictionary-simple-split-string (dictionary-read-answer) "\n+")))
1191 (list (dictionary-simple-split-string (dictionary-read-answer) "\n+")))
1192 1191
1193 (let ((result (mapcar (lambda (item) 1192 (let ((result (mapcar (lambda (item)
1194 (let* ((list (dictionary-split-string item)) 1193 (let* ((list (dictionary-split-string item))
@@ -1204,13 +1203,11 @@ It presents the word at point as default input and allows editing it."
1204 t )))) 1203 t ))))
1205 1204
1206 list))) 1205 list)))
1207 (let ((menu (make-sparse-keymap 'dictionary-popup))) 1206 (easy-menu-define dictionary-mode-map-menu dictionary-mode-map
1208 1207 "Menu used for displaying dictionary popup"
1209 (easy-menu-define dictionary-mode-map-menu dictionary-mode-map 1208 (cons "Matching words"
1210 "Menu used for displaying dictionary popup" 1209 `(,@result)))
1211 (cons "Matching words" 1210 (popup-menu dictionary-mode-map-menu))))
1212 `(,@result)))
1213 (popup-menu dictionary-mode-map-menu)))))
1214 1211
1215;;; Tooltip support 1212;;; Tooltip support
1216 1213
@@ -1234,7 +1231,7 @@ It presents the word at point as default input and allows editing it."
1234 (dictionary-do-search word dictionary 'dictionary-read-definition t)) 1231 (dictionary-do-search word dictionary 'dictionary-read-definition t))
1235 nil)) 1232 nil))
1236 1233
1237(defun dictionary-read-definition (reply) 1234(defun dictionary-read-definition (&ignore)
1238 (let ((list (dictionary-simple-split-string (dictionary-read-answer) "\n+"))) 1235 (let ((list (dictionary-simple-split-string (dictionary-read-answer) "\n+")))
1239 (mapconcat 'identity (cdr list) "\n"))) 1236 (mapconcat 'identity (cdr list) "\n")))
1240 1237
@@ -1255,7 +1252,7 @@ It presents the word at point as default input and allows editing it."
1255(defvar dictionary-tooltip-mouse-event nil 1252(defvar dictionary-tooltip-mouse-event nil
1256 "Event that triggered the tooltip mode") 1253 "Event that triggered the tooltip mode")
1257 1254
1258(defun dictionary-display-tooltip (event) 1255(defun dictionary-display-tooltip (&ignore)
1259 "Search the current word in the `dictionary-tooltip-dictionary'." 1256 "Search the current word in the `dictionary-tooltip-dictionary'."
1260 (interactive "e") 1257 (interactive "e")
1261 (if (and dictionary-tooltip-mode dictionary-tooltip-dictionary) 1258 (if (and dictionary-tooltip-mode dictionary-tooltip-dictionary)