changeset 61583:63a08bfc0b0d

(filesets-add-buffer): If user supplies a name of a non-existing fileset, create a new fileset.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 16 Apr 2005 15:21:04 +0000
parents e0ff525f6d80
children 18a28b7d3930
files lisp/filesets.el
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/filesets.el	Sat Apr 16 14:50:10 2005 +0000
+++ b/lisp/filesets.el	Sat Apr 16 15:21:04 2005 +0000
@@ -1794,8 +1794,17 @@
 	 (name   (or name
 		     (completing-read
 		      (format "Add '%s' to fileset: " buffer)
-		      filesets-data nil t)))
-	 (entry  (assoc name filesets-data)))
+		      filesets-data nil)))
+         (entry  (or (assoc name filesets-data)
+                     (when (y-or-n-p
+                            (format "Fileset %s does not exist. Create it?"
+                                    name))
+                       (progn
+      (add-to-list 'filesets-data (list name '(:files)))
+      (message
+       "Fileset %s created.  Call `M-x filesets-save-config' to save."
+       name)
+      (car filesets-data))))))
     (if entry
 	(let* ((files  (filesets-entry-get-files entry))
 	       (this   (buffer-file-name buffer))