Be more strict when matching an Org table

* lisp/org.el (org-at-table-p): Do not allow "+" character at the
  beginning of a table row.
This commit is contained in:
Nicolas Goaziou 2015-06-28 23:32:38 +02:00
parent 157591db7c
commit 1cc8cdc49e
1 changed files with 3 additions and 1 deletions

View File

@ -4499,7 +4499,9 @@ Normal means, no org-mode-specific context."
If TABLE-TYPE is non-nil, also check for table.el-type tables.
If `org-enable-table-editor' is nil, return nil unconditionally."
(and org-enable-table-editor
(save-excursion (beginning-of-line) (looking-at "[ \t]*[|+]"))
(save-excursion
(beginning-of-line)
(org-looking-at-p (if table-type "[ \t]*[|+]" "[ \t]*|")))
(let ((element (org-element-lineage (org-element-at-point) '(table) t)))
(and element
(or table-type (eq (org-element-property :type element) 'org))))))