浏览代码

org-entities: Remove unused variable and functions

* lisp/org-entities.el (org-entities-ascii-explanatory): Remove
  variable.
(org-entities--user-safe-p): Refactor.
(org-entities-user): Delete reference to removed variable.  Small
docstring fix.
(org-entity-get-representation, org-entity-latex-math-p): Remove
functions.

* etc/ORG-NEWS (Skipping): Document variable removal.
Nicolas Goaziou 10 年之前
父节点
当前提交
4cc8ead4d8
共有 2 个文件被更改,包括 17 次插入49 次删除
  1. 2 0
      etc/ORG-NEWS
  2. 15 49
      lisp/org-entities.el

+ 2 - 0
etc/ORG-NEWS

@@ -118,6 +118,8 @@ would create invalid planning info.  This dangerous option is now
 removed.
 removed.
 *** Removed option ~org-koma-letter-use-title~
 *** Removed option ~org-koma-letter-use-title~
 Use org-export-with-title instead.  See also below.
 Use org-export-with-title instead.  See also below.
+*** Removed option ~org-entities-ascii-explanatory~
+This variable had no effect since Org 8.0.
 *** Removed MathML-related options from ~org-html-mathjax-options~
 *** Removed MathML-related options from ~org-html-mathjax-options~
 MathJax automatically chooses the best display technology based on the
 MathJax automatically chooses the best display technology based on the
 end-users browser.  You may force initial usage of MathML via
 end-users browser.  You may force initial usage of MathML via

+ 15 - 49
lisp/org-entities.el

@@ -38,32 +38,18 @@
   :tag "Org Entities"
   :tag "Org Entities"
   :group 'org)
   :group 'org)
 
 
-(defcustom org-entities-ascii-explanatory nil
-  "Non-nil means replace special entities in ASCII.
-For example, this will replace \"\\nsup\" with \"[not a superset of]\"
-in backends where the corresponding character is not available."
-  :group 'org-entities
-  :version "24.1"
-  :type 'boolean
-  :safe #'booleanp)
-
 (defun org-entities--user-safe-p (v)
 (defun org-entities--user-safe-p (v)
-  "Return t if V is a safe value for `org-entities-user'."
-  (or (eq v nil)
+  "Non-nil if V is a safe value for `org-entities-user'."
+  (or (null v)
       (and (listp v)
       (and (listp v)
-	   ;; The stupid `eval' trick is needed because `apply'
-	   ;; doesn't work with the special form `and'.
-	   (eval (cons #'and (mapcar (lambda (v2)
-				       (and (listp v2)
-					    (= (length v2) 7)
-					    (stringp (nth 0 v2))
-					    (stringp (nth 1 v2))
-					    (booleanp (nth 2 v2))
-					    (stringp (nth 3 v2))
-					    (stringp (nth 4 v2))
-					    (stringp (nth 5 v2))
-					    (stringp (nth 6 v2))))
-				     v))))))
+	   (= (length v) 7)
+	   (stringp (nth 0 v))
+	   (stringp (nth 1 v))
+	   (booleanp (nth 2 v))
+	   (stringp (nth 3 v))
+	   (stringp (nth 4 v))
+	   (stringp (nth 5 v))
+	   (stringp (nth 6 v)))))
 
 
 (defcustom org-entities-user nil
 (defcustom org-entities-user nil
   "User-defined entities used in Org-mode to produce special characters.
   "User-defined entities used in Org-mode to produce special characters.
@@ -72,15 +58,13 @@ of the entity that can be inserted into an Org file as \\name with the
 appropriate replacements for the different export backends.  The order
 appropriate replacements for the different export backends.  The order
 of the fields is the following
 of the fields is the following
 
 
-name                 As a string, without the leading backslash
-LaTeX replacement    In ready LaTeX, no further processing will take place
-LaTeX mathp          A Boolean, either t or nil.  t if this entity needs
-                     to be in math mode.
+name                 As a string, without the leading backslash.
+LaTeX replacement    In ready LaTeX, no further processing will take place.
+LaTeX mathp          Either t or nil.  When t this entity needs to be in
+                     math mode.
 HTML replacement     In ready HTML, no further processing will take place.
 HTML replacement     In ready HTML, no further processing will take place.
                      Usually this will be an &...; entity.
                      Usually this will be an &...; entity.
-ASCII replacement    Plain ASCII, no extensions.  Symbols that cannot be
-                     represented will be left as they are, but see the.
-                     variable `org-entities-ascii-explanatory'.
+ASCII replacement    Plain ASCII, no extensions.
 Latin1 replacement   Use the special characters available in latin1.
 Latin1 replacement   Use the special characters available in latin1.
 utf-8 replacement    Use the special characters available in utf-8.
 utf-8 replacement    Use the special characters available in utf-8.
 
 
@@ -541,24 +525,6 @@ This first checks the user list, then the built-in list."
   (or (assoc name org-entities-user)
   (or (assoc name org-entities-user)
       (assoc name org-entities)))
       (assoc name org-entities)))
 
 
-(defun org-entity-get-representation (name kind)
-  "Get the correct representation of entity NAME for export type KIND.
-Kind can be any of `latex', `html', `ascii', `latin1', or `utf8'."
-  (let* ((e (org-entity-get name))
-	 (n (cdr (assq kind '((latex . 1) (html . 3) (ascii . 4)
-			      (latin1 . 5) (utf8 . 6)))))
-	 (r (and e n (nth n e))))
-    (if (and e r
-	     (not org-entities-ascii-explanatory)
-	     (memq kind '(ascii latin1 utf8))
-	     (= (string-to-char r) ?\[))
-	(concat "\\" name)
-      r)))
-
-(defsubst org-entity-latex-math-p (name)
-  "Does entity NAME require math mode in LaTeX?"
-  (nth 2 (org-entity-get name)))
-
 ;; Helpfunctions to create a table for orgmode.org/worg/org-symbols.org
 ;; Helpfunctions to create a table for orgmode.org/worg/org-symbols.org
 
 
 (defun org-entities-create-table ()
 (defun org-entities-create-table ()