help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: how switch between 2 mostly used windows


From: chenyu
Subject: Re: how switch between 2 mostly used windows
Date: Wed, 08 Dec 2010 15:12:25 -0000

It works very well. Wonderful.


chenyu
"Pascal J. Bourguignon" <pjb@informatimago.com> 
??????:87bpbmo4od.fsf@kuiper.lan.informatimago.com...
> "chenyu" <yu.chen@sh-rfid.com> writes:
>
>> hi,
>> 3 windows have open in emacs, and two of them are mostly used.
>>
>> C-X o, switch to the next windows.
>>
>> But which commands for switch back to the previous windows, by skipping 
>> the
>> third (just show windows)?
>
>
> (defun selected-window ()
>  (first (window-list)))
>
> (defvar *first-window*  nil)
> (defvar *second-window* nil)
>
> (defun designate-first-window ()
>  "Sets the first window."
>  (interactive)
>  (setf *first-window* (selected-window)))
>
> (defun designate-second-window ()
>  "Sets the second window."
>  (interactive)
>  (setf *second-window* (selected-window)))
>
> (defun skip-to-other-designated-window ()
>  "Selects the other window (either the first or second)."
>  (interactive)
>  (if (eq (selected-window) *first-window*)
>      (select-window *second-window*)
>      (select-window *first-window*)))
>
>
> (global-set-key (kbd "<f9>")  'skip-to-other-designated-window)
> (global-set-key (kbd "<f10>") 'designate-first-window)
> (global-set-key (kbd "<f11>") 'designate-second-window)
>
> Type <f10> to designate your first window, <f11> to designate the second.
> Then you can use <f9> to toggle between the two.
>
> -- 
> __Pascal Bourguignon__                     http://www.informatimago.com/ 




reply via email to

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