aboutsummaryrefslogtreecommitdiffhomepage
path: root/coq/coq-local-vars.el
diff options
context:
space:
mode:
authorGravatar Pierre Courtieu <courtieu@lri.fr>2007-05-10 12:44:36 +0000
committerGravatar Pierre Courtieu <courtieu@lri.fr>2007-05-10 12:44:36 +0000
commit6f6d43880bb19767c38580225e83965965e6ae34 (patch)
tree03478e029b61fc6b693e3ed1c9a5e0eff44b77be /coq/coq-local-vars.el
parent37ce3dc6175e460b9d92694989c7c987bc7eee42 (diff)
Fixed coq prog persistent setting.
Diffstat (limited to 'coq/coq-local-vars.el')
-rw-r--r--coq/coq-local-vars.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/coq/coq-local-vars.el b/coq/coq-local-vars.el
index 581a6a80..3d9f2001 100644
--- a/coq/coq-local-vars.el
+++ b/coq/coq-local-vars.el
@@ -80,14 +80,14 @@ coqtop command to be launched on this file."
(local-vars-list-set 'coq-prog-args progargs)
)
-
-(defun coq-read-directory (prompt &optional maynotmatch initialcontent)
- "Ask for (using PROMPT) and return a directory name."
+(defun coq-read-directory (prompt &optional default maynotmatch initialcontent)
+ "Ask for (using PROMPT) and return a directory name.
+Do not insert the default directory."
(let*
;; read-file-name here because it is convenient to see .v files
;; when selecting directories to add to the path. Moreover
;; read-directory-name does not seem to exist in fsf emacs??
- ((path (read-file-name prompt "" "" (not maynotmatch) initialcontent)))
+ ((path (read-file-name prompt "" default (not maynotmatch) initialcontent)))
path))
;(read-from-minibuffer
@@ -124,10 +124,10 @@ will be used to suggest values to the user."
(setq progargs (cons (car olddirs) (cons "-I" progargs))))
(setq olddirs (cdr olddirs)))
;; then ask for more
- (setq option (coq-read-directory "Add directory (tab to complete, empty to stop) :"))
+ (setq option (coq-read-directory "Add directory (tab to complete, empty to stop) :" ""))
(while (not (string-equal option ""))
(setq progargs (cons option (cons "-I" progargs))) ;reversed
- (setq option (coq-read-directory "Add directory (tab to complete, empty to stop) -I :")))
+ (setq option (coq-read-directory "Add directory (tab to complete, empty to stop) -I :" "")))
(reverse progargs)))
(defun coq-ask-prog-name (&optional oldvalue)
@@ -135,8 +135,9 @@ will be used to suggest values to the user."
These variable describes the coqtop command to be launched on this file.
Optional argument OLDVALUE specifies the previous value of `coq-prog-name', it
will be used to suggest a value to the user."
- (let ((cmd (coq-read-directory "coq program name (default coqtop) : " t
- (or oldvalue "coqtop"))))
+ (let* ((deflt (or oldvalue "coqtop"))
+ (cmd (coq-read-directory "coq program name (default \"coqtop\"): "
+ deflt t deflt)))
(if (and
(string-match " " cmd)
(not (y-or-n-p "The prog name contains spaces, are you sure ? ")))
@@ -151,7 +152,7 @@ These variables describe the coqtop command to be launched on this file."
(let* ((oldname (local-vars-list-get-safe 'coq-prog-name))
(oldargs (local-vars-list-get-safe 'coq-prog-args))
(progname (coq-ask-prog-name oldname))
- (progargs (coq-ask-prog-args oldargs)))
+ (progargs (coq-ask-prog-args oldargs)))
(coq-insert-coq-prog-name progname progargs)
(setq coq-prog-name progname)
(setq coq-prog-args progargs)))