diff options
| author | Chong Yidong | 2009-09-21 18:20:50 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-09-21 18:20:50 +0000 |
| commit | 5bebb3324906e2ba7ce90007b3fc2971430e8427 (patch) | |
| tree | a869b2c6faf9e8f17caa152b06edf30427411f13 | |
| parent | 16feddc402fad45e207560c25e6274de348f0782 (diff) | |
| download | emacs-5bebb3324906e2ba7ce90007b3fc2971430e8427.tar.gz emacs-5bebb3324906e2ba7ce90007b3fc2971430e8427.zip | |
* 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.
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/cedet/semantic/db-file.el | 24 | ||||
| -rw-r--r-- | lisp/cedet/semantic/db.el | 7 |
3 files changed, 31 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6f903511edb..4f978958cd5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,16 @@ | |||
| 1 | 2009-09-21 Chong Yidong <cyd@stupidchicken.com> | 1 | 2009-09-21 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 2 | ||
| 3 | * cedet/semantic/db.el (semanticdb--inhibit-make-directory): New | ||
| 4 | var. | ||
| 5 | (semanticdb-save-all-db): Use it. | ||
| 6 | |||
| 7 | * cedet/semantic/db-file.el (semanticdb-default-save-directory): | ||
| 8 | Save in user-emacs-directory instead of the home directory. | ||
| 9 | (semanticdb-file-directory-exists-p): Avoid prompting the user | ||
| 10 | multiple times. | ||
| 11 | |||
| 12 | 2009-09-21 Chong Yidong <cyd@stupidchicken.com> | ||
| 13 | |||
| 3 | * help-fns.el (describe-function-1): Call | 14 | * help-fns.el (describe-function-1): Call |
| 4 | overload-docstring-extension for mode-local functions. | 15 | overload-docstring-extension for mode-local functions. |
| 5 | 16 | ||
diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el index 1ea2caf5787..8a65c5e1e6e 100644 --- a/lisp/cedet/semantic/db-file.el +++ b/lisp/cedet/semantic/db-file.el | |||
| @@ -38,12 +38,13 @@ | |||
| 38 | ;;; Settings | 38 | ;;; Settings |
| 39 | ;; | 39 | ;; |
| 40 | (defcustom semanticdb-default-file-name "semantic.cache" | 40 | (defcustom semanticdb-default-file-name "semantic.cache" |
| 41 | "*File name of the semantic tag cache." | 41 | "File name of the semantic tag cache." |
| 42 | :group 'semanticdb | 42 | :group 'semanticdb |
| 43 | :type 'string) | 43 | :type 'string) |
| 44 | 44 | ||
| 45 | (defcustom semanticdb-default-save-directory (expand-file-name "~/.semanticdb") | 45 | (defcustom semanticdb-default-save-directory |
| 46 | "*Directory name where semantic cache files are stored. | 46 | (expand-file-name "semanticdb" user-emacs-directory) |
| 47 | "Directory name where semantic cache files are stored. | ||
| 47 | If this value is nil, files are saved in the current directory. If the value | 48 | If this value is nil, files are saved in the current directory. If the value |
| 48 | is a valid directory, then it overrides `semanticdb-default-file-name' and | 49 | is a valid directory, then it overrides `semanticdb-default-file-name' and |
| 49 | stores caches in a coded file name in this directory." | 50 | stores caches in a coded file name in this directory." |
| @@ -54,7 +55,7 @@ stores caches in a coded file name in this directory." | |||
| 54 | (directory))) | 55 | (directory))) |
| 55 | 56 | ||
| 56 | (defcustom semanticdb-persistent-path '(always) | 57 | (defcustom semanticdb-persistent-path '(always) |
| 57 | "*List of valid paths that semanticdb will cache tags to. | 58 | "List of valid paths that semanticdb will cache tags to. |
| 58 | When `global-semanticdb-minor-mode' is active, tag lists will | 59 | When `global-semanticdb-minor-mode' is active, tag lists will |
| 59 | be saved to disk when Emacs exits. Not all directories will have | 60 | be saved to disk when Emacs exits. Not all directories will have |
| 60 | tags that should be saved. | 61 | tags that should be saved. |
| @@ -68,7 +69,7 @@ passes a list of predicates in `semanticdb-project-predicate-functions'." | |||
| 68 | :type nil) | 69 | :type nil) |
| 69 | 70 | ||
| 70 | (defcustom semanticdb-save-database-hooks nil | 71 | (defcustom semanticdb-save-database-hooks nil |
| 71 | "*Hooks run after a database is saved. | 72 | "Hooks run after a database is saved. |
| 72 | Each function is called with one argument, the object representing | 73 | Each function is called with one argument, the object representing |
| 73 | the database recently written." | 74 | the database recently written." |
| 74 | :group 'semanticdb | 75 | :group 'semanticdb |
| @@ -202,13 +203,16 @@ If SUPRESS-QUESTIONS, then do not ask to create the directory." | |||
| 202 | ;; @TODO - If it was never set up... what should we do ? | 203 | ;; @TODO - If it was never set up... what should we do ? |
| 203 | nil) | 204 | nil) |
| 204 | ((file-exists-p dest) t) | 205 | ((file-exists-p dest) t) |
| 205 | (supress-questions nil) | 206 | ((or supress-questions |
| 206 | ((y-or-n-p (format "Create directory %s for SemanticDB? " | 207 | (and (boundp 'semanticdb--inhibit-make-directory) |
| 207 | dest)) | 208 | semanticdb--inhibit-make-directory)) |
| 209 | nil) | ||
| 210 | ((y-or-n-p (format "Create directory %s for SemanticDB? " dest)) | ||
| 208 | (make-directory dest t) | 211 | (make-directory dest t) |
| 209 | t) | 212 | t) |
| 210 | (t nil)) | 213 | (t (if (boundp 'semanticdb--inhibit-make-directory) |
| 211 | )) | 214 | (setq semanticdb--inhibit-make-directory t)) |
| 215 | nil)))) | ||
| 212 | 216 | ||
| 213 | (defmethod semanticdb-save-db ((DB semanticdb-project-database-file) | 217 | (defmethod semanticdb-save-db ((DB semanticdb-project-database-file) |
| 214 | &optional | 218 | &optional |
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el index 813786fb184..ece8ea765ef 100644 --- a/lisp/cedet/semantic/db.el +++ b/lisp/cedet/semantic/db.el | |||
| @@ -656,11 +656,16 @@ form." | |||
| 656 | (semanticdb-save-db semanticdb-current-database) | 656 | (semanticdb-save-db semanticdb-current-database) |
| 657 | (message "Saving current tag summaries...done")) | 657 | (message "Saving current tag summaries...done")) |
| 658 | 658 | ||
| 659 | ;; This prevents Semanticdb from querying multiple times if the users | ||
| 660 | ;; answers "no" to creating the Semanticdb directory. | ||
| 661 | (defvar semanticdb--inhibit-create-file-directory) | ||
| 662 | |||
| 659 | (defun semanticdb-save-all-db () | 663 | (defun semanticdb-save-all-db () |
| 660 | "Save all semantic tag databases." | 664 | "Save all semantic tag databases." |
| 661 | (interactive) | 665 | (interactive) |
| 662 | (message "Saving tag summaries...") | 666 | (message "Saving tag summaries...") |
| 663 | (mapc 'semanticdb-save-db semanticdb-database-list) | 667 | (let ((semanticdb--inhibit-make-directory nil)) |
| 668 | (mapc 'semanticdb-save-db semanticdb-database-list)) | ||
| 664 | (message "Saving tag summaries...done")) | 669 | (message "Saving tag summaries...done")) |
| 665 | 670 | ||
| 666 | (defun semanticdb-save-all-db-idle () | 671 | (defun semanticdb-save-all-db-idle () |