]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix opening directory trees from Filesets menu
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Dec 2023 11:25:58 +0000 (13:25 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 16 Dec 2023 19:15:26 +0000 (20:15 +0100)
In bug#976, the code was fixed, but the cautious condition in
the original author's code, which catered to invoking
'filelists-open' from the menu-bar menu, was omitted, which made
that invocation, which did work before, broken.
* lisp/filesets.el (filesets-get-filelist): Fix opening directory
trees from the Filesets menu-bar menu.  (Bug#67658)

(cherry picked from commit 5be94e2bce53f9826b64d3566a0d5524aeccbccd)

lisp/filesets.el

index 639b108ac03f6c92a3ccdb0dfc8f3e0ca02aa21a..8e7ddab8c1c3e71e9c596208b7888f52bec71879 100644 (file)
@@ -1648,7 +1648,17 @@ Assume MODE (see `filesets-entry-mode'), if provided."
                                (filesets-entry-get-master entry)))))
                  (cons entry (filesets-ingroup-cache-get entry))))
               (:tree
-                (let* ((dirpatt (filesets-entry-get-tree entry))
+                ;; Warning: ENTRY here could be of at least two
+                ;; differente forms, either
+                ;;    (NAME (:tree DIRECTORY PATTERN))
+                ;; or
+                ;;    (DIRECTORY PATTERN)
+                ;; The latter happens when opening a tree fileset
+                ;; from the Filesets menu.  We need to support both
+                ;; of these forms!
+                (let* ((dirpatt (if (consp (nth 1 entry))
+                                    (filesets-entry-get-tree entry)
+                                  entry))
                        (dir (nth 0 dirpatt))
                        (patt (nth 1 dirpatt))
                        (depth (or (filesets-entry-get-tree-max-level entry)