From 9760a78da2437acb70f850d9a0e7e61fda51a03b Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Sun, 2 Oct 2022 23:47:08 +0200 Subject: [PATCH] Display links in a tabulated buffer --- dsptl.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dsptl.el b/dsptl.el index 59ae25b..0ccdd50 100644 --- a/dsptl.el +++ b/dsptl.el @@ -72,8 +72,14 @@ (interactive) (let ((links (dsptl--list-links))) (switch-to-buffer (format "*Links in %s*" default-directory)) - (dolist (link links) - (insert (format "%s\t->\t%s\n" (car link) (cdr link)))))) + (setq tabulated-list-format [("Source File" 25 t) + ("Target" 25 t)] + tabulated-list-entries (mapcar (lambda (link) + (list (cdr link) (vector (car link) (cdr link)))) + links)) + (tabulated-list-init-header) + (tabulated-list-print t) + (read-only-mode 1))) (provide 'dsptl) ;;; dsptl.el ends here