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.
This commit is contained in:
Nicolas Goaziou 2015-03-22 21:45:00 +01:00
parent 51b206bcd2
commit d4785381ec
5 changed files with 11 additions and 19 deletions

View File

@ -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.

View File

@ -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."

View File

@ -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)))

View File

@ -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]" "")
("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))
(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 " " html-spaces))

View File

@ -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)