all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Olson <mwolson@gnu.org>
To: Tom Tromey <tromey@redhat.com>
Cc: emacs-devel@gnu.org
Subject: Re: RFC: status icon support
Date: Sun, 13 Jan 2008 20:03:36 -0500	[thread overview]
Message-ID: <87lk6t2p7b.fsf@grepfind.mwolson.org> (raw)
In-Reply-To: m3zlvbkel7.fsf@fleche.redhat.com


[-- Attachment #1.1: Type: text/plain, Size: 3169 bytes --]

Tom Tromey <tromey@redhat.com> writes:

>>>>>> "Dan" == Dan Nicolaescu <dann@ics.uci.edu> 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
;;   => Creates icon in status area
;;   => "Couldn't connect to notification server"
;;   => libnotify-Message: Unable to get session bus: Failed to
;;      execute dbus-launch to autolaunch D-Bus session
;;   => 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
;;   => 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
;;   => Creates icon in status area.
;;   M-x my-icon-display RET
;;   => Always displays popup successfully.
;;   C-x C-c
;;
;;   emacs -Q -l test.el
;;   M-x my-icon-two-separate RET
;;   => 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
;;   => Creates icon in status area.
;;   M-x my-icon-display RET
;;   => 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/etc/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/etc/images/icons/hicolor/48x48/apps/emacs.png"))))
   "foo"))

(defun my-icon-two-separate ()
  (interactive)
  (my-icon-create)
  (my-icon-test))

-- 
       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 |

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  parent reply	other threads:[~2008-01-14  1:03 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-11 23:28 RFC: status icon support Tom Tromey
2008-01-12  1:57 ` Dan Nicolaescu
2008-01-12  1:28   ` Tom Tromey
2008-01-12  1:38   ` Tom Tromey
2008-01-12  8:45     ` Ulrich Mueller
2008-01-12 17:45       ` Tom Tromey
2008-01-14  2:01         ` Richard Stallman
2008-01-14  1:35           ` Tom Tromey
2008-01-14 17:26             ` Richard Stallman
2008-01-19  5:18               ` Tom Tromey
2008-01-20  6:14                 ` Richard Stallman
2008-01-23  4:00                   ` Michael Olson
2008-01-14  1:41           ` Tom Tromey
2008-01-14  1:03     ` Michael Olson [this message]
2008-01-14  1:01       ` Tom Tromey
2008-01-14  7:03         ` Jan Djärv
2008-01-15  6:01         ` Michael Olson
2008-01-16  1:10           ` Tom Tromey
2008-01-16  4:10             ` Michael Olson
2008-01-12 11:11   ` Richard Stallman
2008-01-12 11:25     ` David Kastrup
2008-01-12 11:27       ` Andreas Schwab
2008-01-12 11:46         ` David Kastrup
2008-01-12 14:10           ` Andreas Schwab
2008-01-12 14:19             ` David Kastrup
2008-01-12 17:33               ` Andreas Schwab
2008-01-14  2:00               ` Richard Stallman
2008-01-14  2:25                 ` Stefan Monnier
2008-01-14  7:05                 ` Jan Djärv
2008-01-12 13:52     ` Dan Nicolaescu
2008-01-12 14:13       ` Andreas Schwab
2008-01-12 14:26         ` Dan Nicolaescu
2008-01-12 17:36           ` Andreas Schwab
2008-01-12 18:59             ` Dan Nicolaescu
2008-01-12 14:33         ` David Kastrup
2008-01-12 17:45           ` Andreas Schwab
2008-01-12 18:07             ` David Kastrup
2008-01-12 18:16               ` Andreas Schwab
2008-01-14  2:01           ` Richard Stallman
2008-01-14  2:47             ` Dan Nicolaescu
2008-01-14 17:26               ` Richard Stallman
2008-01-14  9:14             ` David Kastrup
2008-01-14 17:26               ` Richard Stallman
2008-01-14  3:47 ` YAMAMOTO Mitsuharu
2008-01-14  3:49   ` Tom Tromey
2008-01-14 13:35     ` Stefan Monnier
2008-01-14 21:40     ` YAMAMOTO Mitsuharu
2008-01-16  1:17       ` Tom Tromey
2008-01-16 11:55         ` YAMAMOTO Mitsuharu
2008-01-14 17:26   ` Richard Stallman
2008-01-14 17:10     ` Tom Tromey
2008-01-16  2:42       ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2007-12-30 19:56 Tom Tromey
2007-12-31 17:18 ` Dan Nicolaescu
2007-12-31 18:29   ` Tom Tromey

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=87lk6t2p7b.fsf@grepfind.mwolson.org \
    --to=mwolson@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=tromey@redhat.com \
    /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.