Function: ispell-display-buffer

ispell-display-buffer is a byte-compiled function defined in ispell.el.gz.

Signature

(ispell-display-buffer BUFFER)

Documentation

Show BUFFER in new window above selected one.

Also position fit window to BUFFER and select it.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/ispell.el.gz
(defun ispell-display-buffer (buffer)
  "Show BUFFER in new window above selected one.
Also position fit window to BUFFER and select it."
  (let* ((unsplittable
	  (cdr (assq 'unsplittable (frame-parameters (selected-frame)))))
	 (window
	  (or (get-buffer-window buffer)
	      (and unsplittable
		   ;; If frame is unsplittable, temporarily disable that...
		   (let ((frame (selected-frame)))
		     (modify-frame-parameters frame '((unsplittable . nil)))
		     (prog1
			 (condition-case nil
			     (split-window
                              ;; Chose the last of a window group, since
                              ;; otherwise, the lowering of another window's
                              ;; TL corner would cause the logical order of
                              ;; the windows to be changed.
			      (car (last (selected-window-group)))
                              (- ispell-choices-win-default-height) 'above)
			   (error nil))
		       (modify-frame-parameters frame '((unsplittable . t))))))
	      (and (not unsplittable)
		   (condition-case nil
		       (split-window
                        ;; See comment above.
			(car (last (selected-window-group)))
                        (- ispell-choices-win-default-height) 'above)
		     (error nil)))
	      (display-buffer buffer))))
    (if (not window)
	(error "Couldn't make window for *Choices*")
      (select-window window)
      (set-window-buffer window buffer)
      (set-window-point window (point-min))
      (fit-window-to-buffer window nil nil nil nil t))))