Trying to write an emacs lisp function
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
Trying to write an emacs lisp function         


Author: jkarres
Date: Aug 27, 2006 20:17

I'm trying to write a function such that when you use it, all the
windows on the current frame will be deleted, and for each deleted
window, a new frame will be created, displaying the same buffer that
the just-deleted window had been displaying. When it is finished
running, the original frame/window should still be on top (/in
focus/active/however you say it).

This is what I have so far:

(defun windows-into-frames ()
"If the current frame has more than one window,
make each window display in its own
seperate frame."
(interactive)
(setq original-frame (selected-frame))
(while (not (one-window-p t))
(other-window 1)
(make-frame)
(delete-window)
(select-frame original-frame)))
Show full article (0.81Kb)
5 Comments
Re: Trying to write an emacs lisp function         


Author: Ye Wenbin
Date: Aug 27, 2006 22:27

Maybe you function encounter some error, because original-frame always
have many windows,
and should use selected-frame-set-input-focus finally.

(defun windows-into-frames ()
"If the current frame has more than one window,
make each window display in its own
seperate frame."
(interactive)
(let ((original-frame (selected-frame))
(original-window (selected-window)))
(dolist (win (window-list))
(when (not (eq win original-window))
(select-window win)
(make-frame)
(select-frame original-frame)))
(select-frame-set-input-focus original-frame)
(select-window original-window)))

On Mon, 28 Aug 2006 11:17:44 +0800, gmail.com> wrote:
Show full article (1.14Kb)
1 Comment
Re: Trying to write an emacs lisp function         


Author: B. T. Raven
Date: Aug 27, 2006 22:40

gmail.com> wrote in message
news:1156735064.663675.84930@m73g2000cwd.googlegroups.com...
> I'm trying to write a function such that when you use it, all the
> windows on the current frame will be deleted, and for each deleted
> window, a new frame will be created, displaying the same buffer that
> the just-deleted window had been displaying. When it is finished
> running, the original frame/window should still be on top (/in
> focus/active/however you say it).
>
> This is what I have so far:
>
> (defun windows-into-frames ()
> "If the current frame has more than one window,
> make each window display in its own
> seperate frame." ;;;;;;;;separate
> (interactive)
> (setq original-frame (selected-frame))
;;; where does the value of 'selected-frame come from???
;;; maybe try (last (frames-on-display-list)) or maybe car??
> (while (not (one-window-p t)) ...
Show full article (2.28Kb)
no comments
Untitled         


Author: Ehud Karni
Date: Aug 28, 2006 02:58

1 Comment
Re: Trying to write an emacs lisp function         


Author: Pascal Bourguignon
Date: Aug 28, 2006 03:38

"Ye Wenbin" 163.com> writes:
> Maybe you function encounter some error, because original-frame always
> have many windows,
> and should use selected-frame-set-input-focus finally.
>
> (defun windows-into-frames ()
> "If the current frame has more than one window,
> make each window display in its own
> seperate frame."
> (interactive)
> (let ((original-frame (selected-frame))
> (original-window (selected-window)))
> (dolist (win (window-list))
> (when (not (eq win original-window))
> (select-window win)
> (make-frame)
> (select-frame original-frame)))
> (select-frame-set-input-focus original-frame)
> (select-window original-window)))
Show full article (2.43Kb)
no comments
Re: Trying to write an emacs lisp function         


Author: jkarres
Date: Aug 28, 2006 09:00

Ehud Karni wrote:
> On 27 Aug 2006 20:17:44 -0700, jkarres@gmail.com wrote:
>>
>> I'm trying to write a function such that when you use it, all the
>> windows on the current frame will be deleted, and for each deleted
>> window, a new frame will be created, displaying the same buffer that
>> the just-deleted window had been displaying. When it is finished
>> running, the original frame/window should still be on top (/in
>> focus/active/however you say it).
>>
>> This is what I have so far:
>>
>> (defun windows-into-frames ()
>> "If the current frame has more than one window,
>> make each window display in its own
>> seperate frame."
>> (interactive)
>> (setq original-frame (selected-frame))
>> (while (not (one-window-p t))
>> (other-window 1) ...
Show full article (1.42Kb)
no comments

RELATED THREADS
SubjectArticles qty Group
Hypergeometric functions and beta functionssci.math ·
Re: How to debug "Debugger entered--Lisp error: (void-function nil)"gnu.emacs.help ·