* [ELISP] Detect focus on emacs. @ 2005-04-25 22:47 Micha 2005-04-27 10:10 ` Micha 2005-05-02 0:38 ` [ELISP] " Stefan Monnier 0 siblings, 2 replies; 26+ messages in thread From: Micha @ 2005-04-25 22:47 UTC (permalink / raw) Hello, I need to know if emacs has the global input focus, that's to say, if emacs' window is the selected one in the wm. Is there any way to do this ? Thanks in advance :) -- Michael Cadilhac, a.k.a. Micha * + - - --. | -Epita 2007 - Ing 1 - CSI- @ r '@' ***** O `@ | | ,)´ (. ********* `(. | `-- - - ******************************************' ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-04-25 22:47 [ELISP] Detect focus on emacs Micha @ 2005-04-27 10:10 ` Micha 2005-04-27 12:10 ` Peter Dyballa [not found] ` <mailman.3175.1114604433.2895.help-gnu-emacs@gnu.org> 2005-05-02 0:38 ` [ELISP] " Stefan Monnier 1 sibling, 2 replies; 26+ messages in thread From: Micha @ 2005-04-27 10:10 UTC (permalink / raw) Micha <micha.remove@me.lrde.epita.fr> writes: > Hello, > > I need to know if emacs has the global input focus, that's to say, > if emacs' window is the selected one in the wm. > > Is there any way to do this ? > > Thanks in advance :) No idea or workaround guys ? -- Michael Cadilhac, a.k.a. Micha * + - - --. | -Epita 2007 - Ing 1 - CSI- @ r '@' ***** O `@ | | ,)´ (. ********* `(. | `-- - - ******************************************' ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-04-27 10:10 ` Micha @ 2005-04-27 12:10 ` Peter Dyballa [not found] ` <mailman.3175.1114604433.2895.help-gnu-emacs@gnu.org> 1 sibling, 0 replies; 26+ messages in thread From: Peter Dyballa @ 2005-04-27 12:10 UTC (permalink / raw) Am 27.04.2005 um 12:10 schrieb Micha: > No idea or workaround guys ? > XFocusChangeEvent(3)? XmImSetFocusValues(3)? XmProcessTraversal(3)? -- Greetings Pete We are usually convinced more easily by reasons we have found ourselves than by those which have occurred to others. (Blaise Pascal) ^ permalink raw reply [flat|nested] 26+ messages in thread
[parent not found: <mailman.3175.1114604433.2895.help-gnu-emacs@gnu.org>]
* Re: [ELISP] Detect focus on emacs. [not found] ` <mailman.3175.1114604433.2895.help-gnu-emacs@gnu.org> @ 2005-04-27 17:41 ` Mathias Dahl 2005-04-27 19:08 ` Micha 0 siblings, 1 reply; 26+ messages in thread From: Mathias Dahl @ 2005-04-27 17:41 UTC (permalink / raw) Peter Dyballa <Peter_Dyballa@Web.DE> writes: > Am 27.04.2005 um 12:10 schrieb Micha: > >> No idea or workaround guys ? >> > > XFocusChangeEvent(3)? XmImSetFocusValues(3)? XmProcessTraversal(3)? My guess is that Micha wanted to do this from elisp. The above seems to be... something else... :) I would like to have this too. For example, I think jabber-activity.el could make use of it. Right, Magnus? /Mathias ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-04-27 17:41 ` Mathias Dahl @ 2005-04-27 19:08 ` Micha 2005-05-02 13:50 ` rgb 0 siblings, 1 reply; 26+ messages in thread From: Micha @ 2005-04-27 19:08 UTC (permalink / raw) Mathias Dahl <brakjoller.rem0veth1s@gmail.com> writes: > Peter Dyballa <Peter_Dyballa@Web.DE> writes: > >> Am 27.04.2005 um 12:10 schrieb Micha: >> >>> No idea or workaround guys ? >>> >> >> XFocusChangeEvent(3)? XmImSetFocusValues(3)? XmProcessTraversal(3)? > > My guess is that Micha wanted to do this from elisp. The above seems > to be... something else... :) > > I would like to have this too. For example, I think jabber-activity.el > could make use of it. Right, Magnus? That's exactly my point, as I'm developing an IM client for another protocol. The aim is to allow the user to be warned with a `xmessage(1)' that some message arrived, but only if Emacs doesn't have the focus. And I really don't want to add an extra executable file that tells, with X functions, if it's the case :-/ -- Michael Cadilhac, a.k.a. Micha * + - - --. | -Epita 2007 - Ing 1 - CSI- @ r '@' ***** O `@ | | ,)´ (. ********* `(. | `-- - - ******************************************' ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Detect focus on emacs. 2005-04-27 19:08 ` Micha @ 2005-05-02 13:50 ` rgb 2005-05-03 13:15 ` Mathias Dahl 0 siblings, 1 reply; 26+ messages in thread From: rgb @ 2005-05-02 13:50 UTC (permalink / raw) > The aim is to allow the user to be warned with a `xmessage(1)' > that some message arrived, but only if Emacs doesn't have the focus. > Any frame of Emacs or some particular frame? ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Detect focus on emacs. 2005-05-02 13:50 ` rgb @ 2005-05-03 13:15 ` Mathias Dahl 2005-05-03 16:57 ` rgb 0 siblings, 1 reply; 26+ messages in thread From: Mathias Dahl @ 2005-05-03 13:15 UTC (permalink / raw) "rgb" <rbielaws@i1.net> writes: >> The aim is to allow the user to be warned with a > `xmessage(1)' >> that some message arrived, but only if Emacs doesn't have the > focus. >> > > Any frame of Emacs or some particular frame? My guess is the frame with a buffer where a new IM message is displayed. /Mathias ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: Detect focus on emacs. 2005-05-03 13:15 ` Mathias Dahl @ 2005-05-03 16:57 ` rgb 0 siblings, 0 replies; 26+ messages in thread From: rgb @ 2005-05-03 16:57 UTC (permalink / raw) Mathias Dahl wrote: > "rgb" <rbielaws@i1.net> writes: > > >> The aim is to allow the user to be warned with a > > `xmessage(1)' > >> that some message arrived, but only if Emacs doesn't have the > > focus. > >> > > > > Any frame of Emacs or some particular frame? > > My guess is the frame with a buffer where a new IM message is > displayed. That was my thought too but the requirements, as stated, would be so much easier to implement. Personally I think that if one were to go thru the trouble of implementing a solution it should just provide a hook that is called upon loosing focus and another upon getting focus. Some hook code could then maintain a focus flag but I'm sure more cool & useful stuff would spring from the hook than the flag. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-04-25 22:47 [ELISP] Detect focus on emacs Micha 2005-04-27 10:10 ` Micha @ 2005-05-02 0:38 ` Stefan Monnier 2005-05-02 21:21 ` Michael Cadilhac [not found] ` <mailman.1224.1115069322.2819.help-gnu-emacs@gnu.org> 1 sibling, 2 replies; 26+ messages in thread From: Stefan Monnier @ 2005-05-02 0:38 UTC (permalink / raw) > I need to know if emacs has the global input focus, that's to say, > if emacs' window is the selected one in the wm. I don't think you can do that from elisp as of Emacs-22. Patches are welcome to add the functionality, of course, Stefan ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-05-02 0:38 ` [ELISP] " Stefan Monnier @ 2005-05-02 21:21 ` Michael Cadilhac 2005-05-03 3:09 ` Joe Corneli [not found] ` <mailman.1224.1115069322.2819.help-gnu-emacs@gnu.org> 1 sibling, 1 reply; 26+ messages in thread From: Michael Cadilhac @ 2005-05-02 21:21 UTC (permalink / raw) Stefan Monnier <monnier@iro.umontreal.ca> writes: >> I need to know if emacs has the global input focus, that's to say, >> if emacs' window is the selected one in the wm. > > I don't think you can do that from elisp as of Emacs-22. > Patches are welcome to add the functionality, of course, Ok, why not ! A function like `window-focus-p', that will check with XGetInputFocus(3x)/GetForegroundWindow(w32) if the current window has the input focus ? So I'll have a try. BTW, is there guidelines for emacs patches, some must-know coding style or whatever like that somewhere ? -- Michael Cadilhac, a.k.a. Micha [mika] | _ coin _ coin _ angle Epita/LRDE promo 2007 | >(')____, >(')____, >(')____, 2 rue de la Convention | 01.46.70.90.75 | (` =~~/ (` =~~/ (` =~~/ 94270 Le Kremlin Bicetre | 06.23.20.31.30 | ~^~^`---'~^~^~^`---'~^~^~^`---'~^~^ ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-05-02 21:21 ` Michael Cadilhac @ 2005-05-03 3:09 ` Joe Corneli 2005-05-03 19:33 ` Peter Dyballa [not found] ` <mailman.3162.1115148898.2819.help-gnu-emacs@gnu.org> 0 siblings, 2 replies; 26+ messages in thread From: Joe Corneli @ 2005-05-03 3:09 UTC (permalink / raw) Probably just the GNU Coding Standards. Expect to post the "patch" as a stand-alone file first. See the GNU Emacs Sources mailing list or Emacs Lisp List for many examples. Neat sig by the way. What is "coin coin angle"? I've heard of "angle side angle" and "side angle side". "coin coin angle" sounds like some weird marriage of Mario Brothers and Trigonometry. I like it. Stefan Monnier <monnier@iro.umontreal.ca> writes: >> I need to know if emacs has the global input focus, that's to say, >> if emacs' window is the selected one in the wm. > > I don't think you can do that from elisp as of Emacs-22. > Patches are welcome to add the functionality, of course, Ok, why not ! A function like `window-focus-p', that will check with XGetInputFocus(3x)/GetForegroundWindow(w32) if the current window has the input focus ? So I'll have a try. BTW, is there guidelines for emacs patches, some must-know coding style or whatever like that somewhere ? -- Michael Cadilhac, a.k.a. Micha [mika] | _ coin _ coin _ angle Epita/LRDE promo 2007 | >(')____, >(')____, >(')____, 2 rue de la Convention | 01.46.70.90.75 | (` =~~/ (` =~~/ (` =~~/ 94270 Le Kremlin Bicetre | 06.23.20.31.30 | ~^~^`---'~^~^~^`---'~^~^~^`---'~^~^ _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-05-03 3:09 ` Joe Corneli @ 2005-05-03 19:33 ` Peter Dyballa 2005-05-04 20:29 ` Drew Adams [not found] ` <mailman.3162.1115148898.2819.help-gnu-emacs@gnu.org> 1 sibling, 1 reply; 26+ messages in thread From: Peter Dyballa @ 2005-05-03 19:33 UTC (permalink / raw) Cc: help-gnu-emacs Am 03.05.2005 um 05:09 schrieb Joe Corneli: > Neat sig by the way. What is "coin coin angle"? > Michael Cadilhac, a.k.a. Micha [mika] | _ coin _ coin > _ angle > Epita/LRDE promo 2007 | >(')____, >(')____, > >(')____, > 2 rue de la Convention | 01.46.70.90.75 | (` =~~/ (` =~~/ > (` =~~/ > 94270 Le Kremlin Bicetre | 06.23.20.31.30 | > ~^~^`---'~^~^~^`---'~^~^~^`---'~^~^ > The first two ducks speak French, no doubt. (Try to pronounce it through your nose, as in Monty Python's movies, like: queng, queng.) But the third one? I have no idea! -- Greetings Pete Got Mole problems? Call Avogadro 6.02 x 10^23 ^ permalink raw reply [flat|nested] 26+ messages in thread
* RE: [ELISP] Detect focus on emacs. 2005-05-03 19:33 ` Peter Dyballa @ 2005-05-04 20:29 ` Drew Adams 2005-05-04 21:15 ` Peter Dyballa [not found] ` <mailman.3325.1115241750.2819.help-gnu-emacs@gnu.org> 0 siblings, 2 replies; 26+ messages in thread From: Drew Adams @ 2005-05-04 20:29 UTC (permalink / raw) Cc: help-gnu-emacs > Neat sig by the way. What is "coin coin angle"? > Michael Cadilhac, a.k.a. Micha [mika] | _ coin _ coin > _ angle > Epita/LRDE promo 2007 | >(')____, >(')____, > >(')____, > 2 rue de la Convention | 01.46.70.90.75 | (` =~~/ (` =~~/ > (` =~~/ > 94270 Le Kremlin Bicetre | 06.23.20.31.30 | > ~^~^`---'~^~^~^`---'~^~^~^`---'~^~^ > The first two ducks speak French, no doubt. (Try to pronounce it through your nose, as in Monty Python's movies, like: queng, queng.) But the third one? I have no idea! The third duck doesn't quite "get" how to talk canard. It says "angle", because it thinks that ducks are supposed to say "corner" (angle) - "coin" means "corner, in French. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-05-04 20:29 ` Drew Adams @ 2005-05-04 21:15 ` Peter Dyballa 2005-05-04 21:31 ` Drew Adams [not found] ` <mailman.3325.1115241750.2819.help-gnu-emacs@gnu.org> 1 sibling, 1 reply; 26+ messages in thread From: Peter Dyballa @ 2005-05-04 21:15 UTC (permalink / raw) Cc: help-gnu-emacs Am 04.05.2005 um 22:29 schrieb Drew Adams: > The first two ducks speak French, no doubt. (Try to pronounce it > through your nose, as in Monty Python's movies, like: queng, > queng.) > But the third one? I have no idea! > > The third duck doesn't quite "get" how to talk canard. It says "angle", > because it thinks that ducks are supposed to say "corner" (angle) - > "coin" > means "corner, in French. > For me the question is: is the last duck British, or is it a wild one, unadapted, not repeating the slogans as the others do? -- Greetings Pete A child of five could understand this! Fetch me a child of five. ^ permalink raw reply [flat|nested] 26+ messages in thread
* RE: [ELISP] Detect focus on emacs. 2005-05-04 21:15 ` Peter Dyballa @ 2005-05-04 21:31 ` Drew Adams 2005-05-04 22:28 ` Peter Dyballa 0 siblings, 1 reply; 26+ messages in thread From: Drew Adams @ 2005-05-04 21:31 UTC (permalink / raw) Cc: help-gnu-emacs > The first two ducks speak French, no doubt. ... > But the third one? I have no idea! > > The third duck doesn't quite "get" how to talk canard. It says "angle", > because it thinks that ducks are supposed to say "corner" (angle) - > "coin" > means "corner, in French. For me the question is: is the last duck British, or is it a wild one, unadapted, not repeating the slogans as the others do? Maladapted, I guess. "Angle" is both English and French. The joke is a French one. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-05-04 21:31 ` Drew Adams @ 2005-05-04 22:28 ` Peter Dyballa 0 siblings, 0 replies; 26+ messages in thread From: Peter Dyballa @ 2005-05-04 22:28 UTC (permalink / raw) Cc: help-gnu-emacs Am 04.05.2005 um 23:31 schrieb Drew Adams: > "Angle" is both English and French. The joke is a French one. > Although there is a Channel between the two nations they are arch-enemies. Look at the Monty Python's movies! The British tries to copy the French and can't get it right ... -- Greetings Pete ~ o ~_\\_/\ ~ O O ^ permalink raw reply [flat|nested] 26+ messages in thread
[parent not found: <mailman.3325.1115241750.2819.help-gnu-emacs@gnu.org>]
* Re: [ELISP] Detect focus on emacs. [not found] ` <mailman.3325.1115241750.2819.help-gnu-emacs@gnu.org> @ 2005-05-04 21:44 ` Michael Cadilhac 0 siblings, 0 replies; 26+ messages in thread From: Michael Cadilhac @ 2005-05-04 21:44 UTC (permalink / raw) [-- Attachment #1.1: Type: text/plain, Size: 1157 bytes --] Peter Dyballa <Peter_Dyballa@Web.DE> writes: > Am 04.05.2005 um 22:29 schrieb Drew Adams: > >> The first two ducks speak French, no doubt. (Try to pronounce it >> through your nose, as in Monty Python's movies, like: queng, >> queng.) >> But the third one? I have no idea! >> >> The third duck doesn't quite "get" how to talk canard. It says "angle", >> because it thinks that ducks are supposed to say "corner" (angle) - >> "coin" >> means "corner, in French. >> > > For me the question is: is the last duck British, or is it a wild one, > unadapted, not repeating the slogans as the others do? Hehe :) Well, when I first post in this newsgroup, I didn't remove my formal signature, so this is, basically, a _french_ signature (if I could say that :)). So the three of them are french ducks, and the third one is some kind of newbee duck :) Got it ? :) -- Michael Cadilhac, a.k.a. Micha [mika] | Epita/LRDE promo 2007 | Please note that you should 2 rue de la Convention | 01.46.70.90.75 | s/-@t-/@/ my mail address. 94270 Le Kremlin Bicetre | 06.23.20.31.30 | [-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --] [-- Attachment #2: Type: text/plain, Size: 152 bytes --] _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs ^ permalink raw reply [flat|nested] 26+ messages in thread
[parent not found: <mailman.3162.1115148898.2819.help-gnu-emacs@gnu.org>]
* Re: [ELISP] Detect focus on emacs. [not found] ` <mailman.3162.1115148898.2819.help-gnu-emacs@gnu.org> @ 2005-05-04 19:57 ` Michael Cadilhac 2005-05-04 20:03 ` Michael Cadilhac ` (2 more replies) 0 siblings, 3 replies; 26+ messages in thread From: Michael Cadilhac @ 2005-05-04 19:57 UTC (permalink / raw) [-- Attachment #1: Type: text/plain, Size: 2 bytes --] - [-- Attachment #2: Type: text/plain, Size: 3462 bytes --] Peter Dyballa <Peter_Dyballa@Web.DE> writes: > Am 03.05.2005 um 05:09 schrieb Joe Corneli: > >> Neat sig by the way. What is "coin coin angle"? > >> Michael Cadilhac, a.k.a. Micha [mika] | _ coin _ coin >> _ angle >> Epita/LRDE promo 2007 | >(')____, >(')____, >> >(')____, >> 2 rue de la Convention | 01.46.70.90.75 | (` =~~/ (` =~~/ >> (` =~~/ >> 94270 Le Kremlin Bicetre | 06.23.20.31.30 | >> ~^~^`---'~^~^~^`---'~^~^~^`---'~^~^ >> > > The first two ducks speak French, no doubt. (Try to pronounce it > through your nose, as in Monty Python's movies, like: queng, queng.) > But the third one? I have no idea! Exactly ! I searched a way to translate the sound `coin' in english, and I had no result, `queng queng' is great ! In fact, I've answered to this post, but my reply must have been disintegrated by a susceptible smtp server :) Here is it : - --=-=-= Content-Type: message/rfc822 Content-Disposition: inline X-From-Line: nobody Tue May 3 23:14:02 2005 To: help-gnu-emacs@gnu.org Subject: Re: [ELISP] Detect focus on emacs. X-Draft-From: ("nnimap+cadilh_m:INBOX.emacs" 91) References: <87acnm5v9h.fsf@mahaena.lrde> <87mzreqx7f.fsf-monnier+gnu.emacs.help@gnu.org> <877jihb9xr.fsf@mahaena.lrde> <E1DSnn6-00007R-00@lab1.ma.utexas.edu> From: Michael Cadilhac <Michael.Cadilhac.@t.lrde.epita.fr> Organization: LRDE Date: Tue, 03 May 2005 23:14:02 +0200 In-Reply-To: <E1DSnn6-00007R-00@lab1.ma.utexas.edu> (Joe Corneli's message of "Mon, 02 May 2005 22:09:44 -0500") Message-ID: <873bt4j9lx.fsf@mahaena.lrde> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Joe Corneli <jcorneli@math.utexas.edu> writes: > Michael Cadilhac <michael.cadilhac at lrde.epita.fr> wrote: > >> So I'll have a try. BTW, is there guidelines for emacs patches, >> some must-know coding style or whatever like that somewhere ? > > Probably just the GNU Coding Standards. Expect to post the "patch" as > a stand-alone file first. See the GNU Emacs Sources mailing list or > Emacs Lisp List for many examples. Ok, thank you, I'll have a look at that ! >>Michael Cadilhac, a.k.a. Micha [mika] | _ coin _ coin _ angle >> Epita/LRDE promo 2007 | >(')____, >(')____, >(')____, >>rue de la Convention | 01.46.70.90.75 | (` =~~/ (` =~~/ (` =~~/ >> Le Kremlin Bicetre | 06.23.20.31.30 | ~^~^`---'~^~^~^`---'~^~^~^`---'~^~^ > > Neat sig by the way. What is "coin coin angle"? I've heard of "angle > side angle" and "side angle side". "coin coin angle" sounds like some > weird marriage of Mario Brothers and Trigonometry. I like it. In fact, the "coin coin angle" thing is a French joke ! `Coin' is the French for duck's quark, and also means `corner'. You see, corner, angle, corner, quark, angle ? Haha hilarious, nop ? No ? Damn, you must be right. So, there's no link with Mario Bros, btw :) - --=-=-= Content-Transfer-Encoding: quoted-printable =2D-=20 Michael Cadilhac, a.k.a. Micha [mika] | Epita/LRDE promo 2007 | Please note that you should 2 rue de la Convention | 01.46.70.90.75 | s/-@t-/@/ my mail address. 94270 Le Kremlin Bicetre | 06.23.20.31.30 | - --=-=-=-- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCeSk1ZYNf4qobZ7kRAljYAJ0Vw2THnU08OxLPp7Y+fTFkbJIUigCffSM7 IT/x1PKNa4BOV7wKb2wDzzI= =ccOW -----END PGP SIGNATURE----- [-- Attachment #3: Type: text/plain, Size: 152 bytes --] _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-05-04 19:57 ` Michael Cadilhac @ 2005-05-04 20:03 ` Michael Cadilhac 2005-05-05 2:53 ` Joe Corneli [not found] ` <mailman.3390.1115261851.2819.help-gnu-emacs@gnu.org> 2 siblings, 0 replies; 26+ messages in thread From: Michael Cadilhac @ 2005-05-04 20:03 UTC (permalink / raw) [-- Attachment #1.1: Type: text/plain, Size: 611 bytes --] Michael Cadilhac <Michael.Cadilhac-@t-lrde.epita.fr> writes: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > [...] > - --=-=-= > Content-Type: message/rfc822 > Content-Disposition: inline > =2D-=20 > [...] > -----END PGP SIGNATURE----- Okey, mixing inline signature and multipart message was not my today's best idea :) Sorry for that ! -- Michael Cadilhac, a.k.a. Micha [mika] | Epita/LRDE promo 2007 | Please note that you should 2 rue de la Convention | 01.46.70.90.75 | s/-@t-/@/ my mail address. 94270 Le Kremlin Bicetre | 06.23.20.31.30 | [-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --] [-- Attachment #2: Type: text/plain, Size: 152 bytes --] _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-05-04 19:57 ` Michael Cadilhac 2005-05-04 20:03 ` Michael Cadilhac @ 2005-05-05 2:53 ` Joe Corneli [not found] ` <mailman.3390.1115261851.2819.help-gnu-emacs@gnu.org> 2 siblings, 0 replies; 26+ messages in thread From: Joe Corneli @ 2005-05-05 2:53 UTC (permalink / raw) Its funny, its funny! And now I know how to address French ducks. PS. I can't tell if this version is funny... _ coin _ coin ,--. angle >(')____, >(')____, |>(')| (` =~~/ (` =~~/ | (` | ~^~^`---'~^~^~^`---'~^~^`--'^~^~ or just weird. I wonder, would Dada approve? ^ permalink raw reply [flat|nested] 26+ messages in thread
[parent not found: <mailman.3390.1115261851.2819.help-gnu-emacs@gnu.org>]
* Re: [ELISP] Detect focus on emacs. [not found] ` <mailman.3390.1115261851.2819.help-gnu-emacs@gnu.org> @ 2005-05-05 5:30 ` David Kastrup 0 siblings, 0 replies; 26+ messages in thread From: David Kastrup @ 2005-05-05 5:30 UTC (permalink / raw) Joe Corneli <jcorneli@math.utexas.edu> writes: > Its funny, its funny! And now I know how to address French ducks. > > > PS. I can't tell if this version is funny... > > _ coin _ coin ,--. angle > >(')____, >(')____, |>(')| > (` =~~/ (` =~~/ | (` | > ~^~^`---'~^~^~^`---'~^~^`--'^~^~ > This "freedom fries" nonsense is not really funny. And I don't think that only the true French can think out of the box. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum ^ permalink raw reply [flat|nested] 26+ messages in thread
[parent not found: <mailman.1224.1115069322.2819.help-gnu-emacs@gnu.org>]
* Re: [ELISP] Detect focus on emacs. [not found] ` <mailman.1224.1115069322.2819.help-gnu-emacs@gnu.org> @ 2005-05-03 8:56 ` Tim X 2005-05-04 3:46 ` Joe Corneli ` (2 more replies) 2005-05-03 23:24 ` Stefan Monnier 1 sibling, 3 replies; 26+ messages in thread From: Tim X @ 2005-05-03 8:56 UTC (permalink / raw) Michael Cadilhac <Michael.Cadilhac@lrde.epita.fr> writes: > Stefan Monnier <monnier@iro.umontreal.ca> writes: > >>> I need to know if emacs has the global input focus, that's to say, >>> if emacs' window is the selected one in the wm. >> >> I don't think you can do that from elisp as of Emacs-22. >> Patches are welcome to add the functionality, of course, > > Ok, why not ! > > A function like `window-focus-p', that will check with > XGetInputFocus(3x)/GetForegroundWindow(w32) if the current window > has the input focus ? > > So I'll have a try. BTW, is there guidelines for emacs patches, > some must-know coding style or whatever like that somewhere ? > I think the problem you are having is because focus information is handled at the X and window manager level - I don't think emacs knows anything about the focus. Note that this is just a guess. Tim -- Tim Cross The e-mail address on this message is FALSE (obviously!). My real e-mail is to a company in Australia called rapttech and my login is tcross - if you really need to send mail, you should be able to work it out! ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-05-03 8:56 ` Tim X @ 2005-05-04 3:46 ` Joe Corneli 2005-05-04 15:56 ` Kevin Rodgers 2005-05-04 20:13 ` Michael Cadilhac 2 siblings, 0 replies; 26+ messages in thread From: Joe Corneli @ 2005-05-04 3:46 UTC (permalink / raw) >>> I need to know if emacs has the global input focus, that's to say, >>> if emacs' window is the selected one in the wm. >> >> I don't think you can do that from elisp as of Emacs-22. >> Patches are welcome to add the functionality, of course, > > Ok, why not ! > > A function like `window-focus-p', that will check with > XGetInputFocus(3x)/GetForegroundWindow(w32) if the current window > has the input focus ? > > So I'll have a try. BTW, is there guidelines for emacs patches, > some must-know coding style or whatever like that somewhere ? > I think the problem you are having is because focus information is handled at the X and window manager level - I don't think emacs knows anything about the focus. Note that this is just a guess. With the right window manager, it is certainly very easy to get access to this information from within Emacs. But I'd assume that there are also some cross-WM methods... after all, all WMs know which window has focus. (Yes, this assumption involves a bit of a leap of faith on my part.) ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-05-03 8:56 ` Tim X 2005-05-04 3:46 ` Joe Corneli @ 2005-05-04 15:56 ` Kevin Rodgers 2005-05-04 20:13 ` Michael Cadilhac 2 siblings, 0 replies; 26+ messages in thread From: Kevin Rodgers @ 2005-05-04 15:56 UTC (permalink / raw) Tim X wrote: > I think the problem you are having is because focus information is > handled at the X and window manager level - I don't think emacs knows > anything about the focus. Note that this is just a guess. Emacs does know about the focus, it just doesn't expose that information to the Lisp programmer until the user actually provides input. See the "Focus Events" node of the Emacs Lisp manual. -- Kevin Rodgers ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. 2005-05-03 8:56 ` Tim X 2005-05-04 3:46 ` Joe Corneli 2005-05-04 15:56 ` Kevin Rodgers @ 2005-05-04 20:13 ` Michael Cadilhac 2 siblings, 0 replies; 26+ messages in thread From: Michael Cadilhac @ 2005-05-04 20:13 UTC (permalink / raw) [-- Attachment #1.1.1: Type: text/plain, Size: 1106 bytes --] Tim X <timx@spamto.devnul.com> writes: > Michael Cadilhac <Michael.Cadilhac@lrde.epita.fr> writes: > >> Stefan Monnier <monnier@iro.umontreal.ca> writes: >> >>>> I need to know if emacs has the global input focus, that's to say, >>>> if emacs' window is the selected one in the wm. >>> >>> I don't think you can do that from elisp as of Emacs-22. >>> Patches are welcome to add the functionality, of course, >> >> Ok, why not ! >> >> A function like `window-focus-p', that will check with >> XGetInputFocus(3x)/GetForegroundWindow(w32) if the current window >> has the input focus ? >> >> So I'll have a try. BTW, is there guidelines for emacs patches, >> some must-know coding style or whatever like that somewhere ? >> > I think the problem you are having is because focus information is > handled at the X and window manager level - I don't think emacs knows > anything about the focus. Note that this is just a guess. It seems that my answer is now a bunch of lost bytes in the cruel world of usenet. God bless the mighty sent messages saving in gnus. [-- Attachment #1.1.2: Type: message/rfc822, Size: 2102 bytes --] From: Michael Cadilhac <Michael.Cadilhac.@t.lrde.epita.fr> To: help-gnu-emacs@gnu.org Subject: Re: [ELISP] Detect focus on emacs. Date: Wed, 04 May 2005 12:00:27 +0200 Message-ID: <8764xzxqdg.fsf@mahaena.lrde> Tim X <timx@spamto.devnul.com> writes: > Michael Cadilhac <Michael.Cadilhac@lrde.epita.fr> writes: > >> Stefan Monnier <monnier@iro.umontreal.ca> writes: >> >>>> I need to know if emacs has the global input focus, that's to say, >>>> if emacs' window is the selected one in the wm. >>> >>> I don't think you can do that from elisp as of Emacs-22. >>> Patches are welcome to add the functionality, of course, >> >> Ok, why not ! >> >> A function like `window-focus-p', that will check with >> XGetInputFocus(3x)/GetForegroundWindow(w32) if the current window >> has the input focus ? >> >> So I'll have a try. BTW, is there guidelines for emacs patches, >> some must-know coding style or whatever like that somewhere ? >> > I think the problem you are having is because focus information is > handled at the X and window manager level - I don't think emacs knows > anything about the focus. Note that this is just a guess. Yep, I think the problem is here. But now the question is, is it worth doing a `frame-focus-p' compatible with X and W32 (and more ?)? As said, It'll be a great thing for modules wanting to do something iif the user is not concentrated on emacs. I'm wondering if this patch has to be more than X/W32 compatible; In fact, I don't know if mac's cocoa is managed in the same way. [-- Attachment #1.1.3: Type: text/plain, Size: 431 bytes --] By the way, the proposal of rgb provides a nicer way to use this functionality, but I'm not sure this is really possible to have focus hooks on a w32 system, isn't it ? -- Michael Cadilhac, a.k.a. Micha [mika] | Epita/LRDE promo 2007 | Please note that you should 2 rue de la Convention | 01.46.70.90.75 | s/-@t-/@/ my mail address. 94270 Le Kremlin Bicetre | 06.23.20.31.30 | [-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --] [-- Attachment #2: Type: text/plain, Size: 152 bytes --] _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [ELISP] Detect focus on emacs. [not found] ` <mailman.1224.1115069322.2819.help-gnu-emacs@gnu.org> 2005-05-03 8:56 ` Tim X @ 2005-05-03 23:24 ` Stefan Monnier 1 sibling, 0 replies; 26+ messages in thread From: Stefan Monnier @ 2005-05-03 23:24 UTC (permalink / raw) >>> I need to know if emacs has the global input focus, that's to say, >>> if emacs' window is the selected one in the wm. >> >> I don't think you can do that from elisp as of Emacs-22. >> Patches are welcome to add the functionality, of course, > A function like `window-focus-p', that will check with > XGetInputFocus(3x)/GetForegroundWindow(w32) if the current window > has the input focus ? BTW, you might want to use other info than focus. E.g. you might just want to check whether one of Emacs's frames is currently visible (rather than obscured by another window). Of course it depends on the actual application you have in mind. In any case, whatever you use will be fragile, since you might lose focus between the moment you ask whether you have focus and the moment you act on it. > So I'll have a try. BTW, is there guidelines for emacs patches, > some must-know coding style or whatever like that somewhere ? Try to mimick the rest of the code ;-) Stefan ^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2005-05-05 5:30 UTC | newest] Thread overview: 26+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-04-25 22:47 [ELISP] Detect focus on emacs Micha 2005-04-27 10:10 ` Micha 2005-04-27 12:10 ` Peter Dyballa [not found] ` <mailman.3175.1114604433.2895.help-gnu-emacs@gnu.org> 2005-04-27 17:41 ` Mathias Dahl 2005-04-27 19:08 ` Micha 2005-05-02 13:50 ` rgb 2005-05-03 13:15 ` Mathias Dahl 2005-05-03 16:57 ` rgb 2005-05-02 0:38 ` [ELISP] " Stefan Monnier 2005-05-02 21:21 ` Michael Cadilhac 2005-05-03 3:09 ` Joe Corneli 2005-05-03 19:33 ` Peter Dyballa 2005-05-04 20:29 ` Drew Adams 2005-05-04 21:15 ` Peter Dyballa 2005-05-04 21:31 ` Drew Adams 2005-05-04 22:28 ` Peter Dyballa [not found] ` <mailman.3325.1115241750.2819.help-gnu-emacs@gnu.org> 2005-05-04 21:44 ` Michael Cadilhac [not found] ` <mailman.3162.1115148898.2819.help-gnu-emacs@gnu.org> 2005-05-04 19:57 ` Michael Cadilhac 2005-05-04 20:03 ` Michael Cadilhac 2005-05-05 2:53 ` Joe Corneli [not found] ` <mailman.3390.1115261851.2819.help-gnu-emacs@gnu.org> 2005-05-05 5:30 ` David Kastrup [not found] ` <mailman.1224.1115069322.2819.help-gnu-emacs@gnu.org> 2005-05-03 8:56 ` Tim X 2005-05-04 3:46 ` Joe Corneli 2005-05-04 15:56 ` Kevin Rodgers 2005-05-04 20:13 ` Michael Cadilhac 2005-05-03 23:24 ` Stefan Monnier
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).