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

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

[elpa] externals/hyperbole c98bdbf501 02/14: Use plain star wildcard and


From: ELPA Syncer
Subject: [elpa] externals/hyperbole c98bdbf501 02/14: Use plain star wildcard and add a test
Date: Mon, 11 Nov 2024 03:58:23 -0500 (EST)

branch: externals/hyperbole
commit c98bdbf501336997b1ac8a4a6d0a83f4128c66cf
Author: Mats Lidell <mats.lidell@lidells.se>
Commit: Mats Lidell <mats.lidell@lidells.se>

    Use plain star wildcard and add a test
    
    Character classes are only supported by bash so the function will fail
    for other shells. Using a general pattern can potentially match other
    files that WikiPages but is better than giving user an error.
---
 ChangeLog            |  6 +++++-
 hywiki.el            |  4 ++--
 test/hywiki-tests.el | 13 ++++++++++++-
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0235043f4f..02475e9edd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
 2024-11-01  Mats Lidell  <matsl@gnu.org>
 
-* test/hywiki-tests.el (hywiki-tests--word-is-p): Add hywiki test.
+* hywiki.el (hywiki-directory-edit): Remove character classes. Not
+    supported by all shells.
+
+* test/hywiki-tests.el (hywiki-tests--word-is-p):
+    (hywiki-tests--directory-edit):  Add hywiki test.
 
 2024-10-28  Bob Weiner  <rsw@gnu.org>
 
diff --git a/hywiki.el b/hywiki.el
index 57accd7add..535c917cae 100644
--- a/hywiki.el
+++ b/hywiki.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    21-Apr-24 at 22:41:13
-;; Last-Mod:     28-Oct-24 at 01:43:34 by Bob Weiner
+;; Last-Mod:      1-Nov-24 at 00:00:19 by Mats Lidell
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -836,7 +836,7 @@ these are handled by the Org mode link handler."
 (defun hywiki-directory-edit ()
   "Display and edit HyWiki pages in current `hywiki-directory'."
   (interactive)
-  (dired (concat hywiki-directory "[[:upper:]][[:alpha:]]*"
+  (dired (concat hywiki-directory "*"
                 (regexp-quote hywiki-file-suffix))))
 
 (defun hywiki-directory-get-checksum ()
diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el
index dfec9848a0..1621d072cc 100644
--- a/test/hywiki-tests.el
+++ b/test/hywiki-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell
 ;;
 ;; Orig-Date:    18-May-24 at 23:59:48
-;; Last-Mod:     18-Oct-24 at 22:44:05 by Mats Lidell
+;; Last-Mod:      1-Nov-24 at 00:00:19 by Mats Lidell
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -112,6 +112,17 @@
   (should-not (hywiki-word-is-p "hy:WikiWord"))
   (should-not (hywiki-word-is-p "wikiWord")))
 
+(ert-deftest hywiki-tests--directory-edit ()
+  "Verify `hywiki-directory-edit' opens dired in right folder."
+  (let* ((hywiki-directory (file-name-as-directory (make-temp-file "hywiki" 
t)))
+         (wiki-page (hywiki-add-page "WikiWord")))
+    (unwind-protect
+        (progn
+          (hywiki-directory-edit)
+          (should (string= default-directory hywiki-directory)))
+      (hy-delete-file-and-buffer wiki-page)
+      (hy-delete-dir-and-buffer hywiki-directory))))
+
 (ert-deftest hywiki-tests--maybe-at-wikiword-beginning ()
   "Verify `hywiki-maybe-at-wikiword-beginning' identifies if maybe at 
beginning of WikiWord."
   (with-temp-buffer



reply via email to

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