emacs-ess / ESS

Emacs Speaks Statistics: ESS
https://ess.r-project.org/
GNU General Public License v3.0
626 stars 161 forks source link

Why `ess-eval-function` treats `ess-eval-visibly` differently than other `ess-eval-` commands? #1133

Open ywwry66 opened 3 years ago

ywwry66 commented 3 years ago

The current default for ess-eval-visibly is nowait. As a result, the R codes being evaluated would be printed to the inferior buffer if, say, ess-eval-line is called.

However, the behavior of ess-eval-function is just the opposite. If I run (ess-eval-function), nothing is printed to the inferior buffer. If I run (ess-eval-function t) instead, the function body would be printed. Is this a bug? If not, may I ask why this is the intended behavior?

jabranham commented 3 years ago

This is due to these lines in ess-tracebug-send-region:

      ;; Visible evaluation is not nice when sourcing temporary files. You get
      ;; .ess.eval(*code*) instead of *code*.
      (setq visibly (unless inject-p visibly))

where inject-p in non-nil so visibly gets set to nil.

but I can't seem to trigger issue caused by sourcing temporary files @vspinu mentioned in the comment when this was added in 2018. Perhaps we should just remove it?