]> git.eshelyaron.com Git - emacs.git/commitdiff
* cedet/semantic/db.el (semanticdb--inhibit-make-directory): New var.
authorChong Yidong <cyd@stupidchicken.com>
Mon, 21 Sep 2009 18:20:50 +0000 (18:20 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Mon, 21 Sep 2009 18:20:50 +0000 (18:20 +0000)
(semanticdb-save-all-db): Use it.

* cedet/semantic/db-file.el (semanticdb-default-save-directory):
Save in user-emacs-directory instead of the home directory.
(semanticdb-file-directory-exists-p): Avoid prompting the user
multiple times.

lisp/ChangeLog
lisp/cedet/semantic/db-file.el
lisp/cedet/semantic/db.el

index 6f903511edbe7d8fa89bb6104efff52b72985197..4f978958cd5d6af39dda5a4a5e4fe86c7bbdddd0 100644 (file)
@@ -1,3 +1,14 @@
+2009-09-21  Chong Yidong  <cyd@stupidchicken.com>
+
+       * cedet/semantic/db.el (semanticdb--inhibit-make-directory): New
+       var.
+       (semanticdb-save-all-db): Use it.
+
+       * cedet/semantic/db-file.el (semanticdb-default-save-directory):
+       Save in user-emacs-directory instead of the home directory.
+       (semanticdb-file-directory-exists-p): Avoid prompting the user
+       multiple times.
+
 2009-09-21  Chong Yidong  <cyd@stupidchicken.com>
 
        * help-fns.el (describe-function-1): Call
index 1ea2caf5787ee210341ff3767c9313073270b2aa..8a65c5e1e6eceb79e20d86cb42792a741a40cd28 100644 (file)
 ;;; Settings
 ;;
 (defcustom semanticdb-default-file-name "semantic.cache"
-  "*File name of the semantic tag cache."
+  "File name of the semantic tag cache."
   :group 'semanticdb
   :type 'string)
 
-(defcustom semanticdb-default-save-directory (expand-file-name "~/.semanticdb")
-  "*Directory name where semantic cache files are stored.
+(defcustom semanticdb-default-save-directory
+  (expand-file-name "semanticdb" user-emacs-directory)
+  "Directory name where semantic cache files are stored.
 If this value is nil, files are saved in the current directory.  If the value
 is a valid directory, then it overrides `semanticdb-default-file-name' and
 stores caches in a coded file name in this directory."
@@ -54,7 +55,7 @@ stores caches in a coded file name in this directory."
                  (directory)))
 
 (defcustom semanticdb-persistent-path '(always)
-  "*List of valid paths that semanticdb will cache tags to.
+  "List of valid paths that semanticdb will cache tags to.
 When `global-semanticdb-minor-mode' is active, tag lists will
 be saved to disk when Emacs exits.  Not all directories will have
 tags that should be saved.
@@ -68,7 +69,7 @@ passes a list of predicates in `semanticdb-project-predicate-functions'."
   :type nil)
 
 (defcustom semanticdb-save-database-hooks nil
-  "*Hooks run after a database is saved.
+  "Hooks run after a database is saved.
 Each function is called with one argument, the object representing
 the database recently written."
   :group 'semanticdb
@@ -202,13 +203,16 @@ If SUPRESS-QUESTIONS, then do not ask to create the directory."
           ;; @TODO - If it was never set up... what should we do ?
           nil)
          ((file-exists-p dest) t)
-         (supress-questions nil)
-         ((y-or-n-p (format "Create directory %s for SemanticDB? "
-                            dest))
+         ((or supress-questions
+              (and (boundp 'semanticdb--inhibit-make-directory)
+                   semanticdb--inhibit-make-directory))
+          nil)
+         ((y-or-n-p (format "Create directory %s for SemanticDB? " dest))
           (make-directory dest t)
           t)
-         (t nil))
-    ))
+         (t (if (boundp 'semanticdb--inhibit-make-directory)
+                (setq semanticdb--inhibit-make-directory t))
+            nil))))
 
 (defmethod semanticdb-save-db ((DB semanticdb-project-database-file)
                               &optional
index 813786fb184542b3fd3812198166b3099a215da8..ece8ea765ef74bbd0b15302b09182a00fba30bc7 100644 (file)
@@ -656,11 +656,16 @@ form."
   (semanticdb-save-db semanticdb-current-database)
   (message "Saving current tag summaries...done"))
 
+;; This prevents Semanticdb from querying multiple times if the users
+;; answers "no" to creating the Semanticdb directory.
+(defvar semanticdb--inhibit-create-file-directory)
+
 (defun semanticdb-save-all-db ()
   "Save all semantic tag databases."
   (interactive)
   (message "Saving tag summaries...")
-  (mapc 'semanticdb-save-db semanticdb-database-list)
+  (let ((semanticdb--inhibit-make-directory nil))
+    (mapc 'semanticdb-save-db semanticdb-database-list))
   (message "Saving tag summaries...done"))
 
 (defun semanticdb-save-all-db-idle ()