[Top][All Lists]

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

How do I position a child-frame below the point?

From: Aaron Jensen
Subject: How do I position a child-frame below the point?
Date: Fri, 05 Jan 2018 23:29:54 -0800


I have a few questions about child-frames.

Question #1: I'm trying to create a new child-frame and position it
below the point in the parent frame. If I don't use a child-frame, this
isn't hard:

(defun make-peek-frame ()
  (let* ((current-frame (selected-frame))
         (abs-pixel-pos (save-excursion
                          (beginning-of-thing 'symbol)
         (x (car abs-pixel-pos))
         (y (+ (cdr abs-pixel-pos) (frame-char-height)))
         (buffer (get-buffer-create "*Child Frame*"))
         (peek-frame (make-frame `(
                                   (unsplittable . t)
                                   (name . "*Peek Frame*")
                                   (width . 80)
                                   (visibility . nil)
                                   (cursor-type . nil)
                                   (height . 15)))))
    (set-frame-position peek-frame x y)

    (with-selected-frame peek-frame
      (set-window-buffer (car (window-list)) buffer)
      (with-current-buffer buffer
        (let ((inhibit-read-only t))
          (insert "HELLO WORLD"))
        (setq-local mode-line-format nil)
        (recenter-top-bottom 0)
      (raise-frame peek-frame))
    (select-frame current-frame)))

However, if I try this with a child-frame then I'm in frame local
coordinates and I have no idea how to get the appropriate frame local
coordinates for the current point. 

Question #2: 

How do I raise the child frame on macOS without selecting it? I only
want to display it above the current frame, I don't want it to have

Question #3:

How do I hide the point? I've tried (cursor-type . nil) as above, but it
shows up as a block nonetheless. I do wonder if evil is doing that,



reply via email to

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