|
@@ -23593,23 +23593,28 @@ depending on context."
|
|
|
This will call `forward-sentence' or `org-table-end-of-field',
|
|
|
depending on context."
|
|
|
(interactive)
|
|
|
- (let* ((element (org-element-at-point))
|
|
|
- (contents-end (org-element-property :contents-end element))
|
|
|
- (table (org-element-lineage element '(table) t)))
|
|
|
- (if (and table
|
|
|
- (>= (point) (org-element-property :contents-begin table))
|
|
|
- (< (point) contents-end))
|
|
|
- (call-interactively #'org-table-end-of-field)
|
|
|
+ (if (and (org-at-heading-p)
|
|
|
+ (save-restriction (skip-chars-forward " \t") (not (eolp))))
|
|
|
(save-restriction
|
|
|
- (when (and contents-end
|
|
|
- (> (point-max) contents-end)
|
|
|
- ;; Skip blank lines between elements.
|
|
|
- (< (org-element-property :end element)
|
|
|
- (save-excursion (goto-char contents-end)
|
|
|
- (skip-chars-forward " \r\t\n"))))
|
|
|
- (narrow-to-region (org-element-property :contents-begin element)
|
|
|
- contents-end))
|
|
|
- (call-interactively #'forward-sentence)))))
|
|
|
+ (narrow-to-region (line-beginning-position) (line-end-position))
|
|
|
+ (call-interactively #'forward-sentence))
|
|
|
+ (let* ((element (org-element-at-point))
|
|
|
+ (contents-end (org-element-property :contents-end element))
|
|
|
+ (table (org-element-lineage element '(table) t)))
|
|
|
+ (if (and table
|
|
|
+ (>= (point) (org-element-property :contents-begin table))
|
|
|
+ (< (point) contents-end))
|
|
|
+ (call-interactively #'org-table-end-of-field)
|
|
|
+ (save-restriction
|
|
|
+ (when (and contents-end
|
|
|
+ (> (point-max) contents-end)
|
|
|
+ ;; Skip blank lines between elements.
|
|
|
+ (< (org-element-property :end element)
|
|
|
+ (save-excursion (goto-char contents-end)
|
|
|
+ (skip-chars-forward " \r\t\n"))))
|
|
|
+ (narrow-to-region (org-element-property :contents-begin element)
|
|
|
+ contents-end))
|
|
|
+ (call-interactively #'forward-sentence))))))
|
|
|
|
|
|
(define-key org-mode-map "\M-a" 'org-backward-sentence)
|
|
|
(define-key org-mode-map "\M-e" 'org-forward-sentence)
|