* X and EmacsClient
@ 2007-05-18 12:39 Andrea Vettorello
2007-05-18 19:03 ` Gian Uberto Lauri
0 siblings, 1 reply; 2+ messages in thread
From: Andrea Vettorello @ 2007-05-18 12:39 UTC (permalink / raw)
To: help-gnu-emacs
I would like to run the "server-edit" command when clicking with the
mouse to the close button of the eventually EmacsClient's opened
frame, i.e. the window close button using the X parlance.
I've looked on the Emacs documentation but i'm not sure i've
understand completely the "delete-frame" event described in
"Miscellaneous System Events". Do i need to intercept the
"delete-frame" event or it's enough to add my functions on the
"delete-frame-functions" variable?
BTW i'm using a Debian Emacs 22.xx, seems delete-frame-hook is deprecated.
I've tried to add "server-edit" to the "delete-frame-functions"
variable and seems to work but i suspect it's a little clunky, as i've
noted (not fatal) error messages. I think the "delete-frame" in
"server-done-hook" isn't good either. The feeling is i'm doing a big
mess.
Could someone suggest a proper way?
--
Andrea
^ permalink raw reply [flat|nested] 2+ messages in thread
* X and EmacsClient
2007-05-18 12:39 X and EmacsClient Andrea Vettorello
@ 2007-05-18 19:03 ` Gian Uberto Lauri
0 siblings, 0 replies; 2+ messages in thread
From: Gian Uberto Lauri @ 2007-05-18 19:03 UTC (permalink / raw)
To: Andrea Vettorello; +Cc: help-gnu-emacs
>>>>> "AV" == Andrea Vettorello <andrea.vettorello@gmail.com> writes:
Grande idea Andrea!!! La uso anche io se non ti spiace.
AV> I've tried to add "server-edit" to the "delete-frame-functions"
AV> variable and seems to work but i suspect it's a little clunky, as
AV> i've noted (not fatal) error messages. I think the "delete-frame"
AV> in "server-done-hook" isn't good either. The feeling is i'm doing
AV> a big mess.
Maybe you should check that the frame contains a server created buffer
before calling server-edit.
If you put server buffer in a dedicated frame,
(cond
((string-match "#server#.*"
(buffer-name
(window-buffer
(frame-first-window))))
(server-edit)))
should be enought.
Else you can cycle throught frame windows, and if you find a server
created buffer, call server-edit.
--
/\ ___
/___/\_|_|\_|__|___Gian Uberto Lauri_____
//--\| | \| | Integralista GNUslamico
\/ e coltivatore diretto di Software
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-05-18 19:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-18 12:39 X and EmacsClient Andrea Vettorello
2007-05-18 19:03 ` Gian Uberto Lauri
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).