branch: externals/org-mem
commit 7629e620b75f86ed4b1df4e03be0b7aecd79cf51
Author: Martin Edström <[email protected]>
Commit: Martin Edström <[email protected]>
Move code
---
org-mem-list.el | 45 +++++++++++++++++++++++----------------------
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/org-mem-list.el b/org-mem-list.el
index 74bce1e92b..0e251ceff4 100644
--- a/org-mem-list.el
+++ b/org-mem-list.el
@@ -44,6 +44,29 @@
(find-file (org-mem-entry-file entry))
(goto-char (org-mem-entry-pos entry))))
+;;;###autoload
+(cl-defun org-mem-list--pop-to-tabulated-buffer (&key buffer format entries
reverter)
+ "Create, populate and display a `tabulated-list-mode' buffer.
+
+BUFFER is a buffer or buffer name to use.
+FORMAT is the value to which `tabulated-list-format' should be set.
+ENTRIES is the value to which `tabulated-list-entries' should be set.
+
+Optional argument REVERTER is a function to add buffer-locally to
+`tabulated-list-revert-hook'."
+ (unless (and buffer format)
+ (error "org-mem-list--pop-to-tabulated-buffer: Mandatory arguments are
BUFFER, FORMAT, ENTRIES"))
+ (when (null entries)
+ (message "No entries to tabulate"))
+ (pop-to-buffer (get-buffer-create buffer))
+ (tabulated-list-mode)
+ (setq tabulated-list-format format)
+ (tabulated-list-init-header)
+ (setq tabulated-list-entries entries)
+ (when reverter (add-hook 'tabulated-list-revert-hook reverter nil t))
+ (tabulated-list-print t))
+
+
;;;###autoload
(defun org-mem-list-entries ()
(interactive)
@@ -195,28 +218,6 @@ instead of default `org-mem-roamy--connection'."
(sqlite-mode-list-tables))
(message "No DB yet")))))
-;;;###autoload
-(cl-defun org-mem-list--pop-to-tabulated-buffer (&key buffer format entries
reverter)
- "Create, populate and display a `tabulated-list-mode' buffer.
-
-BUFFER is a buffer or buffer name to use.
-FORMAT is the value to which `tabulated-list-format' should be set.
-ENTRIES is the value to which `tabulated-list-entries' should be set.
-
-Optional argument REVERTER is a function to add buffer-locally to
-`tabulated-list-revert-hook'."
- (unless (and buffer format)
- (error "org-mem-list--pop-to-tabulated-buffer: Mandatory arguments are
BUFFER, FORMAT, ENTRIES"))
- (when (null entries)
- (message "No entries to tabulate"))
- (pop-to-buffer (get-buffer-create buffer))
- (tabulated-list-mode)
- (setq tabulated-list-format format)
- (tabulated-list-init-header)
- (setq tabulated-list-entries entries)
- (when reverter (add-hook 'tabulated-list-revert-hook reverter nil t))
- (tabulated-list-print t))
-
(provide 'org-mem-list)
;;; org-mem-list.el ends here