From a84819ae11ee148fa6feb56e351f136c3f83b38b Mon Sep 17 00:00:00 2001 From: Olivia Thiderman Date: Tue, 20 Sep 2022 12:04:18 +0200 Subject: [PATCH] Add configurable spacing between dired and the git info --- README.org | 7 +++++++ dired-git-info.el | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 5688d08..f99dbcb 100644 --- a/README.org +++ b/README.org @@ -51,3 +51,10 @@ the following: (add-hook 'dired-after-readin-hook 'dired-git-info-auto-enable) #+END_SRC +** Set the spacing between the file names and the git info + +If you want more room between the ~dired~ filenames and the git information than +the default 2 spaces, use the following: +#+BEGIN_SRC elisp +(setq dgi-spacing 5) +#+END_SRC diff --git a/dired-git-info.el b/dired-git-info.el index f5c0581..d7d9c89 100644 --- a/dired-git-info.el +++ b/dired-git-info.el @@ -78,6 +78,10 @@ are (see git-log PRETTY FORMATS for all): ยท %f: sanitized subject line, suitable for a filename" :type 'string) +(defcustom dgi-spacing 2 + "How many spaces between the longest filename and the commit messages" + :type 'integer) + (defvar-local dgi--commit-ovs nil "Overlays which show the commit messages.") @@ -220,7 +224,7 @@ info format and defaults to `dgi-commit-message-format'." (dired-unmark-all-marks) (dired-toggle-marks) (dired-get-marked-files))) - (minspc (1+ (apply #'max (dgi--get-dired-files-length files)))) + (minspc (+ dgi-spacing (apply #'max (dgi--get-dired-files-length files)))) (messages (dgi--get-commit-messages files))) (save-excursion (dolist (file files)