From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Olson Newsgroups: gmane.emacs.devel Subject: Re: RFC: status icon support Date: Sun, 13 Jan 2008 20:03:36 -0500 Message-ID: <87lk6t2p7b.fsf@grepfind.mwolson.org> References: <200801120157.m0C1v6WL020654@oogie-boogie.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0992962908==" X-Trace: ger.gmane.org 1200272635 12425 80.91.229.12 (14 Jan 2008 01:03:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Jan 2008 01:03:55 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 14 02:04:16 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JEDkN-0001sX-H1 for ged-emacs-devel@m.gmane.org; Mon, 14 Jan 2008 02:04:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JEDjz-0006be-A1 for ged-emacs-devel@m.gmane.org; Sun, 13 Jan 2008 20:03:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JEDjv-0006bZ-VI for emacs-devel@gnu.org; Sun, 13 Jan 2008 20:03:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JEDju-0006bN-F9 for emacs-devel@gnu.org; Sun, 13 Jan 2008 20:03:47 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JEDju-0006bK-B8 for emacs-devel@gnu.org; Sun, 13 Jan 2008 20:03:46 -0500 Original-Received: from deleuze.hcoop.net ([69.90.123.67]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JEDju-000489-9Z for emacs-devel@gnu.org; Sun, 13 Jan 2008 20:03:46 -0500 Original-Received: from deleuze.hcoop.net ([69.90.123.67] helo=grepfind.mwolson.org ident=nobody) by deleuze.hcoop.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JEDjs-0002Kd-2M; Sun, 13 Jan 2008 20:03:44 -0500 Original-Received: from mwolson by grepfind.mwolson.org with local (Exim 4.68) (envelope-from ) id 1JEDjq-0004I0-Gh; Sun, 13 Jan 2008 20:03:42 -0500 X-Hashcash: 1:20:080114:tromey@redhat.com::mUv1P8FVWQnhjHEZ:000000000000000000000000000000000000000000000BwE X-Hashcash: 1:20:080114:emacs-devel@gnu.org::q7AkEHR1QtF8vx6L:0000000000000000000000000000000000000000004Zmf Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEU1QytIVTlZY0dqc1N6 hGGJl3qZpZCtuKXsjxzFAAACW0lEQVR42l2UXXrqIBCGk67Aoe29Ac4CTPDcGwZ73wLdQDOuQLP9 8wHG9hT1Mc6bb/5jp7Xed92TVrqeCYfKRVc+XdfDbqbJ8TixG1UDu2a3xkf2H+z+A6Qn7Xk71AA8 kdJmZg4xpcTshgr2JQSurAswhwDFYQN9r4yxx1BIQqBTBbvqahw9hxRSLOBdFVA89TTOvgSoMaLf ABTWOg5Z8lLRNyD7x4WSVHU1DZurThn2HI9Oa561JhTSDUWxq64YqRlmrcdhA73y3rmJY1okotDT NzDO2XNGZPnS7A4b6NQ8foQFN2eJmEBR7Du1Q/DRh7R4O50BrGmu0F8i49Iya+ScvtDNqkADB8zD pwU9wTu9c8msdNYOO0JvYYyREd9xBOh7zSNc2WMZUYzIDHOpU0Kxe5o9o0eccsr5mNLcwHhC8DoM SQkJ5wbUxAdlbDELEpDbclc8sT2gV2HJIrj/si7hDgzPpY4sqxTV+p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gc8IQwcLO11taW S6not75pGjedDGGmPeIABWN1+Hwkl0TM57lUjBX2oxtnVmttSu1ncHHbyipssEIPTJXtFmNvrMIC tFzO+SpbtzNwmvIq5yLBSyWrlZ/BwZSmUOX0INOXsoDoq9ppkS4k3bQzwAB7wZbgOPwCLnGfpwtI 2Opu+C/pHWTCf4B9eQfosvkFVxuArNjDplAAAAAASUVORK5CYII= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:86859 Archived-At: --===============0992962908== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable Tom Tromey writes: >>>>>> "Dan" =3D=3D Dan Nicolaescu writes: > > Dan> Please no K&R in new code. > > Here is the updated patch. I tried it out today. I can see from config.log and src/config.h that libnotify support is being detected correctly, and that gtk_status_icon_new is present. The problem is that the `show-status-icon-message' acts somewhat erratically if the icon is created and then an immediate attempt is made to display a popup message. I suspect a race condition. Once this issue is fixed, I'd love to see this feature hit Emacs CVS. It will be particularly nice for ERC once your erc-status.el is adapted to work with the new code. Here's my test case, with instructions in comments. Let me know if you need any additional info. ;; Save this to test.el. ;; ;; Recipe: ;; ;; emacs -Q -l test.el ;; M-x my-icon-all-in-one RET ;; =3D> Creates icon in status area ;; =3D> "Couldn't connect to notification server" ;; =3D> libnotify-Message: Unable to get session bus: Failed to ;; execute dbus-launch to autolaunch D-Bus session ;; =3D> Does not show "foo" popup ;; M-x my-icon-remove-all RET ;; ;; C-x 5 2 ;; C-x 5 o ;; M-x my-icon-all-in-one RET ;; =3D> Creates icon and shows "foo" popup, but off the screen, or ;; sometimes neat the position of the cursor, or (once) crashes ;; Emacs. ;; M-x my-icon-remove-all RET ;; ;; M-x my-icon-create RET ;; =3D> Creates icon in status area. ;; M-x my-icon-display RET ;; =3D> Always displays popup successfully. ;; C-x C-c ;; ;; emacs -Q -l test.el ;; M-x my-icon-two-separate RET ;; =3D> Creates icon and shows "foo" popup, but off the screen, or ;; near the position of the cursor ;; M-x my-icon-remove RET ;; M-x my-icon-create RET ;; =3D> Creates icon in status area. ;; M-x my-icon-display RET ;; =3D> Always displays popup successfully. (defvar my-status-icon nil) (defun my-icon-create () (interactive) (setq my-status-icon (make-status-icon '((help-echo . "bar") (icon-name . "/usr/local/share/emacs/23.0.50/et= c/images/icons/hicolor/48x48/apps/emacs.png"))))) (defun my-icon-test () (interactive) (show-status-icon-message my-status-icon "foo")) (defun my-icon-remove () (interactive) (delete-status-icon my-status-icon)) (defun my-icon-remove-all () (interactive) (dolist (icon (status-icon-list)) (delete-status-icon icon))) (defun my-icon-all-in-one () (interactive) (show-status-icon-message (setq my-status-icon (make-status-icon '((help-echo . "bar") (icon-name . "/usr/local/share/emacs/23.0.50/e= tc/images/icons/hicolor/48x48/apps/emacs.png")))) "foo")) (defun my-icon-two-separate () (interactive) (my-icon-create) (my-icon-test)) =2D-=20 Michael Olson -- FSF Associate Member #652 | http://mwolson.org/ -- Jabber: mwolson_at_hcoop.net | /` |\ | | | Programmer -- Hobbies: Lisp, HCoop | |_] | \| |_| Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner | --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHirTu+1Ho2POo0xkRAseqAJ4+g46w/l3lRguPAAzkpOT0wVX4BQCfQJ3w m3kqL1y9zfQxkVI5+SwMPpQ= =DMAH -----END PGP SIGNATURE----- --=-=-=-- --===============0992962908== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============0992962908==--