From: Eli Zaretskii Date: Sat, 16 Apr 2005 15:22:12 +0000 (+0000) Subject: (filesets-add-buffer): If user supplies a name of a X-Git-Tag: ttn-vms-21-2-B4~963 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3d70f2795c497ee64a5295a9368b601667586b6f;p=emacs.git (filesets-add-buffer): If user supplies a name of a non-existing fileset, create a new fileset. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 18983e0665b..b8c35544cc8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2005-04-16 Chong Yidong + + * filesets.el (filesets-add-buffer): If user supplies a name of a + non-existing fileset, create a new fileset. + 2005-04-16 Carsten Dominik * textmodes/org.el (org-up-heading-all): Fixed bug with diff --git a/lisp/filesets.el b/lisp/filesets.el index 5a4dd7bda9a..9d60f20316f 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -1794,8 +1794,17 @@ User will be queried, if no fileset name is provided." (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))