diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 850cc86a5..9c262f497 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 6ed246550..125209ebf 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 b0e4e5c1d..74d99f17c 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 8f8c83950..732b98962 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" "\\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)) diff --git a/lisp/org.el b/lisp/org.el index 72be8ee9f..c48976f61 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)