Browse Source

Fix <RET> on table.el tables

* lisp/org.el (org-return): Prevent wrong type error when on
  a table.el table.
Nicolas Goaziou 1 year ago
parent
commit
32a7305dda
1 changed files with 4 additions and 4 deletions
  1. 4 4
      lisp/org.el

+ 4 - 4
lisp/org.el

@@ -20442,7 +20442,8 @@ object (e.g., within a comment).  In these case, you need to use
     (cond
      ;; In a table, call `org-table-next-row'.  However, before first
      ;; column or after last one, split the table.
-     ((or (and (eq (org-element-type context) 'table)
+     ((or (and (eq 'table (org-element-type context))
+	       (not (eq 'table.el (org-element-property :type context)))
 	       (>= (point) (org-element-property :contents-begin context))
 	       (< (point) (org-element-property :contents-end context)))
 	  (org-element-lineage context '(table-row table-cell) t))
@@ -20468,9 +20469,8 @@ object (e.g., within a comment).  In these case, you need to use
       (call-interactively #'org-open-at-point))
      ;; Insert newline in heading, but preserve tags.
      ((and (not (bolp))
-	   (save-excursion (beginning-of-line)
-			   (let ((case-fold-search nil))
-			     (looking-at org-complex-heading-regexp))))
+	   (let ((case-fold-search nil))
+	     (org-match-line org-complex-heading-regexp)))
       ;; At headline.  Split line.  However, if point is on keyword,
       ;; priority cookie or tags, do not break any of them: add
       ;; a newline after the headline instead.