bmag / emacs-purpose

Manage Windows and Buffers According to Purposes
GNU General Public License v3.0
498 stars 23 forks source link

Messes with company documentation #145

Open qleguennec opened 5 years ago

qleguennec commented 5 years ago

company-box (https://github.com/sebastiencs/company-box) opens a *Help* buffer to display a help tooltip. With emacs-purpose on, this buffer gets opened in a new frame. Is there a way to ignore opening cetain buffers according to the major mode?

qleguennec commented 5 years ago

(setq pop-up-frames nil) fixes the issue

This is actually not related to company-box at all, my bad.

The function responsible for this behavior is

(defun elisp--company-doc-buffer (str)
  (let ((symbol (intern-soft str)))
    ;; FIXME: we really don't want to "display-buffer and then undo it".
    (save-window-excursion
      ;; Make sure we don't display it in another frame, otherwise
      ;; save-window-excursion won't be able to undo it.
      (let ((display-buffer-overriding-action
             '(nil . ((inhibit-switch-frame . t)))))
        (ignore-errors
          (cond
           ((fboundp symbol) (describe-function symbol))
           ((boundp symbol) (describe-variable symbol))
           ((featurep symbol) (describe-package symbol))
           ((facep symbol) (describe-face symbol))
           (t (signal 'user-error nil)))
          (help-buffer))))))