Pārlūkot izejas kodu

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.
Marco Wahl 8 gadi atpakaļ
vecāks
revīzija
5b4fcc3e2e
1 mainītis faili ar 8 papildinājumiem un 4 dzēšanām
  1. 8 4
      lisp/org-table.el

+ 8 - 4
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)))