[Top][All Lists]

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

Working with several frames

From: Eduardo Ochs
Subject: Working with several frames
Date: Sat, 30 Oct 2021 15:00:14 -0300

Hi Erich,

Can we move the discussion of your problem to the mailing list?

I think that the best way to solve your problem is to use frames
with user-chosen titles, and to extend find-wset to make it also
handle frames... then it will be very easy to define functions
that select a frame with a certain title, or create a frame with
that title if needed, and display the right files and buffers in
it. The code below is _almost_ what we need to implement that,
but the last two `find-wset's don't work as expected - I need
something stronger than `select-frame-set-input-focus', but what?

Can you check if everything below makes sense to you?

;; (find-elnode "Creating Frames")
;; (find-elgrep "grep --color=auto -nH --null -e make-frame *.el */*.el")
;; (find-elnode "Parameter Access")
;; (find-elnode "Frame Titles")
;; (find-elnode "Raising and Lowering")
;; (make-frame '((title . "Foo")))
;; (make-frame '((title . "Bar")))
;;                                    (frame-list)
;;                             (nth 0 (frame-list))
;;           (frame-parameter  (nth 0 (frame-list)) 'title)
;;           (frame-parameter  (nth 1 (frame-list)) 'title)
;; (find-epp (frame-parameters (nth 0 (frame-list))))
;; (find-epp (frame-parameters (nth 1 (frame-list))))

;; (find-clnode "Loop Facility")
;; (find-clnode "Loop Examples")
;; (find-clnode "Other Clauses" "if CONDITION CLAUSE")

(defun ee-frames-with-title (title)
   (cl-loop for fr in (frame-list)
            if (equal title (frame-parameter fr 'title))
    collect fr))

(defun ee-frame-with-title (title)
  (car (ee-frames-with-title title)))

;; (make-frame '((title . "Foo")))
;; (ee-frames-with-title "Foo")
;;  (ee-frame-with-title "Foo")
;; (ee-frames-with-title "SpXlY")
;;  (ee-frame-with-title "SpXlY")

;; (find-elnode "Input Focus")
;; (find-elnode "Input Focus" "Function: select-frame-set-input-focus")
;; (ee-use-frame "Foo")
;; (ee-use-frame "Bar")
(defun ee-use-frame (title)
  (let ((fr (ee-frame-with-title title)))
    (if fr
(select-frame-set-input-focus fr)
      (let ((newf (make-frame `((title . ,title)))))
(select-frame-set-input-focus newfr)))))

;; (find-multiwindow-intro)
;; (find-multiwindow-intro "2. `find-wset'")
;; (find-multiwindow-intro "8. Adding support for new characters in
;; (find-efunction 'find-wset-o)

(defun find-wset-F () (ee-use-frame (car sexps)) (setq sexps (cdr sexps)))

;; (find-wset "13o_"     '(find-ebuffer "Fff"))
;; (find-wset "F_" "Foo" '(find-ebuffer "Fff"))
;; (find-wset "F_" "Bar" '(find-ebuffer "Bbb"))

reply via email to

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