[ESS] Trouble assigning to keys in Emacs Modified for MacOS 30.2
Steve Gutreuter
@gutreuter @end|ng |rom gm@||@com
Wed Jan 21 15:50:52 CET 2026
I am running Vincent Goutet’s Emacs Modified for MacOS 26.2 under MacOS 26.2 and have hit a problem which I have not encountered running Emacs/ESS under Linux distros or Windows. I am trying to assign the R operators <- and %>% to keys using variations of the following code in my .emacs:
;;; Pipe operator (magrittr %>% or |>) defined and bound to Cntl-|
;;; https://emacs.stackexchange.com/questions/8041/how-to-implement-the-piping-
;;; operator-in-ess-mode
;; (defun then_R_operator ()
;; "R |> pipe operator"
;; (interactive)
;; (insert " %> %")
;; (reindent-then-newline-and-indent))
;; (define-key inferior-ess-r-mode-map (kbd "C-|") 'then_R_operator)
(use-package ess
:bind (:map ess-r-mode-map
("C-|" . " %>% ")
:map inferior-ess-r-mode-map
("C-|" . " %>% ")))
;;; Produces compile error:
;;;-----------------------------------------------------------------------------
;;; Bind <- to C-=
;; (defun R-left-assign ()
;; "R - <- left assignment operator"
;; (interactive)
;; (insert " <- "))
;; (define-key inferior-ess-r-mode-map (kbd "C-=") 'R-left-assign)
(use-package ess
:bind (:map ess-r-mode-map
("C-=" . " <- ")
:map inferior-ess-r-mode-map
("C-=" . " <- ")))
;;; Produces compile error:
Everything I have tried fails with byte-compilation like ""Error (use-package): ess/:catch: Symbol’s value as variable is void: ess-r-mode-map”. So it seems that inferior-ess-r-mode-map and ess-r-mode-map might not defined in the implementation of ESS imbedded in Emacs Modified for MacOS. I must confess that I lack any skill with Emacs Lisp,
Is there a successful way to assign R operators to keys for Emacs Modified for MacOS.
Thanks!!!
Steve Gutreuter
SGutreuter using gmail.com
[[alternative HTML version deleted]]
More information about the ESS-help
mailing list