commit 51a3a1ef83b7a5b8151833309f3cf6e8109cd57b
parent 17da3d55a41d003c5ecebcdc517f7a8a383daf98
Author: Suraj N. Kurapati <sunaku@gmail.com>
Date: Tue, 12 May 2009 12:26:19 -0700
allow user to specify order of client regexp mapping evaluation
Diffstat:
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/config.rb b/config.rb
@@ -269,8 +269,9 @@ def load_config config_file
unless defined? @client_tags_by_regexp
# compile the regular expression only once
- pairs = CONFIG['display']['client'].to_a.map {|k,v|
- [eval(k, TOPLEVEL_BINDING, "#{config_file}:display:client:#{k}"), v]
+ pairs = CONFIG['display']['client'].map {|hash|
+ k, v = hash.to_a.first
+ [eval(k, TOPLEVEL_BINDING, "#{config_file}:display:client"), v]
}
@client_tags_by_regexp = Hash[*pairs.flatten]
diff --git a/config.yaml b/config.yaml
@@ -74,13 +74,16 @@ display:
##
# Mapping of clients to views they must appear on:
#
- # <client props regular expression> : <tags to apply>
+ # - <client props regular expression> : <tags to apply>
+ #
+ # These mappings are processed in top-to-bottom order.
+ # Processing stops after the first matching mapping is applied.
#
client:
- /\b(xconsole|alsamixer|XMMS|Sonata)\b/ : 1
- /^pidgin:|:WeeChat\b/ : chat
- /\b(Liferea|GMail)\b/ : mail
- /:(Firefox|Gran Paradiso):.*\bRestore\b.*\bSession\b/ : web
+ - /\b(xconsole|alsamixer|XMMS|Sonata)\b/ : 1
+ - /^pidgin:|:WeeChat\b/ : chat
+ - /\b(Liferea|GMail)\b/ : mail
+ - /:(Firefox|Gran Paradiso):.*\bRestore\b.*\bSession\b/ : web
##
# Self-refreshing buttons on the status bar.