emacs-ess / ESS

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

customize ESS mode-line state: removing "[none]" #1159

Closed beyondpie closed 3 years ago

beyondpie commented 3 years ago

Hi there, I like ESS and use it for quite a long time.

Recently when I use ESS, I notice that ESS[R] [None] in the mode line is usually shown and cannot be removed. I read some of the source codes, and guess this may be introduced by ess--get-mode-line-indicator:

  (setq mode-line-process
        '(" ["
          (:eval (ess--get-mode-line-indicator))
          ess--local-mode-line-process-indicator
          "]"))

(defun ess--get-mode-line-indicator ()
  "Get `ess--mode-line-process-indicator' from process buffer.
Internal function to be used for dynamic mode-line display in
`ess-mode'."
  (if ess-local-process-name
      (let* ((proc (get-process ess-local-process-name))
             (buff (when proc (process-buffer proc))))
        (if (and proc (buffer-live-p buff))
            (with-current-buffer buff (mapcar 'eval ess--mode-line-process-indicator))
          "none"))
    "none"))

Could I let ESS not show this information ?

Thanks!

Songpeng

beyondpie commented 3 years ago

I later notice that when I have R REPL or open script in a package, it will be [R] or [R pkg]. That makes sense. But again, is that possible that I could configure ESS to not show this information ?

vspinu commented 3 years ago

You can simply set mode-line-process to nil in ess-mode-hook and/or inferior-ess-mode-hook:

(setq-local mode-line-process nil)

I don't think it's worth introducing additional configuration for this.