Function: which-key--show-buffer-frame

which-key--show-buffer-frame is a byte-compiled function defined in which-key.el.gz.

Signature

(which-key--show-buffer-frame ACT-POPUP-DIM)

Documentation

Show which-key buffer when popup type is frame.

Source Code

;; Defined in /usr/src/emacs/lisp/which-key.el.gz
(defun which-key--show-buffer-frame (act-popup-dim)
  "Show which-key buffer when popup type is frame."
  (let* (;(orig-window (selected-window))
         (frame-height (+ (car act-popup-dim)
                          (if (with-current-buffer which-key--buffer
                                mode-line-format)
                              1
                            0)))
         ;; without adding 2, frame sometimes isn't wide enough for the buffer.
         ;; this is probably because of the fringes. however, setting fringes
         ;; sizes to 0 (instead of adding 2) didn't always make the frame wide
         ;; enough. don't know why it is so.
         (frame-width (+ (cdr act-popup-dim) 2))
         (new-window (if (and (frame-live-p which-key--frame)
                              (eq which-key--buffer
                                  (window-buffer
                                   (frame-root-window which-key--frame))))
                         (which-key--show-buffer-reuse-frame
                          frame-height frame-width)
                       (which-key--show-buffer-new-frame
                        frame-height frame-width))))
    (when new-window
      ;; display successful
      (setq which-key--frame (window-frame new-window))
      new-window)))