emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/integration-of-dictionary-el 49c250b 2/3: Dont't check coding-sy


From: Torsten Hilbrich
Subject: feature/integration-of-dictionary-el 49c250b 2/3: Dont't check coding-system-list for existence
Date: Thu, 8 Oct 2020 13:56:25 -0400 (EDT)

branch: feature/integration-of-dictionary-el
commit 49c250b388eac27221caa460a01d4ed43c0b37a6
Author: Torsten Hilbrich <torsten.hilbrich@gmx.net>
Commit: Torsten Hilbrich <torsten.hilbrich@gmx.net>

    Dont't check coding-system-list for existence
    
    * lisp/net/dictionary.el (dictionary-coding-systems-for-dictionaries):
    Don't check for coding-system-list before using it. It check no longer
    be necessary.
---
 lisp/net/dictionary.el | 51 +++++++++++++++++++++++---------------------------
 1 file changed, 23 insertions(+), 28 deletions(-)

diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 7f4bb2a..6ba1cc2 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -200,24 +200,21 @@ by the choice value:
   :version "28.1")
 
 ;; Define only when coding-system-list is available
-(when (fboundp 'coding-system-list)
-  (defcustom dictionary-coding-systems-for-dictionaries
-    '( ("mueller" . koi8-r))
-    "Mapping of dictionaries to coding systems.
- Each entry in this list defines the coding system to be used for that
- dictionary.  The default coding system for all other dictionaries
- is utf-8"
-    :group 'dictionary
-    :type `(repeat (cons :tag "Association"
-                        (string :tag "Dictionary name")
-                        (choice :tag "Coding system"
-                                :value 'utf-8
-                                ,@(mapcar (lambda (x) (list 'const x))
-                                          (coding-system-list))
-                                )))
-    :version "28.1")
-
-  )
+(defcustom dictionary-coding-systems-for-dictionaries
+  '( ("mueller" . koi8-r))
+  "Mapping of dictionaries to coding systems.
+Each entry in this list defines the coding system to be used for that
+dictionary.  The default coding system for all other dictionaries
+is utf-8"
+  :group 'dictionary
+  :type `(repeat (cons :tag "Association"
+                       (string :tag "Dictionary name")
+                       (choice :tag "Coding system"
+                               :value 'utf-8
+                               ,@(mapcar (lambda (x) (list 'const x))
+                                         (coding-system-list))
+                               )))
+  :version "28.1")
 
 (if (fboundp 'defface)
     (progn
@@ -459,8 +456,7 @@ by the choice value:
                (eq (dictionary-connection-status dictionary-connection) 'up)))
       (let ((wanted 'raw-text)
            (coding-system nil))
-       (if (and (fboundp 'coding-system-list)
-                (member wanted (coding-system-list)))
+       (if (member wanted (coding-system-list))
            (setq coding-system wanted))
        (let ((coding-system-for-read coding-system)
              (coding-system-for-write coding-system))
@@ -597,14 +593,13 @@ This function knows about the special meaning of quotes 
(\")"
 
 (defun dictionary-coding-system (dictionary)
   "Select coding system to use for that dictionary"
-  (when (boundp 'dictionary-coding-systems-for-dictionaries)
-    (let ((coding-system
-           (or (cdr (assoc dictionary
-                           dictionary-coding-systems-for-dictionaries))
-               'utf-8)))
-      (if (member coding-system (coding-system-list))
-          coding-system
-        nil))))
+  (let ((coding-system
+         (or (cdr (assoc dictionary
+                         dictionary-coding-systems-for-dictionaries))
+             'utf-8)))
+    (if (member coding-system (coding-system-list))
+        coding-system
+      nil)))
 
 (defun dictionary-decode-charset (text dictionary)
   "Convert the text from the charset defined by the dictionary given."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]