[xmonad] Issue 354 in xmonad: Emacs doesn't runOrRaise

codesite-noreply at google.com codesite-noreply at google.com
Sun Dec 20 08:35:35 EST 2009


Status: New
Owner: ----

New issue 354 by Artagnon: Emacs doesn't runOrRaise
http://code.google.com/p/xmonad/issues/detail?id=354

What steps will reproduce the problem?
1. Write in some runOrRaise lines into xmonad.hs for various applications.
Write in the following line for Emacs:
, ((modm, xK_e), runOrRaise "emacs" (className =? "Emacs"))
2. Make sure Emacs server is running
3. Attempt to run or raise Emacs

What is the expected output? What do you see instead?
I expect Emacs to run or raise. Instead, nothing happens. All other
applications in the list work fine. run-or-raise in StumpWM works just fine
with classname Emacs.

(defun run-or-raise (cmd props &optional (all-groups
*run-or-raise-all-groups*) (all-screens *run-or-raise-all-screens*))
   "Run the shell command, @var{cmd}, unless an existing window
matches @var{props}. @var{props} is a property list with the following keys:

@table @code
@item :class
Match the window's class.
@item :instance
Match the window's instance or resource-name.
@item :role
Match the window's @code{WM_WINDOW_ROLE}.
@item :title
Match the window's title.
@end table

By default, the global @var{*run-or-raise-all-groups*} decides whether
to search all groups or the current one for a running
instance. @var{all-groups} overrides this default. Similarily for
@var{*run-or-raise-all-screens*} and @var{all-screens}."
   (labels
       ;; Raise the window win and select its frame.  For now, it
       ;; does not select the screen.
       ((goto-win (win)
          (let* ((group (window-group win))
                 (frame (window-frame win))
                 (old-frame (tile-group-current-frame group)))
            (frame-raise-window group frame win)
            (focus-all win)
            (unless (eq frame old-frame)
              (show-frame-indicator group)))))
     (let* ((matches (find-matching-windows props all-groups all-screens))
            ;; other-matches is list of matches "after" the current
            ;; win, if current win matches. getting 2nd element means
            ;; skipping over the current win, to cycle through matches
            (other-matches (member (current-window) matches))
            (win (if (> (length other-matches) 1)
                     (second other-matches)
                     (first matches))))
       (if win
           (goto-win win)
           (run-shell-command cmd)))))


What version of the product are you using? On what operating system?
Darcs head 0.9.1 on Debian Squeeze GNU/Linux.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings


More information about the xmonad mailing list