[ESS] Windows ESS: trouble re-configuring shortcuts (but Linux OK)

Ponting, Keith (Keith) kponting at avaya.com
Mon Sep 30 16:28:02 CEST 2013

I too avoid C-Ret, but prefer M-Ret for the evaluate as it means I can use my thumb for the modifier key. Therefore I have switched the shortcuts around. The other problem is fixed by using mode hook, so that the mode-map is not accessed until it has been activated:

;;; useful trick from ESS wiki - M-return (hold alt key and return) evaluates line (or selected region) and steps
(defun my-ess-eval ()
  (if (and transient-mark-mode mark-active)
      (call-interactively 'ess-eval-region)
    (call-interactively 'ess-eval-line-and-step)))

(add-hook 'ess-mode-hook
    (local-set-key (kbd "M-<return>") 'my-ess-eval)
    (local-set-key (kbd "C-<return>") 'ess-use-this-dir)



Keith Ponting
Avaya Speech Analytics, Malvern WR14 3SZ  UK
Any opinions are those of the author not the company.

> -----Original Message-----
> From: ess-help-bounces at r-project.org [mailto:ess-help-bounces at r-
> project.org] On Behalf Of Paul Johnson
> Sent: 30 September 2013 15:11
> To: ess-help
> Subject: [ESS] Windows ESS: trouble re-configuring shortcuts (but Linux
> OK)
> Greetings.
> I think protecting CUA mode C-Ret is important, and have been using S-
> Ret instead. For a long time, I had a big-ish function in the init file
> to do that.
> A few months ago, Vitali gave me these lines that work on Linux with ESS
> 13.05
> ;; Change shortcut to use Shift-Return
> ;; Suggested by Vitalie Spinu ESS-help email 2013-05-15 (define-key ess-
> mode-map [(control return)] nil) (define-key ess-mode-map [(shift
> return)] 'ess-eval-region-or-line-and-step)
> It works in Linux. I gave my init file to some students.
> A Windows user just wrote me and said it doesn't work there with Prof
> Goulet's Emacs and ESS 13.05. The shortcut is not established, the
> Warning(initialization): An error occurred while loading
> 'd:/Users/crmda/.emacs.d/init.el'
> Symbol's value as variable is void: ess-mode-map
> To ensure normal operation, you should investigate and remove the cause
> of the error...
> Ideas? If there is a workaround for ESS 13.05, I'd really appreciate it
> because re-installing Emacs on all those student computers will cause a
> collective heart attack at this early point in the semester.
> pj
> --
> Paul E. Johnson
> Professor, Political Science      Assoc. Director
> 1541 Lilac Lane, Room 504      Center for Research Methods
> University of Kansas                 University of Kansas
> http://pj.freefaculty.org               http://quant.ku.edu
> 	[[alternative HTML version deleted]]
> ______________________________________________
> ESS-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

More information about the ESS-help mailing list