[ESS] setting transcript file name

Rodney Sparapani rsparapa at mcw.edu
Tue Aug 2 16:42:37 CEST 2005


>Currently, ESS does not have that behaviour.  The relevant function is 
>inferior-ess which has:
>
>	(if ess-ask-about-transfile
>	    (let ((transfilename (read-file-name
>				  "Use transcript file (default none):"
>				  startdir "")))
>
>One possibility is that we could overload ess-ask-about-transfile
>so that if it is bound to a function, that function is executed to
>return the default transcript name.  Then you could have a simple
>function like:
>
>(defun my-transcript-name ()
>  (let ((date (format-time-string "%y-%m-%d" (current-time)))
>	(directory (car
>		    (last (split-string default-directory "/" 'omit-null)))))
>	(concat date "-" directory ".Rt")))
>
>when then returns something like
>
>(my-transcript-name) 
>"05-08-02-Code.Rt"
>
>But as you can see, this requires a little knowledge of lisp to
>write the defun to return the transcript name.
>
>Ess-core: does this sound like worth adding (& is there an easier
>way to get the name of the current directory?)
>
>Stephen
>  
>
I think I see an easier fix:

(if ess-ask-about-transfile
	    (let ((transfilename (if (stringp ess-ask-about-transfile)
				     ess-ask-about-transfile (read-file-name
				  "Use transcript file (default none):"
				  startdir ""))))


And, then in .emacs you have

(setq ess-ask-about-transfile (my-transcript-name))
(require 'ess-site)


2 cents and worth every penny

Rodney




More information about the ESS-help mailing list