emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole 66b35cc 07/50: Add kotl/kotl-orgtbl.el


From: Stefan Monnier
Subject: [elpa] externals/hyperbole 66b35cc 07/50: Add kotl/kotl-orgtbl.el
Date: Wed, 17 Mar 2021 18:44:13 -0400 (EDT)

branch: externals/hyperbole
commit 66b35ccd52896e6cf473a11696adc07371b5942c
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>

    Add kotl/kotl-orgtbl.el
---
 kotl/kotl-orgtbl.el | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/kotl/kotl-orgtbl.el b/kotl/kotl-orgtbl.el
new file mode 100644
index 0000000..abc96e9
--- /dev/null
+++ b/kotl/kotl-orgtbl.el
@@ -0,0 +1,34 @@
+;;; Allow use of Org minor-mode table editing in Koutlines
+;;; If in an Org table, use kotl-mode {TAB} binding only when given an
+;;; explicit prefix argument; otherwise, {TAB} acts normally in tables.
+
+(require 'org-table)
+
+;; Redefine this Org Table function to handle Koutlines as well.
+(defun orgtbl-tab (arg)
+  "Justification and field motion for `orgtbl-mode' with Hyperbole Koutline 
support."
+  (interactive "P")
+  (cond ((and (derived-mode-p #'kotl-mode) arg)
+        (kotl-mode:tab-command (if (= (prefix-numeric-value arg) 1) nil arg)))
+       (arg
+        (org-table-edit-field t))
+       (t (org-table-justify-field-maybe)
+          (org-table-next-field))))
+
+;; !! TODO: Doesn't leave point in the same place of orig line
+(defun kotl-mode:transpose-lines-up ()
+  "Exchange current line and previous line, maintaining point location.
+If no previous line, exchange current with next line."
+  (interactive)
+  (let ((opoint (set-marker (make-marker) (point))))
+    (kotl-mode:transpose-lines 1)
+    (goto-char opoint)
+    (set-marker opoint nil)))
+
+
+(defun kotl-mode:transpose-lines-down ()
+  (interactive)
+  ;; !! TODO: Write
+  )
+
+(provide 'kotl-orgtbl)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]