summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-03-22 21:45:00 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-03-22 21:45:00 +0100
commitd4785381ec9cf46f4a7f21ca9c86d543f3886657 (patch)
tree04f1d63ae69c81c2a5a69691d43f3bc5267ac60a
parent51b206bcd2676a3f46cbb89e6ac35d3a04ea70b5 (diff)
downloadorg-mode-d4785381ec9cf46f4a7f21ca9c86d543f3886657.tar.gz
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.
-rw-r--r--etc/ORG-NEWS12
-rw-r--r--lisp/org-clock.el2
-rw-r--r--lisp/org-element.el4
-rw-r--r--lisp/org-entities.el6
-rwxr-xr-xlisp/org.el6
5 files changed, 11 insertions, 19 deletions
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 850cc86..9c262f4 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -316,18 +316,10 @@ It is now possible to supply and optional formatting argument to
*** New option ~org-export-with-title~
It is possible to suppress the title insertion with ~#+OPTIONS:
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
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.
Org uses the MathJax CDN by default. See the manual and the docstring
of ~org-html-mathjax-options~ for details.
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 6ed2465..125209e 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2644,7 +2644,7 @@ from the dynamic block definition."
"Return indentation string according to LEVEL.
LEVEL is an integer. Indent by two spaces per level above 1."
(if (= level 1) ""
- (concat "\\" (make-string (- (* 2 level) 3) ?.) " ")))
+ (concat "\\_" (make-string (* 2 (1- level)) ?\s))))
(defun org-clocktable-steps (params)
"Step through the range to make a number of clock tables."
diff --git a/lisp/org-element.el b/lisp/org-element.el
index b0e4e5c..74d99f1 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -207,7 +207,7 @@ specially in `org-element--object-lex'.")
"\\$"
;; Objects starting with "\": line break,
;; entity, latex fragment.
- "\\\\\\(?:[a-zA-Z[(.]\\|\\\\[ \t]*$\\)"
+ "\\\\\\(?:[a-zA-Z[(]\\|\\\\[ \t]*$\\|_ +\\)"
;; Objects starting with raw text: inline Babel
;; source block, inline Babel call.
"\\(?:call\\|src\\)_"))
@@ -2722,7 +2722,7 @@ a plist with `:begin', `:end', `:latex', `:latex-math-p',
Assume point is at the beginning of the entity."
(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
(let* ((value (or (org-entity-get (match-string 1))
(throw 'no-object nil)))
diff --git a/lisp/org-entities.el b/lisp/org-entities.el
index 8f8c839..732b989 100644
--- a/lisp/org-entities.el
+++ b/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]" "◆")
("Diamond" "\\diamondsuit" t "&diamond;" "[diamond]" "[diamond]" "◆")
("loz" "\\lozenge" t "&loz;" "[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))
(let ((n (+ 1 n))
(spaces (make-string n ?\s)))
- (push (list (make-string n ?.)
+ (push (list (setq entity (concat entity " "))
(format "\\hspace*{%sem}" (* n .5))
nil
(setq html-spaces (concat "&ensp;" html-spaces))
diff --git a/lisp/org.el b/lisp/org.el
index 72be8ee..c48976f 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6456,9 +6456,9 @@ needs to be inserted at a specific position in the font-lock sequence.")
(let (ee)
(when org-pretty-entities
(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
"\\\\\\(there4\\|sup[123]\\|frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]\n]\\)"
limit t)