在 ESS 中禁用辅助缓冲区

问题描述

在 emacs 中打开 R 脚本时,总会打开一个名为 Flymake Log 的附加缓冲区,并显示以下消息

Warning [flymake DR.R]: Disabling backend flymake-proc-legacy-flymake because (error Can’t find a suitable init function)

this discussion 之后,我将以下行添加到我的 init.el 文件中:

(remove-hook 'flymake-diagnostic-functions 'flymake-proc-legacy-flymake)

但它并没有解决问题。

此外,当我使用 M-x R 启动 R 进程时,会打开一个 ESS 缓冲区,上面写着

 current-prefix-arg=nil
(inferior-ess: waiting for process to start (before hook)
(inferior-ess 3): waiting for process after hook(R): inferior-ess-language-start=options(STERM='iESS',str.dendrogram.last="'",editor='emacsclient',show.error.locations=TRUE)

每当我重新启动 R 会话时就会发生这种情况。当我经常不得不在这些冗余缓冲区中循环时,这真的很烦人和分心。我说它们是多余的,因为我没有注意到任何会破坏正常 R 操作的方式。

我在带有 R 3.6.3 的 ubuntu 20.04 上使用带有 ESS 18.10.3 的 emacs 26.3。另外,请在下面查看我的整个 init.el 文件

(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
                    (not (gnutls-available-p))))
       (proto (if no-ssl "http" "https")))
  ;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
  (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
  ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
  (when (< emacs-major-version 24)
    ;; For important compatibility libraries like cl-lib
    (add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand,you could mess it up,so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one,they won't work right.
 '(package-selected-packages (quote (dracula-theme ess-smart-underscore ess)))
 '(pop-up-windows nil))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand,they won't work right.
 )


;; Makes *scratch* empty.
(setq initial-scratch-message "")

;; Removes *scratch* from buffer after the mode has been set.
(defun remove-scratch-buffer ()
  (if (get-buffer "*scratch*")
      (kill-buffer "*scratch*")))
(add-hook 'after-change-major-mode-hook 'remove-scratch-buffer)

;; Removes *messages* from the buffer.
(setq-default message-log-max nil)
(kill-buffer "*Messages*")

;; Removes *Completions* from buffer after you've opened a file.
(add-hook 'minibuffer-exit-hook
      '(lambda ()
         (let ((buffer "*Completions*"))
           (and (get-buffer buffer)
                (kill-buffer buffer)))))

;; Don't show *Buffer list* when opening multiple files at the same time.
(setq inhibit-startup-buffer-menu t)

;; Show only one active window when opening multiple files at the same time.
(add-hook 'window-setup-hook 'delete-other-windows)

;; backup in one place. flat,no tree structure
(setq backup-directory-alist '(("" . "~/.emacs.d/backup")))

;; easier switching between windows
(windmove-default-keybindings 'control)

;; color theme
(load-theme 'dracula t)

;; matching parenthesis
(show-paren-mode 1)


;; keybindings for resizing windows
(global-set-key (kbd "S-C-<left>") 'shrink-window-horizontally)
(global-set-key (kbd "S-C-<right>") 'enlarge-window-horizontally)
(global-set-key (kbd "S-C-<down>") 'shrink-window)
(global-set-key (kbd "S-C-<up>") 'enlarge-window)

;; easier switching between buffers
(ido-mode 1)

;; no menu bar
(menu-bar-mode -1)

;; no line wrapping by default
(set-default 'truncate-lines t)

;; Disable Flymake warnings
(remove-hook 'flymake-diagnostic-functions 'flymake-proc-legacy-flymake)

;; disables ESS buffer
(setq ess-write-to-dribble t)

最后一行是尝试永久禁用 ESS 日志缓冲区。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)