[ESS] How to assign function key

Vitalie Spinu @p|nuv|t @end|ng |rom gm@||@com
Mon Feb 8 14:59:44 CET 2016



>> On Sat, Feb 06 2016 15:22, Patrick Connolly wrote:

> (define-key ess-mode-map [f5] 'ess-r-args-show)
> (define-key ess-mode-map [f6] 'ess-r-args-insert)
> (define-key inferior-ess-mode-map [f5] 'ess-r-args-show)
> (define-key inferior-ess-mode-map [f6] 'ess-r-args-insert)

> Now, the point of F5 is almost redundant because it happens by default
> -- *except* that only the first line is shown. :-( To see any more, I
> can press the <tab> key but that won't show the defaults.  To get
> them, I end up having to use the args() function -- now with quotes
> required for the function name.

> For example, if I want to see the arguments and their defaults for
> fisher.test, I see the first line of them in the mini-buffer
> immediately after I type the open bracket.  Previously, I had to press
> the F5 key but it showed all of them.  Now, if I try to do that, I get
> a Message;
>  call-interactively: Wrong type argument: characterp, ("x" . "")


I have fixed this part in the development version. For now you can put this in
your file:

     
     (defun ess-r-args-get (&optional function trim)
       (if (null function)
           (setq function (ess-r-args-current-function)))
       (when (and function
                  (or ess-current-process-name
                      (interactive-p)))
         (ess-force-buffer-current "R process to use: ")
         (mapconcat (lambda (arg) (concat (car arg) "=" (cdr arg)))
                    (cadr (ess-function-arguments function))
                    ", ")))


But don't forget to remove it when you upgrade to 16.3.


   Vitalie




More information about the ESS-help mailing list