浏览代码

Change "\..." entities into "\_ "

* lisp/org-element.el (org-element--set-regexps):
(org-element-entity-parser): Update regexps.

* lisp/org-entities.el (org-entities): Modify syntax for space
  entities.

* lisp/org.el (org-fontify-entities): Update comment.

* lisp/org-clock.el (org-clocktable-indent-string): Apply syntax
  change.

* etc/ORG-NEWS (title): Update announce.

Use a less verbose syntax, which cannot interfere with file paths.
Nicolas Goaziou 10 年之前
父节点
当前提交
d4785381ec
共有 5 个文件被更改,包括 11 次插入19 次删除
  1. 2 10
      etc/ORG-NEWS
  2. 1 1
      lisp/org-clock.el
  3. 2 2
      lisp/org-element.el
  4. 3 3
      lisp/org-entities.el
  5. 3 3
      lisp/org.el

+ 2 - 10
etc/ORG-NEWS

@@ -316,18 +316,10 @@ It is now possible to supply and optional formatting argument to
 *** New option ~org-export-with-title~
 *** New option ~org-export-with-title~
 It is possible to suppress the title insertion with ~#+OPTIONS:
 It is possible to suppress the title insertion with ~#+OPTIONS:
 title:nil~ or globally using the variable ~org-export-with-title~.
 title:nil~ or globally using the variable ~org-export-with-title~.
-*** New entities family: "\...."
-"\..." are used to insert up to 20 contiguous spaces in various
+*** New entities family: "\_ "
+"\_ " are used to insert up to 20 contiguous spaces in various
 back-ends.  In particular, this family can be used to introduce
 back-ends.  In particular, this family can be used to introduce
 leading spaces within table cells.
 leading spaces within table cells.
-
-Also, unlike to other entities, these can be used mid-word, e.g.,
-
-  wo\..rd
-
-Curly brackets can still be added before a dot, e.g.,
-
-  This is the end\...{}.
 *** New MathJax configuration options.
 *** New MathJax configuration options.
 Org uses the MathJax CDN by default.  See the manual and the docstring
 Org uses the MathJax CDN by default.  See the manual and the docstring
 of ~org-html-mathjax-options~ for details.
 of ~org-html-mathjax-options~ for details.

+ 1 - 1
lisp/org-clock.el

@@ -2644,7 +2644,7 @@ from the dynamic block definition."
   "Return indentation string according to LEVEL.
   "Return indentation string according to LEVEL.
 LEVEL is an integer.  Indent by two spaces per level above 1."
 LEVEL is an integer.  Indent by two spaces per level above 1."
   (if (= level 1) ""
   (if (= level 1) ""
-    (concat "\\" (make-string (- (* 2 level) 3) ?.) " ")))
+    (concat "\\_" (make-string (* 2 (1- level)) ?\s))))
 
 
 (defun org-clocktable-steps (params)
 (defun org-clocktable-steps (params)
   "Step through the range to make a number of clock tables."
   "Step through the range to make a number of clock tables."

+ 2 - 2
lisp/org-element.el

@@ -207,7 +207,7 @@ specially in `org-element--object-lex'.")
 		      "\\$"
 		      "\\$"
 		      ;; Objects starting with "\": line break,
 		      ;; Objects starting with "\": line break,
 		      ;; entity, latex fragment.
 		      ;; entity, latex fragment.
-		      "\\\\\\(?:[a-zA-Z[(.]\\|\\\\[ \t]*$\\)"
+		      "\\\\\\(?:[a-zA-Z[(]\\|\\\\[ \t]*$\\|_ +\\)"
 		      ;; Objects starting with raw text: inline Babel
 		      ;; Objects starting with raw text: inline Babel
 		      ;; source block, inline Babel call.
 		      ;; source block, inline Babel call.
 		      "\\(?:call\\|src\\)_"))
 		      "\\(?:call\\|src\\)_"))
@@ -2722,7 +2722,7 @@ a plist with `:begin', `:end', `:latex', `:latex-math-p',
 
 
 Assume point is at the beginning of the entity."
 Assume point is at the beginning of the entity."
   (catch 'no-object
   (catch 'no-object
-    (when (looking-at "\\\\\\(?:\\(?1:\\.+\\)\\(?2:{}\\)?\\|\\(?1:there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\(?2:$\\|{}\\|[^[:alpha:]]\\)\\)")
+    (when (looking-at "\\\\\\(?:\\(?1:_ +\\)\\|\\(?1:there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\(?2:$\\|{}\\|[^[:alpha:]]\\)\\)")
       (save-excursion
       (save-excursion
 	(let* ((value (or (org-entity-get (match-string 1))
 	(let* ((value (or (org-entity-get (match-string 1))
 			  (throw 'no-object nil)))
 			  (throw 'no-object nil)))

+ 3 - 3
lisp/org-entities.el

@@ -515,12 +515,12 @@ packages to be loaded, add these packages to `org-latex-packages-alist'."
      ("diamond" "\\diamondsuit" t "⋄" "[diamond]" "[diamond]" "◆")
      ("diamond" "\\diamondsuit" t "⋄" "[diamond]" "[diamond]" "◆")
      ("Diamond" "\\diamondsuit" t "⋄" "[diamond]" "[diamond]" "◆")
      ("Diamond" "\\diamondsuit" t "⋄" "[diamond]" "[diamond]" "◆")
      ("loz" "\\lozenge" t "◊" "[lozenge]" "[lozenge]" "⧫"))
      ("loz" "\\lozenge" t "◊" "[lozenge]" "[lozenge]" "⧫"))
-   ;; Add "\...."-entity family for spaces.
-   (let (space-entities html-spaces)
+   ;; Add "\_ "-entity family for spaces.
+   (let (space-entities html-spaces (entity "_"))
      (dotimes (n 20 (nreverse space-entities))
      (dotimes (n 20 (nreverse space-entities))
        (let ((n (+ 1 n))
        (let ((n (+ 1 n))
 	     (spaces (make-string n ?\s)))
 	     (spaces (make-string n ?\s)))
-	 (push (list (make-string n ?.)
+	 (push (list (setq entity (concat entity " "))
 		     (format "\\hspace*{%sem}" (* n .5))
 		     (format "\\hspace*{%sem}" (* n .5))
 		     nil
 		     nil
 		     (setq html-spaces (concat " " html-spaces))
 		     (setq html-spaces (concat " " html-spaces))

+ 3 - 3
lisp/org.el

@@ -6456,9 +6456,9 @@ needs to be inserted at a specific position in the font-lock sequence.")
   (let (ee)
   (let (ee)
     (when org-pretty-entities
     (when org-pretty-entities
       (catch 'match
       (catch 'match
-	;; \...-family is left out on purpose.  Only the first one,
-	;; i.e., "\.", could be fontified anyway, and it would be
-	;; confusing when adding more dots.
+	;; "\_ "-family is left out on purpose.  Only the first one,
+	;; i.e., "\_ ", could be fontified anyway, and it would be
+	;; confusing when adding more underscores.
 	(while (re-search-forward
 	(while (re-search-forward
 		"\\\\\\(there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)"
 		"\\\\\\(there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)"
 		limit t)
 		limit t)