[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[XWEM]: Re: Fun with frames
From: |
Steve Youngs |
Subject: |
[XWEM]: Re: Fun with frames |
Date: |
Fri, 07 May 2004 09:49:14 +1000 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) XEmacs/21.4 (Security Through Obscurity, linux) |
* Zajcev Evgeny <address@hidden> writes:
> Steve Youngs <address@hidden> writes:
>> Can I switch frames by name instead of doing multiple `H-x H-n' or
>> `H-x H-p' until I get to the frame I want?
> here is what i have in my xwemrc:
> ;; Fast frame switcher
> (defun my-xwem-switch-frame (key)
> "To be used by H-C-<digit> bindings."
> (interactive (list (event-key xwem-last-event)))
> (xwem-frame-switch-nth (- (char-to-int key) 48)))
> (define-key xwem-global-map (xwem-kbd "H-C-0") 'my-xwem-switch-frame)
> (define-key xwem-global-map (xwem-kbd "H-C-1") 'my-xwem-switch-frame)
> (define-key xwem-global-map (xwem-kbd "H-C-2") 'my-xwem-switch-frame)
> (define-key xwem-global-map (xwem-kbd "H-C-3") 'my-xwem-switch-frame)
> (define-key xwem-global-map (xwem-kbd "H-C-4") 'my-xwem-switch-frame)
> (define-key xwem-global-map (xwem-kbd "H-C-5") 'my-xwem-switch-frame)
> (define-key xwem-global-map (xwem-kbd "H-C-6") 'my-xwem-switch-frame)
> (define-key xwem-global-map (xwem-kbd "H-C-7") 'my-xwem-switch-frame)
> (define-key xwem-global-map (xwem-kbd "H-C-8") 'my-xwem-switch-frame)
> (define-key xwem-global-map (xwem-kbd "H-C-9") 'my-xwem-switch-frame)
Cool, works well.
> NOTE:
> After today commit, which i will performe in few hours, really big
> commit which even changes core things in xwem a little, so will need
> testing, it will be possible to write something like:
> (define-xwem-command my-xwem-switch-frame (name)
> "Switch to xwem frame named by NAME."
> (xwem-interactive (list (xwem-completing-read "XWEM Frame: "
> (mapcar (lambda (f) (list (xwem-frame-name
f)))
> xwem-frames-list))))
> (let ((frame (xwem-frame-find 'name name)))
> (when (xwem-frame-p frame)
> (xwem-frame-select frame))))
This works great. Consider it tested. :-)
> Hehe, your investigations really great!, do you dig in code :)?
Yes. I may not always understand it, but that doesn't stop me. :-)
> *XWEM FRAMES*:
> General function to create frames is `xwem-make-frame-1'. It takes
> all arguments needed to change any parameter of xwem frame at
> creation time. Arguments are:
> o EMBEDDED-P - non-nil if creating embedded frame, i.e. which is
> frame and client at the same time.
I'm not sure I understand the concept of a "embedded" frame. Would
the initial XEmacs/xwem frame be an embedded frame? Can you give me
an example?
> o PARAMS - frame's parameters. List in form '(:token1 val1
> :token2 val2 .. ), where token is one of:
> :name - Frame's name.
> :state - Frame's state.
> ... others not really used.
(xwem-make-frame-1 nil (list :name "foo"))
Perfect!
> o PROPS - frame's properties, plist, known keys are:
> 'inner-border-width
> 'otter-border-width
> 'title-height
> 'title-thickness
Can different frames have different border/title colours?
> Values are numbers.
> o NON-SELECT - Non-nil to not select newly created frame.
Handy.
> Default keybindings to deal with frames:
[...]
> H-x 5 n xwem-frame-set-name
> This answers question about renaming frame without accesing
> XEmacs frame.
Thank you very much. Just what I was looking for. And in fact I
found it earlier today with `H-x 5 H-h'.
> *XWEM WINDOWS*:
> Expectance is special window mark, which is used to manage
> particular clients in this window. For example you want to start
> xterm application but do not want to manage it in current
> window. So you install expectance in some other window and just
> start xterm. xwem will catch xterm application, find window
> which has xterm expectance installed in manage xterm in this
> window. If no such window found - manage xterm in current
> window.
Sounds like it could be quite useful.
> To show how expectances works, just try: H-o r xterm RET
Or lazy people (or people who can't spell "xterm") could do
`H-o H-a x' :-)
> Here is windows oriented keyboard bindings:
The thing that I've noticed, and really appreciate is that a lot of
the xwem key bindings mimic the equivalent XEmacs bindings, just use
hyper instead of meta or control. I have found learning the xwem key
bindings to be quite easy because of this. I just think "if I wanted
to do this in ordinary XEmacs what would I do... `C-x 2', lets try
`H-x 2'."
> Here also support for window configurations. i.e. if using
> `xwem-register' addon, here is bindings to work with window
> configurations:
I have never done anything with XEmacs registers, so maybe this'll
prompt me into learning.
> Working with window expectances:
> For example you have frame:4 selected, and want to launch xterm in
> other(than selected) frame. Here is how it may look:
> (define-xwem-command my-launch-in-oframe (cmd)
> "Run CMD in other frame."
> (xwem-interactive "eMy launch other frame: ")
> (let ((frame (or (xwem-frame-other (xwem-frame-selected))
> (xwem-make-frame-1 nil nil nil t))))
> (xwem-win-expt-inc (xwem-frame-selwin oframe) cmd)
> (xwem-execute-program cmd)))
I can see a hacked version of that going into my
`~/.xwem/xwemrc.el'. :-)
> *XWEM CLIENTS*:
> xwem client is normal X application, such as xterm, xclock, etc.
> They manages according to entries in manage database.
Is it possible to alter the entries in the manage database? I can't
think of a reason to do so, but you never know. :-)
> H-x r <cmd> RET - very generic way to create new client.
This is what I do the vast majority of the time.
> Once you started some applcation you can use H-x 7 2 - run copy
> command. This will examine current client and try to run another
> instance of this application, f.i.:
> H-x r xterm RET .. wait client mapping .. H-x 7 2
Is there any benefit to doing that rather than just starting another
instance of the app with `H-x r' ?
> When some client already managed, and you have lost where it was
> managed, but remeber its name, you can try using `H-x 7 p' - this
> command will find where client managed and switch to its frame,
> window, and client, so it is one of fastest way to find losted
> client.
Hey, that's a nice command. I'll be using that one a lot.
> xwem client can be marked, just like you can mark position in
> XEmacs buffer. H-@ - mark current client. Then you can switch to
> last marked client using H-u address@hidden
I've found that it is handy to have the main XEmacs window
marked... no matter where I am, I can always get back to it. A
question though, how do I unmark a client?
> If using xwem-register addon. You can push client to some register
> H-x / <reg> - push current client to register <REG>, then using
> H-x j <reg> - pop to client in <REG>.
What is "<reg>"? Is it a character, a string, an integer, a symbol,
or something else?
> *HELP SUBSYSEM*
> Proposals about what should be in xwem help subsystem are very
> very welcome, so dont hesistate.
Sure will.
> It was very short description.
But very informative and helpful.
> I understand that many things is pretty hard, and needs very
> detailed description in manuals. But I still can't have time to
> write good doc,
And I don't think that I have met a programmer that actually likes
writing documentation. :-)
> and also my english so ugly, that I can't understand what I wrote
> after 7 days :(
Your English isn't _that_ bad.
> Thanks again that you not give up fighting with xwem :).
It's much less of a fight these days. :-)
> Really I begin to understand that everything for Xing can be done
> in xwem environment, as everything can be done in Emacs for editing
> :)
It just goes to prove that there really isn't a reason to leave
XEmacs. :-)
--
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
| Ashes to ashes, dust to dust. |
| The proof of the pudding, is under the crust. |
|----------------------------------<address@hidden>---|
pgp4yQWe6E31D.pgp
Description: PGP signature