Force stop or halt on error

后端 未结 3 1083
日久生厌
日久生厌 2021-02-06 03:13

I was wondering if anyone knew of a good way to get R or ESS to stop executing the rest of the code beyond the point at which an error occurs if I am evaluating a region or buff

3条回答
  •  伪装坚强ぢ
    2021-02-06 03:20

    According to the ESS manual, this should work: C-c C-c (comint-interrupt-subjob) Sends a Control-C signal to the ESS process. This has the effect of aborting the current command.

    John Fox has a website where he offers a configuration for ESS. In it, he has this function:

    (defun stop-R ()
    
    "Interrupt R process in lower window."
    
    (interactive)
    
    (select-window win2)
    
    (comint-interrupt-subjob)
    
    (select-window win1))
    

    You should be able to add this function to the menu in XEmacs using:

    (defun R-menu ()
    
      "Hook to install R menu and sub-menus"
    
      (add-menu-item '("ESS" "R") "Interrupt computation" 'stop-R
    )
    )
    (add-hook 'ess-mode-hook 'R-menu)
    

    You might check out the rest of his configuration file and documentation to see if it interests you. I haven't tried this yet, but I hope that it works for you!

    Charlie

提交回复
热议问题