circe-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Circe-help] make-frame-visible event


From: John J Foerch
Subject: [Circe-help] make-frame-visible event
Date: Thu, 27 Nov 2008 23:24:28 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Hello,

  I run a dedicated emacs for irc in its own desktop workspace, and I
found that circe's tracking module does not do anything to handle
switching to a workspace which contains frames showing tracked buffers.  I
put together the following code to handle this situation, chaining a
handler onto emacs's special event `make-frame-visible'.  It would be
great if it could be incorporated into tracking-mode itself.

Code follows.

Thank you,
John Foerch


;;; Chain a handler to the make-frame-visible event so that tracking
;;; can remove buffers made visible by the frame being made visible.
;;;
(defvar tracking-handle-make-frame-visible-previous-handler nil)

(defun tracking-handle-make-frame-visible (event)
  (interactive "e")
  (let ((frame (caadr event))) ;;is there any kind of event-target function?
    (mapc
     (lambda (window)
       (tracking-remove-buffer (window-buffer window)))
     (window-list frame 'never-minibuffer)))
  (when tracking-handle-make-frame-visible-previous-handler
    (funcall tracking-handle-make-frame-visible-previous-handler event)))

(eval-after-load 'tracking
  '(let ((prev (lookup-key special-event-map [make-frame-visible])))
    (unless (or tracking-handle-make-frame-visible-previous-handler
                (eq prev 'tracking-handle-make-frame-visible))
      (setq tracking-handle-make-frame-visible-previous-handler prev))
    (define-key special-event-map
        [make-frame-visible] 'tracking-handle-make-frame-visible)))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]