emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to create a small child-frame which only show two lines


From: martin rudalics
Subject: Re: How to create a small child-frame which only show two lines
Date: Fri, 08 Dec 2017 11:12:02 +0100

>  > I only need show 2 lines with child-frame while its mini
>  > size is show 4 lines,  anyone suggest how to deal with this problem?
> [...]
>  > (let ((window (frame-root-window my-child-frame)))
>  >    (set-window-parameter window 'mode-line-format 'none)
>  >    (set-window-parameter window 'header-line-format 'none))
>
> Looks like a stupid bug in the implementation of these parameters.  I'll
> hopefully come up with a fix soon.

Sorry.  Trying again with the current release version the following form
makes a frame with a two lines root window.  What does it make for you?

(let ((window-min-height 1)
      (window-min-width 1))
  (setq my-child-frame
        (let ((after-make-frame-functions nil))
          (make-frame
           `((parent-frame . ,(window-frame))
             (no-accept-focus . t)
             (min-width  . t)
             (min-height . t)
             (border-width . 0)
             (internal-border-width . 0)
             (vertical-scroll-bars . nil)
             (horizontal-scroll-bars . nil)
             (left-fringe . 10)
             (right-fringe . 0)
             (menu-bar-lines . 0)
             (tool-bar-lines . 0)
             (line-spacing . 0)
             (unsplittable . t)
             (no-other-frame . t)
             ;;(undecorated . t)
             (undecorated . nil)
             (visibility . t)
             (cursor-type . nil)
             (minibuffer . nil)
             (width . 50)
             (height . 1)
             (no-special-glyphs . t)))))

  (let ((window (frame-root-window my-child-frame)))
    (set-window-parameter window 'mode-line-format 'none)
    (set-window-parameter window 'header-line-format 'none))

  (set-window-buffer
   (frame-root-window my-child-frame) (get-buffer-create "*foo*"))

  (with-current-buffer "*foo*" (insert "line 1\nline 2\n"))
  (fit-frame-to-buffer my-child-frame))

If it gives you more than two lines, then please tell me what the
following two forms evaluate to.

(window-mode-line-height (frame-root-window my-child-frame))
(window-header-line-height (frame-root-window my-child-frame))

Thank you, martin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]