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
[email protected]




        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help

Reply via email to