[ESS] Custom key bindings for SAS

Daniel Muenz dmuenz at sdac.harvard.edu
Tue Jun 30 20:55:36 CEST 2009


Hi, thanks for your suggestion.  I've already tried the (setq
ess-sas-global-unix-keys t) command though and it does not do exactly what
I want.  For example, I want the F3 key to not only submit the SAS program,
but then also to take me automatically to the *shell* buffer.  Something
like this:

      (global-set-key [f3] '(lambda ()
          (interactive)
          (ess-sas-submit)
          (ess-sas-goto-shell))

But I only want this to apply when the current buffer is a .sas, .log,
or .lst file or the *shell*.

Also, every time I hit a SAS-related key, I want a message echoed to the
minibuffer area which describes what all the key presses do, .e.g,

      (defun my-ess-sas-message ()
          (interactive)
          (message "F3: submit   F4: .sas   F5: .log   F6: .lst   F8:
shell"))

So this message should be echoed each time I hit F3, F4, F5, F6, or F8.  As
an example:

      (global-set-key [f4] '(lambda ()
          (interactive)
          (ess-sas-goto-sas)
          (my-ess-sas-message)))

Regarding my other question about the annoying dialog, sorry if this is in
fact the wrong forum for that, but I mentioned it here because I've only
seen it appear when using ESS.

Thanks again,
Daniel


                                                                                                                    
  From:       Rodney Sparapani <rsparapa at mcw.edu>                                                                   
                                                                                                                    
  To:         ess-help at stat.math.ethz.ch                                                                            
                                                                                                                    
  Date:       06/30/2009 02:30 PM                                                                                   
                                                                                                                    
  Subject:    Re: [ESS] Custom key bindings for SAS                                                                 
                                                                                                                    




Daniel Muenz wrote:
> Hi all, I'm wondering if there's a way to create my own custom key
> definitions for ESS and SAS.  I prefer not to use the line
>
>       (setq ess-sas-global-unix-keys t)
>
> and instead to create my own key bindings.  The trick, though, is having
> the bindings only apply when I have a .sas, .log, or .lst file in the
> current buffer (and maybe also when I've got the *shell* buffer active).
> If I'm using Emacs to edit a Perl script or a regular text file, I don't
> want F3 to submit it to SAS.

I think you should try that command since it does exactly what you
describe that you want.  Give it a try and see if you like it.  If not,
then let us know.  The other question is not ESS related so I deleted it.

Rodney

______________________________________________
ESS-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help



More information about the ESS-help mailing list