[ESS] comma in Julia REPL (change-directory, etc)

Vitalie Spinu @p|nuv|t @end|ng |rom gm@||@com
Thu Mar 5 22:31:57 CET 2015

 >>> Tamas Papp on Wed, 04 Mar 2015 17:10:52 +0100 wrote:

 > I would like to implement them, can someone please suggest another
 > language used by ESS that I could use as an example? Perhaps not R,

It's called ess-smart-comma and is bound to "," in repl. You have to
redefine `ess-handy-commands` for julia. That's all. Just remove
vignettes and other not needed stuff from there.

Most of those functions are intended to be generic. You have to look at
the code of each of them. For example ess-change-directory is defined as

╭──────── #3259 ─ /home/vspinu/VC/ESS/lisp/ess-inf.el ──
│ (defun ess-set-working-directory (path &optional no-error)
│   "Set the current working directory to PATH for both ESS
│ subprocess and Emacs buffer `default-directory'."
│   (interactive "DChange working directory to: ")
│   (if ess-setwd-command
│       (let* ((remote (file-remote-p path))
│              (path (if remote
│                        (tramp-sh-handle-expand-file-name path)
│                      path))
│              (lpath (if remote
│                         (with-parsed-tramp-file-name path v v-localname)
│                       path)))
│         (ess-eval-linewise (format ess-setwd-command lpath))
│         ;; use file-name-as-directory to ensure it has trailing /
│         (setq default-directory (file-name-as-directory path)))
│     (unless no-error
│       (error "Not implemented for dialect %s" ess-dialect))))
╰──────── #3275 ─

You can immediately see from the definition of the error that the only
local variable that you need to define is `ess-setwd-command`. Put it in
`julia-customize-alist` and you are done. Same for other commands.


More information about the ESS-help mailing list