all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "chenyu" <yu.chen@sh-rfid.com>
To: help-gnu-emacs@gnu.org
Subject: Re: how switch between 2 mostly used windows
Date: Tue, 8 Jun 2010 08:07:38 +0800	[thread overview]
Message-ID: <huk1kc$o7t$1@www.shinco.com> (raw)
In-Reply-To: 87bpbmo4od.fsf@kuiper.lan.informatimago.com

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	other threads:[~2010-06-08  0:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <hujpab$chi$1@www.shinco.com>
2010-06-07 22:31 ` how switch between 2 mostly used windows Pascal J. Bourguignon
2010-06-08  0:07   ` chenyu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='huk1kc$o7t$1@www.shinco.com' \
    --to=yu.chen@sh-rfid.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.