[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive 590c4878c2 4/6: Fix: (hyperdrive-dir--entry-at-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive 590c4878c2 4/6: Fix: (hyperdrive-dir--entry-at-point) Handle empty hyperdrive |
Date: |
Sat, 7 Oct 2023 01:00:59 -0400 (EDT) |
branch: elpa/hyperdrive
commit 590c4878c2db9494384c6fed10fd1a5271ed1809
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>
Fix: (hyperdrive-dir--entry-at-point) Handle empty hyperdrive
Previously, this function signaled an error when the directory was
empty, preventing hyperdrive-menu from opening.
---
hyperdrive-dir.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/hyperdrive-dir.el b/hyperdrive-dir.el
index 356524ccfb..6154869685 100644
--- a/hyperdrive-dir.el
+++ b/hyperdrive-dir.el
@@ -215,12 +215,16 @@ To be used as the pretty-printer for `ewoc-create'."
With point below last entry, returns nil.
With point on header, returns directory entry."
(let ((current-line (line-number-at-pos))
- (last-line (line-number-at-pos (ewoc-location (ewoc-nth
hyperdrive-ewoc -1)))))
- (cond ((= 1 current-line)
+ (last-entry (ewoc-nth hyperdrive-ewoc -1)))
+ (cond ((or (not last-entry) (= 1 current-line))
+ ;; Hyperdrive is empty or point is on header line
hyperdrive-current-entry)
- ((or (> current-line last-line) (= 2 current-line))
+ ((or (> current-line (line-number-at-pos (ewoc-location last-entry)))
+ (= 2 current-line))
+ ;; Point is below the last entry or on column headers
nil)
(t
+ ;; Point on a file entry: return its entry.
(ewoc-data (ewoc-locate hyperdrive-ewoc))))))
;;;; Mode
- [nongnu] elpa/hyperdrive updated (0eb0cb9559 -> f3328c0eaf), ELPA Syncer, 2023/10/07
- [nongnu] elpa/hyperdrive 78738cc04a 2/6: Fix: (hyperdrive-menu) Only display selected when point is on entry, ELPA Syncer, 2023/10/07
- [nongnu] elpa/hyperdrive 314c7680f0 5/6: Fix: (hyperdrive-manual.org) Remove .el from texinfo title, ELPA Syncer, 2023/10/07
- [nongnu] elpa/hyperdrive 590c4878c2 4/6: Fix: (hyperdrive-dir--entry-at-point) Handle empty hyperdrive,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive 4ec8171b0a 1/6: Fix: (hyperdrive-dir--entry-at-point) Return nil without entry, ELPA Syncer, 2023/10/07
- [nongnu] elpa/hyperdrive fe9173418b 3/6: Fix: (hyperdrive-menu) Make deleting current or parent dir inapt, ELPA Syncer, 2023/10/07
- [nongnu] elpa/hyperdrive f3328c0eaf 6/6: Chore: Rebuild texi manual, ELPA Syncer, 2023/10/07