summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Wahl <marcowahlsoft@gmail.com>2017-01-04 23:35:40 +0100
committerMarco Wahl <marcowahlsoft@gmail.com>2017-01-04 23:35:40 +0100
commit5b4fcc3e2e25349c690a37a94fd7c8599e7696d2 (patch)
tree5e62f451d7b75bec8aacb35da8f4709f3fe6eae4
parent774ce8a50e26893f503c50c8754672366d121027 (diff)
downloadorg-mode-5b4fcc3e2e25349c690a37a94fd7c8599e7696d2.tar.gz
org-table: Check if on table for field edit
* lisp/org-table.el (org-table-edit-field): Don't open edit buffer if not on a table. Further added the toggle-feature for org-table-follow-field-mode to the documentation.
-rw-r--r--lisp/org-table.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index c689ba3..977c0d6 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -1992,11 +1992,15 @@ blank, and the content is appended to the field above."
;;;###autoload
(defun org-table-edit-field (arg)
"Edit table field in a different window.
-This is mainly useful for fields that contain hidden parts. When called
-with a `\\[universal-argument]' prefix, just make the full field \
-visible so that it can be
-edited in place."
+This is mainly useful for fields that contain hidden parts.
+
+When called with a `\\[universal-argument]' prefix, just make the full field
+visible so that it can be edited in place.
+
+When called with a `\\[universal-argument] \\[universal-argument]' prefix, \
+toggle `org-table-follow-field-mode'."
(interactive "P")
+ (unless (org-at-table-p) (user-error "Not at a table"))
(cond
((equal arg '(16))
(org-table-follow-field-mode (if org-table-follow-field-mode -1 1)))